Skip to content

Instantly share code, notes, and snippets.

@TrevorBasinger
Created January 20, 2017 13:40
Show Gist options
  • Save TrevorBasinger/1c68ef2592234f0a2ee7d11af1c7f477 to your computer and use it in GitHub Desktop.
Save TrevorBasinger/1c68ef2592234f0a2ee7d11af1c7f477 to your computer and use it in GitHub Desktop.
set nocompatible
filetype plugin on
filetype plugin indent on
syntax on
set encoding=utf-8
set expandtab
set tabstop=2
set shiftwidth=2
set number
set hlsearch
set backspace=indent,eol,start
set modeline
set modelines=5
" execute pathogen#infect()
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
" # Plugin Manager
Plugin 'VundleVim/Vundle.vim'
" # Fuzzy file finder
Plugin 'ctrlp.vim'
" # Vim Integrations
Plugin 'fugitive.vim'
" # Plugin for eazy surrounding a block of text think parens or quotes
Plugin 'surround.vim'
" # Dep for something
Plugin 'mattn/webapi-vim'
" # Gist plugin
Plugin 'gist.vim'
" # Aligning in columns
Plugin 'godlygeek/tabular'
" # Remove things from buffer temporarily
Plugin 'chrisbra/NrrwRgn'
" # Easy alignment kinda like tabular only better keystrokes
Plugin 'junegunn/vim-easy-align'
" # I have no fucking idea
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
" # Code auto complete
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
" # Scala syntax highlighting
Plugin 'derekwyatt/vim-scala'
Plugin 'rust-lang/rust.vim'
call vundle#end()
filetype plugin indent on
let g:syntastic_javascript_checkers = ['jshint']
" Fix unneed spaces
nmap <leader><space> :%s/[\ \|\t]*$//g<CR>
" Don't accept arrow keys.
noremap <left> :echo "no!"<cr>
noremap <right> :echo "no!"<cr>
noremap <up> :echo "no!"<cr>
noremap <down> :echo "no!"<cr>
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
inoremap <special> kj <ESC>
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
noremap <leader>l :match OverLength /\%81v.\+/<cr>
" Fix Parenthesis Spacing
noremap <leader>( :%s/\(\S\)(/\1 (/g<cr>
noremap <leader>) :s/\(\S\)(/\1 (/g<cr>
" let g:ctrlp_user_command = {
" \ 'types': {
" \ 1: ['.git', 'cd %s && git ls-files --cached --exclude-standard --others'],
" \ 2: ['.hg', 'hg --cwd %s locate -I .'],
" \ },
" \ 'fallback': 'find %s -type f'
" \ }
" Scala File Detection
fun! s:DetectScala()
if getline(1) =~# '^#!\(/usr\)\?/bin/env\s\+scalas\?'
set filetype=scala
endif
endfun
au BufRead,BufNewFile *.scala set filetype=scala
au BufRead,BufNewFile * call s:DetectScala()
" Install vim-sbt for additional syntax highlighting.
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
let g:ctrlp_custom_ignore = 'bower_components\|node_modules\|DS_Store\|git'
" Tab shortcuts
noremap <Leader>[ :tabprevious<cr>
noremap <Leader>] :tabnext<cr>
noremap <Leader>= :tabnew<cr>
noremap <Leader>- :tabclose<cr>
" Rust autoformat
let g:rustfmt_autosave = 1
" Syntax highlighting for rust
au BufRead,BufNewFile *.rs setfiletype rust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment