vim/vimrc

75 lines
2.3 KiB
VimL

set cb=unnamed,unnamedplus wim=longest,list,full backspace=indent,eol,start cmdheight=1 bg=dark nu rnu cot=menu si sta cpt=.,w,b,i tf foldmethod=syntax path+=** nocompatible sc nosmd listchars=trail,eol:,tab:\ list directory=$HOME/.vim/swap// shm=asTIt fo=rn hls lbr is lz
filetype plugin indent on
syntax on
colorscheme delek
let g:ale_completion_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_hover_to_preview = 1
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'go': ['gofmt'],
\}
let g:ale_sign_error = 'E>'
let g:ale_sign_warning = 'W>'
let g:ale_sign_info = 'I>'
let g:ale_floating_window_border = ''
let g:ale_floating_preview = 1
let g:ale_detail_to_floating_preview = 1
let g:ale_hover_to_preview = 1
let g:ale_hover_to_floating_preview = 1
highlight SignColumn ctermbg=none
let g:airline#extensions#ale#enabled = 1
function BufferSettings()
let lsp_found=0
for linter in ale#linter#Get(&filetype)
if !empty(linter.lsp) && ale#lsp_linter#CheckWithLSP(bufnr(''), linter)
let lsp_found=1
endif
endfor
if (lsp_found)
nnoremap <buffer> K :ALEDocumentation<cr>
nnoremap <buffer> gr :ALEFindReferences<cr>
nnoremap <buffer> gd :ALEGoToDefinition<cr>
nnoremap <buffer> gy :ALEGoToTypeDefinition<cr>
nnoremap <buffer> gh :ALEHover<cr>
setlocal omnifunc=ale#completion#OmniFunc
endif
endfunction
autocmd BufRead,FileType * call BufferSettings()
let g:netrw_banner = 0
let g:netrw_liststile = 3
let g:airline_powerline_fonts = v:true
let g:airline#extensions#tabline#enabled = v:true
let g:airline_skip_empty_sections = v:true
let g:airline_theme='term'
cnoremap w!! execute 'silent! write !doas tee % >/dev/null' <bar> edit! <CR>
cnoremap i! execute 'silent! write !doas make install' <CR>
function! CleverTab()
if &omnifunc != ''
return "\<C-X>\<C-O>"
elseif &spell
return "\<C-X>\<C-S>"
else
return "\<C-X>\<C-P>"
endif
endfunction
inoremap <silent><tab> <c-r>=CleverTab()<cr>
inoremap <silent><s-tab> <Tab>
autocmd FileType yaml setlocal sw=8 sts=8 expandtab
autocmd FileType tex command! Comp execute 'silent !pdflatex %' <bar> redraw!
autocmd FileType less command! Comp execute 'silent !lessc % %:r.css' <bar> redraw!
autocmd FileType tex command! Compdoc execute 'silent !pandoc -t docx % -o %:r.docx' <bar> redraw!
packloadall
silent! helptags ALL