From c8b89f7679e22f57adf6dd9903221e6cbd326ad7 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 12 Jan 2022 08:37:48 -0500 Subject: [PATCH] Bring back some vim customizations --- vim/.vimrc | 55 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index f6551cf..754649a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -16,31 +16,43 @@ Plug 'hashivim/vim-terraform' call plug#end() +" STATUS LINE +set statusline= +set statusline+=%<\ %f%{ZoomState()} +set statusline+=\ %m%r%y%w%= +set statusline+=\ Line:\ %l\/%L\ [%p%%] +set statusline+=\ Col:\ %v +set statusline+=\ Buf:\ #%n +set statusline+=\ " trailing space + " SETTINGS filetype plugin indent on +set autowrite set backspace=2 " Backspace over indent, eol, start of insert set cpoptions+=$ " delimit end of change text -set endofline " Add newline to end of file +set endofline +set laststatus=2 " always show status line set nobackup set noswapfile -set nowrap " Disable wrapping by default -set scrolloff=3 " Keep cursor from touching edges -set showmode " Show current mode +set nowrap +set scrolloff=3 +set showmatch +set showmode set timeoutlen=500 " Don't wait too long (ambiguous leaders) set virtualedit=all " Cursor can go anywhere - -set hlsearch " Search highlights -set ignorecase " Ignore case with search -set incsearch " Search as you type -set smartcase " Search will not ignore uppercase -set wrapscan " Wrapped search +set wildcharm= " Allow use of tab in macros +set hlsearch +set ignorecase +set incsearch +set smartcase +set wrapscan set number -set relativenumber " Relative line numbers +set relativenumber set textwidth=80 -set colorcolumn=80,120 " Ruler at line 80, 120 +set colorcolumn=80,120 " Tabs are 2 spaces set tabstop=2 @@ -49,6 +61,12 @@ set shiftwidth=2 set expandtab set shiftround " make >> go to next tab +if has('persistent_undo') + set undolevels=5000 + set undodir=$HOME/.vim/undo + set undofile +endif + " consistency is key - Y should act like C, D map Y y$ @@ -72,6 +90,12 @@ map sz :so ~/.vimrc map cp "+y map pa "+p +" tabbing +map 2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab +map 4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab +map a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab +map st :let @/ = "\t" + " clear search map cs :let @/ = "" @@ -93,7 +117,7 @@ map fw :StripWhitespace " vim-eunuch map sa :Move % -" Fugitive +" vim-fugitive autocmd FileType fugitiveblame nmap q gq command! Gblame :G blame map gb :Git blame @@ -103,7 +127,10 @@ map pc :PlugClean map pi :PlugInstall map pu :PlugUpdate -" zoomwintab +" vim-terraform +let g:terraform_align=1 + +" zoomwintab.vim nnoremap z :ZoomWinTabToggle nnoremap :ZoomWinTabToggle function! ZoomState()