vimrc: Make Terminal-spawning helpers and mappings
On Mac systems with MacPorts-installed Bash and Vim, the :ter[minal] command doesn't pick up /etc/bashrc (aka /private/etc/bashrc) in my login shell (Bash installed via MacPorts), so I've created helpers to make it easier to spawn terminals. These helpers and their stubby siblings for non-Mac platforms are mapped to F1 and Shift+F1, respectively. I figure if I *really* need :help, I can just type :help. It isn't hard. Usually I trigger the :help <F1> mapping by mistake anyways. Note: ~~~~~ The helpers aren't perfect (you have to close the buffer manually after Bash exits).
This commit is contained in:
parent
0a2dbe713c
commit
52978bca4c
1 changed files with 21 additions and 4 deletions
25
.vimrc
25
.vimrc
|
|
@ -209,11 +209,28 @@ if has("autocmd")
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Mac-specific stuffs
|
||||||
|
if has('macunix')
|
||||||
|
" Hacks for MacPorts Bash to actually work.
|
||||||
|
function! Terminal()
|
||||||
|
execute 'ter bash --rcfile /etc/bashrc -i'
|
||||||
|
endfunction
|
||||||
|
function! VertTerminal()
|
||||||
|
execute 'vert ter bash --rcfile /etc/bashrc -i'
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! Terminal()
|
||||||
|
execute 'ter'
|
||||||
|
endfunction
|
||||||
|
function! VertTerminal()
|
||||||
|
execute 'vert ter'
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
" Super special mappings
|
" Super special mappings
|
||||||
" map <F5> :w!<cr>:!perl %<cr>
|
map <F1> :call Terminal()<cr>
|
||||||
" map <F6> :w!<cr>:!python %<cr>
|
map <S-F1> :call VertTerminal()<cr>
|
||||||
" map <F7> :w!<cr>:!bash %<cr>
|
map <F2> :!git grep -n '<cword>' $(git rev-parse --show-toplevel)<cr>
|
||||||
map <F2> :!git blame %<cr>
|
map <F3> :!git blame %<cr>
|
||||||
map <F5> :w!<cr>:!xelatex %<cr>
|
map <F5> :w!<cr>:!xelatex %<cr>
|
||||||
map <F9> :w!<cr>:!md-previewer %<cr>
|
map <F9> :w!<cr>:!md-previewer %<cr>
|
||||||
map <F12> :mksession!<cr>
|
map <F12> :mksession!<cr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue