I’ve been trying to create a command for Brett Terpstra’s Marked app. Unfortunately I can’t get it to work. On the Marked Bonus Pack page is an example for a Vim mapping and Marked, but I’d prefer to type :Marked to open the current file in Marked.
How am I going to do that? Adding:
command! Marked :silent open -a Marked.app '%:p'<cr>
to .vimrc doesn’t work. (Without silent Vim gives a “file does not exist” error upon execution.)
Thanks for any help guys.
Andreas
%is not expanded in command. You need to use expand instead. (see:help expand)Something like that
I don’t think you need the
:(in front ofsilent) neither the<cr>. You are defining a command not a mapping, so you don’t need to enter in command mode.