Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.98 KB | None | 0 0
  1. " omni's vimrc file
  2.  
  3. " git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  4.  
  5. " Vundle
  6. " --------------
  7. set nocompatible
  8. filetype off
  9.  
  10. " set the runtime path to include Vundle and initialize
  11. set rtp+=~/.vim/bundle/Vundle.vim
  12. call vundle#begin()
  13.  
  14. " alternatively, pass a path where Vundle should install plugins
  15. "call vundle#begin('~/some/path/here')
  16.  
  17. " let Vundle manage Vundle, required
  18. Plugin 'VundleVim/Vundle.vim'
  19.  
  20. " plugins list
  21.  
  22. " youcompleteme
  23. Plugin 'Valloric/YouCompleteMe'
  24.  
  25. " light bar
  26. Plugin 'itchyny/lightline.vim'
  27.  
  28. " emmet
  29. Plugin 'mattn/emmet-vim'
  30.  
  31. " surround
  32. Plugin 'tpope/vim-surround'
  33.  
  34. " nerdtree
  35. Plugin 'scrooloose/nerdtree'
  36.  
  37. " gitgutter
  38. Plugin 'airblade/vim-gitgutter'
  39.  
  40. " ctrlp
  41. Plugin 'ctrlpvim/ctrlp.vim'
  42.  
  43. " vim commentary
  44. Plugin 'tpope/vim-commentary'
  45.  
  46. " fugitive
  47. Plugin 'tpope/vim-fugitive'
  48.  
  49. " searchindex
  50. Plugin 'google/vim-searchindex'
  51.  
  52. " searchcomplete
  53. Plugin 'vim-scripts/SearchComplete'
  54.  
  55. " goyo
  56. Plugin 'junegunn/goyo.vim'
  57.  
  58. " markdown
  59. Plugin 'gabrielelana/vim-markdown'
  60.  
  61. " auto-pair
  62. Plugin 'jiangmiao/auto-pairs'
  63.  
  64. " syntax check
  65. Plugin 'vim-syntastic/syntastic'
  66.  
  67. " java complete
  68. Plugin 'artur-shaik/vim-javacomplete2'
  69.  
  70.  
  71. " All of your Plugins must be added before the following line
  72. call vundle#end()
  73. " --------------
  74.  
  75. " config
  76. " ---------------
  77. " search parameters
  78. set incsearch
  79. set ignorecase
  80. set smartcase
  81. set hlsearch
  82.  
  83. filetype plugin indent on
  84. syntax on
  85.  
  86. " To save, ctrl-s.
  87. nmap <c-s> :w<CR>
  88. imap <c-s> <Esc>:w<CR>a
  89.  
  90. " To save and quit, ctrl-x
  91. nmap <c-x> :x<CR>
  92. imap <c-x> <Esc>:x<CR>a
  93.  
  94. " colorscheme
  95. colorscheme onedark
  96. " if file is markdown -> no spellcheck (ugly red thing)
  97. autocmd BufNewFile,BufRead *.md set nospell
  98.  
  99. " execute C code
  100. map <F8> :w <CR> :!gcc % && ./a.out <CR>
  101.  
  102. " shortcut for split windows
  103. nnoremap <C-h> <C-w>h
  104. nnoremap <C-j> <C-w>j
  105. nnoremap <C-k> <C-w>k
  106. nnoremap <C-l> <C-w>l
  107.  
  108. " set foldmethod
  109. " set foldmethod=indent
  110.  
  111. " Auto reload changed files
  112. set autoread
  113.  
  114. " Automatically indent when adding a curly bracket, etc.
  115. set smartindent
  116. set autoindent
  117.  
  118. " Tabs should be converted to a group of 4 spaces.
  119. " This is the official Python convention
  120. " http://www.python.org/dev/peps/pep-0008/
  121. set shiftwidth=4
  122. set tabstop=4
  123. set noexpandtab
  124. set smarttab
  125.  
  126. " Show autocomplete menus.
  127. set wildmenu
  128.  
  129. " Error bells are displayed visually.
  130. " set visualbell
  131. " --------------
  132.  
  133. " plugins config
  134. " --------------
  135. " nerdtree config
  136. map <C-n> :NERDTreeToggle<CR>
  137.  
  138. " lightline config
  139. set laststatus=2
  140. set noshowmode
  141. "\     'lineinfo': ' %3l:%-2v',
  142. let g:lightline = {
  143.       \ 'colorscheme': 'one',
  144.       \ 'active': {
  145.       \   'left': [ [ 'mode', 'paste' ],
  146.       \             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
  147.       \ },
  148.       \ 'component_function': {
  149.       \   'gitbranch': 'fugitive#head',
  150.       \   'lineinfo': 'GetLines',
  151.       \   'fileformat': 'LightlineFileformat',
  152.       \   'filetype': 'LightlineFiletype',
  153.       \ },
  154.       \ 'component': {
  155.       \ },
  156.       \ }
  157. let g:lightline.separator = {
  158.     \   'left': '', 'right': ''
  159.   \}
  160. let g:lightline.subseparator = {
  161.     \   'left': '', 'right': ''
  162.   \}
  163. let g:lightline.tabline = {
  164.   \   'left': [ ['tabs'] ],
  165.   \   'right': [ ['close'] ]
  166.   \ }
  167. set showtabline=2  " Show tabline
  168. set guioptions-=e  " Don't use GUI tabline
  169.  
  170. function! GetLines()
  171.     return line('.') . ":" . col('.') . "/" . line('$')
  172. endfunction
  173.  
  174. function! LightlineFileformat()
  175.   return winwidth(0) > 70 ? &fileformat : ''
  176. endfunction
  177.  
  178. function! LightlineFiletype()
  179.   return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
  180. endfunction
  181.  
  182. " ycm
  183. let g:ycm_autoclose_preview_window_after_completion = 1
  184.  
  185. " ctrlp
  186. let g:ctrlp_map = '<c-p>'
  187. let g:ctrlp_cmd = 'CtrlP'
  188.  
  189. " markdown
  190. let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'java', 'c', 'javascript']
  191.  
  192. " java complete
  193. autocmd FileType java setlocal omnifunc=javacomplete#Complete
  194.  
  195. " --------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement