vim-settings/vim/dot_vimrc

210 lines
4.3 KiB
Plaintext
Raw Normal View History

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
" File Nav
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'a.vim'
Bundle 'file-line'
" Needs Vim compiled with Ruby
Bundle 'wincent/Command-T'
Bundle 'tpope/vim-fugitive'
" Buffer Nav
Bundle 'kien/tabman.vim'
Bundle 'sandeepcr529/Buffet.vim'
" Needs Vim compiled with Ruby
Bundle 'mutewinter/LustyJuggler'
" Nav in file
Bundle 'taglist.vim'
" Text Manipulation
Bundle 'tomtom/tcomment_vim'
" GUI
Bundle 'vividchalk.vim'
Bundle 'gregsexton/MatchTag'
2012-04-24 14:09:19 +00:00
"Allow arrow keys
set nocompatible
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-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-07-02 17:25:36 +00:00
"Set backup dirs
set backup
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
2012-04-24 14:09:19 +00:00
2012-06-02 01:47:40 +00:00
"set theme
try
colorscheme vividchalk
catch /^Vim\%((\a\+)\)\=:E185/
" deal with it
endtry
2012-04-24 14:09:19 +00:00
"Highlights the line the cursor is on
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkred guibg=darkred guifg=white
"Toggle highlighting with \hr (highlight row)
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>
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>
nmap <leader>lw :set wrap!<CR>
2012-03-29 03:18:33 +00:00
"Allows filetype detection
filetype on
"editing multiple files
"Ctrl+j maximizes split below
"Ctrl+k maximizes split above
"allows size 0 splits
"map <C-J> <C-W>j<C-W>_
"map <C-K> <C-W>k<C-W>_
"set wmh=0
2012-04-24 14:09:19 +00:00
"Move between splits using Ctrl+hjkl
2012-03-29 03:18:33 +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
" map Shift+U to redo
map <S-u> <C-r>
" Buffet shortcut
nnoremap <silent> <F2> :Bufferlist<CR>
2012-07-02 17:25:36 +00:00
"LustyJugler settings
let g:LustyJugglerShowKeys=1 "Show numbers for Lusty Buffers
let g:LustyJugglerSuppressRubyWarning=1
"NERDTree
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-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
"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
nmap <silent> <leader>/ :nohlsearch<CR>
" 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>
else
nnoremap <silent><M-t> :CommandT<CR>
endif
" Leader Commands
nnoremap <leader>t :CommandT<CR>
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
" Always use CtrlP for most recently used files and relative dierctory.
if has('unix')
nnoremap <silent><C-u> :CtrlPCurFile<CR>
else
nnoremap <silent><M-u> :CtrlPCurFile<CR>
endif
" Also map leader commands
nnoremap <leader>u :CtrlPCurFile<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR>
nnoremap <leader>b :CtrlPBuffer<CR>