IdeaVim: Append output of an external command in Rubymine

Answered

In Vim, running `:0read !date` inserts the current date on the current line.

Is there anyway we can make this work in idea vim ?

 

0
3 comments
Avatar
Permanently deleted user
Official comment

In IdeaVim `:read` is not supported yet. You can achieve the same results by selecting the current line in the visual mode and then invoking `!date`:

 

Say your caret is on the second line before `bar`:

 

foo

<caret>bar

 

You press `V` followed by `:!date` followed by <Enter>.

I want to create a keymap that inserts the current date.

Based on Andrey's reply, I added this line to my .ideavimrc:

> nmap _s V=:!date<CR>

But when I execute the mapping by typing "_s", IdeaVim does not insert the date as expected, instead it displays the date at the bottom of the editor window. I tried many different variations of the nmap command, but I did not find one that would insert the date.

Is defining a key mapping that inserts the current date/time possible?

0

Hi, you can achieve this by removing `=` from your keymap: `nmap _s V:!date<CR>`.

0

Please sign in to leave a comment.