I want to use massren renamer in vim in order to rename files within the texteditor.

First, I used this command within Vim to set Vim as default editor for massren

:! c:\tools\massren_renamer\massren.exe --config editor "C:\Progra~2\Vim\vim74\gvim.exe --remote-silent-tab"

Then I tried to change a number of text files with this command within Vim:

:%! c:\tools\massren_renamer\massren.exe d:\t*.txt

but the list of files doesn't open at all in Vim. What did I wrong?

  • Why are you trying to use that tool from Vim? – romainl Jun 2 '14 at 15:03
  • I never use the shell command in windows. Another reason why I would like to do it from within Vim is that massren use vim also to rename the name of the files. – Reman Jun 2 '14 at 15:06

Disclaimer: I don't know / use the tool, but I'd like to highlight some general problems.

First, don't make this overly complex when troubleshooting. When the massren tool doesn't launch Vim as the editor, you should troubleshoot from the command-line, not by invoking the tool from within Vim.

Second, that tool (like any tool) needs to know when you are done editing the file list. Usually that is done by launching the editor in blocking mode, and just waiting until the editor is closed (this is easiest to implement). However, GVIM doesn't work like that, it returns immediately ("forks"), fooling the tool. With --remote-silent-tab, this may even reuse an existing GVIM process, not spawn a new one at all.

Therefore, drop the --remote-silent-tab and replace it with -f:

-f GUI: Do not disconnect from the program that started Vim. 'f' stands for "foreground". If omitted, the GUI forks a new process and exits the current one. "-f" should be used when gvim is started by a program that will wait for the edit session to finish (e.g., mail or readnews). If you want gvim never to fork, include 'f' in 'guioptions' in your |gvimrc|.

If that still doesn't make the massren launch Vim, check how massren handles the editor launch; it might not support arguments (just a full process filespec), which you then need to workaround with a batch wrapper, and configure that for massren.

| improve this answer | |
  • Thanks for answering. Massren support arguments. I changed --remote-silent-tab to -f. It now opens one more vim window. When I rename the files in this window, close this window, I have to hit enter in windows shell window in order to apply the changes. – Reman Jun 2 '14 at 16:08
  • Ah great! What you describe is what I had expected. Do you have that hit-enter only when launching Massren from within Vim? The :! command often has that behavior. – Ingo Karkat Jun 3 '14 at 5:58
  • Yes. When I launch Massren from dos shell I do not have to hit-enter. (I just have to close the shell window because it stays open). – Reman Jun 3 '14 at 7:15
  • I just noted that Massren doesn't handle extended ascii characters :( – Reman Jun 4 '14 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.