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

Neovim rplugin: why does vim.async_call(print, "msg") not echo?

In a traditional :python3 plugin, I can call print("msg") to echo a message. In a remote plugin function, I expect that calling vim.async_call(print, "msg") would do the same thing,...
1
vote
1answer
56 views

how to tabdo all the visible buffers without changing the current tab?

My init.vim code: cd ~/Documents/cp nnoremap <leader>lcd :tabdo lcd %:p:h<cr> suppose, i have 4 tabs opened in nvim via using nvim -p A.cpp B.cpp C.cpp D.cpp A.cpp B.cpp C.cpp D.cpp ...
1
vote
1answer
155 views

Neovim: How to start developing python plugins which run long-blocking code?

EDIT2: A user suggested that I may be going about this in a fundamentally wrong way, in particular in that I am not using remote (new-style) plugins and am trying to use async python code where it ...
-1
votes
2answers
2k views

short key mapping by lua for neovim

the simple why to remap key in lua is: vim.api.nvim_set_keymap('n', 'foo', 'bar', { noremap = true, silent = true }) but i want a simple syntax like vimScript: nnoremap foo bar n_keymap('foo','bar') ...
0
votes
1answer
88 views

Vim locks up completely when pressing `ctrl+w` while using tmux + vim

I have a tmux + vim setup in which I use split panes. Every time I press ctrl+w to move between the vim panes, my vim instance becomes completely unresponsive. At first I thought this was a tmux issue ...
1
vote
1answer
303 views

How to pass a shell command to a vim function and execute it in the neovim terminal?

I've recently switched to neovim (NVIM v0.4.4) from vim. Previously in my .vimrc file I had these two mappings that allowed me to run javascript and c++ files inside vim. nnoremap <f4> :!node %&...
1
vote
1answer
50 views

Character level buffer modification

It is possible to modify buffer at the line granularity. E.g. :py3 vim.current.buffer[0] = "abc". But it deletes the attached marks even if a single character is replaced. Is it possible to ...
0
votes
1answer
57 views

smart single or multiple character deletion of x

I want vim to ignore whitespace copy Default cut x will work same but When i cut one whitespace character or a visual block of whitespaces with x, vim register won't copy like this thread, Vim ...
1
vote
0answers
49 views

Cricle through brackets mapping [closed]

