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
1answer
10 views

Simple Asynchronous function call in Neovim (defer_fn or timer_start ?)

I'm trying to create a very simple shortcut that saves the buffer and cleans the writing message after a second. nmap <silent> <leader>w :w<CR>:sleep 1<CR>:echo ""<...
0
votes
1answer
18 views

How can I get line number by marks in nvim?

I want to get the line number by a mark, is it possible to do it in nvim in Lua? I have searched the doc for mark but I cannot find anything useful. https://neovim.io/doc/user/lua.html
1
vote
1answer
24 views

Neovim Terminal shows a different list of programs available in /usr/bin

I have installed Neovim via flatpak on Fedora 34. I use the coc.nvim plugin for Neovim, it complains that it can't find 'node'. However I have installed node and it is in /usr/bin/node. To double ...
0
votes
1answer
18 views

How to disable configuration display at nvim startup?

When typing nvim in CLI, nvim opens with a screen that contains all my configurations (the picture bellow). I have to press <s-g> and then hit Enter in order to open the file i wanted. The same ...
0
votes
0answers
19 views

What's the best way to auto hide a custom bufferline when there is only one buffer listed?

this is gonna be a lengthy question. I'm developing a neovim bufferline plugin which shows a list of all the buffers in the tabline. I'm trying to implement a auto-hide feature, where the bufferline ...
0
votes
0answers
18 views

Remap enter Terminal-normal mode Neovim to something else than Esc

I have remaped enter terminal normal-mode to <Esc> with: tnoremap <Esc> <C-\><C-n> and it does work. But I am using zsh vi-mode, which also requires the use of <Esc> to ...
0
votes
0answers
15 views

Open a file by dragging into NeoVim in Iterm

I want to open by dragging into NeoVim in Iterm2. I have seen :help drag-and-drop but it doesn't help at all. How can I open a file by dragging a file into NeoVim in Iterm2?
0
votes
0answers
14 views

Open a json file by clicking in NeoVim in Tmux in Iterm2

I want to open a json file in NeoVim in Tmux in Iterm2 by clicking it. I have tried some Apple Script to make an Automator but all those script is only open NeoVim in Iterm2. Is there any script that ...
0
votes
0answers
29 views

Vim Formatter vs VsCode Formatter Problem with GIT

I am using Vim (neovim) for the past couple of weeks now. I am facing one problem with the way vim formats the code. My other team members uses vscode which formats JS file on Save something like this:...
0
votes
0answers
41 views

Autoloaded vs lua functions: which is faster/more efficient?

I'm creating a neovim plugin written in Lua, and I have to react to the BufAdd and BufUnload events with a function call. I have 3 options: write the function in Lua (like the rest of the plugin) and ...
0
votes
1answer
27 views

How to handle no content for a custom text object?

I am building custom text object in lua. With the following code, I am able to change content within certain symbols. This is my code: local in_symbol = function(start_symbol, end_symbol, mode) ...
1
vote
1answer
25 views

How to set norelativenumber on CmdlineEnter and relativenumber on CmdlineLeave?

I am trying to set norelativenumber on CmdlineEnter and relativenumber on CmdlineLeave, but it didn't work. Why is that? local setup = function() vim.api.nvim_exec([[ augroup SmartNumberGroup ...
0
votes
1answer
53 views

a way to run a function on CTRL-O / CTRL-I?

I wrote a little function to highlight a current line when navigating which basically mimics this emacs package. It works fine for navigating between windows. function Util.flash_cursorline() vim....
0
votes
0answers
20 views

Cannot search for pairs with searchpairpos()

I am trying to search for the location of the start and the end of a pair with searchpairpos(). Given an example like this: *hel[]lo* And my code like this: local start_match = vim.api....
0
votes
1answer
27 views

How can I get the current cursor position in Lua?

How can I get the current cursor position in Lua? I want to get a number so that I can use it in a for-loop. I tried this, but I got a hashed value instead: local lineNum = vim.api.nvim_win_get_cursor(...
0
votes
0answers
28 views

E523: Not allowed here for command used in a function of <expr>

I am trying out <expr>, and I found out not all ex-mode command can be run in a function. :LspInfo is a command from nvim-lsp. function! Message() LspInfo endfunction nnoremap <expr> gd ...
0
votes
0answers
18 views

Open file in new tab or split if current file has changes in fzf.vim

I have been using :Files to get a list of files using fzf.vim. Although whenever I hit enter to open a new file and the current file has not been saved I get an error message saying No write since ...
0
votes
1answer
39 views

movement similar to “f” but you can specify more than one character as search criteria

Say we got this sentence: pafpaf apfa fpa i apa panda pafas af I would like to quickly move the cursor from the start of the line to the beginning of the word panda. I could do 6fp, but what takes ...
-1
votes
0answers
20 views

How do I automatically compile and run files?

I'm quite a newbie to vim/neovim. Now I'm searching for a way to detect which file type I'm editing at the moment; if it's something like .java or .py, I want to execute the corresponding compile ...
1
vote
1answer
66 views

Delete everything between two surrounding characters

Commands I use a lot are commands like: dib (delete everything between two surrounding parantheses) di{ (delete everything between two surrounding curly brackets) ... it works for a few other ...
0
votes
1answer
34 views

Remove text specifying mode “INSERT” in bottom vim line

In the bottom two lines, you'll see the statusline saying "INSERT", and the line where you enter commands showing -- INSERT -- This is quite redundant, and I would like any recommendations ...
0
votes
1answer
17 views

Neovim does not autoreload after a BufWritePost, maybe because the timestamps are too close?

I am using neovim to work on a Swift project, so I have set up an autocmd to run swiftformat when I write Swift files as shown. autocmd BufWritePost * if count(['swift'],&filetype) | silent ...
1
vote
1answer
42 views

(coc-)vimtex .bib completion strange suggstions

I've noticed that (coc-)vimtex gives suggestions about bib(la)tex keys and allows too searching in the entries of the literature. Now this search works sometimes for me, sometimes not (see the gif). ...
0
votes
0answers
12 views

How to disable mouse in nvim

I'm on Arch Linux with alacritty, zsh and neovim nightly (NVIM v0.5.0-dev+1069-g02a966386). I've read several posts on disabling the mouse in vim including 13566 and have put the following in my init....
0
votes
1answer
48 views

Run a command that is from a plugin in a function

There is a file browser plugin called fern and I would like to open a split with the fern file system explorer open. This is what I have so far: function File_tree() execute 'vert sb' execute '...
0
votes
1answer
44 views

Unable to use lua inside a `.vim` file

I am using a nightly build of nvim, and I am trying to use neovim/nvim-lspconfig. I have followed to doc and setup the language server, but nvim throws error and reports that it is unable to process ...
2
votes
0answers
28 views

Highlight groups stop working after sourcing vimrc

I'm working on a todo plugin for Neovim, using the remote plugin API. I set highlight groups and matching patterns in my script, and then register it with call remote#host#RegisterPlugin. When Neovim ...
1
vote
1answer
21 views

How can I make NerdTree update root to the current directory when I change directory with :cd?

I found out that when I change directory with :cd, the root directory of NerdTree is not affected. How can I make NerdTree change its root when I use :cd?
0
votes
1answer
48 views

How to temporarily change file encoding?

I'm using a plugin which can show the minimap for the file I'm editing. The plugin can only works with utf-8, while, my mother tongue is Chinese so I wrote comment in Chinese. Does anyone know how to ...
6
votes
2answers
928 views

What does <Plug> do in vim?

I came across <Plug> in this command of easy-motion nmap <Leader>w <Plug>(easymotion-overwin-w) I tried to search for the definition of but no luck. What does it mean? Does it have ...
2
votes
1answer
91 views

Why Vim is slow when I execute vim commands without a terminal?

I want to edit files by executing Vim commands from inside node.js as the following: const child_process = require("child_process"); child_process.execSync(`time vim /home/user/file -c ':%s/^...
1
vote
1answer
37 views

Convert print statements to log statements using a custom mapping

I want to write or find a plugin that helps me convert print statements to log statements in Python 3. Consider a situation: I am writing some code, I want to add a feature based around some API, I ...
0
votes
2answers
48 views

Where are buffer level variables stored in Vim? And how to get their RAM / storage usage?

Where does Vim store b: buffer level variables / dictionaries? RAM or some kind of file on a disk? If it stores it in RAM, how to get an estimate of RAM / storage used by a particular variable / ...
1
vote
0answers
63 views

NeoVim : Can we “insert literally” every ASCII symbol with `<c-v>` ? (including delete `^?` )

In insert or command mode, the printable ASCII chars, like a can be insert with just a (we don't need <c-v> for those ones, but most of them will still work with <c-v>letter ). If I type, ...
0
votes
0answers
22 views

Nerdtree is slowing down neovim in basic config

I am currently trying to create a neovim environment to see if it can be my primary text editor. But I am already facing a problem with Nerdtree which is making neovim way too slow. I don't understand ...
1
vote
1answer
48 views

Using vim-vinegar or trying to use :e . will crash nvim [closed]

I have recently transitioned from vim8.X to nvim0.4.4 and so far I've been extremely impressed with the development experience. One feature I'm really missing is using vim-vinegar to exit the current ...
0
votes
1answer
77 views

How to customize the name of each tab in Vim/NeoVim?

I have patched my own nerd-font and I want those cool icons for each file-type to be shown in the name of tab in Vim/NeoVim. I guess this can be done easily like I have customized my zsh command ...
1
vote
0answers
72 views

Ctrl-o u in insert mode blocks for a few seconds

If I press ctrl-o u while in insert mode, vim (correctly) does an undo and then the status bar changes to something like 1 change; before #x yy seconds ago and stays so for about two seconds, unless ...
0
votes
2answers
52 views

Possible to increase cursor move speed when holding down (h/j/k/l)?

Is it possible to increase cursor move speed when holding down (h/j/k/l) ? If so, how?
0
votes
0answers
39 views

Increment or Decrement font in a neovim GUI?

I have crawled around forums and didn't found an answer which suits my needs. I want to use Neovim in a GUI, but not being able to change the font size on the fly with a keypress is a complete ...
0
votes
2answers
49 views

How to Create Sublime-Like Build Systems in Vim?

I am currently new to neovim. Something that has me a bit stuck is being able to easily run my code. The text editor I used before trying out vim was Sublime Text 3, and, in that text editor, all I ...
0
votes
0answers
21 views

Attaching audio spoken word “escape” to Esc key stops escape key escaping to normal mode in nvim. How to fix?

I am running the latest versions of: Arch, nvim, and the Openbox window manager. I often don't know whether I have actually hit the escape key or not, when exiting another mode to normal mode. If I ...
0
votes
1answer
22 views

How to run internal (Neo)Vim “:Command” from external Terminal?

I'm using MacOSX, and I have script on Terminal, and since I will probably forget how to update everything inside Vim/NeoVim, is it possible to pass command, e.g. :PlugUpdate, to nvim/vim so that I ...
0
votes
2answers
32 views

How to make neovim cmdline-completion suggests common matched substring?

I've installed vimspector. When I type :Vim in the command & hit tab, I get all matched autocomplete suggestion like VimspectorAbortInstall, VimspectorEval, Vim.... etc. I'm tired to iterate that ...
0
votes
1answer
53 views

VimPlug#begin in both vimrc and init.vim?

I'm new to neovim settings. I'm migrating from vim to neovim. My question is described in the comment below, (*). In ../init.vim I have: set runtimepath^=~/.vim runtimepath+=~/.vim/after let &...
0
votes
0answers
12 views

What is wrong with this errorformat for pdk test unit messages?

Imagine :make outputs the following messages: error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'dupa' (file: /home/kamil/ncbj/...
0
votes
0answers
46 views

Can't use <Tab> in insert mode

I installed neovim on my mac and use the config I have from my Ubuntu laptop but I can't use Tab in insert mode (not indent). I press the tab and nothing happened. Everything is fine on my Ubuntu ...
0
votes
2answers
55 views

How can I make vim check for vimrc updates on startup?

My vimrc file is hosted on github. I update it once in a while, and use it on many different computers. Is it possible to make vim asynchronously check the github repo for a new version of the vimrc ...
-1
votes
1answer
54 views

What is the term of feature used by on-the-fly checkers?

Here are two screenshots, with vim and neovim, both with configured language server protocol and showing same file: Neovim: Vim: I want to configure neovim to have same style as vim -- I do not like ...
2
votes
1answer
40 views

Function keys and <Home>, <PageUp> etc are dead in neovim TUI

I decided to give neovim a try and things mostly work with my vim8 configuration. However, function keys are dead in the text user interface (ok in nvim-qt), i.e. with :map <F1> iFoo!<esc> ...

1
2 3 4 5
14