I use VimNotes and I often launch Vim and type
Vim likes many other programs, such as Bash or Python, it has
If you run Vim in server mode like me, you will need to use
I won't use these, at least not for opening my note. I may set up an shell alias, but a key map in Vim is a better option. However, there may have some chances that you really need to run Vim commands in this way.
:Note NoteName
, just for editing the same note. I could map a special key for it, but this repeating process got me thinking if I could run a Vim command when bringing up Vim.Vim likes many other programs, such as Bash or Python, it has
-c
option. So I can simply do the following:vim -c 'Note NoteName'or
vim +Note\ NoteNameThat does it. You can supply up to 10 commands. The commands will be executed after (first) file is loaded, if you tell Vim to open a file or files. Also, another
--cmd
is available but it is executed before vimrc
.If you run Vim in server mode like me, you will need to use
--remote-send
:vim --servername SERVERNAME --remote-send ':Note NoteName<CR>'It is basically emulating your key-presses, so you may need to modify it accordingly. There is also a
--remote-expr
, you might find it interesting.I won't use these, at least not for opening my note. I may set up an shell alias, but a key map in Vim is a better option. However, there may have some chances that you really need to run Vim commands in this way.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.