Breaking vimrc apart into individual settings files in vim/plugin/settings
This commit is contained in:
5
vim/plugin/settings/NERDtree.vim
Normal file
5
vim/plugin/settings/NERDtree.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
" Make nerdtree look nice
|
||||
let NERDTreeMinimalUI = 1
|
||||
let NERDTreeDirArrows = 1
|
||||
let g:NERDTreeWinSize = 30
|
||||
|
||||
4
vim/plugin/settings/README.md
Normal file
4
vim/plugin/settings/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
This directory contains settings for various vim plugins and vim itself.
|
||||
|
||||
For cleanliness, each plugin's overrides/settings should be put into a
|
||||
separate file.
|
||||
19
vim/plugin/settings/Tlist.vim
Normal file
19
vim/plugin/settings/Tlist.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" set up automatic ctags
|
||||
let Tlist_Ctags_Cmd='/opt/local/bin/ctags'
|
||||
|
||||
" taglist defaults
|
||||
let Tlist_Auto_Highlight_Tag=0
|
||||
let Tlist_Auto_Open=0
|
||||
let Tlist_Compact_Format = 1
|
||||
let Tlist_Exist_OnlyWindow = 1
|
||||
let Tlist_WinWidth = 40
|
||||
let Tlist_GainFocus_On_ToggleOpen = 1
|
||||
let Tlist_Show_Menu = 1
|
||||
let Tlist_Use_Right_Window = 1
|
||||
let Tlist_Use_Horiz_Window = 0
|
||||
let Tlist_Close_On_Select = 1
|
||||
let Tlist_Show_One_File = 1
|
||||
let Tlist_Enable_Fold_Column = 0
|
||||
let Tlist_Display_Prototype = 0
|
||||
let Tlist_Use_SingleClick = 1
|
||||
|
||||
3
vim/plugin/settings/autotag.vim
Normal file
3
vim/plugin/settings/autotag.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
" AutoTag
|
||||
" Seems to have problems with some vim files
|
||||
let g:autotagExcludeSuffixes="tml.xml.text.txt.vim"
|
||||
8
vim/plugin/settings/command-t.vim
Normal file
8
vim/plugin/settings/command-t.vim
Normal file
@@ -0,0 +1,8 @@
|
||||
let g:CommandTMaxHeight = 5
|
||||
let g:CommandTMatchWindowReverse = 1
|
||||
|
||||
" Command-T
|
||||
" Mapped to ,t
|
||||
nmap ,t :CommandT<CR>
|
||||
nmap ,T :CommandTBuffer<CR>
|
||||
|
||||
11
vim/plugin/settings/conqueterm.vim
Normal file
11
vim/plugin/settings/conqueterm.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
" Run the current file in a ConqueTerm, great for ruby tests
|
||||
let g:ConqueTerm_InsertOnEnter = 0
|
||||
let g:ConqueTerm_CWInsert = 1
|
||||
let g:ConqueTerm_Color = 2
|
||||
|
||||
" Open up a variety of commands in the ConqueTerm
|
||||
nmap <silent> <Leader>cc :execute 'ConqueTermSplit script/console --irb=pry'<CR>
|
||||
nmap <silent> <Leader>pp :execute 'ConqueTermSplit pry'<CR>
|
||||
nmap <silent> <Leader>bb :execute 'ConqueTermSplit /bin/bash --login'<CR>
|
||||
|
||||
let g:ConqueTerm_SendVisKey = '<Leader>e'
|
||||
14
vim/plugin/settings/easymotion.vim
Normal file
14
vim/plugin/settings/easymotion.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" This remaps easymotion to show us only the left
|
||||
" hand home row keys as navigation options which
|
||||
" may mean more typing to get to a particular spot
|
||||
" but it'll all be isolated to one area of the keyboard
|
||||
call EasyMotion#InitOptions({
|
||||
\ 'leader_key' : '<Leader><Leader>'
|
||||
\ , 'keys' : 'fjdkslewio'
|
||||
\ , 'do_shade' : 1
|
||||
\ , 'do_mapping' : 1
|
||||
\ , 'grouping' : 1
|
||||
\
|
||||
\ , 'hl_group_target' : 'Question'
|
||||
\ , 'hl_group_shade' : 'EasyMotionShade'
|
||||
\ })
|
||||
4
vim/plugin/settings/fugitive.git
Normal file
4
vim/plugin/settings/fugitive.git
Normal file
@@ -0,0 +1,4 @@
|
||||
" fugitive.git
|
||||
" ========================================
|
||||
" For fugitive.git, dp means :diffput. Define dg to mean :diffget
|
||||
nnoremap <silent> dg :diffget<CR>
|
||||
6
vim/plugin/settings/guioptions.vim
Normal file
6
vim/plugin/settings/guioptions.vim
Normal file
@@ -0,0 +1,6 @@
|
||||
" Disable the scrollbars (NERDTree)
|
||||
set guioptions-=r
|
||||
set guioptions-=L
|
||||
|
||||
" Disable the macvim toolbar
|
||||
set guioptions-=T
|
||||
10
vim/plugin/settings/lusty-juggler.vim
Normal file
10
vim/plugin/settings/lusty-juggler.vim
Normal file
@@ -0,0 +1,10 @@
|
||||
" LustyJuggler
|
||||
" ========================================
|
||||
" better triggers for buffer switching
|
||||
" B to use the a/s/d/f juggler, S to search the buffers
|
||||
nmap <silent> B \lj
|
||||
nmap <silent> S \lb
|
||||
|
||||
let g:LustyJugglerSuppressRubyWarning = 1
|
||||
let g:LustyJugglerAltTabMode = 1
|
||||
let g:LustyJugglerShowKeys = 'a' " show a/s/d/f keys
|
||||
9
vim/plugin/settings/neocomplcache.vim
Normal file
9
vim/plugin/settings/neocomplcache.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
" neocomplcache
|
||||
" A beter autocomplete system!
|
||||
let g:neocomplcache_enable_at_startup = 1
|
||||
let g:neocomplcache_enable_camel_case_completion = 1
|
||||
let g:neocomplcache_enable_underbar_completion = 1
|
||||
let g:neocomplcache_min_syntax_length = 5
|
||||
|
||||
" Choose completions using Apple-Space
|
||||
inoremap <expr><D-Space> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||
2
vim/plugin/settings/showmarks.vim
Normal file
2
vim/plugin/settings/showmarks.vim
Normal file
@@ -0,0 +1,2 @@
|
||||
" Tell showmarks to not include the various brace marks (),{}, etc
|
||||
let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY"
|
||||
120
vim/plugin/settings/skwp-keymap.vim
Normal file
120
vim/plugin/settings/skwp-keymap.vim
Normal file
@@ -0,0 +1,120 @@
|
||||
" ========================================
|
||||
" General vim sanity improvements
|
||||
" ========================================
|
||||
"
|
||||
" alias yw to yank the entire word even if the
|
||||
" cursor is inside the word
|
||||
nnoremap yw yaw
|
||||
|
||||
" ========================================
|
||||
" RSI Prevention - keyboard remaps
|
||||
" ========================================
|
||||
" Certain things we do every day as programmers stress
|
||||
" out our hands. For example, typing underscores and
|
||||
" dashes are very common, and in position that require
|
||||
" a lot of hand movement. Vim to the rescue
|
||||
"
|
||||
" Now using the middle finger of either hand you can type
|
||||
" underscores with apple-k or apple-d, and add Shift
|
||||
" to type dashes
|
||||
imap <silent> <D-k> _
|
||||
imap <silent> <D-d> _
|
||||
imap <silent> <D-K> -
|
||||
imap <silent> <D-D> -
|
||||
|
||||
" alias W to write the file instead of :w
|
||||
nnoremap W :w<CR>
|
||||
|
||||
" Don't have to use Shift to get into command mode, just hit semicolon
|
||||
nnoremap ; :
|
||||
|
||||
" move up/down quickly by using Ctrl-j, Ctrl-k
|
||||
" which will move us around by functions
|
||||
nnoremap <silent> <C-j> }
|
||||
nnoremap <silent> <C-k> {
|
||||
|
||||
" Open the project tree and expose current file in the nerdtree with Ctrl-\
|
||||
nnoremap <silent> <C-\> :NERDTreeFind<CR>
|
||||
|
||||
" Command-/ to toggle comments
|
||||
map <D-/> :TComment<CR>
|
||||
imap <D-/> <Esc>:TComment<CR>i
|
||||
|
||||
"open up a git grep line, with a quote started for the search
|
||||
nnoremap ,gg :GitGrep "
|
||||
nnoremap ,gcp :GitGrepCurrentPartial<CR>
|
||||
|
||||
" hit F to find the definition of the current class
|
||||
" this uses ctags. the standard way to get this is Ctrl-]
|
||||
nnoremap <silent> F <C-]>
|
||||
|
||||
"toggle between last two buffers with Z (normally ctrl-shift-6)
|
||||
nnoremap <silent> Z <C-^>
|
||||
|
||||
"git grep the current word using K (mnemonic Kurrent)
|
||||
nnoremap <silent> K :GitGrep <cword><CR>
|
||||
|
||||
" Move between split windows by using the four directions H, L, I, N
|
||||
" (note that I use I and N instead of J and K because J already does
|
||||
" line joins and K is mapped to GitGrep the current word
|
||||
nnoremap <silent> H <C-w>h
|
||||
nnoremap <silent> L <C-w>l
|
||||
nnoremap <silent> I <C-w>k
|
||||
nnoremap <silent> M <C-w>j
|
||||
|
||||
" Create window splits easier. The default
|
||||
" way is Ctrl-w,v and Ctrl-w,s. I remap
|
||||
" this to vv and ss
|
||||
nnoremap <silent> vv <C-w>v
|
||||
nnoremap <silent> ss <C-w>s
|
||||
|
||||
" Remap Q to close a window
|
||||
nnoremap <silent> Q <C-w>c
|
||||
|
||||
" Use \Q to kill the buffer entirely
|
||||
nnoremap <silent> <Leader>Q :bw<CR>
|
||||
|
||||
"open the taglist (method browser) using \t
|
||||
nnoremap <silent> <Leader>t :TlistToggle<CR>
|
||||
|
||||
" create <%= foo %> erb tags using Ctrl-k in edit mode
|
||||
imap <silent> <C-K> <%= %><Esc>3hi
|
||||
|
||||
" create <%= foo %> erb tags using Ctrl-j in edit mode
|
||||
imap <silent> <C-J> <% %><Esc>2hi
|
||||
|
||||
" ============================
|
||||
" Shortcuts for everyday tasks
|
||||
" ============================
|
||||
|
||||
" copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename
|
||||
" this is helpful to paste someone the path you're looking at
|
||||
nnoremap <silent> cf :let @* = expand("%:p")<CR>
|
||||
|
||||
"Clear current search highlight by double tapping //
|
||||
nmap <silent> // :nohlsearch<CR>
|
||||
|
||||
" (C)opy (c)ommand - which allows us to execute
|
||||
" the line we're looking at (it does so by yy-copy, colon
|
||||
" to get to the command mode, C-f to get to history editing
|
||||
" p to paste it, C-c to return to command mode, and CR to execute
|
||||
nmap <silent> Cc yy:<C-f>p<C-c><CR>
|
||||
|
||||
" Type ,hl to toggle highlighting on/off, and show current value.
|
||||
noremap ,hl :set hlsearch! hlsearch?<CR>
|
||||
|
||||
" Apple-* Highlight all occurrences of current word (like '*' but without moving)
|
||||
" http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches
|
||||
nnoremap <D-*> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
|
||||
|
||||
" After repeating a command, return the cursor to where it started
|
||||
" http://vim.wikia.com/wiki/VimTip1142
|
||||
nmap . .`[
|
||||
|
||||
" These are very similar keys. Typing 'a will jump to the line in the current
|
||||
" file marked with ma. However, `a will jump to the line and column marked
|
||||
" with ma. It’s more useful in any case I can imagine, but it’s located way
|
||||
" off in the corner of the keyboard. The best way to handle this is just to
|
||||
" swap them: http://items.sjbach.com/319/configuring-vim-right
|
||||
nnoremap ' `
|
||||
nnoremap ` '
|
||||
10
vim/plugin/settings/solarized.vim
Normal file
10
vim/plugin/settings/solarized.vim
Normal file
@@ -0,0 +1,10 @@
|
||||
" Some color remaps
|
||||
" If statements and def statements should look similar
|
||||
" so you can see the flow
|
||||
hi! link rubyDefine rubyControl
|
||||
|
||||
" Colors to make LustyJuggler more usable
|
||||
" the Question color in LustyJuggler is mapped to
|
||||
" the currently selected buffer.
|
||||
hi clear Question
|
||||
hi! Question guifg=yellow
|
||||
29
vim/plugin/settings/statusline.vim
Normal file
29
vim/plugin/settings/statusline.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
"statusline setup
|
||||
set statusline+=%#warningmsg#
|
||||
set statusline+=%{SyntasticStatuslineFlag()}
|
||||
set statusline+=%*
|
||||
set statusline=%#warningmsg#
|
||||
set statusline+=%f
|
||||
set statusline+=%{fugitive#statusline()}
|
||||
set statusline+=%m "modified flag
|
||||
|
||||
"display a warning if &paste is set
|
||||
set statusline+=%#error#
|
||||
set statusline+=%{&paste?'[paste]':''}
|
||||
set statusline+=%*
|
||||
set statusline+=%= "left/right separator
|
||||
set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight
|
||||
set statusline+=%c: "cursor column
|
||||
set statusline+=%l/%L "cursor line/total lines
|
||||
"set statusline+=\ %P "percent through file
|
||||
set laststatus=2
|
||||
|
||||
"return the syntax highlight group under the cursor ''
|
||||
function! StatuslineCurrentHighlight()
|
||||
let name = synIDattr(synID(line('.'),col('.'),1),'name')
|
||||
if name == ''
|
||||
return ''
|
||||
else
|
||||
return '[' . name . ']'
|
||||
endif
|
||||
endfunction
|
||||
8
vim/plugin/settings/syntastic.vim
Normal file
8
vim/plugin/settings/syntastic.vim
Normal file
@@ -0,0 +1,8 @@
|
||||
"mark syntax errors with :signs
|
||||
let g:syntastic_enable_signs=1
|
||||
"automatically jump to the error when saving the file
|
||||
let g:syntastic_auto_jump=1
|
||||
"show the error list automatically
|
||||
let g:syntastic_auto_loc_list=1
|
||||
"don't care about warnings
|
||||
let g:syntastic_quiet_warnings=1
|
||||
8
vim/plugin/settings/tComment.vim
Normal file
8
vim/plugin/settings/tComment.vim
Normal file
@@ -0,0 +1,8 @@
|
||||
" tComment
|
||||
" ========================================
|
||||
" extensions for tComment plugin. Normally
|
||||
" tComment maps 'gcc' to comment current line
|
||||
" this adds 'gcp' comment current paragraph (block)
|
||||
" using tComment's built in <c-_>p mapping
|
||||
nmap <silent> gcp <c-_>p
|
||||
|
||||
3
vim/plugin/settings/vim-ruby-conque.vim
Normal file
3
vim/plugin/settings/vim-ruby-conque.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
" Default to rspec 1. If you want
|
||||
" rspec 2, set this to 'rspec'
|
||||
let g:ruby_conque_rspec_command='spec'
|
||||
Reference in New Issue
Block a user