From eafa67f1b8fff51247ff00ec2e3564cc10f5e310 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 16 Aug 2016 00:27:42 -0400 Subject: [PATCH] Statusline changes, updatetime, plugin stuff --- vimrc | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index 26a9fca..314b88e 100644 --- a/vimrc +++ b/vimrc @@ -8,11 +8,11 @@ Plug 'nanotech/jellybeans.vim' " keepers Plug 'airblade/vim-gitgutter' Plug 'atomaka/renamefile.vim' +Plug 'atomaka/ZoomWin' " vim-scripts not up to date Plug 'bronson/vim-trailing-whitespace' Plug 'ctrlpvim/ctrlp.vim' Plug 'rbgrouleff/bclose.vim' Plug 'tpope/vim-surround' -Plug 'vim-scripts/ZoomWin' " languages Plug 'fatih/vim-go' @@ -30,7 +30,7 @@ call plug#end() filetype plugin indent on " STATUS LINE -set statusline=%<\ %f\ %m%r%y%w%=%l\/%-6L\ %3c\ +set statusline=%<\ %{GitState()}%f%{ZoomState()}\ %m%r%y%w%=%l\/%-6L\ %3c\ " OPTIONS set fileformats=unix,mac,dos " File format prefer unix endings @@ -71,6 +71,7 @@ set wildmode=list:longest,full " Better file completion set infercase " Adjust completions to match case set wildignorecase " Ignore case on commandline set autowrite " Save file when focus is lost +set updatetime=250 " Make gitgutter autoupdate " Tabs are 2 spaces set tabstop=2 set softtabstop=2 @@ -132,6 +133,7 @@ map fw :FixWhitespace map pm :set paste! map sa :RenameFile map se :e ~/.vimrc +map sc :pclose map sz :so ~/.vimrc " PLUGIN CONFIGURATION @@ -139,5 +141,30 @@ map sz :so ~/.vimrc colorscheme jellybeans syntax enable +" fugitive +function! GitState() + return system("[[ -n \"$(git status --porcelain " . shellescape(expand("%")) . ")\" ]] && echo -n +") +endfunction + " go let g:go_fmt_command = "goimports" + +" ZoomWin +function! ZWStatline(state) + if a:state + let t:zoomed = 1 + else + let t:zoomed = 0 + endif +endfunction +if !exists("g:ZoomWin_funcref") + let g:ZoomWin_funcref= function("ZWStatline") +endif + +function! ZoomState() + if exists('t:zoomed') && t:zoomed + return 'Z' + else + return '' + endif +endfunction