aboutsummaryrefslogtreecommitdiffhomepage
path: root/vimrc
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-03-12 17:47:06 +0800
committertypebrook <typebrook@gmail.com>2019-03-12 17:47:06 +0800
commit2fddc277815b8e09ef80279d94578735481ec435 (patch)
treee73ad022e895cd6b6c41cc571c0ff51b6653d2e4 /vimrc
parentc738efc6a2022eff8cd9367dafe653f02bb0db4e (diff)
update
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc35
1 files changed, 34 insertions, 1 deletions
diff --git a/vimrc b/vimrc
index 78ce6ac..8d7a82a 100644
--- a/vimrc
+++ b/vimrc
@@ -13,9 +13,42 @@ set siso=999
13let g:vim_markdown_conceal = 0 13let g:vim_markdown_conceal = 0
14 14
15nmap <c-c> :q<cr> 15nmap <c-c> :q<cr>
16nnoremap <leader>r :.w !bash<cr> 16nnoremap <leader>t :.w !bash<cr>
17nnoremap <leader>tt :TableFormat<cr> 17nnoremap <leader>tt :TableFormat<cr>
18 18
19let g:vim_markdown_folding_disabled = 1
20source ~/.vim_runtime/vimrcs/redir.vim
21
22"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
23" => Redirect the output of a Vim or external command into a scratch buffer
24"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
25" Copy from : https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7
26" Usage:
27" :Redir hi ............. show the full output of command ':hi' in a scratch window
28" :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window
29"
30function! Redir(cmd)
31 for win in range(1, winnr('$'))
32 if getwinvar(win, 'scratch')
33 execute win . 'windo close'
34 endif
35 endfor
36 if a:cmd =~ '^!'
37 let output = system(matchstr(a:cmd, '^!\zs.*'))
38 else
39 redir => output
40 execute a:cmd
41 redir END
42 endif
43 vnew
44 let w:scratch = 1
45 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
46 call setline(1, split(output, "\n"))
47endfunction
48
49command! -nargs=1 -complete=command Redir silent call Redir(<q-args>)
50nnoremap <leader>r :Redir
51
19 52
20""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 53"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
21" => Make Alt key works on Gnome terminal 54" => Make Alt key works on Gnome terminal