Guest User

Untitled

a guest
Nov 5th, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.20 KB | None | 0 0
  1.  
  2. " An example for a vimrc file.
  3. " - Modified by George Bakewell
  4. "
  5. " Maintainer:  Bram Moolenaar <Bram@vim.org>
  6. " Last change:  2008 Dec 17
  7. "
  8. " To use it, copy it to
  9. "     for Unix and OS/2:  ~/.vimrc
  10. "        for Amiga:  s:.vimrc
  11. "  for MS-DOS and Win32:  $VIM\_vimrc
  12. "      for OpenVMS:  sys$login:.vimrc
  13.  
  14. " When started as "evim", evim.vim will already have done these settings.
  15. if v:progname =~? "evim"
  16.   finish
  17. endif
  18.  
  19. " Use Vim settings, rather than Vi settings (much better!).
  20. " This must be first, because it changes other options as a side effect.
  21. set nocompatible
  22.  
  23. " Also, enable pathogen now - George Bakewell
  24. execute pathogen#infect()
  25.  
  26. " allow backspacing over everything in insert mode
  27. set backspace=indent,eol,start
  28.  
  29. set nobackup    " do not keep a backup file, use versions instead
  30. set history=25    " keep 50 lines of command line history
  31. set ruler    " show the cursor position all the time
  32. set showcmd    " display incomplete commands
  33. set incsearch    " do incremental searching
  34.  
  35. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  36. " let &guioptions = substitute(&guioptions, "t", "", "g")
  37.  
  38. " Don't use Ex mode, use Q for formatting
  39. map Q gq
  40.  
  41. " CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo,
  42. " so that you can undo CTRL-U after inserting a line break.
  43. inoremap <C-U> <C-G>u<C-U>
  44.  
  45. " I want a normal shell
  46. let $BASH_ENV="~/.bash_profile"
  47.  
  48. " In many terminal emulators the mouse works just fine, thus enable it.
  49. if has('mouse')
  50. " set mouse=a // I am not so sure I want to be using a mouse
  51. endif
  52.  
  53. " Kick vim into recognising that this terminal can support 256 colors
  54. if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal"
  55.   set t_Co=256
  56. endif
  57.  
  58.  
  59. " Switch syntax highlighting on, when the terminal has colors
  60. " Also switch on highlighting the last used search pattern.
  61. syntax enable
  62. " Set my preferred color scheme
  63. set background=light
  64. colorscheme solarized
  65. set hlsearch
  66.  
  67. " Only do this part when compiled with support for autocommands.
  68. if has("autocmd")
  69.  
  70.   " Enable file type detection.
  71.   " Use the default filetype settings, so that mail gets 'tw' set to 72,
  72.   " 'cindent' is on in C files, etc.
  73.   " Also load indent files, to automatically do language-dependent indenting.
  74.   filetype plugin indent on
  75.  
  76.   " Put these in an autocmd group, so that we can delete them easily.
  77.   augroup vimrcEx
  78.   au!
  79.  
  80.   " For all text files set 'textwidth' to 80 characters - the default was 78,
  81.   " I changed it to 80 - George
  82.   autocmd FileType text setlocal textwidth=80
  83.  
  84.   " When editing a file, always jump to the last known cursor position.
  85.   " Don't do it when the position is invalid or when inside an event handler
  86.   " (happens when dropping a file on gvim).
  87.   " Also don't do it when the mark is in the first line, that is the default
  88.   " position when opening a file.
  89.   autocmd BufReadPost *
  90.     \ if line("'\"") > 1 && line("'\"") <= line("$") |
  91.     \   exe "normal! g`\"" |
  92.     \ endif
  93.  
  94.   augroup END
  95.  
  96. else
  97.  
  98.   set autoindent    " always set autoindenting on
  99.  
  100. endif
  101.  
  102. " Convenient command to see the difference between the current buffer and the
  103. " file it was loaded from, thus the changes you made.
  104. " Only define it when not defined already.
  105. if !exists(":DiffOrig")
  106.   command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
  107.       \ | wincmd p | diffthis
  108. endif
  109.  
  110. " My preferred tab size: 2 space indents
  111. set shiftwidth=2
  112. set softtabstop=2
  113. set expandtab
  114. set smarttab
  115.  
  116. " Plugin stuff.
  117. " First, I want the beautiful |airline| to use the beautiful powerline
  118. " symbols.
  119. let g:airline_powerline_fonts = 1
  120. " Remove the pause after exiting insert mode
  121. set ttimeoutlen=10
  122. " Make the status bar alwaysvisible, even when editing just one window.
  123. set laststatus=2
  124.  
  125. " I want to be able to avoid having to backspace through a prepended comment
  126. " after pressing o or O
  127. autocmd FileType * set formatoptions-=o
  128.  
  129. " New function for enter key: insert a new line without entering insert mode
  130. nmap <CR> o<Esc>
  131. " Map Ctrl+N to NerdTree
  132. map <C-n> :NERDTreeToggle<CR>
  133. " Map insert-mode esc to esc and then move right
  134. " inoremap <Esc> <Esc>l
  135. " For emmet
  136. let g:user_emmet_leader_key='<C-k>'
Add Comment
Please, Sign In to add comment