From 37c1cb71ceb15428c897ce19952aed991847b0c5 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 18 Dec 2022 14:44:18 +0100 Subject: vim --- .vim/vimrc | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to '.vim/vimrc') diff --git a/.vim/vimrc b/.vim/vimrc index f5cce4b..abfe046 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -38,8 +38,7 @@ let g:rainbow_active = 1 " ALE config "set omnifunc=ale#completion#OmniFunc -let g:ale_completion_enabled = 1 -let g:ale_completion_autoimport = 1 +"let g:ale_completion_autoimport = 1 let g:ale_set_highlights = 1 "Highlights are annoying let g:ale_set_signs = 1 "let g:ale_virtualtext_cursor = 1 " Only use one of the following @@ -48,7 +47,10 @@ let g:ale_close_preview_on_insert = 1 let g:ale_floating_preview = 1 "let g:ale_hover_to_floating_preview = 1 let g:ale_floating_window_border = [] -let g:ale_linters = {'rust': ['rustc', 'analyzer']} +let g:ale_linters = {'rust': [ 'analyzer']} + +highlight ALEWarning cterm=underline,italic ctermfg=yellow +highlight ALEError cterm=underline,italic ctermfg=red "All things cursor set guicursor+=a:blinkon0 "disable blinking @@ -72,7 +74,7 @@ let mapleader = "-" let leader = "-" let maplocalleader = "-" -syntax on +syntax enable filetype plugin indent on "Line number Highlight @@ -91,9 +93,13 @@ highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE gui "nmap :wincmd h "nmap :wincmd l +" Completion +inoremap Tab_Or_Complete() + nmap :vsplit:e . nmap :e . +" Fold nnoremap @=(foldlevel('.')?'za':"\") vnoremap zf @@ -173,3 +179,15 @@ function Run_in_terminal(prog) execute "terminal " . l:args . " " . a:prog startinsert endfunction + +" if we are in the middle of typing, complete, +" otherwise just type TAB +function! Tab_Or_Complete() abort + if pumvisible() + return "\" + elseif col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^[[:keyword:][:ident:]]' + return "\" + else + return "\" + endif +endfunction -- cgit v1.2.3