Questions tagged [execute]
The execute tag has no usage guidance.
14
questions
2
votes
1
answer
102
views
Using the WSL terminal with Neovim
I have Neovim installed on Windows. I use WSL for running Python and C code. So I'd like to map a key to get Neovim to run a shell command in WSL directly from the Neovim editor. But I seem to be ...
0
votes
1
answer
37
views
How to run command using :norm?
Why does :norm :echo hi echo hi ? How can I do something like that?
I would like to :.,.+4norm :m5<cr>J
0
votes
1
answer
54
views
How do I use variables with the delete command? (i.e., how to expand/reference variables for command arguments?)
I'm using variables for line numbers, and I want to delete a range of lines using these variables. How do I do that?
let x = 5
let y = 20
" I want to delete the range of lines from x ...
2
votes
0
answers
59
views
How do I concatenate these strings? [closed]
I have two string variables:
let url = "https://URL/path/to/repo"
let branch = "GIT-HASH"
I want to concatentate them and echo it on the shell:
let result = url . branch
exec '!...
2
votes
1
answer
143
views
How can I have <C-E> and <C-Y>'s normal mode functionalities also work in insert mode?
Once I've asked a general question about special characters, but I've not really pulled anything out of it.
So now I'm asking a very specific question.
I want to have Ctrl+e and Ctrl+y behave in ...
2
votes
1
answer
180
views
How to :edit executable from path?
Environment: Linux
I apologize in advance if this question already exists somewhere and has a proper answer.
It is just so difficult for me to search because the keywords are all so generic.
Put ...
1
vote
1
answer
407
views
Special characters, escaped special characters, escape sequences, and terminal codes
I refer to those 4 terms using terminology picked up by various sources:
Steve Losh, in his Learn Vimscript the Hard Way's chapter 16 refers to things like <cr> (these 4 characters typed in a ...
0
votes
1
answer
47
views
Weird behavior when execute and echo are used together
So I was doing some testing on some function I made, let's call it Test_mode,
"let g:Test_mode = 0 " commented to show that it works without defining it first
function! Test_mode()
if g:...
1
vote
2
answers
582
views
How to `source` a path stored in a variable in Vimscript
tldr: The title pretty much summarizes the entirety of the question
I am trying to make my configuration more adaptable to different machines so that I can use git to keep them in sync between my ...
6
votes
2
answers
128
views
Advice on the use of :exe "norm!" vs. built in functions when writing vimscipt and plugins
I've been using vim for about 3 years and am starting to write my first
plugin. I've noticed when
looking at the code of other popular plugins that the functions very rarely
seem to achieve their aim ...
0
votes
0
answers
127
views
vim execute not working in script
I am using a plugin that expands the word template by a template but only if the word template is followed by a tab. I am trying to write the word new then in insert mode jump to the end of the line ...
2
votes
0
answers
64
views
Make Lightspeed work with Repmo
I'm trying to make the EasyMotion-like (cursor jumping) Lightspeed plugin work with Repmo which repeats a previous motion.
So far, (and after many hours), I've come up with the following:
let g:...
1
vote
1
answer
87
views
execute normal command does not work as expected
I have this line in the buffer:
* [X] determine how to add annotations #a475c217
I want to change it to this line:
* [X] determine how to add annotations ==ANN== #a475c217
So I run this command ...
0
votes
0
answers
110
views
Vim :redir + :execute prepends the executed command and blank lines to the output
I have the following function and command, which is supposed to save the output of a command to a scratch buffer:
function! ScratchCapture(cmd) abort
echo a:cmd
" Run and capture output in l:...