Skip to content

Instantly share code, notes, and snippets.

@cchamberlain
Last active March 30, 2016 17:42
Show Gist options
  • Save cchamberlain/f919af4e9a8a4c3621ac to your computer and use it in GitHub Desktop.
Save cchamberlain/f919af4e9a8a4c3621ac to your computer and use it in GitHub Desktop.
dot-vimrc
execute pathogen#infect()
""" SYNTAX """
syntax on
syntax enable " enable syntax processing
""" SETTINGS """
set tabstop=2 " number of visual spaces per tab when opened
set expandtab " use spaces instead of tabs
set shiftwidth=2 " number of spaces when you hit tab
set softtabstop=2 " number of spaces when you hit tab
set number " show line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
set wildmenu " adds visual autocomplete for command menu
set lazyredraw " makes vim only redraw when it needs to and faster macros
set showmatch " highlights matching parantheses
set incsearch " search: incrementally as characters are entered
set hlsearch " search: highlight search matches
set foldenable " enable folding
set foldlevelstart=10 " open most folds by default
set foldnestmax=10 " max of 10 nested folds
set foldmethod=indent " fold based on indent level (indent,marker,manual,expr,syntax,diff)
set timeoutlen=100
set ttimeoutlen=0
set esckeys " fix insert delay
""" THIS WAS CAUSING SCREEN BUG
" if system("uname") == "Darwin\n"
" set term=xterm-256color
""" COLORSCHEME """
" set t_Co=256
" set background=dark
" if !has('gui_running')
" let g:solarized_termcolors=16
" let g:solarized_termcolors=&t_Co
" let g:solarized_termtrans=1
" let g:solarized_visibility="high"
" endif
" colorscheme solarized
" highlight Normal ctermbg=NONE
" highlight nonText ctermbg=NONE
" Use a blinking upright bar cursor in Insert mode, a blinking block in normal
" if &term == 'xterm-256color' || &term == 'screen-256color'
" let &t_SI = "\<Esc>[5 q"
" let &t_EI = "\<Esc>[1 q"
" endif
" if exists('$TMUX')
" let &t_EI="\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
" let &t_SI="\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
" endif
" function MacOSX()
" hi CursorLine term=none cterm=none
" set cursorline
" hi Cursor cterm=reverse
" match Cursor /\%#/ "This line does all the work
" endfunction
" if $TERM_PROGRAM == "Apple_Terminal"
" if $WINDOWID == ""
" call MacOSX()
" endif
" endif
" if $SSH_TTY != ""
" if $TERM == "xterm-color" || $ORIGTERM = "xterm-color"
" call MacOSX()
" endif
" endif
" else " (WINDOWS ONLY)
""" BACKUPS """
set backup
set backupdir=$TMP
set backupskip=$TMP/*
set directory=$TMP
set writebackup
set term=xterm-16
" set term=xterm
" set t_Co=16
" let &t_AB="\e[48;5;%dm"
" let &t_AF="\e[38;5;%dm"
set mouse=a
set nocompatible
inoremap <Esc>[62~ <C-X><C-E>
inoremap <Esc>[63~ <C-X><C-Y>
nnoremap <Esc>[62~ <C-E>
nnoremap <Esc>[63~ <C-Y>
""" COLORSCHEME """
set background=dark
let g:solarized_termcolors=16
let g:solarized_termtrans=1
let g:solarized_visibility="high"
colorscheme solarized
if &term =~ '^xterm'
" solid underscore
let &t_SI .= "\<Esc>[4 q"
" solid block
let &t_EI .= "\<Esc>[2 q"
" 1 or 0 -> blinking block
" 3 -> blinking underscore
" Recent versions of xterm (282 or above) also support
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
endif
" endif " (END WINDOWS)
let mapleader="," " set leader to comma instead of \
""" FILETYPE """
filetype plugin indent on " load filetype-specific indent files
""" MAPPINGS """
" turn off search highlight with ,<space>
nnoremap <leader><space> :nohlsearch<CR>
" <space> toggles folds
nnoremap <space> za
" move up by visual line
nnoremap j gj
" move down by visual line
nnoremap k gk
" toggle gundo.vim for visualizing the undo tree
nnoremap <leader>u :GundoToggle<CR>
" edit vimrc/zshrc and load vimrc bindings
nnoremap <leader>ev :vsp $MYVIMRC<CR>
nnoremap <leader>ez :vsp ~/.zshrc<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
" save session
nnoremap <leader>s :mksession<CR>
" silver searcher remap to ,a
nnoremap <leader>a :Ag<space>
""" CTRLP """
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
""" AIRLINE """
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_powerline_fonts = 1
set vsvim_useeditordefaults
behave mswin
set selectmode=mouse
:vmap <Tab> >>
:vmap <S-Tab> <<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment