diff options
author | Hsieh Chin Fan <typebrook@gmail.com> | 2021-07-05 10:30:24 +0800 |
---|---|---|
committer | Hsieh Chin Fan <typebrook@gmail.com> | 2021-07-05 10:30:24 +0800 |
commit | 1dbe682f99d170236ca9b04ae68c9a082ab80d60 (patch) | |
tree | 4c6b406c1e336bce06dcf3dc4cb43143478d975f /vimrc | |
parent | f3050ed46a1813b30a0d29e8a5397e1243f20e62 (diff) |
update
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -107,6 +107,31 @@ autocmd FileType json setlocal foldmethod=syntax | |||
107 | " Apply new SniptMat Parser | 107 | " Apply new SniptMat Parser |
108 | let g:snipMate = { 'snippet_version' : 1 } | 108 | let g:snipMate = { 'snippet_version' : 1 } |
109 | 109 | ||
110 | " Redirection with buffer | ||
111 | " Usage: | ||
112 | " :Redir hi ............. show the full output of command ':hi' in a scratch window | ||
113 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window | ||
114 | function! Redir(cmd) | ||
115 | for win in range(1, winnr('$')) | ||
116 | if getwinvar(win, 'scratch') | ||
117 | execute win . 'windo close' | ||
118 | endif | ||
119 | endfor | ||
120 | if a:cmd =~ '^!' | ||
121 | let output = system(matchstr(a:cmd, '^!\zs.*')) | ||
122 | else | ||
123 | redir => output | ||
124 | execute a:cmd | ||
125 | redir END | ||
126 | endif | ||
127 | vnew | ||
128 | let w:scratch = 1 | ||
129 | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile | ||
130 | call setline(1, split(output, "\n")) | ||
131 | endfunction | ||
132 | |||
133 | command! -nargs=1 -complete=command Redir silent call Redir(<q-args>) | ||
134 | |||
110 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 135 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
111 | " => Settings for Vimwiki | 136 | " => Settings for Vimwiki |
112 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 137 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |