New answers tagged

0

I think building on your logic @dedowsdi one could then do argdo if &modified | earlier | endif I can see how one could have several wrapper functions written around this, that's great!


2

I use argdo in this answer, same rule applies to bufdo, windo , ... . Don't use argdo undo argdo undo failes in these conditions: Some buffers remain unchanged after last argdo, might caused by 0 pattern match, execute undo on them is a mistake, it will undo changes made by older argdo. An error occurs during your last argdo, when an error occurs, argdo ...


1

You can use v:shell_error to test whether the external command succeeded or failed. Typically a non-zero result means the command failed. In that case, you can use :q! to exit the Ex script with the file unmodified. Or, perhaps better, use the :cq! command to have Ex/Vim exit with a non-zero exit code, so your script calling Ex can also detect that ...


0

As a workaround, I am now using the shell builtin type alfa before the Vim call.


1

As a vim user, I appreciate the speed of using normal mode keys to move around the text. I prefer using h and l to left arrow and right arrow so my hands do not need to move to reach those keys. When I use other computer keyboards, arrow keys move, but normal mode keys still at their expected place. When I type :%s/oldtext/newtext/gc to make a search and ...


Top 50 recent answers are included