From 0a699a79e4eefe04ea8485e9964444d2677d4112 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Fri, 6 Aug 2021 16:18:14 -0300 Subject: [PATCH] add vimrc --- install.sh | 1 + vimrc | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 vimrc diff --git a/install.sh b/install.sh index 826364a..90d5219 100755 --- a/install.sh +++ b/install.sh @@ -21,6 +21,7 @@ install zshrc install xinitrc install Xmodmap install wallpaper.png +install vimrc installto picom.conf .config/picom installto dunstrc .config/dunst installto config.py .config/qutebrowser diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..0ea0630 --- /dev/null +++ b/vimrc @@ -0,0 +1,102 @@ +syntax on +filetype on +colorscheme torte +set clipboard=unnamedplus +set nu rnu +set smartindent + +noremap - ddp +nnoremap _ ddkP + +let mapleader = " " +let maplocalleader = "," + +nnoremap ev :vsplit $MYVIMRC +nnoremap sv :source $MYVIMRC +nnoremap :%s//gc +nnoremap t :tabnew + +vnoremap " a"``> +nnoremap H 0 +nnoremap L $ + +augroup comments + autocmd! + autocmd FileType javascript nnoremap c 0i// + autocmd FileType c nnoremap c 0i// + autocmd FileType python nnoremap c 0i# + autocmd FileType html nnoremap c 0i +augroup END + +augroup html + autocmd! + autocmd FileType html inoremap > >F<"tyef>"tpa>TT> + autocmd FileType html inoremap = ="" + autocmd FileType html inoremap \= = + autocmd FileType html inoremap \> > + autocmd FileType html iabbrev df> + autocmd FileType html nnoremap f Vatzf + autocmd FileType html vnoremap H "tdh?>"tpvT> + autocmd FileType html vnoremap L "td/<"tPg;vt< +augroup END + +augroup python + autocmd! +" autocmd FileType python set et + autocmd FileType python set ts=4 +augroup END + +" status line +set laststatus=2 +set statusline= +set statusline+=%1* +set statusline+=\ +set statusline+=%{StatuslineMode()} +set statusline+=\ +set statusline+=%2* +set statusline+=%= +set statusline+=%1* +set statusline+=\ +set statusline+=%3l +set statusline+=: +set statusline+=%c +set statusline+=/ +set statusline+=%L +set statusline+=\ +hi User1 ctermbg=27 ctermfg=white +hi User2 ctermbg=234 ctermfg=white + +function! StatuslineMode() + let l:mode=mode() + if l:mode==#"n" + hi User1 ctermbg=27 ctermfg=white + return "NORMAL" + elseif l:mode==?"v" + hi User1 ctermbg=yellow ctermfg=black + return "VISUAL" + elseif l:mode==#"i" + hi User1 ctermbg=darkgreen ctermfg=black + return "INSERT" + elseif l:mode==#"R" + hi User1 ctermbg=darkred ctermfg=white + return "REPLACE" + endif +endfunction + +" TabLine colors +hi clear TabLine +hi clear TabLineFill +hi clear TabLineSel +hi TabLineFill ctermfg=white ctermbg=234 +hi TabLine ctermfg=white ctermbg=237 +hi TabLineSel ctermfg=white ctermbg=27 + +" Disable -- INSERT --, etc +set noshowmode +set noshowcmd + +" Omni completion +filetype plugin on +set omnifunc=syntaxcomplete#Complete +" Ctags +nnoremap :!ctags -R --c++-kinds=+p --fields=+ias --extras=+q .