Advertisement
Guest User

vimrc jaboi

a guest
May 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.16 KB | None | 0 0
  1. "        _
  2. " __   _(_)_ __ ___  _ __ ___
  3. " \ \ / / | '_ ` _ \| '__/ __|
  4. "  \ V /| | | | | | | | | (__
  5. "   \_/ |_|_| |_| |_|_|  \___|
  6.  
  7. " systems clipboard
  8. set clipboard=unnamedplus
  9.  
  10. " Load pathogen for plugins:
  11. execute pathogen#infect()
  12.  
  13. let $RUNTIMEPATH .= ':/home/jaime/.vim/colors/'
  14.  
  15. " Basics
  16. set t_Co=256
  17. syntax on
  18. filetype plugin indent on
  19. set nocompatible
  20. set number
  21. set relativenumber
  22. set encoding=utf-8
  23. set fileencoding=utf-8
  24.  
  25. " folding
  26. set foldmethod=indent
  27. set foldlevel=99
  28. let g:SimpylFold_docstring_preview = 1
  29. " Enable folding with the spacebar
  30. nnoremap <space> za
  31.  
  32. " Colors Spell-Check
  33. hi Visual ctermbg=234
  34. hi SpellBad term=reverse ctermbg=red gui=undercurl guisp=Red
  35. hi SpellCap term=reverse ctermbg=81 gui=undercurl guisp=Blue
  36. hi SpellRare term=reverse ctermbg=225 gui=undercurl guisp=Magenta
  37. hi SpellLocal term=reverse ctermbg=14 gui=undercurl guisp=DarkCyan
  38.  
  39.  
  40. " Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
  41. set splitbelow
  42. set splitright
  43. " Use ctrl-[hjkl] to select the active split!
  44. nmap <silent> <c-k> :wincmd k<CR>
  45. nmap <silent> <c-j> :wincmd j<CR>
  46. nmap <silent> <c-h> :wincmd h<CR>
  47. nmap <silent> <c-l> :wincmd l<CR>
  48.  
  49.  
  50. " Get line, word and character counts with F3:
  51. map <F3> :!wc <C-R>%<CR>
  52. " English Spell-check set to F6:
  53. map <F6> :setlocal spell! spelllang=en_us<CR>
  54. "" German Spell-check set to F7:
  55. map <F7> :NERDTreeToggle<CR>
  56. map <F8> :Goyo \| set linebreak<CR>
  57.  
  58. " Automatically deletes all tralling whitespaces on save.
  59. autocmd BufWritePre * %s/\s\+$//e
  60.  
  61. " Disables automatic commenting on newline:
  62. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  63.  
  64. " .tex files automatically detected
  65. autocmd BufRead,BufNewFile *.tex set filetype=tex
  66.  
  67. " .py files automatically detected
  68. autocmd BufRead,BufNewFile *.py set filetype=python
  69.  
  70. set linebreak
  71. set showbreak=+++
  72. set showmatch
  73. set visualbell
  74.  
  75. set hlsearch
  76. set smartcase
  77. set ignorecase
  78. set incsearch
  79.  
  80. set autoindent
  81. set expandtab
  82. set shiftwidth=4
  83. set smartindent
  84. set softtabstop=4
  85.  
  86. set ruler
  87.  
  88. set undolevels=1000
  89. set backspace=indent,eol,start
  90.  
  91. set swapfile
  92. set dir=/tmp
  93. set nobackup
  94.  
  95.  
  96.     "========="
  97.     " PLUGINS "
  98.     "========="
  99.  
  100. " vim-multiple-cursors
  101.  
  102. let g:multi_cursor_use_default_mapping=0
  103.  
  104. " jedi vim
  105. let g:jedi#popup_on_dot = 0
  106. " let g:jedi#use_tabs_not_buffers = 1
  107.  
  108. " Default mapping
  109. let g:multi_cursor_start_word_key      = '<C-n>'
  110. let g:multi_cursor_select_all_word_key = '<A-n>'
  111. let g:multi_cursor_start_key           = 'g<C-n>'
  112. let g:multi_cursor_select_all_key      = 'g<A-n>'
  113. let g:multi_cursor_next_key            = '<C-n>'
  114. let g:multi_cursor_prev_key            = '<C-p>'
  115. let g:multi_cursor_skip_key            = '<C-x>'
  116. let g:multi_cursor_quit_key            = '<Esc>'
  117.  
  118. " ____        _                  _
  119. "/ ___| _ __ (_)_ __  _ __   ___| |_ ___
  120. "\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __|
  121. " ___) | | | | | |_) | |_) |  __/ |_\__ \
  122. "|____/|_| |_|_| .__/| .__/ \___|\__|___/
  123. "              |_|   |_|
  124.  
  125. "" Navigating with guides
  126. "        inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  127. "        vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  128. "        map <Space><Tab> <Esc>/<++><Enter>"_c4l
  129.  
  130. """ Latex
  131.     " Navigating with guides
  132.         autocmd FileType tex inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  133.         autocmd FileType tex vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  134.         autocmd FileType tex map <Space><Tab> <Esc>/<++><Enter>"_c4l
  135.  
  136.     " Text width
  137.         autocmd FileType tex set textwidth=80
  138.  
  139.     " Word count
  140.         autocmd FileType tex map <F3> :w !detex \| wc -w<CR>
  141.         autocmd FileType tex inoremap <F3> <Esc>:w !detex \| wc -w<CR>
  142.  
  143.     " Code snippets
  144.         autocmd FileType tex inoremap ,sec \section{}<Enter><++><Esc>1kf}i
  145.         autocmd FileType tex inoremap ,ssec \subsection{}<Enter><++><Esc>1kf}i
  146.         autocmd FileType tex inoremap ,sssec \subsubsection{}<Enter><++><Esc>1kf}i
  147.  
  148.         autocmd FileType tex inoremap ,art \documentclass{article}<enter>
  149.         autocmd FileType tex inoremap ,doc \begin{document}<enter><enter>\end{document}<esc>kA
  150.         autocmd FileType tex inoremap ,up \usepackage{}<enter><++><esc>kf}i
  151.  
  152.         autocmd FileType tex inoremap ,it \textit{}<++><Esc>T{i
  153.         autocmd FileType tex inoremap ,bf \textbf{}<++><Esc>T{i
  154.  
  155.         autocmd FileType tex inoremap ,$ $$<++><Esc>4hi
  156.         autocmd FileType tex inoremap ,eq \begin{equation}<Enter><Enter>\end{equation}<Enter><++><Esc>2kA<tab>
  157.         autocmd FileType tex inoremap ,fr \frac{}{<++>}<++><Esc>ba
  158.         autocmd FileType tex inoremap ,ve \vec{}<++><Esc>ba
  159.  
  160. """" Python
  161.     " save and run python script
  162.     autocmd FileType python nnoremap <buffer> <F9> :w<enter> :exec '!python' shellescape(@%, 1)<cr>
  163.  
  164. "    " Navigating with guides
  165. "        autocmd FileType python inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  166. "        autocmd FileType python vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
  167. "        autocmd FileType python map <Space><Tab> <Esc>/<++><Enter>"_c4l
  168. "
  169. "    " Code snippets
  170. "        autocmd FileType python inoremap ,pr print()<enter><++><esc>k$i
  171. "        autocmd FileType python inoremap ,rl range(len())<++><esc>ba
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement