Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to clear message history in gVIM?

Tags:

vim

In gVIM i use echomsg command to output debug messages from my scripts (for debug purpose) and messages command to view them. All works fine, but vim messanging facility displays all messages - from all scripts, system, notifications etc. Is it some way to clear messages list (manually before i perform action i want to debug) so i can easily see messages from my script? Or maybe some filter i can use to view only my messages?

like image 858
grigoryvp Avatar asked Dec 25 '11 11:12

grigoryvp


People also ask

How do I clear the history in Vim?

The history is persisted in the viminfo file; you can configure what (and how many of them) is persisted via the 'viminfo' (and 'history') options. You can clear the history via the histdel () function, e.g. for searches: You can even delete just certain history ranges or matching lines.

How do you delete DM history in D&D?

1 First, you have to take the cursor of your mouse on the DM history option. You will find the option on the right side of the window. ... 2 Then, you have to click on it. 3 Now, you have to select the Delete option from the menu. 4 Finally, you will get a confirming message that you are sure to delete the item. ...

Is it possible to view iMessage history?

Is it Possible to View iMessage History? Yes, you can view your iMessage history with the search bar in the Messages app. If your iPhone is set to never delete messages, all old iMessages will be saved on the device and you can view them at any time you want.

Do I need a viminfo file for command history?

If I've understood your question right -- you want command history to persist when you exit Vim and restart it, and that isn't happening at present -- then what you need is a viminfo file. What puzzles me is that I thought Vim used one by default, and saved command history in it by default. What OS are you on?


2 Answers

as of vim 7.4.1735 you can do :messages clear to clear the history.

like image 120
Christian Brabandt Avatar answered Oct 03 '22 15:10

Christian Brabandt


AFAIK you can’t clear message history, but you can use your own command instead of :echom, for example:

command -nargs=1 -bar Echo :let g:messages=get(g:, 'messages', [])+[<q-args>]

or, maybe better,

command -nargs=1 -bar Echo :let g:messages=get(g:, 'messages', [])+[eval(<args>)] | echom <args>

First one is not evaluating its argument and thus cannot be a replacement of :echom, second is, but note that while with :echom :echom 1 2 and :echom 1.' '.2 produces the same output, with :Echo first will be an error forcing you to use the second form.

Both commands will put messages into g:messages variable, creating it if necessary. To clear history simply use

unlet g:messages
like image 21
ZyX Avatar answered Oct 03 '22 14:10

ZyX