I know that you can print the changelist by running :changes. Is there a way to get this information in vimscript? Even by parsing the print somehow?
Asked
Active
Viewed 212 times
3
Steve Vermeulen
- 567
- 4
- 14
2 Answers
4
You can use the :redir command to redirect command-line output to a register, a file, or a variable. To capture the output of :changes in register a, execute the following.
:set nomore
:redir @a
:changes
:redir END
:set more
See
:help :redir
:help 'more'
garyjohn
- 34,610
- 8
- 97
- 89
2
You can capture the raw output of any Ex command with :redir:
redir => mychanges
changes
redir END
mychanges is a string that you manipulate like any other string.
romainl
- 22,554
- 2
- 49
- 59