All Questions
14,173
questions
0
votes
0
answers
21
views
How to apply a specific syntax to a range within a file?
My cypher files are properly highlighted, however I have python files that include large texts of cypher like so
I would like the cypher part to be have the same cypher syntax highlighting like so
I ...
0
votes
0
answers
6
views
Getting Failed to run `config` for nvim-lspconfig error when installing gopls
I'm trying to refresh all my old school vim setup to lsp based ones. As part of this effort I'm going to use lazy.nvim as the plugin manager.
I was able to get everything working until the part where ...
0
votes
0
answers
43
views
How to automatically close a terminal popup window if a python script run in it didn't return any error?
I am wondering if there is a way to automatically close a popup window running a terminal if the execution of the last program didn't report any error and to keep it open if the execution of the last ...
1
vote
3
answers
285
views
How to print yanked data in replace mode?
I want to paste data from clipboard. But instead of insert the data, I want to overwrite (like using R).
0
votes
0
answers
17
views
How to search and replace the highlighted text from visual mode?
What works (normal mode):
Search/highlight the word the cursor is on.
Replace the word the cursor is on.
Note that the word doesn't get erased when I get prompted to replace it, allowing me to make ...
1
vote
2
answers
215
views
Restore auto-loaded file that was lost by accidently undoing edits
I accidentally removed about 1 hour of my work, how to restore? Last week I worked with file.md on my current computer and didn't save it into disk but just put my OS into a sleep mode. Yesterday I ...
0
votes
1
answer
23
views
Can I make tagbar plugin highlighting the function my cursor is on?
I want this highlight appear on the tagbar plugin window.
Can I?
0
votes
1
answer
27
views
Wonder the scope of the output of the vim command :tags
When I invoke :tags command in vim, the result varies depending on vim windows.
So I wonder the scope of the result of the vim command :tags.
I guess it would be one of below:
g: Global
s: Script-...
1
vote
2
answers
79
views
How can I disable the terminal statusline in gVim?
I want to disable the terminal statusline in gVim as it seems quite useless and I usually have the windows at a relatively small size when using gVim, so it takes up too much space.
I've tried quite a ...
1
vote
0
answers
29
views
Is the vim-daily launchpad.net PPA still functioning?
It says on vim PPA manager Jonathon F's launchpad page that:
"This account belonged to a deceased user and has been archived."
(In fact, Jonathon F. died in January of 2023.)
But on the ...
2
votes
3
answers
43
views
Best way to jump to the nth string block?
Given a line like this:
<input class="submit" type="submit" value="update general">
What is the best way to jump directly to the value string block?
Usually I’d ...
0
votes
1
answer
18
views
html id completion
I'm familiar with vim's built in completion, one of the completion methods allow me to autocomplete filepaths.
I am working with a large html project where I need to reference filepaths along with id'...
1
vote
1
answer
35
views
Disable syntax expansion on cursor hover
I use Neovim with Vimwiki for a personal wiki of mine. I frequently use its syntax for changing typeface; for example _ _ for italic and * * for bold.
The syntax is expanded when the cursor is on a ...
1
vote
1
answer
50
views
How to skip a line when using visual block mode?
I want to add cursors to all lines except the third, is that achievable?
1
2
3 👈 skip this line
4
5
0
votes
0
answers
12
views
Setting TextYankPost v:event attributes in lua
I'm trying to fix a bug in a plugin that manually fires "TextYankPost" like:
vim.api.nvim_exec_autocmds("TextYankPost", {})
This does not set v:event.regcontents, which causes ...
0
votes
1
answer
43
views
Automate Enumeration in vi
Note, this question is about vi, not vim or any other clone. I work on AIX (IBMs UNIX) and the (to my knowledge standard-conforming) vi editor.
Quite often I need to enumerate a list of values, like ...
0
votes
0
answers
13
views
How to detach/disable a buffer-update callback in nvim
In vim, we can implement a vim script, which monitors text changes in details, with listener_add(), listener_remove(), listener_flush(). In nvim, nvim_buf_attach() is available to attach a callback. ...
1
vote
1
answer
31
views
How to replace the default python syntax in Neovim without a plugin manager?
As the title, I would like to replace the default python syntax with the more modern one in https://github.com/vim-python/python-syntax.
I managed to do this in Neovim 0.9.4 with the vim-plug plugin ...
0
votes
1
answer
47
views
sloooow startup
sometimes nvim starts really slow. It takes several seconds to startup.
Here is my log created with nvim --startuptime vim.log:
054.603 022.454: init default mappings & autocommands
104.863 011....
1
vote
1
answer
11
views
Insert abbreviation and open completion
I sometimes add abbreviations for local files or projects.
For example having:
PREFIX_FOO
PREFIX_BAR
PREFIX_BAZ
Instead of typing PREFIX_ I map it to something, for example PP or P1, P2, ... etc.
:...
0
votes
0
answers
18
views
Neovim syntax coloring stops working
I'm on a vanilla Debian 12 system using Neovim 0.9.4 in a tmux (3.3a) session with TERM as screen-256color My (n)vim plugins are nerdtree, vim-airline, vim-airline-themes, matchit, linediff, diffchar,...
2
votes
1
answer
60
views
syntax coloring does not work for flex file
I'm using nord theme, it works normally with other kind of files but not flex file
I have syntax on and filetype on
I tried switching colorthing from gruvbox to nord but it still behaving the same.
...
-1
votes
0
answers
35
views
How do I align columns in a CSV file?
I'm using this csv plugin to view my csv file. I use command :67,68ArrangeColumn to align my file, but it does not align well.
The manual mentions a command like :[range]ArrangeColumn[!] [<Row>]...
1
vote
1
answer
65
views
How can I echo a variable and redirect it to a file, register or the clipboard?
I'm using a colour scheme which makes some text unreadable in the vim terminal. Therefore I want to alter g:terminal_ansi_colors.
:echo g:terminal_ansi_colors
This shows me the value of the variable, ...
1
vote
3
answers
100
views
How to swap lines programmatically in file?
Suppose, we have a perl file where we want to swap shebangs located in the first line:
"#!/usr/bin/perl -d" <-> "#!/usr/bin/env perl"
The first one runs the file with ...
1
vote
2
answers
55
views
Unmap error in filetype autocommand
I use a plugin for todo.txt file (https://gitlab.com/dbeniamine/todo.txt-vim).
Because I mapped some d[other_letters] in my .vimrc and there's a \d mapped in the plugin, to avoid delays when I type \d ...
1
vote
1
answer
28
views
How to change color scheme in a csv plug-in?
I learnt from this post that there is a csv plug-in. I tried this plug-in and it indeed arranged the csv file well.
However, the color scheme is horrible on my screen.
Is there anyway that I can ...
0
votes
0
answers
26
views
multibyte characters unicode in neovim status line
I am trying to configure lualine plugin to display unicode of a multibyte character under the cursor. It is works fine for ASCII but not multibyte chars...
Can anyone share a working lua function? ...
0
votes
1
answer
52
views
Add newline after every paragraph in log file in vi editor
I want to add new line after every paragraph in vi editor. How do I do it?
The new line is located by the date and time in this format
2023-11-26 14:14:14
2
votes
1
answer
123
views
Justify text with leading whitespace
To justify text on vim I use :set textwidth=77 and space+v to select and finally gq to justify the text.
This is the result
original:
Most of the command-line options that you can use with GCC are ...
0
votes
0
answers
8
views
How to configure repmo such that it works with ]m and pythonsense?
I would like to jump from method to method in Python. With Vim you can use the ]m combination to jump to the next method and the [m to the previous.
Since the ] is quite awkward to type on a Belgium ...
-1
votes
2
answers
30
views
Set key to toggle full screen in MacVim
I use Vim from bash and I use MacVim as a UI in macOS.
I max out my desktops, and try to keep "1 app per desktop", so MacVim sits into its own desktop. Except that the app starts in full ...
1
vote
1
answer
28
views
Error when trying to set Kanagawa colorscheme
I installed Kanagawa plugin using vim-plug.
When I tried to change the colorscheme with:
:colorscheme kanagawa
I got the following error :
>- Error detected while processing /home/mmip/.local/...
3
votes
1
answer
63
views
Neovim - Search for Digraph
Is there a way to search for Digraphs in Neovim 0.9.1?
My Ideas so far:
For example somehow using the :digraphs command?
In Vim there is for example the :help digraph-table and you can search there ...
1
vote
4
answers
101
views
Vim mapping to make function parameters become multi-line?
I'm looking for a minimal way to convert code that looks like this:
my_function(param1, param2=value2, param4=a_function_call())
into something like:
my_function(
param1,
param2=value2,
...
0
votes
0
answers
12
views
How to set TMUX window using set title option?
In neovim source code title option is set as follows at https://github.com/neovim/neovim/blob/73c7a0d58e6358d35fe2d5a11b3e807a625a0001/src/nvim/tui/tui.c#L1460 :
void tui_set_title(TUIData *tui, ...
2
votes
1
answer
25
views
Setting an option to a string containing control characters
I'm trying to configure Vim to be able to properly determine the background color when run inside GNU Screen. I know I need to set the option t_RB to the string \eP\e]11;?\x03\e\\ (where \e is the ...
0
votes
1
answer
20
views
I cannot detect where is ^M in my .gvimrc
I have the following .gvimrc:
vim9script
# -----------------------------------
# This file is sourced AFTER .vimrc
# -----------------------------------
set mousehide
# Set fonts for gvim
# fontsize ...
0
votes
0
answers
14
views
Copying from current buffer then creating a file and pasting to it in background
There are sometimes when I am trying to copy to my current buffer (y) and pasting to a different buffer(p) however, sometimes I will fat-finger it and press maybe one or more other keys when trying to ...
1
vote
2
answers
42
views
How can I extend syntax highlighting with my own keywords?
I already have syntax highlighting for javascript, but what I'd like to do is extend it with some additional rules.
What I've been trying to start, is using highlight "Prototype" with a cyan ...
2
votes
1
answer
79
views
Avoiding name conflicts in ~/.config/nvim/lua/
I've installed telescope.nvim plugin for NeoVim. Now, I would like to put some configuration code related to this plugin in this file:
~/.config/nvim/lua/telescope.lua
In my init.lua file, I've ...
0
votes
0
answers
47
views
Certain Nerd Fonts does not display properly
On my Mac (M1), I am not able to get the symbols display properly with all Nerd Fonts excepting one
I have installed Nerd Fonts as described in the documentation. Typically I use homebrew or have ...
0
votes
1
answer
47
views
Vim run custom command immediately upon :e
The below mapping takes me to another file.
The problem is that once I have opened the file, the screen is always,
too far up. I adjust that with zt.
How do I implement zt in the destination file ...
0
votes
0
answers
16
views
Neovim suggestion line highlight
I recently updated from neovim v7 to v10 (NVIM v0.10.0-dev-1613+g585eeacb2)
Right after the update, I started having an issue when opening suggestion dropdown - selected line is not highlighted. Same ...
1
vote
2
answers
40
views
Sort list of citations by the year at the end of the key
I've got some text like:
...many papers due to their interpretability and relatively low cost
\footnote{\citealt{
alviPakistanSignLanguage2007,
atzoriNinaproDatabaseResource2015,
...
4
votes
1
answer
191
views
How is filetype tex and plaintex set in vanilla Vim?
I noticed that when I create a .tex from within Vim itself, in a later session that file is detected as plaintex, while already existing files are detected with the tex filetype (note: both of them ...
0
votes
0
answers
30
views
Startup error on neovim 'has_package' attempts to call a nil value
I am trying to use these configurations for neovim, but every time I start the editor I get:
Error detected while processing /home/user/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ......
0
votes
1
answer
38
views
Have Neovim automagically invoke external program on the Neovim-saved file while exiting
I have the following python code stored in my $HOME/bin/email-process
#!/usr/bin/python3
from sys import argv
# open up the email contents file
infile = open(argv[1], 'r')
# read it into an array ...
1
vote
1
answer
52
views
Docker-Compose LSP will not attach to buffer nor automatically start
With the current default configuration of the "docker_compose_language_service" LSP, it will not start, nor attach after being started to the current buffer.
When taking a look at the ...
0
votes
0
answers
33
views
Set default light and dark themes
How can I set the default colorscheme according the current shell light/dark theme?
I thought about using an if..else statement reading the background variable, but on my light theme terminals, ...