Skip to content

Instantly share code, notes, and snippets.

@oddlyfunctional
Created August 4, 2015 16:06
Show Gist options
  • Save oddlyfunctional/d4d4170e4754fa819757 to your computer and use it in GitHub Desktop.
Save oddlyfunctional/d4d4170e4754fa819757 to your computer and use it in GitHub Desktop.
" Index:
" ==Vundle
" ==Syntax Highlighting
" ==Color schemes
" ==RSpec.vim mappings
" ==Preferences
" ==Syntastic
" ==RenameFile
" ==Vundle
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'}
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-eunuch'
Plugin 'thoughtbot/vim-rspec'
Plugin 'lervag/vim-latex'
" ==Syntax Highlighting
Bundle 'kchmck/vim-coffee-script'
Bundle 'slim-template/vim-slim.git'
" ==Color schemes
Bundle 'https://github.com/jpo/vim-railscasts-theme.git'
Bundle 'https://github.com/tmhedberg/matchit'
" 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
" ==RSpec.vim mappings
map <Leader>c :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
let g:rspec_runner = "os_x_iterm"
" ==Preferences
set number
set ruler
set tabstop=2
set shiftwidth=2
set expandtab
syntax on
" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
map // :nohlsearch<CR>
set cursorline
" Opens an edit command with the path of the currently edited file filled in
" Normal mode: <Leader>e
map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
colorscheme railscasts
set backupdir=~/.vim/tmp
set directory=~/.vim/tmp
" ==RenameFile
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" RENAME CURRENT FILE (thanks Gary Bernhardt) modified to use gitmove
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! RenameFile()
let old_name = expand('%')
let new_name = input('New file name: ', expand('%'), 'file')
if new_name != '' && new_name != old_name
exec ':Gmove ' . new_name
endif
endfunction
map <leader>n :c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment