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
0 votes
0 answers
7 views

NeoVim appends the last four lines to the end of file

Since I've switched to neoVim from vim it often but not always gives me this strange behaviour: Sometimes when I edit code, the last few lines of the file get copied and appended to the file. Then I ...
user avatar
  • 101
1 vote
1 answer
25 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 ...
user avatar
1 vote
1 answer
25 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 ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
0 votes
0 answers
25 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:
user avatar
0 votes
1 answer
29 views

K does not show function signature

My full config is on GitHub. In my lsp-config.lua I have the following: buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) However, when I press K on the name of a ...
user avatar
  • 191
1 vote
1 answer
48 views

nvim (plugged with coc, coc-clangd) is showing parameters for every function. How do disable it?

my nvim (plugged with coc + coc-clangd) is showing the paramters for every function, how do I disable it ? I'm using a common vimrc for vim and neovim, but this problem only happens in neovim. FILE *...
user avatar
  • 111
0 votes
1 answer
29 views

packer.nvim: Error running config for <PACKAGE>: attempt to call a nil value

When I start neovim, I'm now getting a lot of errors like this, packer.nvim: Error running config for hop.nvim: attempt to call a nil value packer.nvim: Error running config for nvim-lspconfig: ...
user avatar
0 votes
1 answer
25 views

Get byte length of current line in Lua

How do I get the length, in bytes, of the current line in Lua? vim.api.strlen('foo') doesn't work
user avatar
  • 141
0 votes
0 answers
44 views

Ho to force the pyright language server to use a interpreter on a mounted volume

I have a problem with the following setup: the volume of a remote machine is mounted using sshfs nvim is opened on the mounted volume to ensure all my plugins and settings work ~/anaconda3/envs/.. is ...
user avatar
  • 11
0 votes
0 answers
81 views

Why is :packadd failing in this case?

I am trying to reinstall neovim so that all the files are in the config directory of .config/nvim. In my config file which is required by /home/shadrock/.config/nvim/init.lua. The commented local ...
user avatar
0 votes
0 answers
33 views

Cannot install vim plugin due to git problem

I'm on MacOS Big Sur with nvim 0.7.2,vim-plug, and git 2.37.1 installed. I succesfully installed vim-crystal (to enable syntax highlighting for Crystal codes) by doing this: Edit ~/.config/nvim/init....
user avatar
  • 101
0 votes
0 answers
37 views

Override autocmd to change filetype for a subset of markdown files

I'd like to load the cornelis plugin for the Agda language when I open a *.lagda.md file. I have this autocmd in init.vim: au BufNewFile,BufReadPre *.agda,*.lagda* setf agda However, *.lagda.md gets ...
user avatar
0 votes
1 answer
49 views

How to check if an external command exists in Lua

How do I translate this VimL code into Lua? if executable('rg') set grepprg=rg\ --vimgrep endif
user avatar
  • 141
0 votes
0 answers
36 views

How to change background color of the text of hover window?

