Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 3 additions & 51 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,54 +1,6 @@
[submodule "bundle/kwbd"]
path = bundle/kwbd
url = http://github.com/rgarver/Kwbd.vim.git
[submodule "bundle/zoomwin"]
path = bundle/zoomwin
url = http://github.com/vim-scripts/ZoomWin
[submodule "bundle/ack"]
path = bundle/ack
url = http://github.com/vim-scripts/ack.vim.git
[submodule "bundle/ag"]
path = bundle/ag
url = http://github.com/epmatsw/ag.vim.git
[submodule "bundle/ctrlp"]
path = bundle/ctrlp
url = http://github.com/kien/ctrlp.vim.git
[submodule "bundle/jasmine"]
path = bundle/jasmine
url = http://github.com/claco/jasmine.vim.git
[submodule "bundle/nerdcommenter"]
path = bundle/nerdcommenter
url = http://github.com/scrooloose/nerdcommenter.git
[submodule "bundle/nerdtree"]
path = bundle/nerdtree
url = http://github.com/scrooloose/nerdtree.git
[submodule "bundle/ruby-matchit"]
path = bundle/ruby-matchit
url = http://github.com/vim-scripts/ruby-matchit.git
[submodule "bundle/supertab"]
path = bundle/supertab
url = http://github.com/ervandew/supertab.git
[submodule "bundle/syntastic"]
path = bundle/syntastic
url = http://github.com/scrooloose/syntastic.git
[submodule "bundle/fugitive"]
path = bundle/fugitive
url = http://github.com/tpope/vim-fugitive.git
[submodule "bundle/gitgrep"]
path = bundle/gitgrep
url = http://github.com/aghareza/vim-gitgrep.git
[submodule "bundle/rails"]
path = bundle/rails
url = http://github.com/tpope/vim-rails.git
[submodule "bundle/rspec"]
path = bundle/rspec
url = http://github.com/thoughtbot/vim-rspec.git
[submodule "bundle/surround"]
path = bundle/surround
url = http://github.com/tpope/vim-surround.git
[submodule "bundle/auto-save"]
path = bundle/auto-save
url = https://github.com/vim-scripts/vim-auto-save.git
[submodule "bundle/localvimrc"]
path = bundle/localvimrc
url = https://github.com/embear/vim-localvimrc.git
[submodule "bundle/vundle"]
path = bundle/vundle
url = git://github.com/gmarik/Vundle.vim.git
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
git clone http://github.com/FundingCircle/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
cd ~/.vim/ && git submodule init && git submodule update
vi
:BundleInstall
```

## Custom Commands
Expand Down
24 changes: 24 additions & 0 deletions bundle.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set nocompatible
filetype off

set rtp+=~/.vim/bundle/vundle
call vundle#begin()

Plugin 'vim-scripts/ZoomWin'
Plugin 'vim-scripts/ack.vim'
Plugin 'epmatsw/ag.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'claco/jasmine.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-scripts/ruby-matchit'
Plugin 'ervandew/supertab'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-fugitive'
Plugin 'aghareza/vim-gitgrep'
Plugin 'tpope/vim-rails'
Plugin 'thoughtbot/vim-rspec'
Plugin 'tpope/vim-surround'
Plugin 'vim-scripts/vim-auto-save'
Plugin 'Pembear/vim-localvimrc'

1 change: 0 additions & 1 deletion bundle/ack
Submodule ack deleted from b9f85e
1 change: 0 additions & 1 deletion bundle/ag
Submodule ag deleted from 36c468
1 change: 0 additions & 1 deletion bundle/auto-save
Submodule auto-save deleted from 6f9093
1 change: 0 additions & 1 deletion bundle/ctrlp
Submodule ctrlp deleted from b5d3fe
1 change: 0 additions & 1 deletion bundle/fugitive
Submodule fugitive deleted from c47132
1 change: 0 additions & 1 deletion bundle/jasmine
Submodule jasmine deleted from 50cae1
1 change: 0 additions & 1 deletion bundle/kwbd
Submodule kwbd deleted from ed6d18
1 change: 0 additions & 1 deletion bundle/localvimrc
Submodule localvimrc deleted from 326374
1 change: 0 additions & 1 deletion bundle/nerdcommenter
Submodule nerdcommenter deleted from 0b3d92
1 change: 0 additions & 1 deletion bundle/nerdtree
Submodule nerdtree deleted from b0bb78
1 change: 0 additions & 1 deletion bundle/rails
Submodule rails deleted from 98fe1d
1 change: 0 additions & 1 deletion bundle/rspec
Submodule rspec deleted from 94a256
1 change: 0 additions & 1 deletion bundle/ruby-matchit
Submodule ruby-matchit deleted from c4d807
1 change: 0 additions & 1 deletion bundle/supertab
Submodule supertab deleted from 940885
1 change: 0 additions & 1 deletion bundle/surround
Submodule surround deleted from f85cb4
1 change: 0 additions & 1 deletion bundle/syntastic
Submodule syntastic deleted from 1383c0
1 change: 1 addition & 0 deletions bundle/vundle
Submodule vundle added at 0b28e3
1 change: 0 additions & 1 deletion bundle/zoomwin
Submodule zoomwin deleted from cf21ce
197 changes: 197 additions & 0 deletions internal.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
set nocompatible

execute pathogen#infect()
let mapleader = ","
color vividchalk
set guifont=monaco:h16
let &t_Co=256

set cursorline
set hidden
set number
set ruler
set encoding=utf-8
set backspace=indent,eol,start " Fix problems with backspace in insert mode
syntax on

" Whitespace
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set list listchars=tab:\ \ ,trail:·

" Searching
set nohlsearch
set incsearch
set ignorecase
set smartcase

" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*

set laststatus=2 " Status bar
set showcmd " Display incomplete commands

" Turn off backup files
set noswapfile
set nobackup
set nowb

" Speed up
set ttyfast
set ttyscroll=3
set lazyredraw

set autoread " Reload files changed outside vim

set autowrite " Automatically :write before running commands

" Press i to enter insert mode, ii to go back to normal mode
imap ii <esc>

" Copy current filename into system clipboard
nnoremap <silent> <leader>cf :let @* = expand("%:~")<CR>

" Paste last contents of what was yanked regardless of what was deleted after
nnoremap <leader>p "0p
nnoremap <leader>P "0P

" Copy to clipboard
vnoremap <C-C> "*y

" Vertical split and move to new window
nnoremap <leader>v <C-W>v<C-W>l

" Horizontal split and move to new window
nnoremap <leader>h :split<CR><C-W>j

" Easier split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Control-P
set runtimepath^=~/.vim/bundle/ctrlp.vim
set wildignore+=*/tmp/*
map <leader>b :CtrlPBuffer<CR>
map <leader>cpc :CtrlPClearCache<CR>

" Make CtrlP use Ag for listing the files. Much faster and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'

" CtrlP auto cache clearing.
function! SetupCtrlP()
if exists("g:loaded_ctrlp") && g:loaded_ctrlp
augroup CtrlPExtension
autocmd!
autocmd FocusGained * CtrlPClearCache
autocmd BufWritePost * CtrlPClearCache
augroup END
endif
endfunction
if has("autocmd")
autocmd VimEnter * :call SetupCtrlP()
endif

" NERDTree configuration
nnoremap <silent> <C-\> :NERDTreeFind<CR>
let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
map <leader>nt :NERDTreeToggle<CR>

" ZoomWin configuration
map <leader><leader> :ZoomWin<CR>

" Delete buffer without closing window
nnoremap <silent> <leader>bd :Kwbd<CR>

" enable AutoSave on Vim startup
let g:auto_save = 1

" CTags
map <leader>rt :!ctags --extra=+f --exclude=tmp --exclude=node_modules -R * <CR><CR>

" Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing
let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"

" Remember last location in file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif

" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby

" Add json syntax highlighting
au BufNewFile,BufRead *.json set ft=javascript

" Add markdown syntax highlighting and spellcheck
au BufRead,BufNewFile *.md set ft=markdown
au BufRead,BufNewFile *.md setlocal spell
au BufRead,BufNewFile *.md setlocal wrap
map <leader>M :set syntax=markdown<CR>:set wrap<CR>:set spell<CR>

" Load the plugin and indent settings for the detected filetype
filetype plugin indent on

" Enable syntastic syntax checking
let g:syntastic_enable_signs=1
let g:syntastic_quiet_messages = {'level': 'warnings'}

" % to bounce from do to end etc.
runtime! macros/matchit.vim

let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapCTabSwitchBufs = 1

" Open up a git grep line, with a quote started for the search
nnoremap <leader>ag :Ag

" Toggle pasting to preserve format when pasting from clipboard into buffer
nnoremap <leader>pt :set invpaste paste?<cr>
set pastetoggle=<leader>pt
set showmode

" Run RSpec tests
let g:rspec_command = "!bundle exec rspec {spec}"
map <leader>t :call RunCurrentSpecFile()<CR>
map <leader>s :call RunNearestSpec()<CR>
map <leader>l :call RunLastSpec()<CR>
map <leader>z :!rspec %<CR>

" Find the related spec for any file you open. Requires
" * Your specs live in spec/ or fast_spec/
" * Your pwd (current dir) is the project root
" * You use the same dir structure in your code and specs so that
" code living at lib/foo/bar.rb has a spec at spec/lib/foo/bar.rb
"
" This method handles files in fast_spec unlike the :A and :AV functions
" that ship with rails.vim
function! FindSpec()
let s:fullpath = expand("%:p")
let s:filepath = expand("%:h")
let s:fname = expand("%:t")

" Possible names for the spec/test for the file we're looking at
let s:test_names = [substitute(s:fname, ".rb$", "_spec.rb", ""), substitute(s:fname, ".rb$", "_test.rb", "")]

" Possible paths
let s:test_paths = ["spec", "fast_spec", "test"]
for test_name in s:test_names
for path in s:test_paths
let s:filepath_without_app = substitute(s:filepath, "app/", "", "")
let s:spec_path = path . "/" . s:filepath_without_app . "/" . test_name
let s:full_spec_path = substitute(s:fullpath, s:filepath . "/" . s:fname, s:spec_path, "")
if filereadable(s:full_spec_path)
execute ":botright vsp " . s:full_spec_path
return
endif
endfor
endfor
endfunction

map <leader>fs :call FindSpec()<CR>
Loading