From 5369c3370ddc54de57e864b20e2d07a8f8608756 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 5 May 2021 23:08:10 +0300 Subject: feat(vim): install coc.nvim and calendar.vim --- .config/nvim/vim-plug/plugins.vim | 2 ++ .vimrc | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.config/nvim/vim-plug/plugins.vim b/.config/nvim/vim-plug/plugins.vim index aa2d4c9..8977674 100644 --- a/.config/nvim/vim-plug/plugins.vim +++ b/.config/nvim/vim-plug/plugins.vim @@ -1,6 +1,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'mhinz/vim-startify', {'branch': 'center'} Plug 'vimwiki/vimwiki' + Plug 'mattn/calendar-vim' " Dark-powered file explorer Plug 'shougo/defx.nvim', Plug 'kristijanhusak/defx-icons' @@ -13,6 +14,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') " Editorconfig Plug 'editorconfig/editorconfig-vim' " Languages + Plug 'neoclide/coc.nvim', {'branch': 'release'} "LSP Plug 'pangloss/vim-javascript' Plug 'leafgarland/typescript-vim' "typescript syntax Plug 'peitalin/vim-jsx-typescript' "react jsx typescript syntax diff --git a/.vimrc b/.vimrc index 8f62762..40282cf 100644 --- a/.vimrc +++ b/.vimrc @@ -127,7 +127,7 @@ set tags+=.git/tags " enable typescipt highlighting augroup SyntaxSettings autocmd! - autocmd BufNewFile,BufRead *.tsx set filetype=typescript + autocmd BufNewFile,BufRead *.tsx set filetype=typescriptreact augroup END " easier indentation @@ -138,7 +138,14 @@ vnoremap > >gv autocmd BufWritePre * %s/\s\+$//e " Vimwiki -let g:vimwiki_list = [{'path': '~/Documents/wiki/', 'syntax': 'markdown', 'ext': '.md'}] +let g:vimwiki_list = [ + \ {'path': '~/Sync/', 'syntax': 'markdown', 'ext': '.md', 'auto_generate_links': 1}, + \ {'path': '~/Documents/wiki/', 'syntax': 'markdown', 'ext': '.md'}, +\] + +let g:vimwiki_markdown_link_ext = 1 +let g:calendar_options = 'nornu' + nnoremap c :let &cole=(&cole == 2) ? 0 : 2 echo 'conceallevel ' . &cole function! VimwikiLinkHandler(link) @@ -158,4 +165,17 @@ function! VimwikiLinkHandler(link) endif endfunction +" Coc.nvim +nmap gd (coc-definition) +inoremap pumvisible() ? "\" : "\u\" +nnoremap t :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction + " TODO: command to toggle comments https://www.chrisatmachine.com/Neovim/09-vim-commentary/ -- cgit v1.2.3