Advertisement
Guest User

.vimrc

a guest
Feb 27th, 2015
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  2. " => General
  3.  
  4. set nocompatible
  5. filetype off
  6. set rtp+=~/.vim/bundle/vundle/
  7. call vundle#rc()
  8. filetype plugin indent on
  9.  
  10. Bundle         'Igorjan94/codeforces.vim'
  11. Bundle            'vim-scripts/dbext.vim'
  12. Bundle                   'kien/ctrlp.vim'
  13. Bundle               'Shougo/vimproc.vim'
  14. Bundle                'majutsushi/tagbar'
  15. Bundle           'Valloric/YouCompleteMe'
  16. Bundle             'scrooloose/syntastic'
  17. Bundle                 'travitch/hasksyn' "*
  18. Bundle               'tpope/vim-surround' "*
  19. Bundle                    'gmarik/vundle'
  20. Bundle                'vim-scripts/a.vim' "*
  21. Bundle         'scrooloose/nerdcommenter' "*
  22. Bundle              'scrooloose/nerdtree'
  23. Bundle                'eagletmt/neco-ghc' "*
  24. Bundle              'eagletmt/ghcmod-vim' "*
  25. Bundle                  'mbbill/undotree'
  26. Bundle                'bling/vim-airline'
  27. Bundle               'tpope/vim-fugitive' "*
  28. Bundle          'Lokaltog/vim-easymotion'
  29. Bundle 'altercation/vim-colors-solarized'
  30. Bundle       'dhruvasagar/vim-table-mode' "*
  31. Bundle      'Twinside/vim-haskellConceal' "*
  32. Bundle              'Twinside/vim-hoogle' "*
  33. Bundle                   'mattn/gist-vim' "*
  34. Bundle                 'mattn/webapi-vim' "*
  35. Bundle                    'bitc/lushtags' "*
  36. Bundle             'itchyny/calendar.vim'
  37. Bundle            'itchyny/thumbnail.vim' "*
  38. Bundle    'xuhdev/vim-latex-live-preview' "*
  39. Bundle         'LaTeX-Box-Team/LaTeX-Box' "*
  40. Bundle          'junegunn/vim-easy-align'
  41. Bundle           'airblade/vim-gitgutter'
  42. Bundle               'takac/vim-hardtime' "*
  43. Bundle             'vim-scripts/Tabmerge' "*
  44. Bundle       'powerman/vim-plugin-ruscmd'
  45. Bundle     'kien/rainbow_parentheses.vim'
  46. Bundle                   'wting/rust.vim' "*
  47. Bundle          'idris-hackers/idris-vim'
  48.  
  49. set nocp
  50. filetype plugin on
  51.  
  52.  
  53. set history=700
  54. set confirm
  55. set cindent
  56.  
  57. "TODO disable in vimrc
  58.  
  59. "for p in ["syntastic", "YouCompleteMe", "tagbar", "taglist", "vimproc", 'vimshell'] | exec 'set rtp+=~/.nix-profile/vim-plugins/'.p | endfor
  60. " Enable filetype plugins
  61. filetype plugin on
  62. filetype indent on
  63. "filetype on
  64. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  65.  
  66. command WQ wq
  67. command Wq wq
  68. command W w
  69. command Q q
  70.  
  71. autocmd vimenter * cd %:p:h
  72.  
  73. set nocompatible
  74. set hidden
  75. filetype indent plugin on | syn on
  76.  
  77. " Start interactive EasyAlign in visual mode
  78. vmap <Enter> <Plug>(EasyAlign)
  79. nmap s <Plug>(easymotion-s2)
  80. map  / <Plug>(easymotion-sn)
  81. omap / <Plug>(easymotion-tn)
  82. map  n <Plug>(easymotion-next)
  83. map  N <Plug>(easymotion-prev)
  84.  
  85. let g:calendar_google_calendar = 1
  86. let g:calendar_google_task = 1
  87.  
  88. let g:gist_clip_command = 'xclip -selection clipboard'
  89. let g:gist_detect_filetype = 1
  90. let g:gist_use_password_in_gitconfig = 1
  91.  
  92. let NERDTreeShowHidden=1
  93. let NERDTreeQuitOnOpen=1
  94. let g:necoghc_enable_detailed_browse = 1
  95.  
  96. au VimEnter * RainbowParenthesesToggle
  97. au Syntax * RainbowParenthesesLoadRound
  98. au Syntax * RainbowParenthesesLoadSquare
  99. au Syntax * RainbowParenthesesLoadBraces
  100.  
  101. let g:airline#extensions#syntastic#enabled = 1
  102. let g:airline_theme='dark'
  103. let g:airline_left_sep = '▶'
  104. let g:airline_right_sep = '◀'
  105. let g:airline_detect_modified=1
  106. let g:airline_detect_paste=1
  107.  
  108. " How many lines should be searched for context
  109. let g:hasksyn_indent_search_backward = 100
  110.  
  111. " Should we try to de-indent after a return
  112. let g:hasksyn_dedent_after_return = 1
  113.  
  114. " Should we try to de-indent after a catchall case in a case .. of
  115. let g:hasksyn_dedent_after_catchall_case = 1
  116.  
  117. let tagbar_autofocus=1
  118. let tagbar_autoclose=1
  119.  
  120. let g:EclimCompletionMethod = 'omnifunc'
  121.  
  122. let g:ycm_server_keep_logfiles = 1
  123. let g:ycm_server_log_level = 'debug'
  124. let g:ycm_path_to_python_interpreter = '/usr/bin/python2'
  125. let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
  126. "autocmd FileType c let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/c/.ycm_extra_conf.py'
  127. let g:ycm_semantic_triggers =  {
  128.   \   'c' : ['->', '.'],
  129.   \   'cpp' : ['->', '.', '::'],
  130.   \   'objc' : ['->', '.'],
  131.   \   'ocaml' : ['.', '#'],
  132.   \   'cpp,objcpp' : ['->', '.', '::'],
  133.   \   'perl' : ['->'],
  134.   \   'php' : ['->', '::'],
  135.   \   'cs,java,javascript,d,vim,python,perl6,scala,vb,elixir,go' : ['.'],
  136.   \   'ruby' : ['.', '::'],
  137.   \   'lua' : ['.', ':'],
  138.   \   'erlang' : [':'],
  139.   \ }
  140.  
  141.  
  142.  
  143. "set listchars=tab:  
  144. "set list
  145. set fencs=utf-8,cp1251,koi8-r,ucs-2,cp866
  146. au FileType qf call AdjustWindowHeight(3, 10)
  147. function! AdjustWindowHeight(minheight, maxheight)
  148.   exe max([min([line("$")+1, a:maxheight]), a:minheight]) . "wincmd _"
  149. endfunction
  150.  
  151. " Set Russian key to understand
  152. "set keymap=russian-cukenwin
  153. set iminsert=0
  154. set imsearch=0
  155. imap <F10> <Esc>:TagbarToggle<CR>
  156. nmap <F10> <Esc>:TagbarToggle<CR>
  157. imap <F11> <Esc>:NERDTreeToggle<CR>
  158. nmap <F11> <Esc>:NERDTreeToggle<CR>
  159. " Num strings
  160. set nu!
  161. set ai!
  162. set cin!
  163. imap <C-S-v> <S-Insert>
  164. " Set to auto read when a file is changed from the outside
  165. set autoread
  166.  
  167. " With a map leader it's possible to do extra key combinations
  168. " like <leader>w saves the current file
  169. let mapleader = ","
  170. let g:mapleader = ","
  171. set viminfo='10,\"100,:20,%,n~/.viminfo
  172.    au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm
  173. $"|endif|endif
  174.  
  175. map <leader>Q :let @+ = system("pastebinit " . " -f " . &filetype . " " . expand("%"))<CR>
  176.  
  177. " Fast saving
  178. "map <C-E> <Esc>:tabedit %<.h<CR>
  179. vnoremap p "_dP
  180. nnoremap <C-u> :UndotreeToggle<CR>
  181. imap <F5> <Esc> :tabprev<CR>
  182. nmap <leader>w :w!<cr>
  183. map <F2> <Esc>:w !sudo tee %<CR>
  184. imap <F2> <Esc>:w<CR>
  185. imap <F5> <Esc> :tabprev<CR>
  186. map <F5> :tabprev<CR>
  187. imap <F6> <Esc> :tabnext<CR>
  188. map <F6> :tabnext <CR>
  189. function! GAC()
  190.     call inputsave()
  191.     let commit = input('Commit message: ')
  192.     call inputrestore()
  193.     let aaa = system("git add " . expand("%") . " && git commit -m \"" . commit . "\"")
  194.     echom aaa
  195. endfunction
  196. let Tlist_Exit_OnlyWindow = 1
  197. " put from clipboard
  198. nmap <leader>p "+p
  199. map cn <ESC>:cn<CR>
  200. map cb <ESC>:cp<CR>
  201. " yank to clipboard
  202. map <leader>y "+y
  203. map <leader>y "+y
  204. set wildmenu
  205. set wcm=<Tab>
  206. menu Exit.quit     :quit<CR>
  207. menu Exit.quit!    :quit!<CR>
  208. menu Exit.save     :exit<CR>
  209. map <F3> :emenu Exit.<Tab>
  210.  function! InsertTabWrapper(direction)
  211.     let col = col('.') - 1
  212.     if !col || getline('.')[col - 1] !~ '\k'
  213.         return "\<tab>"
  214.     elseif "backward" == a:direction
  215.         return "\<c-p>"
  216.     else
  217.         return "\<c-n>"
  218.     endif
  219.  endfunction
  220.  inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
  221.  inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
  222.  
  223.  
  224. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  225. " => VIM user interface
  226. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  227. " Set 7 lines to the cursor - when moving vertically using j/k
  228. set so=7
  229.  
  230. " Turn on the WiLd menu
  231. set wildmenu
  232.  
  233. " Ignore compiled files
  234. set wildignore=*.o,*~,*.pyc
  235.  
  236. "Always show current position
  237. set ruler
  238.  
  239. " Height of the command bar
  240. set cmdheight=1
  241.  
  242. " A buffer becomes hidden when it is abandoned
  243. set hid
  244.  
  245. " Configure backspace so it acts as it should act
  246. set backspace=eol,start,indent
  247. set whichwrap+=<,>,h,l
  248.  
  249. " Ignore case when searching
  250. set ignorecase
  251.  
  252. " When searching try to be smart about cases
  253. set smartcase
  254.  
  255. " Highlight search results
  256. set hlsearch
  257.  
  258. " Makes search act like search in modern browsers
  259. set incsearch
  260.  
  261. " Don't redraw while executing macros (good performance config)
  262. set lazyredraw
  263.  
  264. " For regular expressions turn magic on
  265. set magic
  266.  
  267. " Show matching brackets when text indicator is over them
  268. set showmatch
  269. " How many tenths of a second to blink when matching brackets
  270. set mat=2
  271.  
  272. " No annoying sound on errors
  273. set noerrorbells
  274. set novisualbell
  275. set t_vb=
  276. set tm=500
  277.  
  278.  
  279. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  280. " => Colors and Fonts
  281. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  282. " Enable syntax highlighting
  283. syntax enable
  284.  
  285. let g:solarized_termcolors=256
  286. colorscheme solarized "desert
  287. "colorscheme torte
  288. set background=dark
  289.  
  290. " Set extra options when running in GUI mode
  291. if exists('$WINDOWID')
  292.     set t_Co=256
  293. endif
  294.  
  295. if has("gui_running")
  296.     set guioptions-=T
  297.     set guioptions+=e
  298.     set guitablabel=%M\ %t
  299. endif
  300.  
  301. " Set utf8 as standard encoding and en_US as the standard language
  302. set encoding=utf8
  303. " Use Unix as the standard file type
  304. set ffs=unix,dos,mac
  305.  
  306.  
  307. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  308. " => Files, backups and undo
  309. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  310. " Turn backup off, since most stuff is in SVN, git et.c anyway...
  311. set nobackup
  312. set nowb
  313. set noswapfile
  314.  
  315.  
  316. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  317. " => Text, tab and indent related
  318. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  319. " Use spaces instead of tabs
  320. set expandtab
  321.  
  322. " Be smart when using tabs ;)
  323. set smarttab
  324.  
  325. " 1 tab == 4 spaces
  326. set shiftwidth=4
  327. set tabstop=4
  328. set shiftround                  "Round spaces to nearest shiftwidth multiple
  329. set nojoinspaces                "Don't convert spaces to tabs
  330.  
  331. " Linebreak on 500 characters
  332. set lbr
  333. set tw=500
  334.  
  335. set ai "Auto indent
  336. set si "Smart indent
  337. set wrap "Wrap lines
  338.  
  339.  
  340. """"""""""""""""""""""""""""""
  341. " => Visual mode related
  342. """"""""""""""""""""""""""""""
  343. " Visual mode pressing * or # searches for the current selection
  344. " Super useful! From an idea by Michael Naumann
  345. vnoremap <silent> * :call VisualSelection('f')<CR>
  346. vnoremap <silent> # :call VisualSelection('b')<CR>
  347.  
  348.  
  349. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  350. " => Moving around, tabs, windows and buffers
  351. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  352. " Treat long lines as break lines (useful when moving around in them)
  353. map j gj
  354. map k gk
  355.  
  356. " Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
  357. map <space> /
  358. map <leader><space> <ESC>:%s/
  359.  
  360. " Disable highlight when <leader><cr> is pressed
  361. map <silent> <leader><cr> :noh<cr>
  362.  
  363. " Smart way to move between windows
  364. map <C-j> <C-W>j
  365. map <C-k> <C-W>k
  366. map <C-h> <C-W>h
  367. map <C-l> <C-W>l
  368.  
  369. " Close the current buffer
  370. map <leader>bd :Bclose<cr>
  371.  
  372. " Close all the buffers
  373. map <leader>ba :1,1000 bd!<cr>
  374.  
  375. " Useful mappings for managing tabs
  376. map <leader>tn :tabnew<cr>
  377. map <leader>to :tabonly<cr>
  378. map <leader>tc :tabclose<cr>
  379. map <leader>tm :tabmove
  380.  
  381. " Opens a new tab with the current buffer's path
  382. " Super useful when editing files in the same directory
  383. map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
  384.  
  385. " Switch CWD to the directory of the open buffer
  386. map <leader>cd :cd %:p:h<cr>:pwd<cr>
  387.  
  388. " Specify the behavior when switching between buffers
  389. try
  390.   set switchbuf=useopen,usetab,newtab
  391.   set stal=2
  392. catch
  393. endtry
  394.  
  395. " Return to last edit position when opening files (You want this!)
  396.  
  397.  
  398. """"""""""""""""""""""""""""""
  399. " => Status line
  400. """"""""""""""""""""""""""""""
  401. " Always show the status line
  402. set laststatus=2
  403.  
  404. " Format the status line
  405. set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
  406.  
  407.  
  408. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  409. " => Editing mappings
  410. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  411. " Remap VIM 0 to first non-blank character
  412. map 0 ^
  413.  
  414. " Delete trailing white space on save, useful for Python and CoffeeScript ;)
  415. func! DeleteTrailingWS()
  416.   exe "normal mz"
  417.   %s/\s\+$//ge
  418.   exe "normal `z"
  419. endfunc
  420. autocmd BufWrite *.py :call DeleteTrailingWS()
  421. autocmd BufWrite *.coffee :call DeleteTrailingWS()
  422.  
  423.  
  424. " Toggle paste mode on and off
  425. map <leader>v :setlocal paste!<cr>
  426.  
  427.  
  428.  
  429. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  430. " => Helper functions
  431. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  432. function! CmdLine(str)
  433.     exe "menu Foo.Bar :" . a:str
  434.     emenu Foo.Bar
  435.     unmenu Foo
  436. endfunction
  437.  
  438.  
  439. " Returns true if paste mode is enabled
  440. function! HasPaste()
  441.     if &paste
  442.         return 'PASTE MODE  '
  443.     en
  444.     return ''
  445. endfunction
  446. set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>
  447.  
  448. set relativenumber
  449. vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
  450. "set list
  451. "set listchars=tab:▸\ ,eol:¬
  452. " set cursorline
  453. set undofile
  454.  
  455. autocmd FileType cpp call CppMake()
  456. function! CppMake()
  457.    if filereadable("Makefile")
  458.        set makeprg=make\ -s
  459.    else
  460.        if filereadable("makefile")
  461.            set makeprg=make\ -s
  462.        else
  463.            set makeprg=clang++\ -O2\ -std=c++11\ -o\ %<\ %
  464.        endif
  465.    endif
  466. endfunction
  467.  
  468. autocmd FileType java       set makeprg=javac\ %
  469. autocmd FileType haskell    set makeprg=ghc\ -o\ %<\ %
  470.  
  471.                            nmap <F8> <ESC>:w<CR><ESC>:!./%<CR>
  472.                            imap <F8> <ESC>:w<CR><ESC>:!./%<CR>
  473. autocmd FileType cpp        nmap <F8> <ESC>:w<CR><ESC>:!./%<<CR>
  474. autocmd FileType cpp        imap <F8> <ESC>:w<CR><ESC>:!./%<<CR>
  475. autocmd FileType java       nmap <F8> <ESC>:w<CR><ESC>:!java %<<CR>
  476. autocmd FileType java       imap <F8> <ESC>:w<CR><ESC>:!java %<<CR>
  477. autocmd FileType haskell    nmap <F8> <ESC>:w<CR><ESC>:!./%<<CR>
  478. autocmd FileType haskell    imap <F8> <ESC>:w<CR><ESC>:!./%<<CR>
  479. autocmd FileType python     nmap <F8> <ESC>:w<CR><ESC>:!python3 %<CR>
  480. autocmd FileType python     imap <F8> <ESC>:w<CR><ESC>:!python3 %<CR>
  481.  
  482.  
  483. autocmd FileType cpp        noremap <C-F9> <ESC>:w<CR><ESC>:make<CR>
  484. autocmd FileType java       noremap <C-F9> <ESC>:w<CR><ESC>:make<CR>
  485.  
  486. autocmd FileType python     imap <F9> <ESC>:w<CR><ESC>:!python3 %<CR>
  487. autocmd FileType perl       imap <F9> <ESC>:w<CR><ESC>:!perl %<CR>
  488. autocmd FileType java       imap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!java %<<CR>
  489. autocmd FileType cpp        imap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!./%<<CR>
  490. autocmd FileType c          imap <F9> <ESC>:w<CR><ESC>:!clang % -o %<<CR><ESC>:!./%<<CR>
  491. autocmd FileType haskell    imap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!./%<<CR>
  492.  
  493. autocmd FileType python     nmap <F9> <ESC>:w<CR><ESC>:!python3 %<CR>
  494. autocmd FileType perl       nmap <F9> <ESC>:w<CR><ESC>:!perl %<CR>
  495. autocmd FileType java       nmap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!java %<<CR>
  496. autocmd FileType cpp        nmap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!./%<<CR>
  497. autocmd FileType c          nmap <F9> <ESC>:w<CR><ESC>:!clang % -o %<<CR><ESC>:!./%<<CR>
  498. autocmd FileType haskell    nmap <F9> <ESC>:w<CR><ESC>:make<CR><ESC>:!./%<<CR>
  499.  
  500.  
  501. autocmd FileType cpp        imap <F7> <ESC>:w<CR>:!clang++ -std=c++11 -E %<CR>
  502. autocmd FileType cpp        nmap <F7> <ESC>:w<CR>:!clang++ -std=c++11 -E %<CR>
  503.  
  504. autocmd FileType cpp    imap <C-f> <Esc>:w<CR><Esc>:%!astyle --mode=c --style=allman --indent=spaces=4 --indent-namespaces --break-blocks --align-pointer=middle --align-reference=type --suffix=none<CR><CR>
  505. autocmd FileType java   imap <C-f> <Esc>:w<CR><Esc>:%!astyle --mode=c --style=allman --indent=spaces=4 --indent-namespaces --break-blocks --align-pointer=middle --align-reference=type --suffix=none<CR><CR>
  506. autocmd BufRead *.hs    imap <C-f> <Esc>:w<CR><Esc>:%!stylish-haskell<CR><CR>
  507.  
  508. autocmd FileType cpp    nmap <C-f> <Esc>:w<CR><Esc>:%!astyle --mode=c --style=allman --indent=spaces=4 --indent-namespaces --break-blocks --align-pointer=middle --align-reference=type --suffix=none<CR><CR>
  509. autocmd FileType java   nmap <C-f> <Esc>:w<CR><Esc>:%!astyle --mode=c --style=allman --indent=spaces=4 --indent-namespaces --break-blocks --align-pointer=middle --align-reference=type --suffix=none<CR><CR>
  510. autocmd BufRead *.hs    nmap <C-f> <Esc>:w<CR><Esc>:%!stylish-haskell<CR><CR>
  511.  
  512. " Ctrl-Space for completions. Heck Yeah!
  513. inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
  514.          \ "\<lt>C-n>" :
  515.          \ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
  516.          \ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
  517.          \ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
  518. imap <C-@> <C-Space>
  519.  
  520. let g:ycm_autoclose_preview_window_after_insertion = 1
  521. let g:ycm_complete_in_comments = 1
  522. let g:ycm_goto_buffer_command = 'new-tab'
  523.  
  524. let g:ctrlp_map = '<c-p>'
  525. let g:ctrlp_cmd = 'CtrlP'
  526.  
  527. let g:EclimJavaSearchSingleResult = 'tabnew'
  528.  
  529. let g:undotree_SetFocusWhenToggle = 1
  530.  
  531. let g:CodeForcesUsername = 'Igorjan94'
  532. let g:CodeForcesCount = 40
  533. let g:CodeForcesContestId = 518
  534. let g:CodeForcesShowUnofficial = 1
  535. let g:CodeForcesCommandLoadTask = 'vsplit'
  536.  
  537. noremap <leader>vv <ESC>:CodeForces
  538.  
  539. autocmd FileType cpp  nnoremap <C-E> <ESC>:YcmCompleter GoToDefinitionElseDeclaration<CR>
  540. autocmd FileType java nnoremap <C-E> <ESC>:JavaSearch<CR>
  541.  
  542. set timeoutlen=2000
  543.  
  544. imap <leader>{ {<CR><CR>}<ESC>k$i
  545. imap <leader>re readln();<ESC>hi
  546. imap <leader>wr writeln();<ESC>hi
  547. imap <leader>S System.out.println();<ESC>hi
  548. imap <leader>esc <ESC>
  549. imap <leader>str struct<CR>{<CR><TAB><CR>};<ESC>k$i
  550. imap <leader>v vector<
  551. imap <leader>wh whole(
  552. imap <leader>el elohw(
  553. imap <leader>mne min_element(
  554. imap <leader>mxe max_element(
  555. imap <leader>b begin(),
  556. imap <leader>en end(),
  557. imap <leader>f first
  558. imap <leader>s second
  559. imap <leader>we writeln_range(
  560. imap <leader>[] []()<CR>{<CR>return<CR>};<ESC>kkk$i
  561.  
  562. set foldenable
  563. set foldmethod=marker
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement