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
3 votes
1 answer
11k views

Why files in `~/.config/nvim/after/ftplugin/` are not taken into acount?

My neovim doesn't load file type plugins when loading a ruby/eruby file. Here is the corresponding configuration files: for f in ~/.config/nvim/after/ftplugin/* ; do echo "# $f" ; cat $f; done # /...
psychoslave's user avatar
3 votes
1 answer
307 views

How can I call function in visual mode

I want a function to change underline word to little camel for one line. When I use <shift+v>:s/_\(\w\)/\u\1/g, it work fine. And then I want to make a function to simplify it, <shift+v>:...
Sangria's user avatar
  • 33
3 votes
2 answers
2k views

E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3

I'm switching from vim to neovim, but when starting neovim, I get the following error on startup: E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3 What does this mean, ...
Tom Hale's user avatar
  • 2,601
3 votes
2 answers
3k views

Getting an RGB color from highlight group

In putting together and addon for blender to integrate neovim. Where I'm at with it, github colo imported to blender text editor from nvim_gtk One component is grabbing the current colorscheme of a ...
batFINGER's user avatar
  • 133
3 votes
1 answer
152 views

Setting to prevent <c-h> to erase text

I have a map which allows me to navigate with hjkl in insert mode: " In insert or command mode, move normally by using Ctrl inoremap <C-h> <Left> inoremap <C-j> <Down> ...
Diego Somar's user avatar
2 votes
2 answers
348 views

Neovim - Map selectively only on a terminal window

I like the terminal in neovim. I am accustomed to tmux and tmux's copy-mode, and type q to exit copy-mode to return back to regular-interactive-mode. Now, in neovim, when in NORMAL mode (which is akin ...
Lakshman Kumar's user avatar
2 votes
2 answers
939 views

Where does neovim store its defaults? Where is the defaults.vim for neovim?

On regular vim, you can find the defaults in defaults.vim. These are sourced when there is no .vimrc, or when you include in your .vimrc the following, source $VIMRUNTIME/defaults.vim " Source ...
Evan Carroll's user avatar
  • 1,226
2 votes
2 answers
1k views

Make `!` work with powershell (neovim)

I want to use ! with powershell. I use neovim natively on windows. I tried these settings set shell=powershell.exe set shellcmdflag=-NoProfile\ -NoLogo\ -NonInteractive\ -Command set shellpipe=| set ...
eyal karni's user avatar
  • 1,058
2 votes
1 answer
75 views

Neovim: Converting Vimscript Terminal Functions to Lua

Author: @mizlan Source: https://github.com/mizlan/vim-and-cp/blob/master/cp.vim#L16 This code adds charm to neovim integrated terminal. For cpp programs, I have these: F9 compile, F10 run, F12 ...
Mega Bang's user avatar
  • 199
2 votes
2 answers
78 views

Lua Conversion: Disable highlight after search when a motion is triggered or when entering insert mode

Author: @purpleP Source: Turn off highlight on CursorMoved and InsertEnter without remapping (doesn't break search operator pending mode) noremap <expr> <Plug>(StopHL) execute('nohlsearch'...
Mega Bang's user avatar
  • 199
2 votes
1 answer
2k views

How to disable autoformating on save on LazyVim?

On LazyVim when I save a cpp file it is automatically formatted. It is possible to disable/enable it in the session using Spaceuf But I would like to disable that autoformatting on save functionality ...
Vivian De Smedt's user avatar
2 votes
2 answers
3k views

Recommended way to run vimscript normal commands with lua

What is the recommended way to run VimScript normal commands in Neovim with Lua? Sometimes, I can achieve things very easily with a few keypresses executed as a normal command compared to scripting ...
matko031's user avatar
2 votes
0 answers
337 views

vim auto indent suddenly stopped working

Recently, neovim auto indent was working fine, but suddenly it stopped working. here is my ~/.config/nvim/init.vim:- call plug#begin('~/.local/share/nvim/plugged') Plug 'townk/vim-autoclose' Plug ...
user avatar
2 votes
2 answers
2k views

No folding of markdown files

Running neovim 0.1.7. When I open a markdown file, it does not fold - even when I try zM zR zc, etc. :set tells me ft=markdown and foldmethod=syntax How do I get the folding?
deshmukh's user avatar
  • 265
1 vote
1 answer
332 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 ...
raylight's user avatar
  • 525
1 vote
1 answer
3k views

Syntax highlighting is incomplete on neovim, fixed by calling Telescope

I have this problem that I would really like to get to the bottom of. If I open a file on neovim it will display like the broken syntax highlighting, see image below. Now, If I run :Telescope ...
filype's user avatar
  • 283
1 vote
2 answers
162 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
1 vote
2 answers
56 views

Conversion in Lua: how to tabdo all the visible buffers without changing view of the current tab?

Related to this post, how to tabdo all the visible buffers without changing view of the current tab? function! TabLcd() let current_tab = tabpagenr() tabdo <commands> execute '...
Mega Bang's user avatar
  • 199
1 vote
1 answer
68 views

Conversion in Lua: Detect OS in Vimscript

Related to this post, Detect OS in Vimscript This configuration detects and sets the operating system in Vim. It uses conditional statements to determine if the OS is Windows or Unix-like. if !exists(&...
Mega Bang's user avatar
  • 199
1 vote
1 answer
692 views

How can I re-run my init.lua?

If I'm making changes in my init.lua file, is there anyway to have those changes reflect in my current copy of Neovim without restarting the editor? Not limited to mappings, but is there something ...
Evan Carroll's user avatar
  • 1,226
1 vote
1 answer
12k views

How to install neovim with +clipboard extension?

I have NVIM v0.4.3 installed on Debian 10. When I run: :echo has('clipboard') I get 0, which means that this extension is not available. I cannot copy to OS clipboard using "+y and "*y ...
niekas's user avatar
  • 1,535
1 vote
2 answers
6k views

How do I port a filetype command to neovim's lua format?

Currently my .vimrc file has this in it, filetype plugin indent on -- filetype detection[ON] plugin[ON] indent[ON] How can I port filetype plugin indent on to neovim's lua format?
Evan Carroll's user avatar
  • 1,226
1 vote
1 answer
907 views

How can I change the cursor moving on ctrlp?

I want to change the key mapping when I run CtrlP. For example, if I press ctrl+p to run CtrlP, type in something, and try to move the cursor to choose a file, I want to use ctrl+j to move down, and ...
Blaszard's user avatar
  • 545
1 vote
2 answers
187 views

Close buffer in the other instance

When a file is being opened neovim warns that swap file already exists, at which point you can't safely open a file without first closing it in the other instance. I frequently have many projects ...
Rizhiy's user avatar
  • 133
0 votes
2 answers
71 views

How to open files from terminal in desired pattern (tabs, vertical and horizontal splits on desired files)

So, I wrote next bash script: #!/bin/bash if [ "$#" -gt 1 ]; then path=$1 else path=$(cat subject.txt | tr -d '\n') fi nvim -p 1 "setup/$path/body.tex" -p 1 preamble/...
Vladyslav Rehan's user avatar
0 votes
2 answers
72 views

`Cmd+V`/`Ctrl+V` pasting has an extra new line

In init.vim I have the following setting to ensure the text is yanked to the system clipboard: set clipboard^=unnamed,unnamedplus In Neovim, I select the lines with visual line mode (V) and copy them ...
Wenfang Du's user avatar
0 votes
1 answer
223 views

Focus-follows-mouse in Neovim?

Is it possible to get focus-follows-mouse behavior in terminal Neovim? Please note this is different from this question about how to focus a window by clicking the mouse. This question is about how to ...
Alex Burka's user avatar
0 votes
0 answers
27 views

How to apply TS directive to correct child?

In my sidequest of hiding tailwind classnames, I first realized regex based conceal wasn't going to work due to my love of treesitter, therefore I need to instead use queries! and once again, I am ...
Zynh Ludwig's user avatar
0 votes
2 answers
3k views

neovim: how to close the terminal buffer by just pressing enter?

NVIM v0.2.2 Build type: Release LuaJIT 2.0.5 Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -...
quanta's user avatar
  • 131
0 votes
1 answer
15 views

Conversion in Lua: How to display multiple changed files on disk in Vim?

Related to this post How to display multiple changed files on disk in Vim?, I want to implement this feature in Lua. Some help would be appreciated. set autoread autocmd FocusGained,BufEnter,...
Mega Bang's user avatar
  • 199
0 votes
0 answers
70 views

How to load method definition in a popup?

This is a followup to this question, where I would like to load the method definition in a pop-up rather than a split screen (or the whole screen for that matter). Attempt 1: using nui.vim I’m using ...
abbood's user avatar
  • 671
0 votes
1 answer
909 views

"Error detected while processing TextChangedI Autocommands for "<buffer=4>":" ParInfer Neovim [closed]

I'm setting up parinfer plugin for lisp development in neovim. I've installed neovim plugin using below code - use 'gpanders/nvim-parinfer' And I've also setup below configuration -- parinfer options ...
Rajkumar Natarajan's user avatar
0 votes
0 answers
2k views

Error trying to install packer in neovim

Inspired by this video by The Primeagen, I'm trying to install packer.nvim by following the instructions on its github page. I did this: git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ...
MDeBusk's user avatar
  • 363
0 votes
1 answer
375 views

Shortcut to open definition of variable in a vertical split with Neovim mapping

This is a follow up question to this post where I would jump to the definition of a variable in a vertical split for ctags. I’m currently using an lsp language server like so: local bufopts = { ...
abbood's user avatar
  • 671
0 votes
0 answers
268 views

How come `pip install cmake` is not enough to build neovim?

I just built neovim from source for the first time on linux (Pop!_OS 22.04 LTS x86_64), and I got stuck for a while on something silly. In the Build prerequisites I saw that CMake was (of course) ...
bluthej's user avatar
0 votes
1 answer
159 views

Get visually selected text - weird behavior when last selected char is multi-byte

I have made a simple function to echo the visually selected text. The function is simplistic as I am only interested in max one-line selection. The problem is, if the last character of the visual ...
skamsie's user avatar
  • 235
0 votes
1 answer
450 views

Build errors when installing neovim from source in Debian ModuleNotFoundError: No module named 'ninja'

I am facing some build errors in building Neovim from source in Debian (MxLinux). I tried the package installer and was able to install Neovim, but it is an older version. So, I installed all ...
Aparmar1's user avatar
0 votes
1 answer
64 views

How to disable lsp server syntax highlighting?

I found out that my lsp servers is somehow adding this ugly highlighting to my code (this happened after I updated my Homebrew for some reason), here are before and after pics: Here is my lsp server ...
abbood's user avatar
  • 671
0 votes
1 answer
257 views

How to make a toggle function in .vimrc that toggles multiple configs of almost same type?

My .vimrc code autocmd FileType cpp nnoremap <F4> :RunWithFile autocmd FileType cpp nnoremap <F4> :RunWithFile ~/Downloads/ > output.txt && cat output.txt<s-left><s-...
Mega Bang's user avatar
  • 199
0 votes
1 answer
55 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' |...
Mega Bang's user avatar
  • 199
0 votes
2 answers
58 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 ...
Mega Bang's user avatar
  • 199

1
2