Skip to content

Instantly share code, notes, and snippets.

Created July 3, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9644b1b72fe7979b911f to your computer and use it in GitHub Desktop.
Save anonymous/9644b1b72fe7979b911f to your computer and use it in GitHub Desktop.
set nocompatible
runtime macros/matchit.vim
if has("autocmd")
filetype indent plugin on
endif
filetype off
let mapleader=" "
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
set t_Co=256
set hidden
set backspace=indent,eol,start
set nocompatible
set nobackup
set nowritebackup
set history=50
set noswapfile
set mouse=a
set clipboard=unnamed
set ruler
set number
set shell=zsh
set numberwidth=5
set noswapfile
set incsearch
set laststatus=2
set encoding=utf-8
set tabstop=2
set shiftwidth=2
set expandtab
set timeoutlen=1000 ttimeoutlen=0
set list listchars=tab:»·,trail:·
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_rails = 1
let g:vimclojure#HighlightBuiltins = 1
let g:vimclojure#ParenRainbow = 1
" Let Vundle manage Vundle
Plugin 'gmarik/Vundle.vim'
Plugin 'thoughtbot/vim-rspec'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'pbrisbin/vim-mkdir'
Plugin 'scrooloose/syntastic'
Plugin 'slim-template/vim-slim'
Plugin 'vim-scripts/tComment'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-bundler'
Plugin 'jgdavey/tslime.vim'
Plugin 'tpope/vim-leiningen.git'
Plugin 'dkinzer/vim-schemer'
Plugin 'tpope/vim-sexp-mappings-for-regular-people'
Plugin 'guns/vim-sexp'
Plugin 'tpope/vim-projectionist.git'
Plugin 'tpope/vim-dispatch.git'
Plugin 'sjl/gundo.vim'
Plugin 'tpope/vim-fireplace.git'
Plugin 'calebsmith/vim-lambdify'
Plugin 'guns/vim-clojure-static'
Plugin 'guns/vim-clojure-highlight'
Plugin 'wlangstroth/vim-racket'
Plugin 'tpope/vim-classpath.git'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'bling/vim-airline'
Plugin 'christoomey/vim-run-interactive'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'amdt/vim-niji'
Plugin 'ethereum/vim-solidity'
Plugin 'rust-lang/rust.vim'
Plugin 'Pychimp/vim-luna'
Plugin 'vim-scripts/scribble.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'rizzatti/dash.vim'
autocmd FileType ruby compiler ruby
" non github repos
Plugin 'git://git.wincent.com/command-t.git'
filetype on
filetype plugin on " required!
filetype indent on
syntax on
"
" Brief help
" :PluginList - list configured bundles
" :PluginInstall(!) - install(update) bundles
" :PluginSearch(!) foo - search(or refresh cache first) for foo
" :PluginClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin command are not allowed..
"""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""" Gary Bernhardt Stuff """""""""
"""""""""""""""""""""""""""""""
" MISC KEY MAPS
"""""""""""""""""""""""""""""""
map <Esc><Esc> :w<CR>
map <leader>y "*y
" Move around splits with <c-hjkl>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <c-w> <c-w>w
"-----------------------------------------------------------------------
"" Gundo Settings
"---------------------------------------------------------------------
nmap <c-g> :GundoToggle<cr>
let g:rspec_command = "!bundle exec rspec {spec}"
" Vim Runner Stuff
nnoremap <leader>irb :VtrOpenRunner {'orientation': 'h', 'percentage': 50, 'cmd': 'irb'}<cr>
nnoremap <leader>pry :VtrOpenRunner {'orientation': 'h', 'percentage': 50, 'cmd': 'pry'}<cr>
" automatically rebalance windows on vim resize
autocmd VimResized * :wincmd =
" zoom a vim pane, <C-w>= to re-balance
nnoremap <leader>- :wincmd _<cr>:wincmd \|<cr>
nnoremap <leader>= :wincmd =<cr>
autocmd filetype lisp,scheme,art setlocal equalprg=scmindent.rkt
let g:niji_dark_colours = [
\ [ '81', '#5fd7ff'],
\ [ '99', '#875fff'],
\ [ '1', '#dc322f'],
\ [ '76', '#5fd700'],
\ [ '3', '#b58900'],
\ [ '2', '#859900'],
\ [ '6', '#2aa198'],
\ [ '4', '#268bd2'],
\ ]
map <Leader>r :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
" let g:rspec_command = 'call Send_to_Tmux("rspec {spec}\n")'
" [q]uit (close) window/split
nnoremap <silent> <Leader>q <C-w>q
" " [s]plit window horizontally
nnoremap <silent> <Leader>s <C-w>s
" " split window [v]ertically
nnoremap <silent> <Leader>\ <C-w>v
"" Airline
let g:airline_powerline_fonts = 1
" Insert a hash rocket with <c-l>
" imap <c-l> <space>=><space>
" " Can't be bothered to understand ESC vs <c-c> in insert mode
imap <c-c> <esc>
" " Clear the search buffer when hitting return
function! MapCR()
nnoremap <cr> :nohlsearch<cr>
endfunction
call MapCR()
nnoremap <leader><leader> <c-^>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
inoremap <s-tab> <c-n>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MAPS TO JUMP TO SPECIFIC COMMAND-T TARGETS AND FILES
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>gr :topleft :split config/routes.rb<cr>
function! ShowRoutes()
" Requires 'scratch' plugin
:topleft 100 :split __Routes__
" Make sure Vim doesn't write __Routes__ as a file
:set buftype=nofile
" Delete everythin
:normal 1GdG
" Put routes output in buffer
:0r! rake -s routes
" Size window to number of lines (1 plus rake output
length)
:exec ":normal " . line("$") . _ "
" Move cursor to bottom
:normal 1GG
" Delete empty trailing line
:normal dd
endfunction
map <leader>gR :call ShowRoutes()<cr>
map <leader>gv :CommandTFlush<cr>\|:CommandT app/views<cr>
map <leader>gm :CommandTFlush<cr>\|:CommandT app/models<cr>
map <leader>gh :CommandTFlush<cr>\|:CommandT app/helpers<cr>
map <leader>gl :CommandTFlush<cr>\|:CommandT app/controllers<cr>
map <leader>gp :CommandTFlush<cr>\|:CommandT public<cr>
map <leader>gf :CommandTFlush<cr>\|:CommandT features<cr>
map <leader>gg :topleft 100 :split Gemfile<cr>
map <leader>gt :CommandTFlush<cr>\|:CommandTTag<cr>
map <leader>b :CommandTFlush<cr>\|:CommandTBuffer<cr>
map <leader>f :NERDTreeToggle<cr>
map <silent> <leader>d <Plug>DashSearch
nnoremap <silent> <Leader>gs :Gstatus<CR>
nnoremap <silent> <Leader>gc :Gcommit -v<CR>
" nnoremap <leader> :call OpenTestAlternate()<cr>
syntax enable
vmap <silent><Leader>, <Plug>SendSelectionToTmux
nmap <silent><Leader>, <Plug>NormalModeSendToTmux
nmap <C-c>r <Plug>SetTmuxVars
" let g:rspec_command = 'call Send_to_Tmux("bundle exec rspec {spec}\n")'
colorscheme solarized
set background=dark
let g:airline_theme='luna'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment