-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.local
89 lines (73 loc) · 2.4 KB
/
vimrc.local
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
" Avoid lugin ale conflicts
let g:ale_emit_conflict_warnings = 0
set shell=zsh\ -l
set background=light
" Plug 'christoomey/vim-tmux-runner'
nnoremap <leader>vo :VtrOpenRunner<cr>
nnoremap <leader>va :VtrAttachToPane<cr>
nnoremap <leader>fr :VtrFocusRunner<cr>
nnoremap <leader>sf :VtrSendFile<cr>
nnoremap <leader>q :VtrSendCommandToRunner q<cr>
" set mouse=a
set relativenumber
" let g:instant_markdown_slow = 1
" Search
set hlsearch
set ignorecase
set smartcase
nmap <leader>h :nohlsearch<cr>
" vim-tmux script"
nnoremap <leader>vo :VtrOpenRunner<cr>
nnoremap <leader>va :VtrAttachToPane<cr>
nnoremap <leader>fr :VtrFocusRunner<cr>
nnoremap <leader>q :VtrSendCommandToRunner q<cr>
" Indenting whole file
map <Leader>i mmgg=G`m
" Paste with proper indentation
map <Leader>p :set paste<CR><esc>"*]p:set nopaste<cr>
" Rails.vim
map <Leader>m :Rmodel
map <Leader>sm :RSmodel
map <Leader>sv :RSview
map <Leader>vc :Vcontroller<cr>
map <Leader>vm :Vmodel
map <Leader>vv :Vview<cr>
vmap <Leader>b :<C-U>!git blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR>
"Mapping in Other Modes
imap jk <esc>
imap kj <esc>
imap jj <esc>
" C-z to save
map <C-z> <esc>:w<cr>
imap <C-z> <esc>:w<cr>
" C-q to save and quit
imap <C-q> <esc>:wq<cr>
" Quick PluginStall
nmap <Leader>bi :source ~/.vimrc<cr>:PlugInstall<cr>
" Pre-populate a split command with the current directory
nmap <leader>v :vnew <C-r>=escape(expand("%:p:h"), ' ') . '/'<cr>
" Edit your vimrc in a new tab
nmap <leader>vi :tabedit ~/.vimrc<cr>
" Copy the entire buffer into the system register
map <Leader>co mmggVG"*y`m
" Edit the db/schema.rb Rails file in a split
nmap <leader>sc :split db/schema.rb<cr>
" Move up and down by visible lines if current line is wrapped
nmap j gj
nmap k gk
" Command aliases for typoed commands (accidentally holding shift too long)
command! Q q " Bind :Q to :q
command! Qall qall
command! QA qall
command! E e
" Source (reload) your vimrc. Type space, s, o in sequence to trigger
nmap <leader>so :source $MYVIMRC<cr>
" automatically rebalance windows on vim resize
autocmd VimResized * :wincmd =
" Split edit your vimrc. Type space, v, r in sequence to trigger
nmap <leader>vr :sp $MYVIMRC<cr>
" " Source (reload) your vimrc. Type space, s, o in sequence to trigger
nmap <leader>so :source $MYVIMRC<cr>
" zoom a vim pane, <C-w>= to re-balance
nnoremap <leader>- :wincmd _<cr>:wincmd \|<cr>
nnoremap <leader>= :wincmd =<cr>