All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
1 view

search('map <F\d>.','W') fails to find pattern in my .vimrc

Mostly I invoke my key-mappings with a function key followed by a single character. Finding an unused combination gets tedious, so I'm writing a mapping to list all such combinations in my .vimrc But ...
4 votes
1 answer
373 views

How to set the background color for colored items in the statusline to the background color of the statusline?

I am experimenting with creating a statusline and have opted for coloring different parts of it. The problem is that while the item's foreground color is changed, the background is black and doensn't ...
0 votes
0 answers
24 views

Fix un-linked color groups

I recently had to re-install my OS (which I didn't update in some time prior to that), and after fresh installation (and installation of the latest version of all the tools I'm using) I noticed some ...
2 votes
1 answer
21 views

Check for diff mode while using git mergetool

I am using Neovim v0.10.0 and have the following config for git difftool: [diff] tool = nvimdiff [difftool] prompt = False trustExitCode = true [difftool "nvimdiff"] cmd = ...
0 votes
1 answer
28 views

How do I use tree-sitter to change syntax highlighting for different kinds of identifiers?

I'm using coc-clangd and nvim-treesitter in NeoVim, and I have the following requirements. set the global variable identifiers to bold set the virtual function identifiers to italic set the macro ...
0 votes
1 answer
61 views

How to display a colored file icon in the statusline?

So I was setting up my status line and I wanted a function which gives the icon of current file type. But it has to be in string. provider=function() str="{some icon}" return str end so ...
1 vote
0 answers
36 views

Fully conceal syntax region

Occasionally I embed base64 in markdown like: <figure> <img src="data:image/png;base64,/9j/4AAQ … [snip] " width="100%"> </figure> I have this defined in ...
1 vote
1 answer
470 views

Handle star imports in Python

I'm currently developing a lot with Python. I use projects like pwntools and sometimes I'm contributing to repositories that use star imports in their source code. I know that star imports are not ...
0 votes
1 answer
621 views

How to configure pylsp installed by Mason with lsp-zero for nvim?