I have such binding that opens the hover window vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) As you can see the background color of the let name2: {unknown} is white (#ffffff). I would like ...
user avatar
0 votes
0 answers
17 views

virtual replacement by string not cchar

the virtual text makes vim/neovim very powerful I want to use the conceallevel to change some text virtually, using the regex or treesitter replace > with one char: ▶ " vim > > > :...
user avatar
2 votes
2 answers
29 views

Keymap or mark to jump to timestamped filename

I often need to access a machine-generated file. This file is always in the same folder, and is created each day with a timestamp, e.g. $HOME/foo/bar/target-2022-07-21.txt. Currently I use fzf to open ...
user avatar
  • 123
0 votes
0 answers
16 views

Is there a way to redefine options set in a lua setup{} call without calling setup again?

I'm trying to customize a plugin and I want to know if there's a way to just set a single option without calling setup, or to change an option after setup has been called. local actions = require('...
user avatar
  • 1
1 vote
1 answer
46 views

Automatically highlight visual selection matches

Since there are no VisualEnter and VisualLeave events, I am trying to make a function that will activate on every cursor movement in visual mode, i.e. it will automatically highlight all the matches ...
user avatar
  • 21
0 votes
2 answers
28 views

Neovim wont match beginning of word with # sign

/\< matches beginning of all words as expected. /\<a matches beginning of all words starting with a but /\<# doesn't match words starting with # what am I missing here? Was planning on using ...
user avatar
0 votes
1 answer
49 views

Incorrect autocomplete with Javascript using nvim-lspconfig

My lspconfig works fine with typescript files, but not with Javascript. Autocomplete shows .constructor and other standard props/methods instead of the expected ones defined on the type This happens ...
user avatar
0 votes
1 answer
33 views

Opening the first file(not empty) shows blank

After starting nvim, the first opened file always shows blank, the second will be back to normal. This issue is out of nowhere. OS:Arch nvim: 0.7.2 terminal: kitty
user avatar
  • 11
0 votes
0 answers
9 views

Refresh neovim when terminal is not focused [duplicate]

I'm using external program to change content of file and I want to use neovim to content in real time. If some change is made to file and terminal is focused window then neovim immediately shows the ...
user avatar
1 vote
1 answer
34 views

Why wrap neovim config in a table?

I've noticed that some neovim configs are separated into several files or folders and the content of each file is wrapped in code like so: local M = {} function M.name() ~~~~~~~~ ~~~~~~~~ ...
user avatar
  • 113
0 votes
1 answer
39 views

How can I open a vim fold so that it is not affected by `foldclose=all`?

In my config file I have set foldclose=all so that folds get automatically closed upon cursor leaving them. However, sometimes, I want a specific fold not to close for a while. Because folds below ...
user avatar
  • 21
0 votes
0 answers
25 views

How do I yank to a custom clipboard, but put normally?

Whenever I yank (y) in vim, I'd like to trigger a custom clipboard script. This works fine. However, I also want the put (p) functionality to continue working as normally, ie. pasting from the normal ...
user avatar
  • 101
0 votes
0 answers
40 views

How to add another key to enter command mode?

In normal mode I have a a lot of <c-*> mappings. I end up typing <c-;> often when I intended to type :. I'd like to add a mapping for <c-;> to : but nothing I've done works. I've ...
user avatar
0 votes
0 answers
70 views

Neovim how to rexecute vim.fn.expand() every time a keymap is called?

I would like to create a keymap to edit files by my current path, while showing the directory path of the current file For example, if I was editing file: /Users/[username]/projects/test.py Clicking &...
user avatar
  • 11
0 votes
1 answer
33 views

Why is nvim updating the clipboard on start?

I use set clipboard=unnamed in my configuration. When I open nvim with nvim, the clipboard is left unchanged but if I open with nvim . the latest entry of the clipboard is always something unexpected. ...
user avatar
0 votes
1 answer
63 views

lsp client failing to attach as part of autocmd

I'm using the nvim-lspconfig plugin to set up *sh, lua, and python LSPs. If I have the setup function at the 'top level' of my init.lua, the servers attach as expected. However, I'd like the lsp ...
user avatar
0 votes
1 answer
50 views

How to join multiple lines which doesn't include space at the end

I'm working on a subtitle document (.srt) which has thousand of lines. But this issue is not about the subtitle documents, I going to export as plain text to read after. To see the dialogs line by ...
user avatar
0 votes
0 answers
26 views

How do you disable all magic comment formatting in neovim?

I recently switched to Neovim's new LSP setup instead of the old Vim-based language plugins and now I get this incredibly annoying comment "helper" behavior when I hit enter after a /** in e....
user avatar
0 votes
1 answer
24 views

How to remove the left over lines after cutting

how do I cut text in vim and automatically remove the remaining lines. For example, when I cut the following text using d: The lines remain there: But I want to remove those lines with the cut. ...
user avatar
1 vote
1 answer
31 views

Issues of UI when combining Tmux and neovim and sourcing a python virtual env created with Poetry

The issue I recently switched to nvim + tmux and I have a fully working setup with various plugins. I use Poetry to manage my python virtual envs and it's a mandatory tool. I highlight the fact that ...
user avatar
  • 11
1 vote
1 answer
24 views

Limit the amount of oldfiles in Vim and Neovim

As simple as the title stated. Suppose I only want to keep the n (say 20) latest files, and the older ones be deleted. How may I configure that?
user avatar
0 votes
0 answers
91 views

How do I configure NeoVim in termux?

I install neovim in termux And run these commands:- cd ~ mkdir .config cd .config/ mkdir nvim cd nvim/ nvim init.vim I put set number in the init.vim file and save it. Nothing happens.
user avatar
  • 101
-1 votes
1 answer
57 views

In neovim, how do I get a file to open at the same line number I closed it at last time?

au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif This code is valid in vim. It is the ...
user avatar
  • 5
3 votes
1 answer
35 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 ...
user avatar
  • 131
0 votes
0 answers
139 views

How do I use github copilot in NvChad?

I've written the following in my custom folder, and I've run :PackerSync followed by :Copilot setup, but I get an error: E492: Not an editor command: Copilot setup. Do I need to clone github/copilot ...
user avatar
0 votes
1 answer
53 views

Indent changes when using CoC, how do I stop this?

I have set up my init.vim file to always use tabs as indentation by adding this to it: set tabstop=4 set shiftwidth=4 set noexpandtab Ever since I installed CoC to use Rust's language server, it ...
user avatar
2 votes
1 answer
90 views

Open file in new buffer within original vim instance from a terminal buffer [duplicate]

The terminal emulator is handy! However, using it to open a file you wish to edit (while remaining in vim) is troublesome because simply doing vim myfile.txt will spawn a 'vim within vim inception' ...
user avatar
  • 121
0 votes
1 answer
26 views

How to revert to "close file when buffer closes" behavior in Neovim?

The "old" Vim behavior was to close the file when all associated buffers are closed. With the newest version of Neovim, it appears that closing a buffer doesn't actually close the file. As ...
user avatar
0 votes
1 answer
24 views

Show command prompt including commands issued before entering neovim

I've been using vim for a long time and got used to issuing: :! to peek at the command prompt behind the vim "window" working on Terminal.app in Mac OS where I can see old commands and ...
user avatar
1 vote
0 answers
44 views

How can I prompt user for an input using Telescope-nvim?

I'm new to neovim. I want to create a function which will run my current python script. But the problem is with venv. So I want the function to ask for the path to venv when I call that, so that it ...
user avatar
2 votes
1 answer
185 views

Keep specific parts of a :s command in nvim

What I'm trying to do is convert between Textile and Markdown links, so it should be able to do something like :s/".*"(.*)/[.*](.*)/, which is to say, keep the stuff that is matched by the .*...
user avatar
0 votes
1 answer
43 views

Vim Autoindent does not work [closed]

I'm configuring my Vim editor. Now I want it to automatically indent when I press enter after a parenthesis (like in modern IDEs) function test() { | } I already have autoindent and smartindent ...
user avatar
1 vote
0 answers
27 views

How to map keybindings only for specific file type?

In vimwiki, <C-x><C-o> provides available tags in autocomplete dropdown. I am attempting to map that key mapping to something easier like (ctrl+alt+space) and only when I am in a markdown ...
user avatar
  • 111
0 votes
1 answer
29 views

Disabling a plugin loading when launching Vim from `git commit`

Is there a way to disable a plugin only on occasions where Vim was launched from another program? I have set Vim (Neovim, more specifically) to be the default core.editor of my git configuration and ...
user avatar
0 votes
1 answer
54 views

Run autocmd on file close

I've been looking through :help autocmd-events for an event that is going to be ran when a file is closed, but I got pretty confused, seeing there were many events that sound like they might do their ...
user avatar
-1 votes
1 answer
30 views

How to remove words in a visual selection

Suppose I have the following input as shown below. What I would like to do is to visually select lines 2 through 4 (shift + v) and then delete the word dog. How can I do that? I know I can use ...
user avatar
  • 101

1
2 3 4 5
21