Skip to content

Instantly share code, notes, and snippets.

@jaxbot
Created August 4, 2013 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaxbot/6148496 to your computer and use it in GitHub Desktop.
Save jaxbot/6148496 to your computer and use it in GitHub Desktop.
My vimrc, pre-cleanup 8/3/13
" Must be the first line, apparently
set nocompatible
set encoding=utf-8
" Look
set background=dark
colorscheme twilight
set guifont=Source\ Code\ Pro
set number
set guioptions-=T " no toolbar
set guioptions-=m " no menu
set backspace=2
let mapleader = ","
" Disable chimes/flashes
set visualbell
set t_vb =
set visualbell t_vb=
au GuiEnter * set visualbell t_vb=
" sick of those swp files
set backupdir=~/vimfiles/tmp,.
set directory=~/vimfiles/tmp,.
set nobackup " DIE FOUL BEAST
set noswapfile
" lets start in my www folder
cd ~/packpack/www
syntax on
filetype plugin on
filetype plugin indent on
set clipboard=unnamed
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
set virtualedit=onemore " Allow for cursor beyond last character
set history=1000 " Store a ton of history (default is 20)
set spell " Spell checking on
set hidden " Allow buffer switching without saving
set cursorline " Highlight current line
" Statusline
set laststatus=2
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
set showmatch " Show matching brackets/parenthesis
set matchtime=0
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line high
set ignorecase " Case insensitive search
set smartcase " Case sensitive when uc present
" CTRL-S
nnoremap <silent> <C-S> :<C-u>Update<CR>
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-L> <C-W>l<C-W>_
map <C-H> <C-W>h<C-W>_
" Wrapped lines goes down/up to next row, rather than next line in file.
nnoremap j gj
nnoremap k gk
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
set autoindent
set noexpandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set cinkeys=0{,0},:,0#,!^F
" Folding
set foldmethod=syntax
set foldnestmax=10
set nofoldenable
set foldlevel=1
let g:DisableAutoPHPFolding = 1
" Pathogen
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"Auto maximize
if has("gui_running")
" GUI is running or is about to start.
" Maximize gvim window.
set lines=100 columns=130
winpos 0 0
endif
" Plugins
set undolevels=400 " Vim setting
let g:neocomplete#enable_at_startup = 1
" Neocompl
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_min_syntax_length = 3
"let g:neocomplcache_enable_auto_select = 1
inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=nodejscomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
au FileType php set omnifunc=phpcomplete#CompletePHP
" Some convenient mappings
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
inoremap <expr> <CR> pumvisible() ? "\<C-y><C-x><C-o>" : "\<CR>"
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
" Automatically open and close the popup menu / preview window
au InsertLeave * if pumvisible() == 0|silent! pclose|endif
inoremap <C-c> <ESC>
set completeopt=menu,longest
set completeopt-=preview
" Node.js complete
let g:nodejs_complete_config = {
\ 'js_compl_fn': 'jscomplete#CompleteJS',
\ 'max_node_compl_len': 0
\}
let g:jscomplete_use = ['dom']
" PHP Generated Code Highlights (HTML & SQL)
let php_sql_query=1
let php_htmlInStrings=1
" NERDTree
let g:NERDShutUp=1
hi CursorLineNr term=bold ctermfg=Gray gui=bold guifg=#c5c5c5
let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc"
" Nodejs dictionary
au FileType javascript set dictionary+=$HOME/vimfiles/bundle/vim-node/dict/node.dict
" Brolink
au BufWritePost */static/templates/*.html :BLReloadTemplate
" Ag.vim, the silver searcher
map <C-\> :execute "Ag " . expand("<cword>") <CR>
" Shortcuts
nnoremap <leader>gs :Gstatus<CR>
" Unite
let g:unite_source_history_yank_enable = 1
call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <leader>f :Unite -no-split -buffer-name=files -start-insert file<cr>
nnoremap <leader>r :Unite -no-split -buffer-name=mru -start-insert file_mru<cr>
nnoremap <leader>y :Unite -no-split -buffer-name=yank history/yank<cr>
nnoremap <leader>e :Unite -no-split -buffer-name=buffer -start-insert buffer<cr>
autocmd FileType unite call s:unite_settings()
function! s:unite_settings()
" Play nice with supertab
let b:SuperTabDisabled=1
" Enable navigation with control-j and control-k in insert mode
imap <buffer> <C-j> <Plug>(unite_select_next_line)
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
endfunction
" Powerline stuff
let g:Powerline_dividers_override = ['>>', '>', '<<', '<']
let g:Powerline_symbols = 'unicode'
let g:Powerline_symbols_override = {
\ 'BRANCH': '|',
\ 'LINE': 'LN',
\ }
" Netrw remote transfers
let g:netrw_silent = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment