Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [execute]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Make vim.execute function dot repeatable

I made the following keybinding to substitute "a/b" with "\frac{a}{b}". -- convert / to \frac{}{} -- (dot repeatable) _G.div_to_latex = function() vim.cmd('execute "normal f/...
robertspierre's user avatar
0 votes
1 answer
27 views

Using the return of a user defined function in an :execute statement

I am trying to get the output of the following function to an :execute statement such as I have this in my .vimrc def GetBufAbsPath(): string return substitute(expand("%:p"), '[^\/]\+$', ...
freddie_ventura's user avatar
2 votes
1 answer
441 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 ...
vvenk's user avatar
  • 33
0 votes
1 answer
68 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
minseong's user avatar
  • 2,333
0 votes
1 answer
64 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 ...
Rob Bednark's user avatar
2 votes
0 answers
65 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 '!...
Jin's user avatar
  • 185
2 votes
1 answer
191 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 ...
Enlico's user avatar
  • 2,214
2 votes
1 answer
193 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 ...
Josh Thies's user avatar
1 vote
1 answer
685 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 ...
Enlico's user avatar
  • 2,214
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:...
Nordine Lotfi's user avatar
2 votes
2 answers
746 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 ...
Riley Hughes's user avatar
6 votes
2 answers
149 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 ...
mattb's user avatar
  • 1,141
0 votes
0 answers
140 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 ...
MrEngineer13's user avatar
2 votes
0 answers
67 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:...
Tom Hale's user avatar
  • 2,691
1 vote
1 answer
113 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 ...
StevieD's user avatar
  • 1,492
0 votes
0 answers
117 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:...
shadowtalker's user avatar