28,265 questions
1
vote
3
answers
94
views
Copy lines that match a pattern within a range in nvim
Assume I have the following text, and I want to use nvim to extract only the lines that contain z_image:
README.md
14 kB
Update README.md
12 days ago
z_image_turbo-Q3_K.gguf
4.12 GB
Intial Commit
12 ...
0
votes
2
answers
65
views
replacing multiple lines in nvim based on an array
If I have the following content
head = cfg["head"]
head = cfg["head"]
head ...
2
votes
1
answer
58
views
Escaping a backslash in a parser definition returns two backslashes / Ctrl-] over a keyword inserts backslashes where there shouldn't be
*Write setlocal iskeyword+=[,],^ in your markdown ftplugin file to reproduce this problem
I'm trying to create tags for my markdown endnotes in vim, so that jumping to them from the text is easier. An ...
Best practices
1
vote
4
replies
136
views
Open Vim with text in it, without saving the file
I want to write a script which ends by calling my text editor (vim) on a specific file path. The file doesn't yet exist, and I want the editor window to already have some contents in it. In particular,...
5
votes
1
answer
73
views
How to ignore keywords when rewrapping text in Vim?
Is there an option I can set in Vim and Neovim to force the gq motion to wrap text strictly at 80 characters, without addings hanging indents after lines that begin with common programming keywords ...
Advice
1
vote
1
replies
76
views
In vim how can I redo the last command, including those done by key-map
What do I want:
I set "<leader>gd" as the key to "go to definition"
vim.keymap.set("n", "<leader>gd", ":Lspsaga goto_definition<Enter>&...
Advice
0
votes
3
replies
92
views
Vim 9.1 & Python Virtual Env
I'm writing vim-script(s) that utilizes vim's embedded Python environment. One of these requires the Python Environment to utilize a virtual environment. Ideally for this application, vim would ...
2
votes
2
answers
131
views
Non-repeating patterns
I am trying to find lines where pattern does not repeat its value.
I have a CSV file like this:
2025-10-20;71149;WZ/OPM/04757/12/2023;-220.83;7622100598299;-1;1027144
2025-10-20;81142;WZ/OPM/04993/08/...
0
votes
0
answers
101
views
RecursionError in YouCompleteMe for Python Docs in VIm
I am trying to use YouCompleteMe in Vim for getting python documentation (using YcmCompleter GetDoc and the vim pop up menu). This works well for normal python commands, but there seems to be various ...
0
votes
1
answer
98
views
jj + vim: make syntax coloring for describe messages work like commit messages
I have vim configured as my editor when using jj.
When using git commit I have some vim extensions to provide colored output and some sane max-length defaults.
Here is my .vimrc
filetype plugin on
...
2
votes
2
answers
81
views
How can I figure out why vim is suddenly running an external binary when I press `gq` to reflow a comment?
I'm used to being able to do the following in vim to reflow a comment:
Use V to enter visual line selection mode.
Select the lines containing the comment.
Press gq to reflow the comment.
This has ...
1
vote
1
answer
82
views
In vim, how to search the contents of :highlight (*NOT* hlsearch) [duplicate]
When I type :highlight, I get a buffer like:
:highlight
SpecialKey xxx term=bold ctermfg=188 guifg=#dcdfe4
EndOfBuffer xxx links to NonText
NonText xxx term=bold ctermfg=239 guifg=#...
-1
votes
1
answer
67
views
Suppress latex warnings in vim-latex for package robust-externalize [closed]
I use vim-latex to edit LaTeX files. When compiling, usual warnings are suppressed.
If I use the package robust-externalize, they are not: I get a couple of (useless) windows, one of which says
/usr/...
-3
votes
1
answer
157
views
Can `jq` be forced` to take slightly malformed JSON body? [closed]
I like using :!pbpaste | jq to see my JSON objects when reading logs in vim.
But it often throws the following error with the slightest inconvenience in the JSON body.
jq: parse error: Invalid numeric ...
0
votes
0
answers
70
views
Odd indentation with vim, cindent, and nested parentheses
I want to indent some code with cindent and cino=(0,m1. When I have parentheses inside the argument list of a function call I get some extra indentation:
foo();
bar( // <--- normal ...