0

Typing gvim note_$(date +%F).md in terminal, opens a file in gvim that has today's date in the title. When I try to bind a keyboard shortcut to the same command, gvim throws an error message:

"note_$(date" [New File]
Error detected while processing command line:
E492: Not an editor command: ).md
Press ENTER or type command to continue

The file title reads note_$(date (~). I have tried with backticks and expr, but I receive the same error. I am on Gnome3 and trying to create the shortcut via Keyboard >> Shortcuts >> Custom Shortcuts.

How should I go about getting the keyboard shortcut command to work the same way as when typed directly in the terminal?

0

I just figured out that the command runs fine if I put it in a script and then just assign a keyboard shortcut to the script. So in /path/to/file:

#!/bin/bash
gvim note_$(date +%F).md

Make the script executable (chmod +x /path/to/file), and in the 'command'-field for the shortcut, just put path/to/file.

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.