Advertisement
umangx

Untitled

Sep 30th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. set nocompatible
  2.  
  3. if empty(glob('~/.config/nvim/autoload/plug.vim'))
  4. silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
  5. \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  6. endif
  7.  
  8. call plug#begin('~/.config/nvim/autoload/plugged')
  9. Plug 'jiangmiao/auto-pairs'
  10. Plug 'neoclide/coc.nvim'
  11. Plug 'Yggdroot/indentLine'
  12. Plug 'voldikss/vim-floaterm'
  13. Plug 'tpope/vim-commentary'
  14. Plug '907th/vim-auto-save'
  15. Plug 'overcache/NeoSolarized'
  16. Plug 'sheerun/vim-polyglot'
  17. call plug#end()
  18.  
  19. colo NeoSolarized
  20. set bg=light
  21. set list lcs=tab:\|\
  22. set noshowmode
  23. set number
  24. set cursorline
  25. set termguicolors
  26. set autoread
  27. syntax on
  28. set updatetime=300
  29. set mouse=a
  30. set nowrap
  31. set noswapfile
  32. set hlsearch
  33. set showmatch
  34. set expandtab
  35. set shiftwidth=2
  36. set nobackup
  37. set hidden
  38. set ai
  39. set shortmess+=c
  40. set ruler
  41.  
  42. let g:rainbow_active = 1
  43.  
  44. let g:auto_save = 1
  45. let g:auto_save_events = ["InsertLeave", "TextChanged","CursorHoldI","CursorHold"]
  46.  
  47. autocmd filetype java nnoremap <F5> :w <bar> :FloatermNew --autoclose=0 java % -o %< <CR>
  48. autocmd filetype cpp nnoremap <F5> :w <bar> :FloatermNew --autoclose=0 g++ % && ./a.out %< <CR>
  49.  
  50. inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
  51. nmap <silent> gd <Plug>(coc-definition)
  52. nmap <silent> gy <Plug>(coc-type-definition)
  53. nmap <silent> gi <Plug>(coc-implementation)
  54. nmap <silent> gr <Plug>(coc-references)
  55. autocmd CursorHold * silent call CocActionAsync('highlight')
  56. xmap <leader>f <Plug>(coc-format-selected)
  57. nmap <leader>f <Plug>(coc-format-selected)
  58. if has('nvim')
  59. inoremap <silent><expr> <c-space> coc#refresh()
  60. else
  61. inoremap <silent><expr> <c-@> coc#refresh()
  62. endif
  63. function! CheckBackspace() abort
  64. let col = col('.') - 1
  65. return !col || getline('.')[col - 1] =~# '\s'
  66. endfunction
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement