Use actual commands and even cleverer tab and set some defaults

This commit is contained in:
Alex 2020-05-13 21:44:08 +02:00
parent 13471905c5
commit d3d77ed9de
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 15 additions and 5 deletions

20
vimrc
View File

@ -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' <bar> edit! <CR>
cnoremap i! execute 'silent! write !sudo make install' <CR>
function! CleverTab()
if strpart( getline('.'), col('.')-2, 3) =~ '^\w'
return "\<C-X>\<C-U>"
if &completefunc
return "\<C-X>\<C-U>"
elseif exists('b:compkey')
return b:compkey
else
return "\<C-X>\<C-I>"
endif
else
return "\<Tab>"
endif
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
cnoremap cles execute 'silent !lessc % %:r.css' <bar> redraw! <CR>
cnoremap cltx execute 'silent !rubber -d %' <bar> redraw! <CR>
cnoremap cdoc execute 'silent !pandoc -t docx % -o %:r.docx' <bar> redraw! <CR>
autocmd FileType tex let b:compkey = "\<C-X>\<C-S>"
autocmd FileType tex set spell
autocmd FileType tex command! Comp execute 'silent !rubber -d %' <bar> redraw!
autocmd FileType css command! Comp execute 'silent !lessc % %:r.css' <bar> redraw!
autocmd FileType tex command! Compdoc execute 'silent !pandoc -t docx % -o %:r.docx' <bar> 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