Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
189 lines (145 sloc) 4.94 KB
set nocompatible
let mapleader = " "
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile "
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
syntax on
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
let g:lightline = { 'colorscheme': 'Dracula' }
augroup vimrcEx
" When editing a file, always jump to the last known cursor position.
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" Cucumber navigation commands
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
" Set syntax highlighting for specific file types
autocmd BufRead,BufNewFile Appraisals set filetype=ruby
autocmd BufRead,BufNewFile *.md set filetype=markdown
autocmd BufRead,BufNewFile *.es6 set filetype=javascript
" Enable spellchecking for Markdown
autocmd FileType markdown setlocal spell
" Automatically wrap at 80 characters for Markdown
autocmd BufRead,BufNewFile *.md setlocal textwidth=80
" Allow stylesheets to autocomplete hyphenated words
autocmd FileType css,scss,sass setlocal iskeyword+=-
augroup END
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
" Display extra whitespace
set listchars=tab\ ,nbsp:·,trail:·
" FZF instead of ctrlp
map <C-p> :FZF<CR>
highlight NonText guibg=#060606
highlight Folded guibg=#0A0A0A guifg=#9090D0
" Make it obvious where 80 characters is
set textwidth=80
set colorcolumn=+1
" Numbers
set number
set numberwidth=5
" Tab completion
" will insert tab at beginning of line,
" will use completion if not at beginning
set wildmode=list:longest,list:full
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
return "\<c-p>"
inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
inoremap <S-Tab> <c-n>
" Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing
let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"
" Switch between the last two files
nnoremap <leader><leader> <c-^>
" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" configure syntastic syntax checking to check on open as well as save
let g:syntastic_check_on_open=1
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
source $HOME/.vim/shortcuts.vim
highlight NonText guibg=#060606
highlight Folded guibg=#0A0A0A guifg=#9090D0
set number
" Snippets are activated by Shift+Tab
let g:snippetsEmu_key = "<S-Tab>"
" Persisted undo
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
if has('mac')
set clipboard=unnamed
set clipboard=unnamedplus
set scrolloff=5
" Show the 80 char column
autocmd BufWinEnter,WinEnter * setlocal colorcolumn=80
autocmd BufWinEnter,WinEnter *.ex* setlocal colorcolumn=100
autocmd BufWinLeave,WinLeave * setlocal colorcolumn=0
let g:UltiSnipsExpandTrigger = "<S-tab>"
let g:UltiSnipsListSnippets = "<c-j>"
let g:UltiSnipsJumpForwardTrigger = "<S-tab>"
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
let g:no_turbux_mappings = 1
map <leader>a <Plug>SendTestToTmux
map <leader>l <Plug>SendFocusedTestToTmux
let g:SuperTabNoCompleteAfter = ['^', ',', '\s']
let g:syntastic_filetype_map = { 'html.handlebars': 'handlebars' }
" let g:syntastic_handlebars_checkers=['']
au BufNewFile,BufRead *.slim set filetype=slim
au BufNewFile,BufRead *.ex* set filetype=elixir
au BufNewFile,BufRead *.eex* set filetype=elixir
" Format elixir files on save
let g:mix_format_on_save = 0
" Shorten the escaping
inoremap jj <Esc>
" vim pad
let g:pad#window_height = 20
let g:pad#dir = "~/dropbox/notes"
let base16colorspace=256 " Access colors present in 256 colorspace
if $COLORTERM == 'gnome-terminal'
set t_Co=256
set background=dark
colorscheme dracula
source ~/.vim/airline.vim
source ~/.vim/tests.vim
set showmatch
set nofoldenable