Questions tagged [neovim]

A project that seeks to refactor Vim. Use this tag for questions specifically regarding Neovim-only features (i.e. features not found in Vim and other Vi-like editors).

Filter by
Sorted by
Tagged with
1 vote
1 answer
12 views

Aligning variables and comments in vim

I've looked for this since a long time but I can't seem to find anything relating to this. It could be because of my poor searching skills. Whenever the code starts getting long, its obvious that we ...
  • 11
1 vote
0 answers
5 views

Is there a way to get the coordinates of the character that was clicked from a <LeftMouse> bind?

I'm trying to create a plugin that will, when the user clicks the mouse, switch focus to the window the user clicked in without changing the cursor position in that window. To do this, I intend to ...
0 votes
0 answers
24 views

Vim automatically inserts "* " add the start of every new line in css files

If theres a "* " at the start of the previous line Vim automatically inserts a "* " at the start of the next new line. I want Vim to not insert anything. examples: 1|* {margin: 0;} ...
  • 1
0 votes
1 answer
20 views

How can I restore the behavior where h and l stopped at the beginning and end of the line?

After quite some time of using Vim I wanted to switch to NeoVim and set it up with more IDE-like features. So I googled and took the first thing I found (LunarVim/nvim-basic-ide/), thinking I could ...
  • 3
0 votes
1 answer
31 views

How to call a command with remapping in neovim?

Say I have a normal mode mapping on key P, for sure it can be executed in command mode: :lua normal! P Now I want to do this in lua, so I tried: vim.cmd('normal! P') and NeoVim executed it as "...
  • 781
0 votes
0 answers
14 views

Edit history in Neovim

I'd like to edit my command history at ~/.local/share/nvim/shada/main.shada to remove some incorrect commands. I open the file with nvim main.shada, remove the commands in question, and close the file....
1 vote
1 answer
23 views

How can use :grep with range in neovim with ripgrep as external grep program?

I am using ripgrep as external grep program in neovim. Which works when I call :grep 'pattern' in neovim Command Mode. I frequently have to search some strings within a blocked range in long json ...
0 votes
2 answers
48 views

Where is the `o:` variable prefix documented?

I'm aware of :help variable-scope, which describes the following: buffer-variable b: Local to the current buffer. window-variable w: Local to the current window. tabpage-variable t: Local ...
0 votes
0 answers
28 views

Efficiently viewing log files

I have a log file, with each line containing log level {NOT_SET/TRACE,DEBUG,INFO,WARNING,ERROR,CRITICAL}. I would like to have the following functionality: Define custom levels and their priority ...
  • 123
2 votes
1 answer
141 views

What do I need in my ~/.vimrc to make neovim act like vim?

I'd like to be able to use Neovim with my usual Vim configuration by running nvim -u ~/.vimrc. However, Neovim seems to introduce a few changes to the default Vim key bindings, such as Y no longer ...
  • 236
-2 votes
1 answer
56 views

Pre-Migration Risk Assessment - Vim to Neovim (5of8)

(Shared preamble) With my pending adoption of Ubuntu MATE 22.04, I am looking primarily at Neovim, with possible adaptation as SpaceVim/LunarVim. I am comfortable with Vim, but am looking for a ...
-2 votes
1 answer
47 views

Pre-Migration Risk Assessment - Vim to Neovim (2of8) [duplicate]

(Shared preamble) With my pending adoption of Ubuntu MATE 22.04, I am looking primarily at neovim, with possible adaptation as spacevim/lunarvim. I am very comfortable with Vim, but am looking for a ...
-1 votes
0 answers
45 views

Pre-Migration Risk Assessment - Vim to Neovim (1of8)

(Shared preamble) With my pending adoption of Ubuntu MATE 22.04, I am looking primarily at neovim, with possible adaptation as spacevim/lunarvim. I am very comfortable with Vim, but am looking for a ...
0 votes
0 answers
20 views

How to configure Neoformat to use Prettier?

Installed Neoformat with Plug in init.vim for Neovim 0.7.2 on Linux Mint 19.3 I can't figure out how to get Neoformat to work with Prettier. I installed Prettier as a snap package in --devmode, so ...
  • 1
0 votes
0 answers
22 views

When starting neovim with tmux command in split pane, the layout is broken [closed]

I'm new to nvim and tmux. and I tried to start nvim with tmux commands, but the layout of nvim is broken after starting, and then I start nvim manually, the layout will be normal. Here is screencast: ...
7 votes
2 answers
1k views

Abandon Vim and adopt Neovim - hard reasons for not doing so? [closed]

With my pending adoption of Ubuntu MATE 22.04, I am looking primarily at neovim, with possible adaptation as spacevim/lunarvim. I am very comfortable with Vim, but am looking for a proper ide layer ...
0 votes
0 answers
22 views

How can I color a certain character, using Lua or otherwise?

I want to color arbitrary characters. As an example, let's say we want to color whatever character is to the immediate right of the cursor. Suppose we have the line: int x = 5; and the cursor is on n,...
  • 3
1 vote
1 answer
45 views

Lost my small project, can I get it back?

I am a new vim user and currently using neovim on Linux. I my whole project which I had written in one file (only 1 day of work). There are two ways I could've lost it: I saved the file but ...
0 votes
1 answer
33 views

Using Lua, how can I run a function whenever the cursor moves?

I want a function to fire whenever the cursor moves. How can I do this?
  • 3
0 votes
1 answer
15 views

Neovim LSP Phpactor not finding classes

I have a project like this: - fruity/ - composer.json - vendor/ - appley/ - various.php - orangy/ - composer.json - vendor/ - src/ It's basically two ...
-1 votes
0 answers
15 views

Raspberry Pi Neovim is missing meta-accessors

On my Raspberry Pi I installed neovim. While writing the configuration files in Lua vim.g and vim.o don’t exist. Is it possible to install the meta-accessors afterwards by hand?
  • 1
1 vote
1 answer
60 views

How to save quickfix list per neovim session using :mksession?

I could not find this in :h sessionoptions. If this cannot be done, is there another way to save quickfix list to some file and reload it?
0 votes
0 answers
31 views

How to detect Ctrl+Enter in (neo)vim

My system is macOS. The terminal simulator I'm using is Alacritty. I run neovim inside a tmux session. In my case, both ↵ and control↵ send ^M(visually here, in fact it's a single char). So there is ...
  • 781
1 vote
1 answer
126 views

Why does this mapping of g to gj give "'Undefined variable gj"?

E121: Undefined variable : gj E121: Undefined variable : gk local keymap = vim.keymap.set local default_opts = { noremap = true, silent = true } local expr_opts = { noremap = true, expr = true, ...
  • 113
1 vote
2 answers
49 views

No syntax highlighting in git commit with nvim

I have installed nvim using scoop on two Windows 11 systems. The installation works fine on my laptop (Surface Laptop 3). On my desktop, when I run git commit with nvim set as my editor, the terminal (...
  • 111
0 votes
1 answer
46 views

Add a custom plugin to astrovim

How to add a custom plugin to the astrovim distribution? astrovim uses the Packer plugin manager, but I cannot find the default syntax for Packer which looks like this: return require('packer')....
  • 23
3 votes
1 answer
42 views

Paste command to command mode instead of insert mode

I observed a difference in behavior between Vim and Neovim: When pasting a :-prefixed command in normal mode, Vim will enter command mode whereas Neovim will enter insert mode. More precisely: Given ...
  • 187
0 votes
1 answer
20 views

NeoVim-LUA: can vim.b only hold read-only data?

I'm writing a plugin for NeoVim in Lua and I'm trying to keep the state of my plugin in the vim.b table: vim.b.myplugin = vim.b.myplugin or { "property" = "value", ... } ...
0 votes
0 answers
23 views

Vim-Matlab Errno 2 No such file or directory

I just installed the plugin provided by daeyun here: https://github.com/daeyun/vim-matlab But when I open up an M-file in Neovim, go to connect to the server with the command :MatlabLaunchServer I get ...
  • 1
0 votes
0 answers
12 views

Neovim terminal mode <C-w> simulation like Vim

In Vim you can switch windows and paste using <C-w> which leaves the terminal in whatever mode it was already in. Can this be simulated in neovim? For instance <C-W>h moves to the left ...
1 vote
0 answers
22 views

How can I show `relativenum` at the end of a line?

I'm in neovim, and I've got relative numbering turned on so my files look something like: ... 2 public class Main { 1 public static void main(String[] args) { 17 if (args.length ...
0 votes
0 answers
17 views

How to add custom text to vi airline?

How can I add custom text to vim airline? For example the word evgenimba in the right botton of the picture below? I have tried to search with various keyword but could not find the solution.
1 vote
2 answers
56 views

Is there a way to have some kind of virtual environment for neovim?

I would like to try out some fancy plugins, debug my own configuration and plugins, try out new neovim versions. But I do want to keep my daily used nvim stable (with fixed set of settings and plugins)...
  • 111
2 votes
1 answer
88 views

How Can I Use The Error Color for `guibg` and `ctermbg`

I have the following Vim code which highlights trailing whitespace in red: highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s\+$/ But instead of making the color "red"...
0 votes
0 answers
40 views

Disable TreeSitter highlighting in inactive buffers

How can I disable TreeSitter highlighting in inactive buffers? I currently have all inactive buffers blurred and their syntax disabled, but I can't figure out how to disable the TreeSitter ...
1 vote
1 answer
27 views

Where is the text data stored during typing text in insert mode?

I would like to develop a small app in React and Nodejs that sends real-time typed text from my Nodejs/Express server to my React frontend. To do this, I would like to use socket.io. The text data is ...
0 votes
1 answer
46 views

Passing a count to a user command with neovim's Lua API

vim.api.nvim_create_user_command("TestCommand", function(opts) print(opts.count) end, { count = 1 }) vim.keymap.set("n", "<C-x>", "<cmd> TestCommand ...
  • 101
0 votes
0 answers
35 views

Cannot find colorscheme in neovim

I am a very very new user of neovim and i was trying to customize it using init.vim. When i was trying to set a color theme for neovim, it did not work. I am using vim-plug and i have the plugin in ...
  • 1
1 vote
0 answers
78 views

Pyright LSP flagging errors in class using pandas method

Using the following code example: import pandas as pd from typing import Dict class Test: def __init__(self, df : pd.DataFrame) -> None: self.df = df def example(self, ...
  • 795
1 vote
3 answers
215 views

Cannot switch tabs when in terminal tab

For using the terminal while working with Rust. I've added this config (NVIM) (TTerm one). if has('nvim') command Ter vsplit term://zsh command Tter tabe term://zsh else command Terminal ...
0 votes
0 answers
41 views

NerdTree... after using <m> bottom panel stays bigger and wont disappear

When using Menu in NERDTree to create a directory/file and toggle it off, will keep bottom window open.
1 vote
3 answers
72 views

Can you make it so that :e hides the current buffer but that :e! discards it?

Title says it all really. Sorry for noob question. I've noticed that if 'hidden' is set, :e! will do the same thing as :e (that is, put the buffer you're currently working on in the background and ...
1 vote
1 answer
50 views

How to elegantly return to text file after executing a `:terminal` command similar to `:!`?

I want to return to the open file after I executed command with :terminal <command> First off, I am using neovim. So to get to the situation, I want to improve: follow these steps : create a ...
  • 111
4 votes
1 answer
147 views

Moving from Ultisnips to LuaSnip?

I recently decided to switch my init.vim to init.lua as I'm using Neovim and opted to use LuaSnip over UltiSnips - previously, CoC autocomplete and UltiSnips were clashing over the same tab triggers. ...
  • 71
2 votes
1 answer
128 views

How to disable the interactive preview for substitute in Neovim?

In Neovim, when I type :%s/foo then the current buffer changes to have all instances of foo removed, basically giving a preview of the change. Coming from standard Vim, I find this confusing and it's ...
  • 381
0 votes
1 answer
105 views

How to install vim-treesitter?

I have installed neovim, it was cool so I installed vim-treesitter plugin. I'm trying to use it but I get some error message. I can't find solution about it. Could you help me? This is the error ...
1 vote
1 answer
34 views

giving one snippet priority over another

I would like to use two custom snippets whose endings are the same: snippet ah "\aH for ta marbuta" i \\aH${0} endsnippet snippet iyyah "\iyyah" i \\iyyah${0} endsnippet How can ...
1 vote
1 answer
39 views

Showing text info in window split separators

(I'm using nvim 0.7 and have recently moved from a init.vim to lua, which is baffling me slightly.) In my old set-up a split would look like this: → note that the bar that splits the two windows ...
0 votes
0 answers
108 views

neovim - unable to setup gopls integration

I have configured my neovim editor using this link (https://github.com/LunarVim/Neovim-from-scratch). I have run LspInstallInfo and installed gopls successfully here. However, when I open type of ...
0 votes
0 answers
26 views

How to make VIM Use the Whole Screen While Reading Help? [duplicate]

Why is it, when I search for help, that so much of my screen's vertical space is wasted by default in vim? How can I make it use the whole screen instead. See below:

1
2 3 4 5
21