diff --git a/vimrc b/vimrc index ff30da1..901e27d 100644 --- a/vimrc +++ b/vimrc @@ -1,4 +1,4 @@ -set mouse=a cb=unnamed,unnamedplus wim=longest,list,full nocompatible backspace=indent,eol,start cmdheight=1 bg=dark nu rnu showcmd incsearch listchars=trail:·,tab:\\ ,eol: list cot=menu si sta cpt=".,w,b,i" tf path+=** aw cfu=path +set mouse=a cb=unnamed,unnamedplus wim=longest,list,full nocompatible backspace=indent,eol,start cmdheight=1 bg=dark nu rnu showcmd incsearch listchars=trail:·,tab:\\ ,eol: list cot=menu si sta cpt=".,w,b,i" tf path+=** aw filetype plugin indent on syntax on colorscheme slate @@ -7,15 +7,25 @@ cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! cnoremap i! execute 'silent! write !sudo make install' function! CleverTab() if strpart( getline('.'), col('.')-2, 3) =~ '^\w' - return "\\" + if &completefunc + return "\\" + elseif exists('b:compkey') + return b:compkey + else + return "\\" + endif else return "\" endif endfunction inoremap =CleverTab() -cnoremap cles execute 'silent !lessc % %:r.css' redraw! -cnoremap cltx execute 'silent !rubber -d %' redraw! -cnoremap cdoc execute 'silent !pandoc -t docx % -o %:r.docx' redraw! + +autocmd FileType tex let b:compkey = "\\" +autocmd FileType tex set spell + +autocmd FileType tex command! Comp execute 'silent !rubber -d %' redraw! +autocmd FileType css command! Comp execute 'silent !lessc % %:r.css' redraw! +autocmd FileType tex command! Compdoc execute 'silent !pandoc -t docx % -o %:r.docx' redraw! let g:lsc_server_commands = {'java': 'jdtls','html': 'html-languageserver --stdio','less': 'css-languageserver --stdio','css': 'css-languageserver --stdio', 'cpp': { 'command': 'clangd', 'suppress_stderr': v:true }, 'c': { 'command': 'clangd', 'suppress_stderr': v:true }} let g:lsc_auto_map = v:true