Created
December 3, 2011 02:02
-
-
Save eggsyntax/1425737 to your computer and use it in GitHub Desktop.
.vimrc
This file contains 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
colorscheme morning | |
if has("gui_macvim") | |
let macvim_hig_shift_movement = 1 | |
endif | |
set nocompatible | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
behave mswin " GUI like windows, except: | |
set selectmode="cmd" | |
set gfn=DejaVu_Sans_Mono:h10:cANSI | |
hi Search guibg=LightGreen | |
" allows ctrl-uparrow & -downarrow to scroll the screen. may need adjustment | |
" on *nix systems. | |
unmap <C-Y> | |
map <C-Down> <C-E> | |
map <C-Up> <C-Y> | |
" disable arrow keys so I can learn better habits | |
"noremap <Up> "" | |
"noremap! <Up> <Esc> | |
"noremap <Down> "" | |
"noremap! <Down> <Esc> | |
"noremap <Left> "" | |
"noremap! <Left> <Esc> | |
"noremap <Right> "" | |
"noremap! <Right> <Esc> | |
" disable arrow keys in insert mode | |
"#inoremap <up> <nop> | |
"#inoremap <down> <nop> | |
"#inoremap <left> <nop> | |
"#inoremap <right> <nop> | |
" initial window size | |
set co=80 | |
set lines=40 | |
" tabs | |
set softtabstop=3 | |
set shiftwidth=3 | |
set expandtab | |
" Hide buffers instead of closing them | |
set hidden | |
" auto folding based on indent | |
set foldmethod=indent | |
set nofen " start with all folds open | |
set autoindent | |
set sw=3 " indentation width | |
set wrap linebreak textwidth=0 | |
set hls " highlight search terms | |
" these two options cause visual word wrap like most text editors. | |
set formatoptions=l | |
set lbr | |
" put all those damn swap files in one place | |
set backupdir=~/temp | |
set ic smartcase " ignore case | |
set incsearch " start searching as you type | |
" aliasii | |
"ab #!pl #!/usr/bin/env perl | |
"ab #!py #!/usr/bin/env python | |
" do some smart things with filetypes | |
filetype on | |
filetype plugin on | |
filetype indent on | |
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 | |
" For gnome-terminal: cursor effects in insert mode | |
if has("autocmd") | |
au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam" | |
au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block" | |
au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam" | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment