Created
April 24, 2012 15:13
-
-
Save zachbrowne/2480479 to your computer and use it in GitHub Desktop.
VIM on Windows vimrc Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
behave mswin | |
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 | |
"my settings | |
set showcmd | |
set showmatch | |
set ignorecase | |
set incsearch | |
set autowrite | |
set cindent | |
set autoindent | |
set shiftwidth=4 | |
set tabstop=4 | |
set softtabstop=4 | |
set backspace=2 | |
set laststatus=2 | |
set ignorecase | |
set ruler | |
set nohlsearch | |
set smarttab | |
set vb | |
syntax on | |
set fdm=marker | |
set nofen | |
colo desert | |
map <silent> <F2> :if &background == "light"<CR>set background=dark<CR>else<CR>set | |
background=light<CR>endif<CR> | |
noremap <F3> :res<CR> | |
noremap <F4> <C-W>= | |
map <F5> :set invhlsearch<CR> | |
map <F7> g<C-]> | |
map <F8> <C-T> | |
map <F10> :set invnu<CR> | |
map <C-J> <C-W>jmap <C-K> <C-W>k | |
" last-position-jump | |
" :au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal | |
" g'\"" | endif | |
" " windows settings: (font/size/position) | |
" " default system | |
" " set guifont=Lucida_Console:h11 | |
" " system with Consolas font, download it from M$: | |
" " http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en | |
" set guifont=Consolas:h12 | |
" winsize 100 50 | |
" winpos 120 60 | |
" set nobackup | |
" set nowritebackup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment