diff --git a/vimrc b/vimrc index c70c4ca..f71aac4 100644 --- a/vimrc +++ b/vimrc @@ -62,6 +62,11 @@ call plug#begin() Plug 'lervag/vimtex' Plug 'Valloric/YouCompleteMe' Plug 'preservim/nerdtree' + "Plug 'liuchengxu/vim-which-key' + Plug 'godlygeek/tabular' + Plug 'preservim/vim-markdown' + Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} + Plug 'https://github.com/godlygeek/tabular' call plug#end() " Theme configuration @@ -99,3 +104,23 @@ nnoremap :NERDTree nnoremap :NERDTreeToggle nnoremap :NERDTreeFind let g:NERDTreeQuitOnOpen = 1 +" Whichkey +set timeoutlen=500 +"let g:mapleader = "\" +"let g:maplocalleader = ',' +"nnoremap :WhichKey '' +"nnoremap :WhichKey ',' + +" Tabularize +inoremap :call align()a + +function! s:align() + let p = '^\s*|\s.*\s|\s*$' + if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) + let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) + let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) + Tabularize/|/l1 + normal! 0 + call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) + endif +endfunction