Please bear with us as we work to restore functionality to dotfiles.org.
"
" General
"
set nocompatible
"
" Searching
"
set incsearch
set ignorecase
set smartcase
set nohlsearch
"
" Editing
"
set scrolloff=2
set ts=4
filetype plugin indent on
set number
set backupdir=~/.vim/backups
set backup writebackup
syntax enable
"
" Tab navigation
"
map th :tabnext
map tl :tabprev
map tn :tabnew
map td :tabclose
"
" Path Navigation
"
let g:netrw_keepdir=0
let g:netrw_browse_split=3
"
" Plugins
"
filetype plugin on
" helpful mappings for using twitter.vim
" see http://vim.sourceforge.net/scripts/script.php?script_id=1853
let g:twitterusername='ardekantur'
let g:twitterpassword=''
map tp :let g:twitterpassword=inputsecret('Twitter password? ')
map tw :execute 'TwitterStatusUpdate ' . inputdialog('Enter a Twitter status message:')
map tf :TwitterFriendsTimeline
"
" NERDTree
"
map :NERDTreeToggle
"
" Miscellaneous
"
colorscheme Desert-256
"
" Add whitespace
"
map ok
"
" Buffer Exploration Shortcuts
"
map :bn
map :bp
"
" Ruby Indentation Defaults
"
function RubyEndToken ()
let current_line = getline( '.' )
let braces_at_end = '{\s*\(|\(,\|\s\|\w\)*|\s*\)\?$'
let stuff_without_do = '^\s*\(class\|if\|unless\|begin\|case\|for\|module\|while\|until\|def\)'
let with_do = 'do\s*\(|\(,\|\s\|\w\)*|\s*\)\?$'
if match(current_line, braces_at_end) >= 0
return "\}\O"
elseif match(current_line, stuff_without_do) >= 0
return "\end\O"
elseif match(current_line, with_do) >= 0
return "\end\O"
else
return "\"
endif
endfunction
"
function UseRubyIndent ()
setlocal tabstop=8
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal expandtab
imap =RubyEndToken()
endfunction
autocmd FileType ruby,eruby call UseRubyIndent()