mirror of
https://git.davidovski.xyz/dot.git
synced 2024-08-15 00:43:28 +00:00
125 lines
2.9 KiB
VimL
125 lines
2.9 KiB
VimL
set viminfo+=n~/.config/vim/viminfo
|
|
set runtimepath+=~/.config/vim,~/.config/vim/after
|
|
set autoindent
|
|
set wrap
|
|
set linebreak
|
|
set mouse=a
|
|
set autowrite
|
|
|
|
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
|
|
|
|
set nocompatible
|
|
|
|
set spelllang=en_gb
|
|
|
|
set number relativenumber
|
|
|
|
syntax on
|
|
|
|
nnoremap <silent> <C-l> :nohl<CR><C-l>
|
|
|
|
inoremap { {}<ESC>ha
|
|
inoremap [ []<ESC>ha
|
|
inoremap " ""<ESC>ha
|
|
inoremap ( ()<ESC>ha
|
|
|
|
inoremap <C-space> <C-n>
|
|
|
|
|
|
nnoremap <C-J> <C-W><C-J>
|
|
nnoremap <C-K> <C-W><C-K>
|
|
nnoremap <C-L> <C-W><C-L>
|
|
nnoremap <C-H> <C-W><C-H>
|
|
|
|
nnoremap <F9> :w<Enter>:!chmod<Space>+x<Space>"%:p"<Enter>:!"%:p"<Enter>
|
|
|
|
set foldmethod=syntax
|
|
set foldlevel=99
|
|
set conceallevel=2
|
|
|
|
call plug#begin()
|
|
|
|
Plug 'preservim/nerdtree'
|
|
nnoremap <F5> :NERDTree<CR>
|
|
|
|
Plug 'preservim/vim-markdown'
|
|
"let g:vim_markdown_math = 1
|
|
"let g:vim_markdown_frontmatter = 1
|
|
"let g:vim_markdown_toml_frontmatter = 1
|
|
"let g:vim_markdown_json_frontmatter = 1
|
|
|
|
|
|
Plug 'neoclide/coc.nvim'
|
|
hi CocInlayHint ctermbg=Black ctermfg=Gray
|
|
|
|
set updatetime=300
|
|
set signcolumn=yes
|
|
|
|
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
|
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
|
|
|
nmap <silent> gd <Plug>(coc-definition)
|
|
nmap <silent> gy <Plug>(coc-type-definition)
|
|
nmap <silent> gi <Plug>(coc-implementation)
|
|
nmap <silent> gr <Plug>(coc-references)
|
|
|
|
xmap <leader>f <Plug>(coc-format-selected)
|
|
nmap <leader>f <Plug>(coc-format-selected)
|
|
|
|
nmap <leader>rn <Plug>(coc-rename)
|
|
nmap <silent> <leader>re <Plug>(coc-codeaction-refactor)
|
|
xmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
|
|
" nmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
|
\ CheckBackspace() ? "\<Tab>" :
|
|
\ coc#refresh()
|
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
|
|
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
|
|
function! CheckBackspace() abort
|
|
let col = col('.') - 1
|
|
return !col || getline('.')[col - 1] =~# '\s'
|
|
endfunction
|
|
|
|
|
|
if has('nvim')
|
|
inoremap <silent><expr> <c-space> coc#refresh()
|
|
else
|
|
inoremap <silent><expr> <c-@> coc#refresh()
|
|
endif
|
|
|
|
xmap <leader>a <Plug>(coc-codeaction-selected)
|
|
nmap <leader>a <Plug>(coc-codeaction-selected)
|
|
|
|
" autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
|
|
function! ShowDocumentation()
|
|
if CocAction('hasProvider', 'hover')
|
|
call CocActionAsync('doHover')
|
|
else
|
|
call feedkeys('K', 'in')
|
|
endif
|
|
endfunction
|
|
|
|
autocmd FileType python let b:coc_root_patterns = ['.git', '.env', '.']
|
|
|
|
Plug 'junegunn/fzf.vim'
|
|
|
|
nnoremap <F6> :Files<CR>
|
|
nnoremap <F7> :Rg<CR>
|
|
|
|
|
|
Plug 'heavenshell/vim-pydocstring', { 'do': 'make install', 'for': 'python' }
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
call plug#end()
|
|
|
|
highlight Pmenu ctermbg=black guibg=black ctermfg=white
|
|
|
|
hi TrailingWhitespace ctermbg=red guibg=red
|
|
call matchadd("TrailingWhitespace", '\v\s+$')
|