Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [command]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
53 views

Is it possible to have vim run a command every time save `:w` is invoked?

I am editting typescript now, and I'd like to be able to have it so, whenever :w is invoked, the shell runs tsc compiling my new save. This beats having to !tsc every time. Does something like this ...
0
votes
1answer
39 views

How can I alias a command with arguments?

All I want to do is to change :vertical resize + arguments into :vr + arguments. for example change: :vertical resize +60 <CR> into: :vr +60 <CR> From other answers Aliasing a command ...
1
vote
1answer
34 views

How to pass everything from a command into a function with escaped characters

These are my scenarios and expected output function! s:Foo(text) echoerr "'" . a:text . "'" endfunction command ... FooCommand ... (not sure what to write here) FooCommand text 'text' ...
0
votes
1answer
26 views

How to use variables in a user defined command? [duplicate]

I have this user defined command: command! PS silent! w | PlugSnapshot! ~/.vim/plugins/plugins.lock How could I change it to take the filepath from a variable, something like this: let ...
0
votes
1answer
26 views

Print Command Without Hitting Enter

Suppose I map a key to enter a command in the command buffer, but without hitting enter: function! BuildSystemTask() if inProject() "generic function that checks if I am in a buildable project ...
0
votes
1answer
44 views

Are there any performance difference between :edit and :buffer on existing unchanged buffer?

I used to believe that :buffer file is faster than :edit file if file is an existing unchanged buffer. I even created a tiny function for this: function! myvim#open(file) abort let nr = bufnr(a:...
2
votes
2answers
98 views

creating a “:KeepCursor” command

I'd like to make a command that works like this: :KeepCursor {cmd} will the given execute ex command string, then restore the cursor's position. A primary example is: :KeepCursor normal! * which ...