Advertisement
Marzipan_at

My .vimrc

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