Skip to content

Instantly share code, notes, and snippets.

@dualvtable
Last active January 5, 2018 05:37
Show Gist options
  • Save dualvtable/d799d631e5fa654d867723171e1c2c81 to your computer and use it in GitHub Desktop.
Save dualvtable/d799d631e5fa654d867723171e1c2c81 to your computer and use it in GitHub Desktop.
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
set incsearch ic hlsearch
set backspace=eol,indent,start
set hidden
set tabstop=4 expandtab shiftwidth=4 smarttab
set textwidth=75
set autowrite
set wildmenu wildmode=longest,list,list:full
set showmatch
set nobackup nowritebackup
set autoindent
if has('autocmd')
autocmd GUIEnter * set noerrorbells vb t_vb=
endif
set history=50
set showcmd
set ruler
function GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
if label != ''
let label .= ' '
endif
" Append the buffer name (not full path)
return label . "%t"
endfunction
if has('gui_running')
set guifont=consolas:h10:cANSI
set lines=40 columns=110
set guitablabel=%!GuiTabLabel()
set gcr+=a:blinkon0
behave mswin
source $VIMRUNTIME/mswin.vim
set laststatus=2
set background=dark
"if using solarized then uncomment the two lines below
"let g:solarized_contrast="high"
"colorscheme solarized
set directory=.,$TEMP
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
endif
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment