Advertisement
Marzipan_at

My .vimrc

Aug 8th, 2022 (edited)
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.37 KB | None | 0 0
  1. " download this script "wget -O ~/.vimrc pastebin.com/raw/gNS9qm63"
  2. " some settings
  3. set number
  4. set nocursorline
  5. set nocursorcolumn
  6. set wrap
  7. set noexpandtab
  8. set showmode
  9.  
  10. "set background=light
  11. " syntax higlighting:
  12. syntax on
  13. filetype on
  14. filetype plugin on
  15. filetype indent on
  16.  
  17. " higlighting while search
  18. set incsearch
  19. set showmatch
  20. set hlsearch
  21.  
  22. set history=1000
  23.  
  24. set wildmenu
  25. set wildmode=list:longest
  26. set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
  27.  
  28.  
  29. " You can split a window into sections by typing `:split` or `:vsplit`.
  30. " Display cursorline and cursorcolumn ONLY in active window.
  31. augroup cursor_off
  32.     autocmd!
  33.     autocmd WinLeave * set nocursorline nocursorcolumn
  34.     autocmd WinEnter * set cursorline cursorcolumn
  35. augroup END
  36.  
  37.  
  38. "the plugin is from "curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
  39. call plug#begin('~/.vim/plugged')
  40.  
  41.  
  42. Plug 'neoclide/coc.nvim', {'branch': 'release'}
  43. Plug 'cdelledonne/vim-cmake'
  44.  
  45. call plug#end()
  46.  
  47.  
  48. "Configs for coc
  49. " Use tab for trigger completion with characters ahead and navigate.
  50. " NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
  51. " other plugin before putting this into your config.
  52. inoremap <silent><expr> <TAB>
  53.       \ coc#pum#visible() ? coc#pum#next(1):
  54.       \ CheckBackspace() ? "\<Tab>" :
  55.       \ coc#refresh()
  56. inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
  57.  
  58. " Make <CR> to accept selected completion item or notify coc.nvim to format
  59. " <C-g>u breaks current undo, please make your own choice.
  60. inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
  61.                               \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
  62. " Use <c-space> to trigger completion.
  63. if has('nvim')
  64.   inoremap <silent><expr> <c-space> coc#refresh()
  65. else
  66.   inoremap <silent><expr> <c-@> coc#refresh()
  67. endif
  68.  
  69.  
  70. " Use K to show documentation in preview window.
  71. nnoremap <silent> K :call ShowDocumentation()<CR>
  72.  
  73. function! ShowDocumentation()
  74.   if CocAction('hasProvider', 'hover')
  75.     call CocActionAsync('doHover')
  76.   else
  77.     call feedkeys('K', 'in')
  78.   endif
  79. endfunction
  80.  
  81. " Map function and class text objects
  82. " NOTE: Requires 'textDocument.documentSymbol' support from the language server.
  83. xmap if <Plug>(coc-funcobj-i)
  84. omap if <Plug>(coc-funcobj-i)
  85. xmap af <Plug>(coc-funcobj-a)
  86. omap af <Plug>(coc-funcobj-a)
  87. xmap ic <Plug>(coc-classobj-i)
  88. omap ic <Plug>(coc-classobj-i)
  89. xmap ac <Plug>(coc-classobj-a)
  90. omap ac <Plug>(coc-classobj-a)
  91.  
  92. " Remap <C-f> and <C-b> for scroll float windows/popups.
  93. if has('nvim-0.4.0') || has('patch-8.2.0750')
  94.   nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
  95.   nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
  96.   inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
  97.   inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
  98.   vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
  99.   vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
  100. endif
  101.  
  102.  
  103. "to really foce it
  104. "verbose set noexpandtab
  105.  
  106. set nocursorline
  107. set nocursorcolumn
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement