Skip to content

Instantly share code, notes, and snippets.

@jgarber
Created January 28, 2014 20:58
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 jgarber/8676399 to your computer and use it in GitHub Desktop.
Save jgarber/8676399 to your computer and use it in GitHub Desktop.
set background=dark
set guifont=Menlo\ for\ Powerline:h14
colorscheme solarized
set guioptions=egmt
let &colorcolumn=join(range(80,999),",")
set wrap
set mouse=a
set nohlsearch
"nnoremap <esc> :noh<return><esc>
"
"" https://github.com/jistr/vim-nerdtree-tabs
""map <Leader>n <plug>NERDTreeTabsToggle<CR>
" Reselect visual block after indent/outdent
vnoremap < <gv
vnoremap > >gv
" numbers.vim
nnoremap <F3> :NumbersToggle<CR>
let g:Powerline_symbols = 'fancy'
call Pl#Theme#RemoveSegment('fugitive:branch')
colorscheme solarized
" Disable NERDTree on VimEnter (override Janus)
autocmd! AuNERDTreeCmd VimEnter *
set cpo+=J " sentences have two spaces
set foldmethod=indent
set foldlevelstart=10
syntax sync minlines=256
" Switch to last buffer
nnoremap <leader><leader> <c-^>
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
silent! %s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | :call <SID>StripTrailingWhitespaces() | endif
" Force Saving Files that Require Root Permission
cnoremap w!! %!sudo tee > /dev/null %
" :W also saves
cnoreabbrev W w
" Fast saving
nnoremap <leader>w :w!<cr>
" use . to repeat a change for every line in the block
vnoremap <silent> . :normal .<CR>
" Make K split lines (the opposite of J)
nnoremap K i<cr><esc>k$
" Insert new line above cursor
nnoremap <C-K> O<Esc>j
" Insert new line below cursor
nnoremap <C-J> o<Esc>k
" Insert space after cursor
nnoremap <C-L> li <Esc>h
" Insert space before cursor
nnoremap <C-H> i <Esc>l
" Hit TAB twice to switch to the next window
nnoremap <tab><tab> <C-w>w
nnoremap <s-tab><s-tab> <C-w>W
" Open the current file's directory in Finder
nnoremap <leader>o :!open<space>%:p:h<enter>
" Mike's mapping for comments
call janus#add_mapping('nerdcommenter', 'map', '<C-_><C-_>', '<plug>NERDCommenterToggle<CR>')
unlet g:ctrlp_custom_ignore
let g:ctrlp_custom_ignore = '\.git$\|tmp$\|\.bundle$\|public\/uploads$\|public\/system$\|\.sass-cache$\|app\/assets\/images'
" Open new split panes to right and bottom, which feels more natural than Vim’s default:
set splitbelow
set splitright
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ARROW KEYS ARE UNACCEPTABLE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <Left> <Nop>
map <Right> <Nop>
map <Up> <Nop>
map <Down> <Nop>
set nocompatible
filetype on
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'vim-scripts/pbcopy.vim'
Bundle 'kchmck/vim-coffee-script'
Bundle 'altercation/vim-colors-solarized'
Bundle 'plasticboy/vim-markdown'
Bundle 'kien/ctrlp.vim'
Bundle 'vim-ruby/vim-ruby'
Bundle 'tpope/vim-fugitive'
Bundle 'Simple-Javascript-Indenter'
Bundle 'VimClojure'
Bundle 'jpalardy/vim-slime'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-ragtag'
Bundle 'matschaffer/netrw-v142'
Bundle 'matschaffer/vim-matschaffer'
filetype plugin indent on
if has("gui_running")
let g:loaded_netrw = 1 " Disable netrw
let g:loaded_netrwPlugin = 1 " Disable netrw
end
" remap jj to escape in insert mode
inoremap jj <Esc>
"indent guides
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_color_change_percent = 3
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:ctrlp_root_markers = ['Gemfile']
iabbrev rdebug require 'ruby-debug'; debugger; 1
"let g:solarized_menu=0
let g:vimwiki_menu=''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment