Skip to content

Commit

Permalink
🌟feature(nvim): coc shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
cutbypham committed Oct 26, 2021
1 parent 84e6d2a commit 36ae1a8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
25 changes: 22 additions & 3 deletions nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,34 @@ let g:coc_global_extensions = [
\ "coc-css",
\ "coc-clangd"]

inoremap <expr> <TAB> pumvisible() ? "\<C-y>" : "\<TAB>"
let g:coc_snippet_next = '<TAB>'
let g:coc_snippet_prev = '<S-TAB>'
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

nmap <silent> [d :call CocAction('diagnosticNext')<cr>
nmap <silent> ]d :call CocAction('diagnosticPrevious')<cr>
noremap <silent> <Leader>; :CocCommand<enter>
imap <C-l> <Plug>(coc-snippets-expand)
vmap <C-j> <Plug>(coc-snippets-select)
let g:coc_snippet_next = '<c-j>'

let g:coc_snippet_prev = '<c-k>'

imap <C-j> <Plug>(coc-snippets-expand-jump)
xmap <leader>x <Plug>(coc-convert-snippet)
Plug 'djoshea/vim-autoread'

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Expand Down
5 changes: 3 additions & 2 deletions nvim/snips/markdown.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ My stories, lessons, and advice are my personal experience, not reflecting opini
endsnippet

snippet talk-show
# Talk show `!v strftime("%b %d, %Y")`:
# Talk show `!v strftime("%b %d, %Y")`: $1

📚 Chapters

- 0:00 Hi
- $2

**Note:**

- $1
- $0

👋 Hi folks
• I'm a random nerd, finding something fun to do every day.
Expand Down

0 comments on commit 36ae1a8

Please sign in to comment.