diff options
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 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |