Last active
October 11, 2015 10:58
-
-
Save stevekinney/3848532 to your computer and use it in GitHub Desktop.
Vim Configuration, 2012-10-09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" My Bundles | |
Bundle 'stevekinney/snipmate.vim' | |
" Vim Bundles via Vundle | |
" | |
Bundle 'Lokaltog/vim-powerline' | |
Bundle 'vim-scripts/L9' | |
Bundle 'tpope/vim-abolish' | |
Bundle 'Townk/vim-autoclose' | |
Bundle 'jeetsukumaran/vim-buffergator' | |
Bundle 'kchmck/vim-coffee-script' | |
Bundle 'ap/vim-css-color' | |
Bundle 'chrisbra/csv.vim' | |
Bundle 'kien/ctrlp.vim' | |
Bundle 'tpope/vim-endwise' | |
Bundle 'tpope/vim-haml' | |
Bundle 'michaeljsmith/vim-indent-object' | |
Bundle 'pangloss/vim-javascript' | |
Bundle 'plasticboy/vim-markdown' | |
Bundle 'scrooloose/nerdcommenter' | |
Bundle 'scrooloose/nerdtree' | |
Bundle 'mmalecki/vim-node.js' | |
Bundle 'tpope/vim-pastie' | |
Bundle 'tpope/vim-ragtag' | |
Bundle 'tpope/vim-rails' | |
Bundle 'tpope/vim-repeat' | |
Bundle 'vim-ruby/vim-ruby' | |
Bundle 'ecomba/vim-ruby-refactoring' | |
Bundle 'henrik/vim-ruby-runner' | |
Bundle 'beaugunderson/vim-scss-instead' | |
Bundle 'cakebaker/scss-syntax.vim' | |
Bundle 'stevekinney/snipmate.vim' | |
Bundle 'altercation/vim-colors-solarized' | |
Bundle 'tpope/vim-speeddating' | |
Bundle 'ervandew/supertab' | |
Bundle 'tpope/vim-surround' | |
Bundle 'duskhacker/sweet-rspec-vim' | |
Bundle 'scrooloose/syntastic' | |
Bundle 'vitaly/vim-syntastic-coffee' | |
Bundle 'godlygeek/tabular' | |
Bundle 'kana/vim-textobj-line' | |
Bundle 'nelstrom/vim-textobj-rubyblock' | |
Bundle 'kana/vim-textobj-user' | |
Bundle 'tpope/vim-unimpaired' | |
Bundle 'skalnik/vim-vroom' | |
Bundle 'Spaceghost/vim-matchit' | |
Bundle 'kien/ctrlp.vim' | |
Bundle 'vim-scripts/scratch.vim' | |
" Ctrl-P Setting | |
let g:ctrlp_working_path_mode = 'ra' | |
" Git Support | |
Bundle 'tpope/vim-git' | |
Bundle 'tpope/vim-fugitive' | |
" NERDCommenter | |
Bundle 'scrooloose/nerdcommenter' | |
nmap <leader>/ :call NERDComment(0, "invert")<cr> | |
vmap <leader>/ :call NERDComment(0, "invert")<cr>" | |
Bundle "mileszs/ack.vim" | |
nnoremap <leader>a :Ack!<space> | |
Bundle 'matthias-guenther/hammer.vim' | |
nmap <leader>p :Hammer<cr> | |
syntax on | |
filetype plugin indent on | |
set encoding=utf-8 | |
set nocompatible | |
set modelines=0 | |
set fillchars+=stl:\ ,stlnc:\ | |
" Remap the Leader key for enhanced awesomness | |
let mapleader = "," | |
let maplocalleader = "\\" | |
" Powerline setup | |
" let g:Powerline_symbols = 'fancy' | |
" Get out of insert mode using a shortcut | |
inoremap jj <Esc> | |
" New lines without entering insert mode | |
"map <S-Enter> O<Esc> | |
"map <CR> o<Esc> | |
nnoremap <C-J> m`o<Esc>`P | |
nnoremap <C-K> m`O<Esc>`P | |
" Ragtag suggestions | |
inoremap <M-o> <Esc>o | |
inoremap <C-j> <Down> | |
let g:ragtag_global_maps = 1 | |
set showcmd " Show typed command prefixes while waiting for operator | |
set showmode | |
set mouse=a " Use mouse support in XTerm/iTerm. | |
" Stuff involving tabs | |
set expandtab " Use soft tabs | |
set tabstop=2 " Tab settings | |
set autoindent | |
set shiftwidth=2 " Width of autoindent | |
set smarttab " Use shiftwidth to tab at line beginning | |
set list " Show whitespace | |
set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮ | |
set showbreak=↪ | |
" Lines, numbers, and wrapping | |
set number " Line numbers | |
set cursorline " Highlight current line | |
set nowrap " No wrapping | |
set formatoptions=qrn1 | |
set colorcolumn=80 " Show me the end of the page | |
set ruler | |
set scrolloff=3 " Scroll when the cursor is 3 lines from edge | |
set backspace=indent,eol,start " Let backspace work over anything. | |
" Getting wild | |
set wildmenu | |
set wildmode=list:longest | |
set wildignore+=tags " Ignore tags when globbing. | |
set wildignore+=tmp/** " ...Also tmp files. | |
set wildignore+=public/uploads/** " ...Also uploads. | |
set wildignore+=public/images/** " ...Also images. | |
set wildignore+=vendor/** " ...Also vendor. | |
set lbr | |
" Filetype-specific Setting | |
command! FJ set filetype=javascript | |
command! FR set filetype=ruby | |
autocmd FileType ruby,eruby,yaml set tw=80 ai sw=2 sts=2 et | |
autocmd User Rails set tabstop=2 shiftwidth=2 softtabstop=2 expandtab | |
au BufNewFile,BufReadPost *.jade setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab | |
au BufNewFile,BufReadPost *.html setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab | |
au BufNewFile,BufReadPost *.slim setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab | |
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable | |
au BufNewFile,BufReadPost *.coffee setl tabstop=2 softtabstop=2 shiftwidth=2 expandtab | |
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab | |
set showmatch " Show matching brackets | |
set hidden " Allow hidden, unsaved buffers | |
set splitright " Add new windows towards the right | |
set splitbelow " ... and bottom | |
" More detailed status line | |
set statusline=[%n]\ %f\ %m\ %y | |
set statusline+=%{exists('g:loaded_rvm')?rvm#statusline():''} | |
set statusline+=%= " Left/right separator | |
set statusline+=%c, " Cursor column | |
set statusline+=%l/%L " Cursor line/total lines | |
set statusline+=\ %P " Percent through file | |
set laststatus=2 " Always show statusline | |
" Searching | |
set incsearch " Incremental search | |
set gdefault " Automatically search globally | |
set history=1024 " History size | |
set ignorecase " Ignore case by default | |
set smartcase " Care about case if I use a capital | |
" double percentage sign in command mode is expanded | |
cnoremap %% <C-R>=expand('%:h').'/'<cr> | |
cnoremap rr ! rake | |
set autoread " No prompt for file changes outside Vim | |
set swapfile " Keep swapfiles | |
set directory=~/.vim-tmp,~/tmp,/var/tmp,/tmp | |
set backupdir=~/.vim-tmp,~/tmp,/var/tmp,/tmp | |
" Save when losing focus | |
set autowriteall | |
autocmd BufLeave,FocusLost * silent! wall | |
" Create a persistent undo file | |
set undofile | |
" Turn off ri tooltips that don't work with Ruby 1.9 yet | |
" http://code.google.com/p/macvim/issues/detail?id=342 | |
if has("gui_running") | |
set noballooneval | |
endif | |
" Disable help | |
inoremap <F1> <ESC> | |
nnoremap <F1> <ESC> | |
vnoremap <F1> <ESC> | |
" Ruby's hashrocket | |
imap <C-l> <space>=><space> | |
" Tab completion | |
set wildmode=list:longest,list:full | |
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/* | |
set wildmenu | |
" Remember last location in file | |
if has("autocmd") | |
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | |
\| exe "normal g'\"" | endif | |
endif " Keybindings | |
" Make Y consistent with D and C | |
map Y y$ | |
" Search | |
nmap <leader>ss :%s/ | |
vmap <leader>ss :s/ | |
" Yank to the OS X clipboard | |
vnoremap <leader>yo "*y | |
" Paste to the OS X clipboard | |
nnoremap <leader>po "*p | |
" Surround a word (follow this with the surrounding character) | |
nmap <leader>sw ysiw | |
" Split screen | |
map <leader>v :vsp<CR> | |
" Move between screens | |
nmap <C-j> <C-w>j | |
nmap <C-k> <C-w>k | |
nmap <C-h> <C-w>h | |
nmap <C-l> <C-w>l | |
" Reload .vimrc | |
map <leader>rv :source ~/.vimrc<CR> | |
" Jump to a new line in insert mode | |
imap <S-CR> <Esc>o | |
imap <C-S-CR> <Esc>O | |
" Previous/next quickfix file listings (e.g. search results) | |
map <M-C-Down> :cn<CR> | |
map <M-C-Up> :cp<CR> | |
" Previous/next buffers | |
map <M-C-Left> :bp<CR> | |
map <M-C-Right> :bn<CR> | |
"indent/unindent visual mode selection with tab/shift+tab | |
vmap <tab> >gv | |
vmap <s-tab> <gv | |
" Buffergator | |
map <C-x> :BuffergatorToggle<CR> | |
" Comment/uncomment lines | |
map <leader>/ <plug>NERDCommenterToggle | |
map <D-/> <plug>NERDCommenterToggle | |
imap <D-/> <Esc><plug>NERDCommenterToggle i | |
" Emacs-bindings | |
cnoremap <c-a> <home> | |
cnoremap <c-e> <end> | |
nnoremap <C-e> $ | |
nnoremap <C-a> ^ | |
imap <C-e> <esc>A | |
imap <C-a> <esc>I | |
" Easy access to the shell | |
map <Leader><Leader> :! | |
if !has("gui_running") | |
" Map Cmd-S to <F12> in iTerm2 for Save. | |
map <F11> :w<CR> | |
map! <F11> <C-o>:w<CR> | |
end | |
let g:closetag_html_style = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment