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
2 answers
219 views

How can I create command abbreviations (`ca`) with the lua api?

In my init.vim, I have the following: ca WQ wq What would be the equivalent in my init.lua?
David Goldstein's user avatar
1 vote
1 answer
144 views

How can I run a java file from a neovim terminal using a remap

For a bit of background, I'm trying to set up a function that runs a java file in Neovim, I've tried using the following autocmd: vim.api.nvim_create_autocmd( { "FileType" }, { ...
Nico Elbers's user avatar
0 votes
1 answer
130 views

How to make zsh detect if terminal session is run inside nvim's :term

I were following the Modern Vim book by Drew Neil. In tip 20 he writes: At a glance, you may not be able to tell whether a shell is running within a terminal buffer or outside of Neovim. In this tip, ...
Vladyslav Rehan's user avatar
0 votes
0 answers
549 views

Spawning language server with cmd: `clangd` failed

I have a c project and I would like to use the feature of LSP in Neovim such as gd (go to definition). I follow each of these materials to configure LSP langserver.org/ Konwing that I need to use ...
HRC's user avatar
  • 11
1 vote
1 answer
99 views

Devanagari in Neovim

It is an old issue, that Vim is not able to correctly display Devanagari (Sanskrit) ligatures as it is non GUI (emacs, gedit do well). In different forums it was discussed in the past (mostly before ...
Denis's user avatar
  • 21
0 votes
1 answer
191 views

Autocmd is breaking my lsp and not working (neovim)

I’m new to neovim so there’s a decent chance this is just a rookie mistake. I wanted to make an autocmd to remap F5 to running the (python) file. I found a stack overflow post on how to do this (https:...
Nico Elbers's user avatar
1 vote
1 answer
485 views

vim-devicons not rendered properly

I am configuring vim-devicons for my neovim and this is my init.nvim: :set number :set autoindent :set tabstop=4 :set shiftwidth=4 :set smarttab :set softtabstop=4 :set mouse=a call plug#begin() Plug ...
Rahn's user avatar
  • 175
1 vote
1 answer
108 views

How to evaluate Lua in substitution field instead of vim script?

As simple example, take this: :'<,'>s/\vs([A|B])\.size\(\)/\={"A":"a","B":"b"}[submatch(1)]/g This substitution will replace sA.size() with a and sB.size(...
Vladyslav Rehan's user avatar
0 votes
1 answer
45 views

NeoVim - Single Redo my mapping containing an <Escape>

Well I know it doesn't work because of the <Esc>, but is there any way to do it so that .(vim single redo) repeats the whole mapping and not only the part after the first <Esc> (without ...
Pixelbog's user avatar
  • 417
0 votes
0 answers
438 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
  • 101
1 vote
2 answers
82 views

Ex global command is silenced, why is execution still stopped on error (Neovim)?

I have a sample text: 123 456 If I delete the first line, why does :silent! execute 'g/123/d' | execute 'g/456/d' work while :silent! g/123/d | g/456/d doesn't work, unless I bring back the first ...
danko's user avatar
  • 11
0 votes
2 answers
101 views

Cannot get block-wise visual selections in vimscript?

I am searching for how to get visual selection in vimscript. And I found this: https://stackoverflow.com/a/61486601/4438921, it is great, but the only issue is that, in block-wise visual mode, I ...
linrongbin's user avatar
0 votes
1 answer
161 views

How to pass an argument to a user command that contains a space

I have a user command that grep-replaces files recursively using vimgrep and cfdo: -- Grep vim.api.nvim_create_user_command( 'Grep', function(opts) if #opts.fargs < 1 then print("...
Martin Braun's user avatar
0 votes
1 answer
211 views

How to replace one char in Neovim?

I used to use s for replacing one char with another. e.g. source: "bla". command: ss. result: "sla" source: "bla". command: 3ss. result: "s" Neovim (using ...
CIsForCookies's user avatar
0 votes
0 answers
174 views

Copy to android system clipboard in nvim from termux

I use Neovim on termux on android 11 I commonly use :y to yank/copy text to nvim clipboard Then paste it to another files Recently I've tried using helix-editor(hx) looks and feels so similar to ...
ANDuser's user avatar
0 votes
1 answer
291 views

CSS Syntax highlighting in NeoVim in a <style> inside an html file?

Just getting started learning Vim/Neovim and am just following along with some tutorials that said to just open up any repo on your system to play around. I noticed that I don't have syntax ...
null's user avatar
  • 101
0 votes
1 answer
593 views

JsDoc typechecks for JS files in Neovim

Is it possible in Neovim to use JsDoc for typechecking of javascript files? Right now I use default LSP configurations for eslint and tsserver provided by lspconfig: -- init.lua require('lspconfig')....
xaxa's user avatar
  • 165
0 votes
0 answers
94 views

How to display LanguageTool suggestions with neovim

I want to see LanguageTool suggestions (not just errors) when using LanguageTool with my LaTeX documents. LanguageTool can output the Error, Context, and Suggestion. However, with my setup (ltex-ls ...
nikost's user avatar
  • 101
0 votes
0 answers
48 views

In Neovim where is {lhs} of triggering a keymap stored? Can we access it?

If we set a keymap that {lhs} is abc in normal mode. For example, local opts = { noremap = true, silent = true } vim.keymap.set('n', 'abc', function() print("Keymap abc!"), opts) If we type ...
HRC's user avatar
  • 11
2 votes
1 answer
585 views

How can I make (Neo)Vim wrap lines in respect to indentation?

Currently, indented lines will wrap all the way to the left of the text area. This is what they look like: This is a long line of text that is indented wi th tabs. In order for it to properly fit ...
natalie's user avatar
  • 23
0 votes
1 answer
44 views

Insert current branch name in insert mode in Neovim

I'd like to create a hotkey to insert the current branch name directly in insert mode with the hotkey <C-b>. I use the plugin gitsigns which has a variable vim.b.gitsigns_head containing the ...
Marc's user avatar
  • 113
0 votes
0 answers
252 views

Neovim diagnostic virtual_text keep on showing only after save current file

this is my neovim diagnostic config, I have enabled "update_in_insert" when diagnostic detect new error, It will show them correctly, but when error is fixed, it still show the old virtual ...
Jeff Jia's user avatar
0 votes
0 answers
43 views

(neovim) nvim_win_get_cursor() gets same value after nvim_input("<CR><Esc>")?

I'm trying to set a key map like local key_map = vim.keymap.set local input = vim.api.nvim_input local opts = { noremap = true, silent = true } key_map('n', '<C-j>', function() ...
HRC's user avatar
  • 11
0 votes
1 answer
38 views

Adding Colorscheme to Neovim conditionally?

I'm trying to create a status line and get the color scheme correctly. I have the function function GetDiagnosticErrorCount() local errorCount = #vim.diagnostic.get(0, { severity = vim.diagnostic....
Marc's user avatar
  • 113
0 votes
0 answers
25 views

Problems with libEG.dll after installing neovide

After installing neovide on my Windows 11 Pro machine, several other apps started to fail because they do not find: C:\tools\neovim\nvim-w64\bin\libEG.dll So I uninstalled neovide, restarted my ...
Antonio Sesto's user avatar
1 vote
1 answer
1k views

How to setup treesitter in vim script?

I have my entire nvim setup written in vim script at ~/.config/nvim/init.vim, but tresitter on it's GitHub says require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" ...
Vladyslav Rehan's user avatar
0 votes
1 answer
105 views

Can't apply config changes to all windows in neovim without closing the buffer at least

I am trying to update the config and see the changes take place without exiting neovim. I have structured my neovim config files like this ~/.config/nvim ├── init.lua └── lua └── [username] ...
me.nkr's user avatar
  • 41
0 votes
1 answer
254 views

Neovim - using patched nerdfont but icon not working

I am using neovim 0.9. I liked JetBrains Mono font so I downloaded the nerd font patched JetBrains font and installed on my Linux Mint 21.1. All is well except when there is an error, neovim ...
ThomasDKim's user avatar
2 votes
1 answer
3k views

Neovim lua module not found even though it exist

I have structured my neovim config files like this ~/.config/nvim ├── init.lua └── lua └── [username] ├── core │   └── options.lua ├── init.lua └── plugins These ...
me.nkr's user avatar
  • 41
1 vote
1 answer
148 views

How do I change the color of the deleted text on the left side of a vimdiff?

My colors currently look like this, with the text highlighted green on both sides: I would like it to be red on the left, and green on the right. I tried to change the DiffDelete highlight, but that ...
vinnydiehl's user avatar
0 votes
0 answers
154 views

How to add fonts/icons to a remote terminal running on ubuntu vm?

I am using lunar vim, and want to add icons to a remote terminal running on ubuntu vm. Is this possible? On vm, output of echo $TERM is xterm-256color. I tried the steps given here https://www....
HarshvardhanSharma's user avatar
0 votes
0 answers
38 views

Cannot connect from python repl to neovim instance which waiting on '127.0.0.1:6666'

I tried to experiment with what the nvim documentation (connecting chapter in api.txt) says. The experiment is to use python repl to execute an instruction to nvim listening for socket communication. ...
ksk srs's user avatar
3 votes
1 answer
232 views

If I set cmdheight=0 I get the "Press Enter or type command to continue" message

If I set my cmdheight=0 then any action I perform like saving the buffer or opening a new buffer or anything trigger the Press Enter or type command to continue message. It annoys me. I want to ...
Nikhil Singh's user avatar
0 votes
2 answers
130 views

How would I bind a keybind that uses Rubber to compile the current file on NvChad?

I'm new to NvChad and would like to learn how to bind <leader>t to execute rubber on the current file. My previous nvim setup had the code nnoremap <leader>t :!rubber --pdf %<CR>. ...
user avatar
0 votes
0 answers
109 views

How to use `Ctrl+c` in Nvim if GNOME terminal SIGINT call was remapped to Ctrl+x?

GNOME terminal SIGINT call was remapped to ctrl+x using stty intr ^X, and ctrl+c was mapped to be 'copy'. In Neovim config I have vim.keymap.set("v", "<C-c>", "\"+y&...
Vlad Mosienko's user avatar
0 votes
0 answers
86 views

fzf.vim - How to search git branch command with git log preview?

I'm trying to create neovim fzf command FzfGBranches to use git branch -a as query, and use git log --oneline as fzf preview: command! -bang -nargs=0 FzfGBranches \ call fzf#vim#grep( ...
linrongbin's user avatar
0 votes
3 answers
1k views

Neovim+PHP basic set up

I’ve been using Vim for years want to try out nvim and a bit confused. Can someone please assist me on how to set up a simple config with Lsp intelephense for php, commenting lines, show folds and fzf....
iaskakho's user avatar
0 votes
0 answers
135 views

Packer or config structure problem

I'm trying to port my nvim configuration to another desktop, but I can't seem to figure out how to make packer work. I enter nvim and I don't see any errors regarding packer at startup, just about ...
enrico223's user avatar
1 vote
2 answers
45 views

How to prevent left/right arrow from cycling through completion candidates on the :cmdline?

Say I have 4 files in current directory: file-bar-01.txt file-bar-02.txt file-foo-01.txt file-foo-02.txt Next, I want to save current buffer to a new file file-foo-03.txt. So I enter :w f and then ...
vim.ggyG's user avatar
  • 181
0 votes
2 answers
1k views

NeoVim: Following the instructions in ":h clipboard-wsl" not work? It shows "no provider" but also "ok" in ":checkhealth"?

I am using neovim on archlinux/WSL2, and try to communicate with the Windows clipboard in neovim. Following the instructions in :h clipboard-wsl, I filled in init.lua with code: vim.g.clipboard = { ...
Jerry Z's user avatar
  • 11
2 votes
2 answers
187 views

Alt > or Alt < mappings do not work

I am trying to configure the key mappings for the barbar plugin commands, specifically the BufferMovePrevious and BufferMoveNext actions. The desired key combinations are Alt < and Alt >. ...
Jastcher's user avatar
1 vote
0 answers
209 views

How to autoformat with efm-langserver

I just want autoformat on save, I don't want it to have any delay. And they say efm-langserver is best choice. After I installed via AUR yay -S efm-langserver, that's only I know what to do. How do I ...
Happy Cakiey's user avatar
1 vote
1 answer
139 views

Neovim append method does not works on matchpairs

I want to append <:> to vim.opt.matchpairs, which AFAIK is a string type. Neovim lua doc says: vim.opt:append() Option:append(value) ...
manungsa's user avatar
1 vote
2 answers
166 views

LeftMouse focus window without moving cursor

Is there a way for clicking on a Vim window to focus that window if inactive (without moving the cursor), then move the cursor if the window is already active? Here's what I've got so far: function ...
thirstyice's user avatar
0 votes
0 answers
25 views

How to check if a function is deprecated using NeoVim Lua api

I'm currently working on neovim plugins that use vim functions through the Lua API. However, I'm not sure how to determine if a particular Vim API function is deprecated or not using the Lua API. For ...
Danielo515's user avatar
0 votes
0 answers
59 views

How to remove non printable chars in lua?

I am using astronvim. Installed copilot and set hotkey ctrl+l. Here is the code itself, lua on top, plugin below. mappings.lua file return { n = { ["b"] = { "<Plug>Sneak_S&...
serii 's user avatar
  • 57
0 votes
0 answers
48 views

Neovim startup: faster on the second run, how do I warm it up?

I noticed that the second time I run nvim it loads much faster (on Windows 11). Ideally, what I want is this something like nvim --warmup-then-exit, which I would run on session startup/login. How ...
Guy Langston's user avatar
0 votes
0 answers
440 views

error "attempt to index global 'keymaps' (a nil value)"

I am on Mac with nvim v0.9.0. I have the following „init.lua“ config loaded: vim.g.mapleader = '<Space>' local keymap = vim.keymap keymap.set("i","jk","<ESC>")...
dragontec12's user avatar
0 votes
0 answers
179 views

Making vim-fugitive compatible with file explorers

I have the vim-fugitive plugin and use :G a lot. If I have NERDTree as a plug or netrw enabled then :G will open either a NERDTree file or a netrw file instead of the usual fugitive file with the ...
hilbor's user avatar
  • 15
0 votes
1 answer
62 views

NeoVim - Interact with the thing that pop ups when you type in a command

Questions How can I type something in there? What even is the name of this thing? Problem If you type in for example :!echo 'Hello World' This kinda terminal thing pops up I want to interact with ...
Pixelbog's user avatar
  • 417

1
3 4
5
6 7
33