I'm using bracket a lot and I'm trying to quickly circle through the bracket in both back and forth with the following mapping: nnoremap 0 f) nnoremap 9 F( Unfortunately, it does not work. Any ...
0
votes
0answers
19 views

how can i define g:errorMessageString as a List?

related to this thread Multiple error messages in vim message history How can i define g:errorMessageString as a List? Can anyone help me fix this? i am using this code in my vimrc but i don't know ...
0
votes
0answers
37 views

How can vim show multiple files are changed on disk?

How can vim tell me which buffer is changed on disk among multiple buffers? related to this thread, @b-layer helped me my current vimrc code: set autoread autocmd FocusGained,BufEnter,CursorHold,...
0
votes
1answer
33 views

How can vim tell me which buffer is changed on disk among multiple buffers?

I am using this code in my vimrc if a file is changed outside vim, it shows File changed on disk. Buffer reloaded. set autoread autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' |...
0
votes
1answer
33 views

Replacement of characters gives ^@ when replaced with newline but not newline [duplicate]

Why does replacement of something by using :%s/,/\n/gc in vim gives me ^@ instead of giving me newline. Sed replacement works perfectly sed s/,/'\n'/g. Any idea how to do sed thingy in Vim and save ...
0
votes
0answers
55 views

How to change color of tabbar of neovim

How can I change the color of tabbar background (which is green in below screenshot)
0
votes
0answers
37 views

How do you get Vim/Neovim to stop hard wrapping comments?

I thought that with formatoptions-=c, vim wont automatically format comments, but for some reason with setlocal formatoptions=ant and textwidth=80, neovim is still hard wrapping markdown comments (<...
1
vote
3answers
1k views

Neovim lua config: how to append to listchars?

In a neovim init.lua config, I know that I can append to a string like so: vim.opt.wildignore:append("*/node_modules/*,*/vendor/*,*/venv/*,*/.venv/*,*/target/*") However, I'm getting errors ...
0
votes
1answer
144 views

Neovim fail to open file via scp - Undefined variable: b:netrw_method

I am opening a remote file with this command: [n]vim scp://user@host/relative_file Vim (8.2) opens the file correctly, but Neovim (v0.5.0-dev+1186-g8665a96b9) just shows a blank file and a blank ...
1
vote
0answers
95 views

How to set copyq to handle clipboard

I want to let CopyQ clipboard manager handle clipboard (am using set clipboard+=unnamed setting). To that end, this setting was added to init.vim file: let g:clipboard = { \ 'name': '...
0
votes
0answers
33 views

should i use getcwd(-1) or getcwd(-1, -1) in neovim?

related to this vi.stackexchange post How do you go back to your to global current directory after inheriting an lcd what should i use in my neovim? @mass @elliottcable
0
votes
0answers
29 views

How to instantiate/setup a plugin (VGit) in Neovim?

I am new to NeoVim and slowly converting to it as my main tool of choice for editing and development in general. I came across the VGit plugin and decided to give it a try but the setup section ...
0
votes
0answers
63 views

coc diagnostic signs displaying incorrectly

My coc settings are practically copied and pasted from nicknisi/dotfiles. I'm using SourceCodePro from Nerd Fonts. { "suggest.enablePreview": true, "codeLens.enable": true, ...
0
votes
1answer
43 views

Is it possible to exclude special buffers from the v:oldfiles list?

I use the :oldfiles command a lot, but it's annoying that it gets populated with things like terminal or help buffers. My understanding is that any buffer for which a mark exist will be listed by the ...
3
votes
0answers
116 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, ...
0
votes
1answer
42 views

Inconsistent behavior of dj and other motion-delete operations

I'm running Neovim 0.5.0 locally. I'm going through Harvard's CS50 course and they have an IDE (accessible here: https://ide.cs50.io/) with a shell that's running this version of Vim: version 8....
0
votes
1answer
27 views

v alias to open new buffer with tab completion

I have 'alias v="nvim"' in my zshrc, and when I'm inside neovim and want to open a new buffer I always start writting :v path-to-file then I realize and I have to change it for :vi path-to-...
0
votes
1answer
152 views

How to set the diagnostic level for neovim lsp

By default the lsp has set the diagnosticLevel to Hints, i wanna set this to information level. I tried looking at various places but couldn't find much. I am using LunarVim config if that gives extra ...
1
vote
1answer
120 views

What is the equivalent command to :% terminal bash on NeoVim?

When I'm using Vim, I can execute bash or node.js files by using :%terminal bash or :%terminal node... I like to execute them like this inside Vim because it works in an interactive way, so I can see ...
0
votes
0answers
32 views

How can I make this comment script work for certain filetypes?

I got this code from voyeg3r's gist @d-ben-knoble helped me add a feature I wanted in this QA. Now I want this code to support commenting out certain filetypes like conf, mail, tex and so on. My ...
2
votes
2answers
400 views

Get value of $MYVIMRC from Lua

I am trying to retrieve the value of $MYVIMRC in my init.lua but I am coming up short because I don't understand what $MYVIMRC actually is. It is not a global variable, is it? None of these work: vim....
0
votes
2answers
50 views

How can I change this comment plugin to work at the start of the line?

I got this from voyeg3r's gist He and @dave-kennedy made it 3 years ago. I am here because I couldn't contact them Can someone help me add a feature such that this vimscript code puts comment out ...
3
votes
1answer
87 views

Show lines, words, and character count in fold text

I just joined community, and have a quest: I would like to show more content in the fold text marker for folded regions in [Neo]VIM (especially for Markdown files). The default fold text shows number ...
1
vote
1answer
25 views

How to match two parts of error message and concatenate them?

I try to read :h errorformat: %m error message (finds a string) I try to read it, but I practically found that it's impossible to specify %m twice: E372: Too many %m in format string I ...
3
votes
4answers
664 views

Open another file in split view that sits within the same directory as the currently opened file

I know there's a file called handler.ts in the same directory as the currently opened file handler.test.ts. How do I open that file in a split window (horizontal or vertical) without doing this: Ctrl+...
3
votes
1answer
155 views

Can macros be edited? [duplicate]

I want to end up in insert mode after a macro. Is there a way to do that? A real life example: Given "foo", I'm wanting to convert it into "$123" where the number is something I ...
0
votes
1answer
1k views

How can I comment multiple lines on NeoVim?

On Vim, when I want to comment multiple lines I always use the following procedure: 1. select the first caracter of your block 2. press Ctrl+V ( this is rectangular visual selection mode) 3. type j ...
0
votes
0answers
42 views

How to find all function in runthime by Telescope

i'm using a lot of plugins in neovim, for each plugin , we have a lot of function How can i grep all function by telescope :Telescope find_call then run this function if possible
1
vote
0answers
74 views

What does "bound to github" mean?

The lastest Vim documentation has this paragraph: Neovim A Vim clone. Forked the Vim source in 2014 and went a different way. Very much bound to github and has many more dependencies, making ...
0
votes
1answer
98 views

manually set syntax highlighting works from command-line mode but not from .vimrc/init.vim

The gruvbox colorscheme and syntax highlighting for C++ doesn't highlight some elements such as: string vector I have this: So I decided to change the colors manually using in init.vim syn keyword ...
4
votes
0answers
73 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 ...
2
votes
0answers
158 views

Does vim-easymotion only work in neovim?

I was wondering if the easymotion-overwin was compatible with vim, or does it only works in neovim? I have my .vimrc's keymaps setup like this for easy-motion "----- Easy-Motion ----- map <...
0
votes
1answer
232 views

Mapping Leader to a Ctrl combination not working/being ignored in NeoVim mappings?

I'm trying to map my leader to <C-s> and local leader to <C-q>, in my NeoVim (0.5.0) init.lua file. I know Ctrl-S and Ctrl-Q are software flow control, and I mainly use the terminal ...
0
votes
1answer
155 views

vim-test :TestSuite return message Not a test file

It's a really simple setup. I'm actually following along with the modern vim book. (I've been using vim emulation on IDEs for years and want to fully dive in). Anyway, my project structure is: ...
0
votes
0answers
27 views

Make keypresses stay in the bottom-right until the next action

Say I type ciw then it will show c then ci then blank. Is it possible to keep it there until I start a new sequence of commands? I'm assuming that since a lot of videos I see use an overlay logging ...
1
vote
1answer
21 views

How can I make Packer ignore the splitright setting?

I have splitright set in my init.lua so that when I run :vs, the new split opens on the right. Using Neovim 0.5-HEAD, Packer follows this setting and opens its splits on the right. I would like these ...
1
vote
0answers
51 views

neovim, vimscript execute keystroke from function

I am trying to execute a keystroke from function when its called. However, it does not work. function SmartNERDTreeFocus() if expand('%') =~ 'NERD_tree.*' normal <C-w><C-p> ...
0
votes
0answers
23 views

`echohl` not highligthing with custom color, but its working with the defaults

in my init.vim (.vimrc) file i have this: hi TerminalGreenColor guifg=#6bd676 function! EchoInitVimReloadedSuccessfully() echon " -- [ " echohl Identifier echon "init.vim&...
0
votes
1answer
56 views

Define default value to a variable

I want to assign an expression to a variable, and if it has no value, use some default. On almost every programming language I can use something like: let linked_hl_id = hlID(l:linked_group) || 114 ...
0
votes
1answer
88 views

How to get range value of a ex-mode command in Lua?

I want to get the range of ex-mode command in Lua(eg 1 and 3 in 1;3d). The range value should be stored as a:firstline and a:lastline in vim, but based on the doc, a is not implemented in the vim ...
0
votes
1answer
51 views

How to remap `m` key correctly?

I want to remap the m key for executing a function after a mark is set. I tried with this function but it doesn't work. The mark function is not running correctly, and hello world is never printed. ...
1
vote
1answer
133 views

Problem with compiling/running a file in neovim

When I try to run a file with Neovim it shows me this: It doesn't allow me to type any input. How can I type some input using Neovim ? This is my script for compiling: g++ -static -DLOCAL -lm -s -x c+...

1 2 3
4
5
18