Skip to content

Instantly share code, notes, and snippets.

@BananaNeil
Created June 11, 2015 23:06
Show Gist options
  • Save BananaNeil/99d66653d78b7d0d9160 to your computer and use it in GitHub Desktop.
Save BananaNeil/99d66653d78b7d0d9160 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" 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 'gmarik/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
"Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
"Plugin 'user/L9', {'name': 'newL9'}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""" Plugins """""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plugin 'gmarik/vundle'
" Scripts?
Plugin 'SelectBuf'
Plugin 'Wombat'
Plugin 'wombat256.vim'
Plugin 'genutils'
"Plugin 'tomtom/tcomment_vim'
"Plugin 'bruno-/vim-alt-mappings'
Plugin 'tomtom/tcomment_vim'
Plugin 'benjaminwhite/Benokai'
"Plugin 'fsouza/go.vim'
"Plugin 'wting/rust.vim'
Plugin 'godlygeek/tabular'
"Plugin 'plasticboy/vim-markdown'
Plugin 'mtth/scratch.vim'
" Plugin 'editorconfig/editorconfig-vim'
" Plugin 'mcandre/Conque-Shell'
Plugin 'groenewege/vim-less'
Plugin 'plasticboy/vim-markdown'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-git'
"Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'vim-ruby/vim-ruby'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""" CUSTOM STUFF """"""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax on
set background=dark
filetype plugin on
augroup mkd " MarkDown
autocmd FileType mkd setlocal ai spell nofoldenable colorcolumn=80
augroup END
augroup commit
autocmd FileType gitcommit,cvs setlocal spell textwidth=72 colorcolumn=73
augroup END
" Indentation
set autoindent
filetype plugin indent on
if has("mouse")
set mouse=a
endif
" Bash-style tab completion
set wildmode=longest,list
set wildmenu
" No swap files, use version control instead
set noswapfile
set number
" Default to soft tabs, 2 spaces
set sw=2
set sts=2
" Except for Makefiles: Hard tabs of width 2
autocmd FileType make set ts=2
" And Markdown
au BufRead,BufNewFile *.md set filetype=markdown
" And Java
autocmd FileType java set sw=2
" Default to Unix LF line endings
set ffs=unix
set nowrap
color Benokai
map ; :
set ttymouse=xterm2
" Enable the status bar
set laststatus=2
if $POWERLINE_FONT
let g:airline_powerline_fonts = 1
endif
set hlsearch
set number
set tabstop=2
set backspace=indent,eol,start
set shiftwidth=2
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|CVS$\|build|\.svn$\|target$',
\ 'file': '\.class$\|\.so$',
\ }
let g:ctrlp_extensions = ['dir', 'mixed']
let g:vundle_default_git_proto = 'git'
" CUSTOM CHANGES
highlight LineNr ctermfg=grey
map ; :
filetype plugin indent on
set expandtab
if has ("autocmd")
filetype indent on
endif
let g:BASH_Ctrl_j = 'on'
"Ignore case unless searching for capital letters
set ignorecase
set smartcase
map π 
map \/ 
" Select in indent
function! SelectIndent ()
let temp_var=indent(line("."))
while indent(line(".")-1) >= temp_var
exe "normal k"
endwhile
exe "normal V"
while indent(line(".")+1) >= temp_var
exe "normal j"
endwhile
endfun
nmap <Space> :call SelectIndent()<CR>
nmap vii <Space>
nmap dii <Space>d
nmap cii <Space>c
nmap yii <Space>y
nmap <ii <Space><
nmap >ii <Space>>
" Expand spec path for ruby files
cmap  <C-R>=expand('%:p:h') . '/'<CR>
function! GetSpecPath ()
let path=expand('%:p')
if path =~ '_spec.rb'
return substitute(substitute(path, '_spec.rb', '.rb', ''), '/spec/', '/app/', '')
else
return substitute(substitute(path, '.rb', '_spec.rb', ''), '/app/', '/spec/', '')
endif
endfun
cmap  <C-R>=GetSpecPath()<CR>
nmap <C-k> ddkkp
nmap <C-j> ddp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment