Skip to content

Instantly share code, notes, and snippets.

@Reasat
Last active July 6, 2024 05:54
Show Gist options
  • Save Reasat/f537a1b7e5e204a29074b3e3b3d678e0 to your computer and use it in GitHub Desktop.
Save Reasat/f537a1b7e5e204a29074b3e3b3d678e0 to your computer and use it in GitHub Desktop.
vimrc spec file
set number
set backspace=indent,eol,start
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch':'release'}
call plug#end()
"Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment