Re: capture to file output of :set all?

60 views
Skip to first unread message

Salman Halim

unread,
Nov 17, 2012, 6:35:08 PM11/17/12
to vim...@googlegroups.com


On Saturday, November 17, 2012, Erik wrote:
I'm trying to troubleshoot why vim is behaving differently on different systems, and it would be really handy if i could dump all the settings to a text file for comparison. What's the recommended way of doing that? Or, alternatively, how can i see these settings from the command prompt without invoking vi?

Thanks,
e.l.

:help :redir

You can redirect output of all subsequent commands into a file, variable or register. 

Don't forget :redir END at the end to turn it off.  

Salman


--
سلمان حلیم

Erik

unread,
Nov 17, 2012, 7:12:34 PM11/17/12
to vim...@googlegroups.com
Thanks, but:
:help :redir
E433: No tags file
E149: Sorry, no help for :redir

# yum install vim-common

:help :redir
E434: Can't find tag pattern

Found help here:
http://vim.wikia.com/wiki/Capture_ex_command_output

Then got:
E475: Invalid argument: @a

Tried the alternate route in the Comments of the article but ultimately did not get the desired result in any discernible form. There was output about line counts but that was all.

Perhaps my shell/vi environment has been cocked up in some obscure way? I wouldn't rule that out.
If not, I believe this has departed significantly from the realm of "easy to do".

Not fun, but much quicker to do several mouse sweeps and copies and pastes from the terminal window. Result achieved. Moving on.

John Beckett

unread,
Nov 17, 2012, 7:38:53 PM11/17/12
to vim...@googlegroups.com
Erik wrote:
> Thanks, but:
> :help :redir
> E433: No tags file
> E149: Sorry, no help for :redir

If your help was working, you could use:
:help :helptags
to see:
To rebuild the help tags in the runtime directory
(requires write permission there):
:helptags $VIMRUNTIME/doc

> Found help here:
> http://vim.wikia.com/wiki/Capture_ex_command_output
>
> Then got:
> E475: Invalid argument: @a

If the following (from the tip) fails, I guess your Vim is
broken:
:redir @a
:set all
:redir END

What does :version show (just the version number and patches
would be a start)?

John

Ben Fritz

unread,
Nov 17, 2012, 8:25:45 PM11/17/12
to vim...@googlegroups.com
On Saturday, November 17, 2012 3:22:06 PM UTC-6, Erik wrote:
> I'm trying to troubleshoot why vim is behaving differently on different systems, and it would be really handy if i could dump all the settings to a text file for comparison. What's the recommended way of doing that? Or, alternatively, how can i see these settings from the command prompt without invoking vi?
>
> Thanks,
> e.l.

In addition to suggestions in getting :redir working, you may get something of value from the :mkvimrc command.

Erik

unread,
Nov 19, 2012, 10:30:41 PM11/19/12
to vim...@googlegroups.com
This is quite bizarre. Seems like pretty much any command I enter (including :mkvimrc) does nothing. Instead of getting output or the intended effect on the text, the command just stays visible. I did have a .vimrc file with some settings; removed it for troubleshooting but it made no difference. What setting might disable the execution of commands? This is happening on CentOS 5.4 and CentOS 6.3; i have a BSD system and an Ubuntu system where it is not happening and the same commands execute fine.

Ben Fritz

unread,
Nov 19, 2012, 10:48:10 PM11/19/12
to vim...@googlegroups.com
On Monday, November 19, 2012 9:30:41 PM UTC-6, Erik wrote:
> This is quite bizarre. Seems like pretty much any command I enter (including :mkvimrc) does nothing. Instead of getting output or the intended effect on the text, the command just stays visible. I did have a .vimrc file with some settings; removed it for troubleshooting but it made no difference. What setting might disable the execution of commands? This is happening on CentOS 5.4 and CentOS 6.3; i have a BSD system and an Ubuntu system where it is not happening and the same commands execute fine.

No setting will do this. You probably have a tiny Vim. Or a different program that is not Vim at all. As John asked, what is the output of your :version command? Version number and patches and feature set (HUGE/BIG/NORMAL/SMALL/TINY) should do it.

Reply all
Reply to author
Forward
0 new messages