Skip to main content

Questions tagged [neovim]

Use this tag for questions specifically regarding Neovim-only features (i.e. features not found in Vim and other Vi-like editors). It should only be used if the problem does NOT occur in Vim or other Vi-like editors.

553 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
0 answers
676 views

Persistently fix the height of a split in vim

So I searched the web far and wide and I can not for the life of me figure out how to do this. I have the following key binding: nnoremap <leader>o :below 10sp term://.//$SHELL <cr> :set ...
Otis Wright's user avatar
8 votes
0 answers
17k views

Is there any similar way in vim to get standard path like neovim stdpath function

In neovim, we can get default standard path via stdpath() function. I wonder if there is any way to do that in vim. below is the help doc about stdpath() in neovim: stdpath({what}) *...
ZMJ's user avatar
  • 283
6 votes
0 answers
569 views

How to get bold comments in vim

I am trying to add bold comments to my vim files. What i mean, is to be able to get something like this: I saw other articles like this that allow to toggle bold comment. The proposed solutions from ...
needle's user avatar
  • 181
6 votes
2 answers
786 views

How to exit insert mode if pressing escape merely types "^["?

I have neovim 0.4.2 running in a session of kiTTY 0.17.4 on OSX. I have pasted a long url while in insert mode. After doing this, every time I type BKSPC vim adds ^? to my document. Every time I type ...
Andrew Farrell's user avatar
6 votes
0 answers
1k views

(Solved-ish) neovim: Don't close :terminal buffer after process exit

In Vim, when I run, for example, :terminal python3, and, when I'm done, exit python, the terminal window stays open as a readonly buffer, which I can inspect freely. In Neovim, I always get "[Process ...
LunarLambda's user avatar
5 votes
1 answer
2k views

How do I perform a code action on a visual range in Neovim 0.9?

In Neovim 0.8, I had the following command mapped vnoremap <leader>a :lua vim.lsp.buf.range_code_action()<cr> which in visual mode, gave me options such as Wrap In Try-Catch/Extract Method ...
pinoyyid's user avatar
  • 153
5 votes
0 answers
2k views

Can (Neo)Vim be configured to set the filetype according to the shebang?

Lately I've been using neovim to edit lots of files with the .tmpl extension. These files all have shebangs, most (but not all) of which are #!/bin/sh. The default behavior seems to be that neovim ...
Brian Fitzpatrick's user avatar
5 votes
0 answers
39 views

Neovim makes spurious directories and doesn't clean them up on exit

Neovim makes directories in my home folder (presumably to store swapfiles, etc.) of the form nvimzOvQcg, nvim098eqo, nvimUyUGZ8, etc. Upon exit, the contents of these directories are cleaned up but ...
user26306's user avatar
5 votes
0 answers
10k views

How to delete swap files on neovim?

While editing a file my neovim crashed when I tried to save the file (with the error message "init.vim" 77L, 2423C writtennvim(5888,0x7fffa9f29340) malloc: *** error for object ...
Blaszard's user avatar
  • 555
5 votes
1 answer
2k views

How can I configure nvim to use a single escape to exit insert mode?

I was trying out nvim (neovim) for the first time and I find that I have to type <escape> twice to get out of insert mode. I'm not sure if this is a feature or a bug. I see the same behaviour ...
Peeter Joot's user avatar
4 votes
0 answers
341 views

How to copy to system clipboard using Mosh + Tmux?

I've set vim.opt.clipboard = "unnamedplus" to copy to/paste from the system clipboard. However, I noticed that the behavior differs whether I'm using nvim in my local machine, a remote ...
Gianluca's user avatar
  • 141
4 votes
0 answers
2k views

How to disable a lsp server using a specific rule?

I'm on a vue project, and I installed both tsserver and volar, but both of them will be called up when I open a *.ts | *.js file. But for vue project I only want to use volar since both tsserver and ...
ogios's user avatar
  • 43
4 votes
1 answer
2k views

How to disable semantic highlighting for certain filetypes only?

Using Neovim's native LSP interface, I noticed that semantic highlighting provided by LSP makes things worse for certain languages, so I want to disable it based on filetype. I know about possibility ...
Thunderbeef's user avatar
4 votes
1 answer
245 views

How to normalize a file path opened from the quickfix window?

Setup I am using NeoVim v0.7.2 (also tested with v0.6.1) on Windows 10 in git-bash, with vim-dispatch to allow for asynchronous builds (building a C++ codebase with Clang). I have this option in my ...
Ad N's user avatar
  • 141
4 votes
0 answers
254 views

Mapping that works in Vim does not work in Neovim

I use Tim Pope's plugin vim-unimpaired, and one of the shortcuts that it enables is "bubbling" text (moving a line or a set of lines up/down). In normal mode, the shortcut for bubbling text ...
Michael P. Geraci's user avatar
4 votes
0 answers
170 views

How does expression folding actually work?

The following is a stripped down version of my folding function for LaTeX documents: setlocal foldmethod=expr setlocal foldexpr=LaTeXFoldsExpr(v:lnum) " Sections to be folded let g:...
noibe's user avatar
  • 189
4 votes
0 answers
1k views

"^[[201~" character being pasted at the end of file

I'm trying to copy-paste by hand this file, but whenever I paste the contents in vim the last line shows this weird character at the end of the line ^[[201~. My guess is that it's one of those wrong ...
Teodoro's user avatar
  • 153
4 votes
0 answers
1k views

How do I setup Mypy with Neomake

I'm trying to use Mypy with Neomake, but without success. I am currently using flake8 with Neomake, and it works seamlessly, e.g.: def foo(bar): return 1 foo(1) > E305 expected 2 blank lines ...
Jay Lee's user avatar
  • 141
4 votes
0 answers
768 views

Wrong color-theme displayed

I recently saw this video about tmux and vim and instantly fell in love with the color theme used in the video. Luckily the presenter (Nick Nisi) provides a link in the video-description to his .vimrc ...
LastSecondsToLive's user avatar
3 votes
0 answers
38 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 ...
Ari Sweedler's user avatar
3 votes
1 answer
953 views

Use treesitter to jump to next argument without going into nested function calls

I'm hoping to write a macro that involves jumping to a second argument of a function call and deleting it. The function arguments will sometimes include nested function calls, sometimes not, will ...
Michael's user avatar
  • 131
3 votes
0 answers
205 views

Delay When Closing `:terminal` Window

Long story, short.... Everything's fine on my MacBook, but I have an issue in Neovim 0.9.1 on Windows 10. I see this behavior when starting nvim from the usual shells - Command Prompt (cmd.exe), ...
Phil R's user avatar
  • 503
3 votes
0 answers
49 views

Can't remap `<D-p>` in iTerm2

I'm configuring neovim using iTerm2 on mac. When trying to remap <D-p> (Cmd+p) I only open the print view. local telescope_builtin = require('telescope.builtin') -- Doesn't work vim.keymap.set('...
Louisb Boucquet's user avatar
3 votes
1 answer
104 views

How to call incremental forward/reverse search inside function in Neovim?

I'm trying to implement a search function that finds a pattern and jumps to it without overriding the current searched for & highlighted pattern. Specifically, I want to be able to type out the ...
WalksB's user avatar
  • 517
3 votes
0 answers
1k views

What is the file structure of Neovim?

It seems like Neovim has files in many places. The binary is in /usr/bin/nvim. Inside ~/.config/nvim is init.vim, for declaring plugins, and also directories in ~/.config for storing Neovim plugins, ...
Julius Hamilton's user avatar
3 votes
1 answer
206 views

Vimwiki overriding normal md highlighting

I love the concept of Vimwiki, but have a problem with it overriding the default md syntax highlighting. The default works well, and I use it regularly to edit md documents to be used with pandoc. ...
Megymagy's user avatar
3 votes
0 answers
1k views

TailwindCSS Intellisense into Neovim

I need someone that has tailwindcss-intellisense into neovim, I haven't been able to set it up since yesterday, I might have at this point to build it from scratch. I followed this two guides: https://...
Atlas's user avatar
  • 31
3 votes
1 answer
2k views

neovim: vim.fn is nil

I have a lua plugins script defining local fn = vim.fn. A couple of lines later it defines local install_path = fn.stdpath('data'). This script is called from my init.vim by lua require('plugins'). ...
Jonathan Herrera's user avatar
3 votes
0 answers
2k views

:Telescope commands throw error

My environment: OS: OSX 11.6 BigSur nvim: 0.6 I had never used vim telescope before, so this is my first encounter with it. I followed the instructions of installing telescope.nvim and plenary.nvim....
Mopparthy Ravindranath's user avatar
3 votes
0 answers
665 views

How do I recover a specific swap file?

Last night I wrote a short piece the saved saved and exited (:wq). Then the goat-rope of trying to recover what apparently seemed to vanish stated. Since it was about 3 AM and I was getting no where, ...
hrokr's user avatar
  • 131
3 votes
0 answers
751 views

What Neovim GUIs have GUI scrollbars as described in vim under :h gui-scrollbars?

TL;DR I am looking for a Neovim GUI with GUI scrollbars as described in vim under :h gui-scrollbars (accessed on 2021-08-21). What GUI Vim scrollbars are like 2. Scrollbars *gui-...
Hotschke's user avatar
  • 4,790
3 votes
0 answers
272 views

Delete key appears to remove two characters

I open a simple HTML file and navigate to a section of the file where I want to delete a character. I enter INSERT mode and press the DEL key, this seemingly causes two characters to be removed, ...
HennyH's user avatar
  • 31
3 votes
0 answers
470 views

<ESC> does not exit command-line mode. Neovim on tmux on WSL

nvim is not exiting command-line mode when the ESC key is hit. E.g., the key sequence :ff<ESC>ff gives :ffff at the command-line prompt. The expected behavior is that the first :ff be discarded ...
Liam's user avatar
  • 139
3 votes
0 answers
3k views

View pylint errors using coc and neovim

For the following code there is an error in the gutter, but I don't know how to view the actual message for it. Similarly here: In the bottom right of the editor are warnings and errors: But I don'...
baxx's user avatar
  • 1,035
3 votes
0 answers
324 views

How to set rulerformat to align left and full width in vim?

I use ruler format like this, set rulerformat=%36(%5l,%-6(%c%V%)\ %f%)%* However, if the filename gets too long, it will be broken. So I like to align left, but It can't be align like statusline %=. ...
ryuta69's user avatar
  • 41
3 votes
2 answers
294 views

Prevent buffer loads within NERDTree

If I have many buffers opened and, if the cursor (focus) is within NERDTree, when I change the buffer with :bn or :bp, the content of buffer loads within NERDTree. There's a way to, before buffer ...
Diego Somar's user avatar
3 votes
0 answers
2k views

How to recover from swap files correctly on Neovim?

My Mac crashed and was forced to restart. So I opened Terminal, try recovering the file, but struggle to correctly recover the file. Specifically, I tried the following command: nvim ~/.config/nvim/...
Blaszard's user avatar
  • 555
3 votes
0 answers
120 views

How to emulate vim job out_io buffer with neovim?

I'd like to make a plugin with functionality that is similar to https://github.com/ramele/agrep and grep-edit in emacs. That is get search results from ag or some other tool that supports multiline ...
user1685095's user avatar
  • 1,141
2 votes
0 answers
62 views

Error setting up julia language server in Neovim

When I try to use julials I get the following prompt: Client quit with exit code 1 and signal 0 These are the lsp log [ERROR][2023-09-24 23:12:43] .../vim/lsp/rpc.lua:677 "rpc" "/...
kay's user avatar
  • 61
2 votes
1 answer
556 views

vim.keymap.set issue

I've tried to make a key map as follows: vim.keymap.set('x', '<leader>n', function() -- Here <leader> is <Space> line1r, line1c = unpack(vim.api.nvim_buf_get_mark(0, "<&...
HRC's user avatar
  • 33
2 votes
0 answers
63 views

Why xdg-open won't launch mplayer when started from within Neovim?

I have my ubuntu 20.04 system set up so that xdg-open launches mplayer for .mp4 files. When I type xdg-open ~/video.mp4 in the shell in terminal, xdg-open launches mplayer and the video plays. But ...
Zoran Loncarevic's user avatar
2 votes
0 answers
826 views

Extremely slow with C++ LSP and fairly big project

How do i troubleshoot what is causing below problem. Problem: neovim unresponsive for several seconds (10-30 seconds) for any keys Setup: Neovim 0.9.2 and neovim nightly workspace with > 900 files ...
Zhivaji's user avatar
  • 21
2 votes
1 answer
69 views

Behaviour of Neovim when in insert mode is different from expected

I recently switched from vim to neovim. I have the following keybindings in neovim: vim.keymap.set("i", "0", "<Esc>la", { noremap = true }) vim.keymap.set("i&...
caffeinemachine's user avatar
2 votes
0 answers
1k views

How to force bashls, shellcheck to treat zsh files as bash using lspconfig?

Most of my dotfile scripts are in zsh, with the .zsh extension and shebang - #!/usr/bin/env zsh. Formatting and linting does not work in zsh files out of the box (understandably so); however, they can ...
casraf's user avatar
  • 121
2 votes
0 answers
711 views

enable `update_in_insert` only for certain extensions

I have several LSP servers I use in neovim with nvim-lspconfig. Some are fast, and most are slow. I can make the diagnostics update while in insert mode by doing something like vim.lsp.handlers['...
Max Coplan's user avatar
2 votes
1 answer
153 views

Get motion used within operatorfunction?

How can I make a custom operator function that can programmatically reuse the motion that the user called it with? E.g. I want to map the operator m so that miw goes to the start of the file and then ...
minseong's user avatar
  • 2,353
2 votes
1 answer
563 views

Cannot open terminal ini nvim

I installed Plugin terminal using the vim-terminal plugin and try to execute :TerminalSplit bash but before the terminal open I got a warning message. Python 2 interface is not installed, using Python ...
Muhammad Fhadli's user avatar
2 votes
0 answers
1k views

How to not change directory when I use "Go to file"?

I'm using neovim and I have NvimTree installed. When I press gf on a file path, it opens that import file but at same time, my NvimTree go to that file path too, so I have to cd back to the original ...
Lai32290's user avatar
  • 275
2 votes
1 answer
1k views

neovim change keybind only for specific buffer type/plugin

In neovim, I have my leader mapped to space. I also use nvim-tree. What I want: when nvim-tree is open and that is the active buffer (cursor is there), map leader to something else so I can use space ...
echo's user avatar
  • 121
2 votes
2 answers
1k views

Highlight nvim tree directory that contains file I found with telescope

Is there a way to highlight a directory of a found file? For example I look for a specific file with telescope and when I open it, my nvim-tree is updated and shows me parent directory?
Nedzny's user avatar
  • 21

1
2 3 4 5
12