Skip to content

Instantly share code, notes, and snippets.

Created January 26, 2013 22:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
set encoding=utf-8
set nocompatible
syntax on
set mouse=a
set selectmode=mouse
set et
set sw=4
set smarttab
set tabstop=4
set expandtab
set shiftwidth=4
set hls
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
set background=dark
"set background=light
colorscheme ir_black
"colorscheme solarized
set cursorline
set incsearch
set hlsearch " highlight search terms
set linespace=0
"Line numbers
set number
highlight lineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=DarkCyan gui=NONE guibg=NONE
set numberwidth=4
"Status stuff
set laststatus=2
set ruler
set title
"Status displays
set showmode
set showcmd
set showmatch
match ErrorMsg '\%>80v.\+'
set smartindent
set autoindent
filetype indent on
au FileType python source ~/.vim/syntax/python.vim
au FileType css source ~/.vim/syntax/css.vim
au FileType javascript source ~/.vim/syntax/javascript.vim
"set foldmethod=indent
"set foldcolumn=2
" Space will toggle folds
nnoremap <space> za
" Set page up pagedown for k /j
nnoremap <C-j> <PageDown>
nnoremap <C-k> <PageUp>
"nnoremap <F6> .!pbcopy<CR><CR>
nmap <F6> :.w !pbcopy<CR><CR>
"Dictionary lists
"set dictionary+=/usr/share/dict/words
"if version >= 700
" set spl=en spell
" set nospell
""Paste Toggle
"let paste_mode = 0 " 0 = normal, 1 = paste
"func! Paste_on_off()
" if g:paste_mode == 0
" set paste
" let g:paste_mode = 1
" else
" set nopaste
" let g:paste_mode = 0
" endif
" return
" Paste Mode! Dang!
"nnoremap <silent> <F5> :call Paste_on_off()<CR>
"set pastetoggle=<F5>
"Tag list
"Map F4 to open tag list
map <F4> :TlistToggle<cr>
""Taglist configuration
let Tlist_Ctags_Cmd = "/usr/bin/ctags"
let Tlist_WinWidth = 50
let Tlist_Use_Right_Window = 0
let Tlist_Enable_Fold_Column = 0
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_SingleClick = 1
let Tlist_Inc_Winwidth = 0
"Builds tags libs for the current working directory
nmap <F8> :TagbarToggle<CR>
"Conque Term
"Map F2 to open tag list
map <F2> :ConqueTermVSplit bash<cr>
"File tree
"Map F3 to open tag list
map <F3> :NERDTree<cr>
"Tab completion (for filenames and whatnot)
set wildmenu
set wildmode=list:longest,full
"Remove _ from keyword list
set iskeyword-=_
"Save Backups to a Different Location
" (These directories must be manually created)
set backup
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
"set directory=.,$TEMP
behave xterm
filetype plugin on
filetype plugin indent on
let g:tex_flavor='latex'
set clipboard=unnamed
call pathogen#infect()
"Auto commands
"autocmd BufRead,BufNewFile *.py syntax on
autocmd BufRead,BufNewFile *.py set ai
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
"Remember last position in file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
"Coffee script stuff
"Set spaces
au BufNewFile,BufReadPost *.coffee setl shiftwidth=4 expandtab
"Fold by indentation
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
au BufNewFile,BufRead *.less let &filetype='css'
au BufNewFile,BufRead *.server let &filetype='javascript'
au BufWritePost *.coffee silent CoffeeMake! -b | cwindow 5 | redraw!
au BufRead,BufNewFile *.handlebars,*.hbs set ft=handlebars
"Javascript stuff
" Fold markers
au FileType javascript setlocal foldmethod=marker
au FileType javascript setlocal foldmarker={,}
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
"Auto completion stuff
"set ofu=syntaxcomplete#Complete
":highlight Pmenu guibg=brown gui=bold
"au FileType * exe('setl dict+='.$VIMRUNTIME.'/syntax/'.&filetype.'.vim')
"" neocomplcache {
"let g:neocomplcache_enable_at_startup = 1
"let g:neocomplcache_enable_at_startup = 0
"let g:neocomplcache_enable_camel_case_completion = 1
"let g:neocomplcache_enable_smart_case = 1
"let g:neocomplcache_enable_underbar_completion = 1
"let g:neocomplcache_min_syntax_length = 3
"let g:neocomplcache_enable_auto_delimiter = 1
"let g:neocomplcache_max_list = 15
"let g:neocomplcache_auto_completion_start_length = 3
"let g:neocomplcache_force_overwrite_completefunc = 1
"let g:neocomplcache_snippets_dir='~/.vim/bundle/snipmate-snippets/snippets'
"" AutoComplPop like behavior.
"let g:neocomplcache_enable_auto_select = 0
"" SuperTab like snippets behavior.
"imap <silent><expr><tab> neocomplcache#sources#snippets_complete#expandable() ? "\<plug>(neocomplcache_snippets_expand)" : (pumvisible() ? "\<c-e>" : "\<tab>")
"smap <tab> <right><plug>(neocomplcache_snippets_jump)
"" Plugin key-mappings.
"" Ctrl-k expands snippet & moves to next position
"" <CR> chooses highlighted value
"imap <C-k> <Plug>(neocomplcache_snippets_expand)
"smap <C-k> <Plug>(neocomplcache_snippets_expand)
"inoremap <expr><C-g> neocomplcache#undo_completion()
"inoremap <expr><C-l> neocomplcache#complete_common_string()
"inoremap <expr><CR> neocomplcache#complete_common_string()
"" <CR>: close popup
"" <s-CR>: close popup and save indent.
"inoremap <expr><s-CR> pumvisible() ? neocomplcache#close_popup()"\<CR>" : "\<CR>"
"inoremap <expr><CR> pumvisible() ? neocomplcache#close_popup() : "\<CR>"
"" <TAB>: completion.
"inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
"inoremap <expr><s-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
"" <C-h>, <BS>: close popup and delete backword char.
"inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
"inoremap <expr><C-y> neocomplcache#close_popup()
"" Define keyword.
"if !exists('g:neocomplcache_keyword_patterns')
"let g:neocomplcache_keyword_patterns = {}
"let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
"" Enable omni completion.
"autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
"autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
"autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
"autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
"autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
"autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
"" Enable heavy omni completion.
"if !exists('g:neocomplcache_omni_patterns')
"let g:neocomplcache_omni_patterns = {}
"let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
"let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*'
"let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::'
"" For snippet_complete marker.
"if has('conceal')
"set conceallevel=2 concealcursor=i
"" }
"highlight Pmenu ctermbg=8 guibg=#606060
"highlight PmenuSel ctermbg=4 guifg=#dddd00 guibg=#1f82cd
"highlight PmenuSbar ctermbg=0 guibg=#d6d6d6
"set virtualedit=onemore " allow for cursor beyond last character
set history=400 " Store a ton of history (default is 20)
"set spell " spell checking on
"Command and status line
set ruler " show the ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
set showcmd " show partial commands in status line and
" selected characters/lines in visual mode
set laststatus=2
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=%{fugitive#statusline()} " Git Hotness
set statusline+=\ [%{&ff}/%Y] " filetype
set statusline+=\ [%{getcwd()}] " current dir
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
"The default leader is '\', but many people prefer ',' as it's in a standard
"location. To override this behavior and set it back to '\' (or any other
"character) add let g:spf13_leader='\' in your .vimrc.bundles.local file
let mapleader = ','
"clearing highlighted search
nmap <silent> <leader>/ :nohlsearch<CR>
""" Code folding options
nmap <leader>f0 :set foldlevel=0<CR>
nmap <leader>f1 :set foldlevel=1<CR>
nmap <leader>f2 :set foldlevel=2<CR>
nmap <leader>f3 :set foldlevel=3<CR>
nmap <leader>f4 :set foldlevel=4<CR>
nmap <leader>f5 :set foldlevel=5<CR>
nmap <leader>f6 :set foldlevel=6<CR>
nmap <leader>f7 :set foldlevel=7<CR>
nmap <leader>f8 :set foldlevel=8<CR>
nmap <leader>f9 :set foldlevel=9<CR>
" Buffer explorer {
nmap <leader>b :BufExplorer<CR>
" }
set listchars=tab:,.,trail:.,extends:#,nbsp:. " Highlight problematic whitespace
" Fugitive {
nnoremap <silent> <leader>gs :Gstatus<CR>
nnoremap <silent> <leader>gd :Gdiff<CR>
nnoremap <silent> <leader>gc :Gcommit<CR>
nnoremap <silent> <leader>gb :Gblame<CR>
nnoremap <silent> <leader>gl :Glog<CR>
nnoremap <silent> <leader>gp :Git push<CR>
" TagBar {
nnoremap <silent> <leader>tt :TagbarToggle<CR>
"Coffee tags
if executable('coffeetags')
let g:tagbar_type_coffee = {
\ 'ctagsbin' : 'coffeetags',
\ 'ctagsargs' : '',
\ 'kinds' : [
\ 'f:functions',
\ 'o:object',
\ ],
\ 'sro' : ".",
\ 'kind2scope' : {
\ 'f' : 'object',
\ 'o' : 'object',
\ }
\ }
"Indent Guides
" indent_guides {
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#212121 ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#404040 ctermbg=4
set ts=4 sw=4 et
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:indent_guides_enable_on_vim_startup = 1
" }
"POWERLINE settings
let g:Powerline_symbols = 'fancy'
map <leader>l :ListMethods
map <leader>d :exec("CocoaDoc ".expand("<cword>"))<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment