Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

vimrc

By: a guest on Oct 31st, 2013  |  syntax: VIM  |  size: 6.06 KB  |  views: 237  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if $SHELL =~ 'bin/fish'
  2.     set shell=/bin/sh
  3. endif
  4. set nocompatible  " no vi compatibility
  5. filetype off
  6.  
  7. if has('win32') || has('win64')
  8.     set rtp+=~/vimfiles/bundle/vundle/
  9.     call vundle#rc('$HOME/vimfiles/bundle/')
  10.     set guifont=DejaVu\ Sans\ Mono:h11
  11. else
  12.   " Usual quickstart instructions
  13.     set rtp+=~/.vim/bundle/vundle/
  14.     call vundle#rc()
  15.     if has("gui_macvim")
  16.         set guifont=DejaVu\ Sans\ Mono:h12
  17.     else
  18.         set guifont=DejaVu\ Sans\ Mono\ 11
  19.     endif
  20. endif
  21.  
  22. call vundle#rc()
  23. Bundle 'gmarik/vundle'
  24. Bundle 'tpope/vim-fugitive'
  25. Bundle 'Lokaltog/vim-easymotion'
  26. Bundle 'kien/ctrlp.vim'
  27. Bundle 'bling/vim-airline'
  28. Bundle 'scrooloose/nerdtree'
  29. Bundle 'hesselbom/vim-hsftp'
  30. Bundle 'Shougo/neocomplcache.vim'
  31. Bundle 'Shougo/neosnippet'
  32. Bundle 'mattn/emmet-vim'
  33. "Bundle 'Yggdroot/indentLine'
  34. Bundle 'scrooloose/syntastic'
  35. Bundle 'othree/javascript-libraries-syntax.vim'
  36. Bundle 'terryma/vim-multiple-cursors'
  37. Bundle 'Valloric/MatchTagAlways'
  38. Bundle 'evidens/vim-twig'
  39. Bundle 'arnaud-lb/vim-php-namespace'
  40. Bundle 'terryma/vim-multiple-cursors'
  41. Bundle 'Valloric/MatchTagAlways'
  42. " Bundle 'Shougo/vimproc'
  43. " Bundle 'm2mdas/phpcomplete-extended'
  44.  
  45. filetype plugin indent on
  46.  
  47. set encoding=utf8
  48.  
  49. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  50. " => Files, backups and undo
  51. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  52. " Turn backup off, since most stuff is in SVN, git anyway...
  53. set nobackup
  54. set nowb
  55. set noswapfile
  56. set vb
  57. autocmd GUIEnter * set vb t_vb= "disable visual bells gvim "disable visual bells for gvim
  58. autocmd VimEnter * set vb t_vb= "disable visual bells in vim " disable visual bells for vim
  59. syntax enable
  60.  
  61. " colors
  62. set t_Co=256
  63. set background=dark
  64.  
  65. if has('gui_running')
  66.     colorscheme Tomorrow-Night
  67. else
  68.     colorscheme Tomorrow
  69. endif
  70.  
  71. "Persistent undo
  72. try
  73.     set undodir=~/.vim/undodir
  74.         set undofile
  75. catch
  76. endtry
  77.  
  78. set hidden "allow to jumping between modified buffers
  79. set cf  " Enable error files & error jumping.
  80. set history=256  " Number of things to remember in history.
  81. "set ruler  " Ruler on
  82. set nu  " Line numbers on
  83. set nowrap  " Line wrapping off
  84. set timeoutlen=250  " Time to wait after ESC (default causes an annoying delay)
  85. set cursorline
  86.  
  87. " Formatting
  88. set tabstop=4  " Tabs are 2 spaces
  89. set shiftwidth=4  " Tabs under smart indent
  90. set expandtab
  91. set smarttab
  92. set cindent
  93. set autoindent
  94.  
  95. set bs=2  " Backspace over everything in insert mode
  96. set nocp incsearch
  97. set colorcolumn=80
  98.  
  99. set formatoptions=tcqr
  100.  
  101. " Make backspce behave more normally
  102. set backspace=indent,eol,start      " Visual
  103.  
  104. " searching
  105. set hlsearch            " highlight all search results
  106. set incsearch           " increment search
  107. set ignorecase          " case-insensitive search
  108. set smartcase           " uppercase causes case-sensitive search
  109.  
  110. set showmatch  " Show matching brackets.
  111. set mat=5  " Bracket blinking.
  112.  
  113. let g:airline_powerline_fonts = 0
  114. let g:airline#extensions#tabline#enabled = 1
  115. let g:airline#extensions#tabline#fnamemod = ':t'
  116. let g:airline#extensions#tabline#buffer_nr_show = 1
  117. let g:airline#extensions#tabline#buffer_max = 500
  118.  
  119. set cmdheight=1
  120. set noshowmode " hide original status line because of airline
  121. set laststatus=2  " Always show status line.
  122.  
  123. function! SaveProper()
  124.     :set et| retab " change indent to spaces and retab
  125.     :set ff=unix " set line endings to unix
  126.     :%s/\s\+$//e " delete trailing whitespace
  127.     :update " write to disk
  128. endfunction
  129.  
  130. " keyboard remaps
  131. let mapleader = ","
  132. inoremap jk <esc>
  133. "nnoremap <silent> <C-s> :update<CR>
  134. nnoremap <silent> <C-s> :call SaveProper()<CR>
  135. nnoremap <space> 10jzz
  136. nnoremap <backspace> 10kzz
  137. nnoremap <leader>n :NERDTreeToggle<cr>
  138. nnoremap <leader>N :NERDTreeFind<cr>
  139. nnoremap <C-tab> :bn<CR>
  140. nnoremap <C-S-tab> :bp<CR>
  141. inoremap <C-tab> <Esc>:bn<CR>i
  142. inoremap <C-S-tab> <Esc>:bp<CR>i
  143.  
  144. vmap <C-c> "+y
  145. vmap <C-p> "+gP
  146. imap <C-c> "+y
  147. imap <C-p> "+gP
  148. nmap <C-c> "+y
  149. nmap <C-p> "+gP
  150.  
  151. imap <c-l> <space>=><space>
  152. imap <c-b> ->
  153.  
  154. " let g:netrw_liststyle = 3
  155. " sftp shortcuts
  156. nnoremap <silent> <leader>s :Hupload<CR>
  157. nnoremap <silent> <leader>d :Hdownload<CR>
  158.  
  159. " neocomplcache
  160. let g:neocomplcache_enable_at_startup = 1
  161. let g:neocomplcache_ctags_program = "ctags"
  162.  
  163. " neosnippet
  164. " Plugin key-mappings.
  165. imap <C-k>     <Plug>(neosnippet_expand_or_jump)
  166. smap <C-k>     <Plug>(neosnippet_expand_or_jump)
  167. xmap <C-k>     <Plug>(neosnippet_expand_target)
  168.  
  169. "Ctrl P
  170. let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
  171.  
  172. " SuperTab like snippets behavior.
  173. imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  174. \ "\<Plug>(neosnippet_expand_or_jump)"
  175. \: pumvisible() ? "\<C-n>" : "\<TAB>"
  176. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  177. \ "\<Plug>(neosnippet_expand_or_jump)"
  178. \: "\<TAB>"
  179.  
  180. " For snippet_complete marker.
  181. if has('conceal')
  182.   set conceallevel=2 concealcursor=i
  183. endif
  184.  
  185. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  186. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  187. autocmd FileType php setlocal omnifunc=javascriptcomplete#CompletePHP
  188. let g:neocomplcache_max_list = 10
  189. let g:neocomplcache_auto_completion_start_length = 3
  190.  
  191. " emmet
  192. let g:user_emmet_leader_key = '<c-tab>'
  193.  
  194. "syntastic
  195. let g:syntastic_html_checkers=[]
  196.  
  197. " indentline
  198. let g:indentLine_color_gui = '#111111'
  199. let g:indentLine_char = '│'
  200.  
  201. " javascript libraries
  202. let g:used_javascript_libs = 'underscore,angularjs,jquery'
  203.  
  204. " airline
  205. let g:airline_left_sep=''
  206. let g:airline_right_sep=''
  207.  
  208. "php namespace
  209. set tags+=./tags.vendors,tags.vendors
  210. inoremap <Leader>u <C-O>:call PhpInsertUse()<CR>
  211. noremap <Leader>u :call PhpInsertUse()<CR>
  212. inoremap <Leader>e <C-O>:call PhpExpandClass()<CR>
  213. noremap <Leader>e :call PhpExpandClass()<CR>
  214.  
  215.  
  216. " php-extend
  217. autocmd  FileType  php setlocal omnifunc=phpcomplete_extended#CompletePHP
  218.  
  219. " gvim specific
  220. set mousehide  " Hide mouse after chars typed
  221. set mouse=a  " Mouse in all modesc
  222. set guioptions-=m "Hide toolbar
  223. set guioptions-=T "Hide menubar
  224. set guioptions-=L "Hide scrollbar