I want to disable a specific error/warning - E203. This is my lsp.lua where I tried to add ignore config according to this doc from lsp-zero git local lsp = require("lsp-zero") lsp.preset(&...
3 votes
1 answer
1k views

enable '+python3' failed

I try to compile vim from source. First I do ./configure --with-features=huge \ --enable-multibyte \ --enable-python3interp=yes \ --with-python3-command=/usr/bin/...
1 vote
1 answer
313 views

How can I remove the default digraphs?

I like Vim’s digraph feature but I find the number of default digraphs overwhelming. Is there a way to clear all of these so that the only digraph definitions are the ones that I created myself (e.g. ...
0 votes
1 answer
76 views

Check items of a list

I have this list : let myList1 = ["short-term"] And I want to get this second list with my first : let myList2 = ["short", "term"] using for elem in myList1 let myList2 = [] code ??????...
0 votes
1 answer
93 views

Neovim window rolls up when dividing screen horizontally with tmux

When I'm coding, I like to have neovim window up and command line window down to run my code on the screen. When I save a neovim file and divide the screen into two horizontally using tmux, the neovim ...
0 votes
0 answers
11 views

How to set tailwindCSS.experimental.classRegex in Mason?

I am using Neovim and use mason to configure my LSPs. I want to use Tailwind with Dioxus which means I need to setup "tailwindCSS.experimental.classRegex": ["class: \"(.*)\"&...
1 vote
1 answer
1k views

How to overwrite the conceal background color with line color?

I've started using coc for NeoVim and I've setup a highlight for a line with error using the following: hi CocErrorLine guibg=#ce2c28 However, when the error line has a concealed character, it has a ...
0 votes
1 answer
1k views

How to map a keybind to an already existing keybind provided by plugin

-- commenting single line keymap("n", "<C-/>", "gcc", opts) This is the line in my lua config for keybinds. I am using this plugin for commenting keybinds: use({ ...
3 votes
1 answer
4k views

How to get the Lua version of Neovim?

As title. From nvim -v it only shows about the version of LuaJIT: NVIM v0.7.0-dev+714-g3aff3d634 Build type: Release LuaJIT 2.1.0-beta3
3 votes
0 answers
40 views

How to look up neovim command for existing Vim command?

This is a question about using the help docs. I find Vim's documentation really easy to navigate, I've done it a lot, and there was the user manual to explain the system. But I find neovim's ...
1 vote
1 answer
51 views

Remembering folds across sessions but in Lua

the question is as the title says. I have code that works but not as I expect. For example, I have a fold here. And another one as well. These two folds are from the same file. When I save and quit ...
0 votes
1 answer
612 views

Error using vim.lsp.buf.definition() in any C# classes

The setup I have works fine for tsserver but not the csharp_ls local servers = { 'tsserver', 'csharp_ls' } local on_attach = function(client, bufnr) vim.keymap.set('n', 'gd', ":vsplit | ...
1 vote
1 answer
143 views

Toggling the `spell` option with Lua does not redraw the screen until an additional command is entered

While porting my init.vim to init.lua, I noticed some strange behaviour. In vimscript, one can toggle spell in the following way: noremap <Leader>ss :setlocal spell!<CR> Observe that this ...
1 vote
1 answer
2k views

Neovim augroup and autocommand in lua (relative line numbering)

I'm converting my init.vim into a set of lua config files, called from init.lua I'm trying to convert this from init.vim augroup numbertoggle autocmd! autocmd BufEnter,FocusGained,InsertLeave * ...
2 votes
3 answers
605 views

How can I execute Lua code from a buffer?

I realized that for a very basic lua debugging the most simple way is to write directly the code in the command line (no plugin, no DAP). For example: :lua print(vim.inspect(vim.api.nvim_list_wins())) ...
6 votes
1 answer
5k views

How to change editor mode from lua (or viml)

I know I can get the current mode, via mode(), but is it possible to set the current mode from viml or preferably lua (though I know a vim command/fn can be gotten to via the lua bridge). I know I can ...
2 votes
1 answer
2k views

Vim, lua and ctags

I work a bit on a lua project (not small, but most of the code is not my own), and I'd like to get tags working. Current ctags contains bug, which can be fixed by getting the latest code from svn ...
1 vote
0 answers
41 views

Highlight semicolmns when editting lua files [duplicate]

I program in both C and Lua and therefore sometimes add a semicolmn in my Lua files. This is allowed by the standard, but my company's guidelines forbid semicolmns in lua code. Therefore, I would like ...
2 votes
1 answer
356 views

How to pass custom arguments to the shell invoked by :terminal?

I would like to specify the startup command to run on the :terminal shell. E.g. bash -c ls. The shell can be specified with set shell=bash, but how to specify the arguments? In another use case, I ...
0 votes
1 answer
355 views

Vim syntax line matching mechanism

Can someone explain or link to valid explanation information on the syntax highlighting mechanism. In particular I am having having a hard time understanding how rules are applied. Imagine the ...
0 votes
2 answers
340 views

How to run a callback when an nvim plugin is loaded. Can I tie this back to running a callback when a plugin is required/imported?

I can see in vim how we can: Call function only when the plugin is loaded But I want to: Call function only when the plugin is required
0 votes
1 answer
59 views

Need help to make a by-default `:RunWithFile` of this toggle function

related to this post, How to make a toggle function in .vimrc that toggles multiple configs of almost same type? @BLayer's code func! MapRunCmd() abort if exists("b:rwfcmd1") && ...
0 votes
3 answers
329 views

Is there a built-in method to jump to the next character after a tab character?

I am editing tab-delimited data in a plaintext file (that was originally a spreadsheet) and I'd like to quickly jump forward to the next entry, the character after the next "tab" character. ...
0 votes
1 answer
208 views

(coc.nvim) error: Warning: The 'x' rule requires type information

I'm using coc.nvim for react (typescript) development. I have installed following coc plugins. coc-tslint-plugin coc-tsserver coc-prettier tslint integration is enabled for prettier in coc-settings....
0 votes
1 answer
457 views

NeoVim does not pick up ruby defined by rbenv/asdf

On my clean install macOS Big Sur (with migrated user account), I am having the mentioned problem in (homebrew) NeoVim 0.4 with Neovim gem (0.8.1) using zsh. :ruby puts RUBY_VERSION 2.7.2 :echo ...
1 vote
1 answer
37 views

How do I syntax highlight this comment as if it were Python?

I am currently working on a Python(-like) project which contains code like this: def func(): """ This is a docstring. EXAMPLES:: sage: func() 1 "&...
3 votes
1 answer
99 views

Show sixel images inside Vim terminal

I'm trying to get the img2sixel function to work from a terminal inside of the vim. Outside of vim, the image ("Hey") appears inline as expected and wanted: However, this does not work from ...
0 votes
1 answer
173 views

How to overwrite ftdetect from a plugin loaded with lazy?

I am using ansible.vim I am loading it with lazy: return { 'pearofducks/ansible-vim', } and this is the configuration I have for ansiblels: ["ansiblels"] = function() ...
1 vote
0 answers
30 views

New foldtext syntax highlighting in Neovim 0.10

I really like the new vim.o.foldtext="" functionality that enables syntax highlighting. However, I am unsure how to modify it to show not only the first line of the fold but also the number ...
1 vote
2 answers
879 views

Append inside brackets, quotes, double quotes

I've been using Vim for a few weeks now and I find myself constantly using ci" or ci( to change whats enclosed in "" or (). I do also find myself wanting to append inside of the ...
1 vote
1 answer
91 views

Neovim: with auto-session, how can I restore Neotree's position to where it was before closing Neovim?

I have no idea what I'm doing, When I just have nvim and Auto session setup individually and I quit Neovim, auto session restores a blank window in place of Neotree. I have this snippet in my init.lua ...
1 vote
1 answer
53 views

AutoPairsDelete() noise with vim plugins

I have been a vim user for years... I recently added a lot of plugins (see my ~/.vimrc) and I keep hitting a problem where I type a word (in this case, a string called cisco) and vim a) sees an ...
-1 votes
0 answers
188 views

When I'm in Vi Normal mode my H and L keys do not work [closed]

I am new to using Vi. I'm using a virtual machine. When I'm in Normal mode and pressing l it used to take me to the right and h used to take me to the left. Now when I am in command mode pressing h or ...
0 votes
0 answers
22 views

Sorting numbers, but according to forth column [duplicate]

What do you want to achieve? I have a 2 dimensional arrays of numbers like this: [8, 18, 2, 20, 0] [13, 18, 3, 15, 1] [8, 18, 3, 30, 2] [8, 13, 3, 15, 3] [8, 13, 2, 10, 4] [8, 15, 1, 7, 5] [13, ...
2 votes
1 answer
409 views

Passing arguments function with --argument or -a format

Is it possible to pass arguments to Vimscript functions with the --argument or -a format, similar to arguments in the command line? I am writing a command that submits a job in a remote machine. I ...
0 votes
1 answer
240 views

Is it possible to keep editing the same line when I execute code with !%?

Let's say I have a file with the following bash code: echo "line 1" echo "line 2" echo "line 3" echo "line 4" echo "line 5" echo "line 6" ...
0 votes
1 answer
207 views

set a default value to a command that acccepts two arguments?

I often need to delineate "sections" of source code files using a comment character to create horizontal lines. For example if I wanted to draw such a line in a python file I could do :Hline ...
0 votes
1 answer
171 views

How can I create a command alias for :Ex /path/to/directory

I'm trying to make my life easier by making a shortcut for the following command :Ex /path/to/directory I need to to be able to press :akeyword and execute the command above. The directory needs to ...
1 vote
2 answers
407 views

How to get timezone using strftime command?

I have a custom command for stamping time in my log files. However, I would like that format to match the one of bash command date. For example, I use this command: :command InLog pu=strftime(\"\...
0 votes
1 answer
81 views

How do I send the output of an :r! command to another Vim command?

I would like to edit some text before dumping it into the Vim buffer. I retrieve the content of a webpage with :r! w3m -dump someurl.com. I would like to delete everything in the returned text from ...
1 vote
1 answer
237 views

Advance to next non-blank line only if current line is not blank

I want to tell a command or mapping to advance to the next non-blank line before executing - but to do this only if the current line is not blank. Ultimately, I intend to apply this to a command to ...
1 vote
1 answer
34 views

Apply next non-blankline function as one part of multi-part user-command

Why do I seem to get different results when I apply this function from the Vim command line than when I apply it as part of a user-command? " advance to next non-blank line only if current line ...

15 30 50 per page
1
2 3 4 5
293