2012-07-02 17:25:36 +00:00
|
|
|
" Vundle
|
|
|
|
filetype off " required!
|
|
|
|
|
|
|
|
set rtp+=~/.vim/bundle/vundle/
|
|
|
|
call vundle#rc()
|
|
|
|
|
|
|
|
" let Vundle manage Vundle
|
|
|
|
" required!
|
|
|
|
Bundle 'gmarik/vundle'
|
|
|
|
|
|
|
|
" Rest of my bundles
|
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- File Nav --
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'kien/ctrlp.vim'
|
|
|
|
Bundle 'scrooloose/nerdtree'
|
2013-01-09 00:28:07 +00:00
|
|
|
Bundle 'ViViDboarder/a.vim'
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'file-line'
|
2012-07-02 19:26:56 +00:00
|
|
|
Bundle 'tpope/vim-fugitive'
|
2012-07-02 17:25:36 +00:00
|
|
|
" Needs Vim compiled with Ruby
|
2013-01-07 17:36:30 +00:00
|
|
|
Bundle 'wincent/Command-T'
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- Buffer Nav --
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'kien/tabman.vim'
|
|
|
|
Bundle 'sandeepcr529/Buffet.vim'
|
|
|
|
" Needs Vim compiled with Ruby
|
|
|
|
Bundle 'mutewinter/LustyJuggler'
|
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- Nav in file --
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'taglist.vim'
|
2013-01-23 19:33:05 +00:00
|
|
|
" Syntax checking
|
|
|
|
Bundle 'scrooloose/syntastic'
|
|
|
|
" Project Searching
|
|
|
|
Bundle 'mileszs/ack.vim'
|
|
|
|
" Easy Toggle of QuickFix window
|
|
|
|
Bundle 'sunaku/QFixToggle'
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- Text Manipulation --
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'tomtom/tcomment_vim'
|
2013-01-08 20:51:22 +00:00
|
|
|
" Surround for wrapping text
|
|
|
|
Bundle 'tpope/vim-surround'
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- GUI --
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'vividchalk.vim'
|
2013-01-07 17:36:30 +00:00
|
|
|
" Can probably drop this for wombat256
|
|
|
|
Bundle 'vim-scripts/Wombat'
|
|
|
|
Bundle 'wombat256.vim'
|
2012-07-02 17:25:36 +00:00
|
|
|
Bundle 'gregsexton/MatchTag'
|
2013-01-08 20:51:22 +00:00
|
|
|
" Custom Status Line
|
|
|
|
Bundle 'Lokaltog/vim-powerline'
|
|
|
|
"Powerline Config
|
|
|
|
"If using a patched font: https://github.com/Lokaltog/vim-powerline/wiki/Patched-fonts
|
|
|
|
"let g:Powerline_symbols = 'fancy'
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2013-01-08 20:51:22 +00:00
|
|
|
" -- Filetypes --
|
2012-12-13 16:07:02 +00:00
|
|
|
Bundle 'ViViDboarder/vim-forcedotcom'
|
2013-01-08 20:51:22 +00:00
|
|
|
Bundle 'pdurbin/vim-tsv'
|
2012-10-15 19:18:14 +00:00
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
"Allow arrow keys
|
|
|
|
set nocompatible
|
|
|
|
|
2012-07-02 19:26:56 +00:00
|
|
|
"Use more convenient leader
|
|
|
|
let mapleader=","
|
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
"Enable mouse input
|
|
|
|
set mousehide
|
|
|
|
set mouse=a
|
|
|
|
|
2012-03-29 03:18:33 +00:00
|
|
|
"tab functionality
|
|
|
|
"tabs inserted as 4 spaces
|
|
|
|
"backspace deletes all spaces
|
|
|
|
"autoindent enabled
|
|
|
|
set expandtab
|
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set softtabstop=4
|
|
|
|
set autoindent
|
2012-07-31 15:54:33 +00:00
|
|
|
"Ensure backspace actually works
|
|
|
|
set backspace=2
|
2012-07-02 17:25:36 +00:00
|
|
|
filetype plugin indent on
|
2012-03-29 03:18:33 +00:00
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
set virtualedit=onemore " allow for cursor beyond last character
|
|
|
|
set scrolljump=5 " lines to scroll when cursor leaves screen
|
|
|
|
set scrolloff=3 " minimum lines to keep above and below cursor
|
|
|
|
|
2012-12-10 19:29:24 +00:00
|
|
|
" Display filename at bottom of window
|
|
|
|
set ls=2
|
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
"Set backup dirs
|
|
|
|
set backup
|
|
|
|
set backupdir=~/.vim/backup
|
|
|
|
set directory=~/.vim/tmp
|
|
|
|
|
2012-06-02 01:47:40 +00:00
|
|
|
"set theme
|
2012-07-02 17:37:30 +00:00
|
|
|
try
|
2013-01-02 17:12:41 +00:00
|
|
|
if !empty($VIM_COLOR)
|
|
|
|
colorscheme $VIM_COLOR
|
|
|
|
else
|
|
|
|
if has("gui_running")
|
|
|
|
colorscheme wombat
|
|
|
|
else
|
|
|
|
colorscheme vividchalk
|
|
|
|
endif
|
|
|
|
endif
|
2012-07-02 17:37:30 +00:00
|
|
|
catch /^Vim\%((\a\+)\)\=:E185/
|
2013-01-02 17:12:41 +00:00
|
|
|
" Colorschemes not installed yet
|
|
|
|
" This happens when first installing bundles
|
2012-07-02 17:37:30 +00:00
|
|
|
endtry
|
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
"Highlights the line the cursor is on
|
|
|
|
set cursorline
|
2012-06-01 19:49:20 +00:00
|
|
|
:hi CursorLine cterm=NONE ctermbg=darkred guibg=darkred guifg=white
|
|
|
|
"Toggle highlighting with \hr (highlight row)
|
2013-01-02 17:12:41 +00:00
|
|
|
nnoremap <leader>hr :set cursorline!<CR>
|
2012-04-24 14:09:19 +00:00
|
|
|
|
2012-03-29 03:18:33 +00:00
|
|
|
"enable line numbers
|
|
|
|
set nu
|
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
"Toggle Line numbers with Ctrl+N double tap
|
|
|
|
nmap <C-N><C-N> :set invnumber<CR>
|
2012-06-01 19:49:20 +00:00
|
|
|
nmap <leader>ln :set invnumber<CR>
|
2012-04-24 14:09:19 +00:00
|
|
|
|
|
|
|
"Toggle line wrap with Ctrl+L double tap
|
|
|
|
nmap <C-L><C-L> :set wrap!<CR>
|
2012-06-01 19:49:20 +00:00
|
|
|
nmap <leader>lw :set wrap!<CR>
|
2012-03-29 03:18:33 +00:00
|
|
|
|
|
|
|
"Allows filetype detection
|
|
|
|
filetype on
|
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
"Move between splits using Ctrl+hjkl
|
2013-01-02 17:11:26 +00:00
|
|
|
"map <C-k> <C-w>k
|
|
|
|
"map <C-j> <C-w>j
|
|
|
|
"map <C-l> <C-w>l
|
|
|
|
"map <C-h> <C-w>h
|
2012-03-29 03:18:33 +00:00
|
|
|
|
2012-07-02 19:26:56 +00:00
|
|
|
"map Shift+U to redo
|
2012-07-03 19:40:13 +00:00
|
|
|
nnoremap <S-u> <C-r>
|
2012-06-01 19:49:20 +00:00
|
|
|
|
2012-07-02 19:49:56 +00:00
|
|
|
"Buffet shortcut
|
2012-06-01 19:49:20 +00:00
|
|
|
nnoremap <silent> <F2> :Bufferlist<CR>
|
|
|
|
|
2012-07-02 19:49:56 +00:00
|
|
|
"Tab Man shortcut
|
|
|
|
nnoremap <silent> <F3> :TMToggle<CR>
|
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
"LustyJugler settings
|
|
|
|
let g:LustyJugglerShowKeys=1 "Show numbers for Lusty Buffers
|
|
|
|
let g:LustyJugglerSuppressRubyWarning=1
|
2012-10-17 20:26:42 +00:00
|
|
|
nnoremap <silent> <C-L><C-J> :LustyJuggler<CR>
|
|
|
|
nnoremap <leader>. :LustyJugglePrevious<CR>
|
2012-07-02 17:25:36 +00:00
|
|
|
|
|
|
|
"NERDTree
|
2012-07-02 19:49:56 +00:00
|
|
|
nnoremap <silent> <F4> :NERDTreeToggle<CR>
|
2012-07-02 17:25:36 +00:00
|
|
|
nnoremap <leader>nn :NERDTreeToggle<CR>
|
|
|
|
nnoremap <leader>nf :NERDTreeFind<CR>
|
|
|
|
|
2012-04-24 14:09:19 +00:00
|
|
|
"CTags List
|
2012-03-29 03:18:33 +00:00
|
|
|
nnoremap <silent> <F8> :TlistToggle<CR>
|
|
|
|
let Tlist_Exit_OnlyWindow=1
|
|
|
|
let Tlist_Winwidth=30
|
|
|
|
|
|
|
|
"Syntax Hightlighting
|
|
|
|
syntax on
|
|
|
|
|
|
|
|
"Remap jk to esc
|
|
|
|
inoremap jk <esc>
|
2012-10-15 19:18:14 +00:00
|
|
|
"vnoremap jk <esc> "Makes it difficult to select lines as j is common
|
2012-04-24 14:09:19 +00:00
|
|
|
|
|
|
|
"Remap Ctrl+Space for auto Complete
|
|
|
|
inoremap <C-Space> <C-n>
|
|
|
|
inoremap <Nul> <C-n>
|
|
|
|
|
|
|
|
" Stupid shift key fixes
|
2012-06-01 19:49:20 +00:00
|
|
|
"cmap W w
|
2012-07-02 17:25:36 +00:00
|
|
|
cmap WQ<CR> wq<CR>
|
|
|
|
cmap Wq<CR> wq<CR>
|
|
|
|
cmap W<CR> w<CR>
|
|
|
|
cmap Q<CR> q<CR>
|
2012-04-24 14:09:19 +00:00
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
"Enable search highlighting
|
|
|
|
set hls
|
2012-04-24 14:09:19 +00:00
|
|
|
"clearing highlighted search
|
2012-10-17 20:26:42 +00:00
|
|
|
nmap <silent> <leader>/ :set hlsearch! hlsearch?<CR>
|
|
|
|
noremap <C-h><C-s> :set hlsearch! hlsearch?<CR>
|
2012-04-24 14:09:19 +00:00
|
|
|
|
|
|
|
" Change Working Directory to that of the current file
|
|
|
|
cmap cwd lcd %:p:h
|
|
|
|
cmap cd. lcd %:p:h
|
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
" ---------------
|
|
|
|
" Command T and ctrlp.vim
|
|
|
|
" Snagged from mutewinter @ https://github.com/mutewinter/dot_vim
|
|
|
|
" ---------------
|
|
|
|
" Ensure Ctrl-P isn't bound by default
|
|
|
|
let g:ctrlp_map = ''
|
|
|
|
|
|
|
|
" Ensure max height isn't too large. (for performance)
|
|
|
|
let g:ctrlp_max_height = 10
|
|
|
|
let g:CommandTMaxHeight = 10
|
|
|
|
|
|
|
|
" Set the default escape keybinding to, you guessed it, escape.
|
|
|
|
let g:CommandTCancelMap = '<esc>'
|
|
|
|
|
|
|
|
" Dynamically use Command T or ctrlp.vim based on availability of Ruby.
|
|
|
|
" We do this because Command T is much faster than ctrlp.vim.
|
|
|
|
if has('ruby')
|
|
|
|
" --------
|
|
|
|
" Use Command T since we've got Ruby
|
|
|
|
" --------
|
|
|
|
|
|
|
|
" Conditional Mappings
|
|
|
|
if has('unix')
|
|
|
|
nnoremap <silent><C-t> :CommandT<CR>
|
2013-03-12 16:59:36 +00:00
|
|
|
nnoremap <C-r><C-t> :CommandTFlush<CR>
|
2012-07-02 17:25:36 +00:00
|
|
|
else
|
|
|
|
nnoremap <silent><M-t> :CommandT<CR>
|
2013-03-12 16:59:36 +00:00
|
|
|
nnoremap <M-r><M-t> :CommandTFlush<CR>
|
2012-07-02 17:25:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
" Leader Commands
|
|
|
|
nnoremap <leader>t :CommandT<CR>
|
2012-10-17 20:26:42 +00:00
|
|
|
nnoremap <leader>b :CommandTBuffer<CR>
|
2012-07-02 17:25:36 +00:00
|
|
|
else
|
|
|
|
" --------
|
|
|
|
" Use ctrlp.vim since we don't have Ruby
|
|
|
|
" --------
|
|
|
|
|
|
|
|
" Conditional Mappings
|
|
|
|
if has('unix')
|
|
|
|
let g:ctrlp_map = '<C-t>'
|
|
|
|
else
|
|
|
|
let g:ctrlp_map = '<M-t>'
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Leader Commands
|
|
|
|
nnoremap <leader>t :CtrlPRoot<CR>
|
|
|
|
nnoremap <leader>b :CtrlPBuffer<CR>
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Also map leader commands
|
|
|
|
nnoremap <leader>u :CtrlPCurFile<CR>
|
|
|
|
nnoremap <leader>m :CtrlPMRUFiles<CR>
|
2012-10-17 20:26:42 +00:00
|
|
|
|
2012-10-31 13:41:30 +00:00
|
|
|
" Add some shortcuts for git commands
|
|
|
|
nnoremap <leader>gs :Gstatus<CR>
|
|
|
|
nnoremap <leader>gc :Gcommit<CR>
|
|
|
|
nnoremap <leader>gb :Gblame<CR>
|
|
|
|
|
2013-01-23 19:33:05 +00:00
|
|
|
" Bind Make to F5 like other IDEs
|
|
|
|
nnoremap <F5> :make<CR>
|
|
|
|
|
|
|
|
" Toggle QuickFix window
|
|
|
|
nnoremap <silent> <F6> :QFix<CR>
|
|
|
|
|
|
|
|
nmap <leader>a :Ack<Space>
|
|
|
|
nmap <leader>* :Ack<Space><c-r><c-W><CR>
|
|
|
|
"nnoremap ** :Ack<Space><c-r><c-W><CR>
|
|
|
|
|