Advertisement
Abstract-Chief

nvim/init.vim

Jun 24th, 2022
1,113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.52 KB | None | 0 0
  1. set nocompatible
  2. set number
  3. syntax on
  4. set foldcolumn=2
  5. set hlsearch
  6. set tabstop=3
  7. set shiftwidth=3
  8. set smarttab
  9. set expandtab
  10. set smartindent
  11. "packing/unpack funck
  12. set foldmethod=syntax  
  13. set foldlevel=101
  14.  
  15. colorscheme sublimemonokai
  16. "keybinds
  17.  
  18. "\+w save file
  19. nmap <leader>w :w!<cr>
  20. "F6 open nerdtree
  21.  
  22. nmap <F8> :TagbarToggle<CR>
  23.  
  24. nmap <F6> :NERDTreeToggle<CR>
  25.  
  26. nmap <F5> :UndotreeToggle<CR>
  27.  
  28. call plug#begin('~/.config/nvim/autoload')
  29.  
  30. Plug 'mbbill/undotree'
  31.  
  32. "comment
  33. Plug 'scrooloose/nerdcommenter'
  34.  
  35. Plug 'scrooloose/syntastic'
  36.  
  37. "sublime monokai
  38. Plug 'erichdongubler/vim-sublime-monokai'
  39.  
  40. Plug 'ervandew/supertab'
  41. Plug 'shougo/neocomplcache.vim'
  42.  
  43. "Plug 'ryanoasis/vim-devicons'
  44.  
  45. "airline
  46. Plug 'bling/vim-airline'
  47. Plug 'vim-airline/vim-airline-themes'
  48.  
  49. "nerdtree
  50. Plug 'scrooloose/nerdtree'
  51. Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
  52.  
  53. Plug 'kien/ctrlp.vim'
  54.  
  55. Plug 'christoomey/vim-tmux-navigator'
  56.  
  57. Plug 'raimondi/delimitmate'
  58.  
  59.  
  60. call plug#end()
  61.  
  62.  
  63.  
  64. "NerdTree
  65.  
  66. "open directory symbol
  67. let g:NERDTreeDirArrowCollapsible = '-'
  68. "close dir symbol
  69. let g:NERDTreeDirArrowExpandable = '+'
  70.  
  71. "airline
  72. "let g:airline_section_y = ''
  73. "let g:airline_section_z = ''
  74. let g:airline_theme = 'behelit'
  75.  
  76. "autocomplite
  77. "Note: This option must set it in .vimrc(_vimrc).  NOT IN .gvimrc(_gvimrc)!
  78. " Disable AutoComplPop.
  79. let g:acp_enableAtStartup = 0
  80. " Use neocomplcache.
  81. let g:neocomplcache_enable_at_startup = 1
  82. " Use smartcase.
  83. let g:neocomplcache_enable_smart_case = 1
  84. " Set minimum syntax keyword length.
  85. let g:neocomplcache_min_syntax_length = 3
  86. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  87.  
  88. " Enable heavy features.
  89. " Use camel case completion.
  90. "let g:neocomplcache_enable_camel_case_completion = 1
  91. " Use underbar completion.
  92. "let g:neocomplcache_enable_underbar_completion = 1
  93.  
  94. " Define dictionary.
  95. let g:neocomplcache_dictionary_filetype_lists = {
  96.     \ 'default' : '',
  97.     \ 'vimshell' : $HOME.'/.vimshell_hist',
  98.     \ 'scheme' : $HOME.'/.gosh_completions'
  99.         \ }
  100.  
  101. " Define keyword.
  102. if !exists('g:neocomplcache_keyword_patterns')
  103.     let g:neocomplcache_keyword_patterns = {}
  104. endif
  105. let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
  106.  
  107. " Plugin key-mappings.
  108. inoremap <expr><C-g>     neocomplcache#undo_completion()
  109. inoremap <expr><C-l>     neocomplcache#complete_common_string()
  110.  
  111. " Recommended key-mappings.
  112. " <CR>: close popup and save indent.
  113. inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  114. function! s:my_cr_function()
  115.   return neocomplcache#smart_close_popup() . "\<CR>"
  116.   " For no inserting <CR> key.
  117.   "return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
  118. endfunction
  119.  
  120. " <TAB>: completion.
  121. inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
  122. " <C-h>, <BS>: close popup and delete backword char.
  123. inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
  124. inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
  125. inoremap <expr><C-y>  neocomplcache#close_popup()
  126. inoremap <expr><C-e>  neocomplcache#cancel_popup()
  127. " Close popup by <Space>.
  128. "inoremap <expr><Space> pumvisible() ? neocomplcache#close_popup() : "\<Space>"
  129.  
  130. " For cursor moving in insert mode(Not recommended)
  131. "inoremap <expr><Left>  neocomplcache#close_popup() . "\<Left>"
  132. "inoremap <expr><Right> neocomplcache#close_popup() . "\<Right>"
  133. "inoremap <expr><Up>    neocomplcache#close_popup() . "\<Up>"
  134. "inoremap <expr><Down>  neocomplcache#close_popup() . "\<Down>"
  135. " Or set this.
  136. "let g:neocomplcache_enable_cursor_hold_i = 1
  137. " Or set this.
  138. "let g:neocomplcache_enable_insert_char_pre = 1
  139.  
  140. " AutoComplPop like behavior.
  141. "let g:neocomplcache_enable_auto_select = 1
  142.  
  143. " Shell like behavior(not recommended).
  144. "set completeopt+=longest
  145. "let g:neocomplcache_enable_auto_select = 1
  146. "let g:neocomplcache_disable_auto_complete = 1
  147. "inoremap <expr><TAB>  pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
  148.  
  149. " Enable omni completion.
  150. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  151. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  152. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  153. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  154. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  155.  
  156. " Enable heavy omni completion.
  157. if !exists('g:neocomplcache_force_omni_patterns')
  158.   let g:neocomplcache_force_omni_patterns = {}
  159. endif
  160. let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  161. let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  162. let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  163.  
  164. " For perlomni.vim setting.
  165. " https://github.com/c9s/perlomni.vim
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement