/
dot_vimrc.after
98 lines (72 loc) · 2.59 KB
/
dot_vimrc.after
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
" Basic Settings -------------------- {{{
"allow hidden buffers which does stuff like preserve undo history
set hidden
"More history
set history=1000
"set up bash-style tab-completion
set wildmode=list:longest
"purty colors
set background=dark
"colorscheme solarized
"setup folding for vim files
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
" Some shortcuts -------------------- {{{
" * scroll up and down 10 lines at a time
noremap <C-K> 10k
noremap <C-J> 10j
"Window shortcuts
map <leader>v :vsp<CR>
map <leader>s :sp<CR>
" }}}
" Some Functions -------------------- {{{
"Remove whitespace from end of lines
function! Preserve(command)
" Preparation - save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
map <leader>$ :call Preserve("%s/\\s\\+$//e")<CR>
" }}}
" Plugin customizations -------------------- {{{
" buffergator is <M-F>
call janus#add_mapping("buffergator", "nnoremap", "ƒ", ":BuffergatorToggle<CR>")
call janus#add_mapping("buffergator", "nnoremap", "<M-F>", ":BuffergatorToggle<CR>")
" ctrlp prefix is <C-P>
" Note: <C-P><C-P> is set in vimrc.before
call janus#add_mapping("ctrlp", "nnoremap", "<C-P><C-B>", ":CtrlPBuffer<CR>")
" gundo is <M-G>
call janus#add_mapping("gundo", "nnoremap", "©", ":GundoToggle<CR>")
call janus#add_mapping("gundo", "nnoremap", "<M-G>", ":GundoToggle<CR>")
" nerdtree prefix is <M-R>
call janus#add_mapping("nerdtree", "nnoremap", "®®", ":NERDTreeToggle<CR>")
call janus#add_mapping("nerdtree", "nnoremap", "<M-R><M-R>", ":NERDTreeToggle<CR>")
call janus#add_mapping("nerdtree", "nnoremap", "®ƒ", ":NERDTreeFind<CR>")
call janus#add_mapping("nerdtree", "nnoremap", "<M-R><M-F>", ":NERDTreeFind<CR>")
unmap <leader>n
" tagbar is <M-A>
call janus#add_mapping("tagbar", "nnoremap", "å", ":TagbarToggle<CR>")
call janus#add_mapping("tagbar", "nnoremap", "<M-A>", ":TagbarToggle<CR>")
" zoomwin is <C-W><C-M> to be beside the other window commands (See :help
" CTRL-W)
call janus#add_mapping("zoomwin", "nnoremap", "<C-W><C-M>", ":ZoomWin<CR>")
" }}}
" Language settings -------------------- {{{
"setup markdown filetype using my naming convention
:autocmd BufNewFile,BufRead *.md.txt set filetype=markdown
"Configure Rails to not build tags for java
let g:rails_ctags_arguments='--languages=-javascript --languages=-java --exclude=vendor'
"golang plugins
if exists("$GOROOT")
set runtimepath+=$GOROOT/misc/vim
endif
" }}}