Bring back some vim customizations
This commit is contained in:
parent
0d1d285887
commit
c8b89f7679
1 changed files with 41 additions and 14 deletions
55
vim/.vimrc
55
vim/.vimrc
|
@ -16,31 +16,43 @@ Plug 'hashivim/vim-terraform'
|
||||||
|
|
||||||
call plug#end()
|
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
|
" SETTINGS
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
|
set autowrite
|
||||||
set backspace=2 " Backspace over indent, eol, start of insert
|
set backspace=2 " Backspace over indent, eol, start of insert
|
||||||
set cpoptions+=$ " delimit end of change text
|
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 nobackup
|
||||||
set noswapfile
|
set noswapfile
|
||||||
set nowrap " Disable wrapping by default
|
set nowrap
|
||||||
set scrolloff=3 " Keep cursor from touching edges
|
set scrolloff=3
|
||||||
set showmode " Show current mode
|
set showmatch
|
||||||
|
set showmode
|
||||||
set timeoutlen=500 " Don't wait too long (ambiguous leaders)
|
set timeoutlen=500 " Don't wait too long (ambiguous leaders)
|
||||||
set virtualedit=all " Cursor can go anywhere
|
set virtualedit=all " Cursor can go anywhere
|
||||||
|
set wildcharm=<tab> " Allow use of tab in macros
|
||||||
set hlsearch " Search highlights
|
set hlsearch
|
||||||
set ignorecase " Ignore case with search
|
set ignorecase
|
||||||
set incsearch " Search as you type
|
set incsearch
|
||||||
set smartcase " Search will not ignore uppercase
|
set smartcase
|
||||||
set wrapscan " Wrapped search
|
set wrapscan
|
||||||
|
|
||||||
set number
|
set number
|
||||||
set relativenumber " Relative line numbers
|
set relativenumber
|
||||||
|
|
||||||
set textwidth=80
|
set textwidth=80
|
||||||
set colorcolumn=80,120 " Ruler at line 80, 120
|
set colorcolumn=80,120
|
||||||
|
|
||||||
" Tabs are 2 spaces
|
" Tabs are 2 spaces
|
||||||
set tabstop=2
|
set tabstop=2
|
||||||
|
@ -49,6 +61,12 @@ set shiftwidth=2
|
||||||
set expandtab
|
set expandtab
|
||||||
set shiftround " make >> go to next tab
|
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
|
" consistency is key - Y should act like C, D
|
||||||
map Y y$
|
map Y y$
|
||||||
|
|
||||||
|
@ -72,6 +90,12 @@ map <Leader>sz :so ~/.vimrc<cr>
|
||||||
map <Leader>cp "+y
|
map <Leader>cp "+y
|
||||||
map <Leader>pa "+p
|
map <Leader>pa "+p
|
||||||
|
|
||||||
|
" tabbing
|
||||||
|
map <Leader>2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab<cr>
|
||||||
|
map <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab<cr>
|
||||||
|
map <Leader>a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab<cr>
|
||||||
|
map <Leader>st :let @/ = "\t"<cr>
|
||||||
|
|
||||||
" clear search
|
" clear search
|
||||||
map <Leader>cs :let @/ = ""<cr>
|
map <Leader>cs :let @/ = ""<cr>
|
||||||
|
|
||||||
|
@ -93,7 +117,7 @@ map <Leader>fw :StripWhitespace<cr>
|
||||||
" vim-eunuch
|
" vim-eunuch
|
||||||
map <Leader>sa :Move %<tab>
|
map <Leader>sa :Move %<tab>
|
||||||
|
|
||||||
" Fugitive
|
" vim-fugitive
|
||||||
autocmd FileType fugitiveblame nmap <buffer> q gq
|
autocmd FileType fugitiveblame nmap <buffer> q gq
|
||||||
command! Gblame :G blame
|
command! Gblame :G blame
|
||||||
map <Leader>gb :Git blame<cr>
|
map <Leader>gb :Git blame<cr>
|
||||||
|
@ -103,7 +127,10 @@ map <Leader>pc :PlugClean<cr>
|
||||||
map <Leader>pi :PlugInstall<cr>
|
map <Leader>pi :PlugInstall<cr>
|
||||||
map <Leader>pu :PlugUpdate<cr>
|
map <Leader>pu :PlugUpdate<cr>
|
||||||
|
|
||||||
" zoomwintab
|
" vim-terraform
|
||||||
|
let g:terraform_align=1
|
||||||
|
|
||||||
|
" zoomwintab.vim
|
||||||
nnoremap <C-w>z :ZoomWinTabToggle<CR>
|
nnoremap <C-w>z :ZoomWinTabToggle<CR>
|
||||||
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR>
|
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR>
|
||||||
function! ZoomState()
|
function! ZoomState()
|
||||||
|
|
Loading…
Reference in a new issue