This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

vimrc

By: panchuri on Nov 18th, 2012  |  syntax: VIM  |  size: 6.62 KB  |  views: 27  |  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. call pathogen#runtime_append_all_bundles()
  2. call pathogen#helptags()
  3. let mapleader=','
  4. " suppress the default lusty mapping
  5. let g:LustyJugglerDefaultMappings = 0
  6. " file explorer
  7. noremap <leader>o <Esc>:CommandT<CR>
  8. noremap <leader>O <Esc>:CommandTFlush<CR>
  9. noremap <leader>m <Esc>:CommandTBuffer<CR>
  10. " tag list
  11. let g:tagbar_usearrows = 1
  12. nnoremap <leader>l :TagbarToggle<CR>
  13. " lusty juggler for switching between buffers
  14. nnoremap <C-y> :LustyJuggler<CR>
  15.  
  16. " settings for ctrlp plugin
  17. let g:ctrlp_map = '<c-p>'
  18. let g:ctrlp_cmd = 'CtrlP'
  19. let g:ctrlp_working_path_mode = '0'
  20. set wildignore+=*/tmp/*,*.so,*.swp,*.zip     " Linux/MacOSX
  21. nmap <Leader>bb :ls<CR>:buffer<Space>
  22. " buffer stuff
  23. " "" Tab triggers buffer-name auto-completion
  24.  set wildchar=<Tab> wildmenu wildmode=full
  25. " if system is fast enough do syntax highlighting
  26. autocmd BufEnter * :syntax sync fromstart
  27. " clang user options
  28. let g:clang_user_options='|| exit 0'
  29. " navigate buffers using arrows
  30. " hide some files and remove stupid help
  31.  let g:netrw_list_hide='^\.,.\(pyc\|pyo\|o\)$'
  32. "
  33. " " Split window management
  34.  nnoremap <leader>w <C-w>v<C-w>l
  35.  nnoremap <leader>W <C-w>s
  36.  "nnoremap <leader>s :new<CR>
  37. "
  38.  let g:miniBufExplMapWindowNavVim = 1
  39.  let g:miniBufExplMapWindowNavArrows = 1
  40.  let g:miniBufExplMapCTabSwitchBufs = 1
  41.  let g:miniBufExplModSelTarget = 1
  42. " use space bar to close the fold
  43. nnoremap <silent> <Space> @=(foldlevel('.')?'zA':"\<Space>")<CR><SNR>12_HandlePossibleSelectionEnter()vnoremap <Space> zf
  44. "
  45.  map <Leader>t :CommandT<Return>
  46.  map <Leader>a :bprev<Return>
  47.  map <Leader>s :bnext<Return>
  48.  map <Leader>d :bd<Return>
  49.  map <Leader>f :b
  50. "
  51. " "" Show the buffer number in the status line.
  52.  set laststatus=2 statusline=%02n:%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
  53. " new
  54. map <F2> :NERDTreeToggle<CR>
  55. map <F8> :tabnew
  56. map <F5> :tabclose
  57. map <F6> :tabprevious
  58. map <F7> :tabnext
  59. map  :bn
  60. map  :bd
  61. "map  :tabprevious
  62. map N Nzz
  63. map n nzz
  64. nnoremap ; :
  65. map <up> <nop>
  66. map <down> <nop>
  67. map <left> <nop>
  68. map <right> <nop>
  69. nmap <silent> ,/ :nohlsearch<CR>
  70. imap ^C daw
  71. inoremap jj 
  72. inoremap kk 
  73. inoremap jk 
  74. syntax on
  75. set gfn=Monofont\ 10
  76. set foldmethod=syntax
  77. set number
  78. set hlsearch
  79. set incsearch
  80. set smarttab
  81. set autoindent
  82. set expandtab
  83. set backupdir=~/.tmp
  84. set directory=~/.tmp
  85. ":nmap <Space> i_<Esc>r
  86. set textwidth=80
  87. " saved macros
  88. let @q ='o#ifdef _DEBUG_EXTENSOkbIONxx#endifjjkijj'
  89. let @w ='I//jj'
  90. let @s = 'I%jj'
  91. " marvim
  92. nnoremap <F3> :set nonumber!<CR>:set foldcolumn=0<CR>
  93. filetype plugin indent on
  94. "autocmd FileType tex :AcpDisable
  95. " disable pyflakes..syntastic is good enough
  96. let g:pyflakes_use_quickfix = 0
  97. "autocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(
  98. set guifont=Neep\ 8
  99. set ruler
  100. set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%)
  101. set grepprg=grep\ -nH\ $*
  102. "omnicomplete
  103. :highlight PmenuSel ctermfg=black
  104.  
  105. " configure tags - add additional tags here or comment out not-used ones
  106. set tags+=~/.vim/tags/cpp
  107. set tags+=~/.vim/tags/gl
  108. set tags+=~/.vim/tags/sdl
  109. set tags+=~/.vim/tags/qt4
  110. set tags+=~/.myTags/std3.3.tags
  111. " build tags of your own project with Ctrl-F12
  112. map <C-F12> :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
  113. map <F4> : !ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
  114.  
  115. " taslit
  116. "noremap <silent> <Leader>t :TlistToggle<CR>
  117. nnoremap <leader>ev :vsplit $MYVIMRC<CR>
  118. nnoremap <leader>sv :source $MYVIMRC<CR>
  119. map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
  120. map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
  121. " OmniCppComplete
  122. let OmniCpp_NamespaceSearch = 1
  123. let OmniCpp_GlobalScopeSearch = 1
  124. let OmniCpp_ShowAccess = 1
  125. let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
  126. let OmniCpp_MayCompleteDot = 1 " autocomplete after .
  127. let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
  128. let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
  129. let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
  130. " start empty .tex files with plaintex
  131. let g:tex_flavor='latex'
  132. " automatically open and close the popup menu / preview window
  133. au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
  134. set completeopt=menuone,menu,longest,preview
  135.  
  136. "latex suite
  137. set tabstop=4
  138. set shiftwidth=4
  139. set expandtab
  140. nnoremap j gj
  141. nnoremap k gk
  142. cmap W w
  143. cmap WQ wq
  144. cmap wQ wq
  145. cmap Q q
  146. cmap Tabe tabe
  147. vmap <C-c> "+yi
  148. vmap <C-x> "+c
  149. "vmap <C-v> c<ESC>"+p
  150. "imap <C-v> <ESC>"+pa
  151.  
  152. "
  153. noremap <silent> <A-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
  154. nnoremap <silent> <A-Right> :execute 'silent! tabmove ' . tabpagenr()<CR>
  155.  
  156.  
  157. " syntastic
  158. set statusline+=%#warningmsg#
  159. set statusline+=%{SyntasticStatuslineFlag()}
  160. set statusline+=%*
  161. let g:syntastic_mode_map = { 'mode': 'active',
  162.             \ 'active_filetypes': [],
  163.             \ 'passive_filetypes': ['python'] }
  164. "let g:syntastic_enable_signs=1
  165. let g:syntastic_cpp_check_header = 1
  166. "let g:syntastic_auto_loc_list=1
  167.  
  168.  
  169. if has("autocmd")
  170.     au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  171.     au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
  172.     au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  173. endif
  174. " Alt-right/left to navigate forward/backward in the tags stack
  175. map <M-h> <C-T>
  176. map <M-l> <C-]>
  177. "
  178. " tab movement
  179. let g:lasttab = 1
  180. nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
  181. au TabLeave * let g:lasttab = tabpagenr()
  182. if exists("+showtabline")
  183.     function MyTabLine()
  184.         let s = ''
  185.         let t = tabpagenr()
  186.         let i = 1
  187.         while i <= tabpagenr('$')
  188.             let buflist = tabpagebuflist(i)
  189.             let winnr = tabpagewinnr(i)
  190.             let s .= '%' . i . 'T'
  191.             let s .= (i == t ? '%1*' : '%2*')
  192.             let s .= ' '
  193.             let s .= i . ')'
  194.             let s .= ' %*'
  195.             let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
  196.             let file = bufname(buflist[winnr - 1])
  197.             let file = fnamemodify(file, ':p:t')
  198.             if file == ''
  199.                 let file = '[No Name]'
  200.             endif
  201.             let s .= file
  202.             let i = i + 1
  203.         endwhile
  204.         let s .= '%T%#TabLineFill#%='
  205.         let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
  206.         return s
  207.     endfunction
  208.     set stal=2
  209.     set tabline=%!MyTabLine()
  210. endif
  211. augroup vimrc_autocmds
  212.       autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929
  213.         autocmd BufEnter * match OverLength /\%90v.*/
  214.     augroup END
  215. set hidden
clone this paste RAW Paste Data