From def2b251062d27b3fa0352f5ea9095174c60fb74 Mon Sep 17 00:00:00 2001 From: 0scar Date: Mon, 7 Mar 2022 16:09:31 +0100 Subject: Update vimrc * Fix shift-tab when cycling command-mode options * Fix cursor stuff that didn't change properly between block and bar * Fix weird output when opening vim --- .config/vim/vimrc | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to '.config') diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 9652a37..20bf9f3 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -1,12 +1,18 @@ runtime! archlinux.vim +set nocompatible scriptencoding utf-8 -set directory=$XDG_CACHE_HOME/vim,~/,/tmp -set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp -set viminfo+=n$XDG_CACHE_HOME/vim/viminfo +set directory=$XDG_CACHE_HOME/vim,/tmp +set backupdir=$XDG_CACHE_HOME/vim,/tmp +set viminfo=%,<800,'10,/50,:100,h,f0,n$XDG_CACHE_HOME/vim/.viminfo let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME,$VIM/vimfiles,$VIM/vimfiles/after +" Check if the backup/swap dir exists +if !isdirectory($XDG_CACHE_HOME) + !mkdir $XDG_CACHE_HOME +endif + " behaviour set history=200 set wildmenu @@ -14,12 +20,15 @@ set ruler set cursorline set showmatch set hlsearch -set nocompatible set backspace=2 set incsearch set formatoptions+=tcroqn2bmj set number set nowrap +set splitright + +" Fix shift-tab +exe 'set t_kB=' . nr2char(27) . '[Z' " Enable mouse support set mouse=a @@ -48,7 +57,11 @@ syntax enable set background=dark set colorcolumn=81 -" Colorscheme overrides, for transparency and other stuff + +"let &t_8f = "\[38:2:%lu:%lu:%lum" +"let &t_8b = "\[48:2:%lu:%lu:%lum" + +" Colorscheme overrides, for transparency let g:moonflyTransparent = 1 let g:moonflyCursorColor = 1 let g:moonflyTerminalColors = 1 @@ -88,6 +101,10 @@ set fileformats=unix set grepprg=grep\ -nH\ $* +"set statusline+=%#warningmsg# +"set statusline+=%{SyntasticStatuslineFlag()} +"set statusline+=%* + let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 @@ -139,6 +156,8 @@ set makeprg=GCC_COLORS=\ make vnoremap // y/\V" vnoremap (( `>a)` +vnoremap [[ `>a]` +vnoremap {{ `>a}` match ErrorMsg '\%>80v.\+' match ErrorMsg '\( \| \)\+$' @@ -182,8 +201,8 @@ autocmd VimSuspend * call system("xsel -ib", getreg()) " 5 -> blinking vertical bar " 6 -> solid vertical bar " 7 -> snowman -au VimEnter * silent execute "!echo -ne '\e[2 q'" -"au VimLeave * silent execute "!echo -e '\e[6 q' +au VimEnter * silent execute "!echo -e '\e[2 q'" +au VimLeave * silent execute "!echo -e '\e[6 q'" au InsertEnter * silent execute "!echo -ne '\e[6 q'" au InsertLeave * silent execute "!echo -ne '\e[2 q'" -- cgit v1.3