From 35575755ef0cfa49dbb73aade4b6e4f550dcdde5 Mon Sep 17 00:00:00 2001 From: bretello Date: Tue, 16 Jan 2024 11:52:12 +0100 Subject: [PATCH] vim: improve Man command display --- vim/functions.vim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vim/functions.vim b/vim/functions.vim index 52891a9..b418941 100644 --- a/vim/functions.vim +++ b/vim/functions.vim @@ -129,13 +129,12 @@ command! -nargs=1 -complete=command -bar -range Redir silent call Redir( function! Man(cmd) vnew let w:scratch=1 - setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile filetype=man - setlocal nonumber norelativenumber - let output = system('man ' . a:cmd) + setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile filetype=man nonumber norelativenumber + let output = system('env COLUMNS=80 man ' . a:cmd) call setline(1, split(output, '\n')) endfunction -command! -nargs=1 -complete=shellcmd Man silent call Man() +command! -nargs=1 -complete=shellcmd Vert Man silent call Man() " Execute the given command and print it in a scratch buffer function! Cmd(cmd)