Skip to main content
Share Your Experience: Take the 2024 Developer Survey
3 votes

Is there a vimscript command equivalent to ya"?

While it seems to solve your immediate problem with replicating ya", the function in your self-answer is short-sighted for several reasons: It uses characters as delimiters so it can only be ...
romainl's user avatar
  • 41.1k
2 votes

How to make an user-defined command that is repeatable with . operator

A few things first… You should probably add the range argument to your function definition. With it, the function is only called once. Without it, the function will be called once for every line in ...
romainl's user avatar
  • 41.1k
1 vote
Accepted

Provide bash vars or at least develop ~ through let variable

I would use the expand() function. It expands environment variables (expand('$HOME/.pyenv): let lspServers = [#{ name: 'pylsp', \ filetype: 'python', \ path: ...
Vivian De Smedt's user avatar
1 vote

Select current Line from normal mode without changing cursor position AND without selecting the new line character at the end

As mentioned in another answer, visually selecting text generally moves the cursor to one end of the selected area, because moving the cursor is the mechanism by which the boundaries of the visual ...
romainl's user avatar
  • 41.1k
1 vote
Accepted

Setting "g:jedi#use_tabs_not_buffers" option in lazy.nvim in lua

This is a guess, but the # in g:jedi#use_tabs_not_buffers typically indicates an autoload variable (see :help autoload). That likely suggests that using neovim's Lua tables like vim.g.jedi = { ...
D. Ben Knoble's user avatar
  • 26.4k
1 vote

Is there a vimscript command equivalent to ya"?

Here is a possible function that returns the text surrounded by a user-specified character: def GetSurroundedText(char: string) var prev_char_y_pos = searchpos(char, 'bnW')[1] var ...
Barzi2001's user avatar
  • 606
1 vote

Problem using the edit command in a function defined in vimrc

The root cause of the error is that some time ago, thinking I was clever, I created an "after" script for my file-type. In this "after" script I sourced my vimrc. For anyone who ...
efru's user avatar
  • 13
1 vote
Accepted

Problem using the edit command in a function defined in vimrc

Beside the XY Problem-ness of your question, I think that the main problem we have with it is that your function is fine as-is and there is no obvious reason for it to have the effect that you ...
romainl's user avatar
  • 41.1k
1 vote

Problem using the edit command in a function defined in vimrc

If your goal is to replace short commands with longer commands in the file you're just editing, the solution is to use abbreviations, as commented by romainl. In that case, do something like :iabbrev ...
Friedrich's user avatar
  • 2,125

Only top scored, non community-wiki answers of a minimum length are eligible