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
120 views

Is there way to use Obsidian Sync from Neovim?

Now, when I make changes in my Obsidian notes using Neovim I need to keep Obsidian app opened, to make Obsidian sync work. Is there a way to make it sync without keeping app opened?
Vlad Mosienko's user avatar
0 votes
0 answers
21 views

Compile Neovim failed for "unprotected error in call to Lua API (26)"

Run make CMAKE_BUILD_TYPE=RelWithDebInfo got following errors: With little knowledge of lua, I have no idea how to solve this... touch build/.ran-cmake ninja -C build ninja: Entering directory `build'...
tangxindan's user avatar
0 votes
1 answer
19 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
2 votes
2 answers
154 views

See Last Commands Output from the Terminal Buffer

Lets say I run the external very_long_taking_command like this: :!very_long_taking_command and I get the output in this Vim Terminal where it says "Press ENTER or type command to continue". ...
Bog's user avatar
  • 457
2 votes
1 answer
228 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
3 votes
0 answers
186 views

How to copy to system clipboard using Mosh + Tmux?

I've set vim.opt.clipboard = "unnamedplus" to copy to/paste from the system clipboard. However, I noticed that the behavior differs whether I'm using nvim in my local machine, a remote ...
Gianluca's user avatar
  • 131
2 votes
2 answers
132 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
1 vote
1 answer
250 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
161 views

Unable to install coc-clangd

When I use the command :CocInstall clangd to install coc-clangd, it will throw the following error: [Coc.nvim] Error on install coc-clangd: AggregateError Why do I get this error? OS: Archlinux ...
Sam Ma's user avatar
  • 113
1 vote
0 answers
76 views

Unable to configure buildFlag for gopls with mason

I'm using kickstart on my vanilla Neovim config and having some troubles with configuring buildFlags for my gopls. I added uncommented gopls and added following config in my init.lua Spent few hours ...
user3194649's user avatar
2 votes
1 answer
914 views

How to exclude some files and folder in telescope?

I want to exclude package-lock.json and lazy-lock.json on telescope but I cant make it work. Both files are not included in .gitignore but I don't want to search on them. This my config for telescope ...
zer09's user avatar
  • 179
1 vote
2 answers
61 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
3 votes
1 answer
179 views

# key causing delay in Neovim

Whenever I input # in Neovim I get delay. I tried to fix this with nnoremap # <nop> vnoremap # <nop> In my init.vim but that seemed to only fix it in non .tex environments. I assume this ...
Maths Wizzard's user avatar
0 votes
1 answer
194 views

I need help updating config code from vimscript to lua

About three years ago, I had gathered chunks of code from the net and made my init.vim config file. Now, with Lua released, I am unable to convert it. And it's down to you folks whether you can help ...
Mega Bang's user avatar
  • 199
1 vote
1 answer
200 views

How to add a keymap for a visual mode plugin command and pass it the visually-selected range?

I have the linediff.vim plugin installed. Its main command :Linediff only works for visual mode, to which I'd like to add a keymap for this command. I'm using Neovim's Lua API, so I tried this: vim....
Jethro Cao's user avatar
1 vote
1 answer
91 views

Toggling the `spell` option with Lua does not redraw the screen until an additional command is entered

While porting my init.vim to init.lua, I noticed some strange behaviour. In vimscript, one can toggle spell in the following way: noremap <Leader>ss :setlocal spell!<CR> Observe that this ...
Phro's user avatar
  • 121
0 votes
0 answers
92 views

I broke nvim and it's no longer usable

I broke nvim and now it's unusable. I was experimenting with ways of executing a command under the cursor (while editing) and having the command's output inserted into the buffer. In my buffer, I had ...
LiamF's user avatar
  • 185
0 votes
1 answer
120 views

How make nvim NOT to remove trailing spaces?

There is a not-so-well formatted text file (c# code). Some lines in this file contain trailing spaces. I do not want to fix these trailing spaces (let 'git blame' blame those who wrote these lines!) ...
lesnik's user avatar
  • 451
1 vote
1 answer
68 views

What is the meaning of lbr in Vim?

I write set lbr in my vimrc file but I don't know the meaning of that. What does this option do? I know it's about line-breaking but I need more explanation. This is from the Vim document and I can ...
mohamadi_arch's user avatar
0 votes
1 answer
636 views

Error when configuring lspconfig with mason

I'm trying to set up autocompletion, fixing, etc. for lua files in Neovim. I started by trying to follow the instructions from this video: https://www.youtube.com/watch?v=lpQMeFph1RE&t=188s ...
quant's user avatar
  • 101
1 vote
2 answers
37 views

Switch modes without losing the selection

I use VsCode with Neovim extension. Sometimes I have to add different quotations or underscores or edit parentheses around a word but the words or marks around them aren't always straightforward or ...
mpower's user avatar
  • 111
1 vote
1 answer
127 views

Making a shortcut for compiling in C

I've changed my code a million times and can't get it right. I want to compile the file I have open with whatever its name is minus the .c that comes after and I want to do it on a second terminal to ...
Baguaguy's user avatar
0 votes
1 answer
191 views

In Lua, how can I check if a buffer exists on disk?

I use Neotree on Neovim, and have mapped a key to open the file browser which is supposed to: open the file browser pointing to the current file if there is no filename, open the file browser at the ...
artfulrobot's user avatar
0 votes
1 answer
86 views

Neovim slow while compiling LaTeX [closed]

When I compile a .tex file using vimtex it takes a hot second to compile. Following this post I obtained the profile.log while compiling latex [given below is just the sorted part] FUNCTIONS SORTED ...
kay's user avatar
  • 61
0 votes
1 answer
60 views

How to edit WebAssembly Text Format (`.wast`/`.wat`) files using NeoVim?

The latest version of VIM includes some basic support for .wat files (although it doesn't highlight the global directives directly), but the latest version of NeoVim doesn't. In NeoVim, I can set the ...
FlatAssembler's user avatar
0 votes
0 answers
55 views

Recommended configuration of npm for working with Neovim and LunarVim in Debian stable

I'm trying to figure out how to set up npm the "best" way for my future Neovim+LunarVim use in Debian stable. I installed the latest stable Neovim from source and I'm in the process of ...
pipe's user avatar
  • 239
0 votes
1 answer
53 views

How to traverse folders in :edit command dropdown menu

When opening a new file I use :e <tab> then a dropdown appears showing files in the PWD, I can move up and down with <tab> and <shift>+<tab> Pressing <enter> accepts the ...
Susensio's user avatar
  • 103
1 vote
0 answers
418 views

TypeScript LSP Not Reading tsconfig.json

I am almost certain that I have a mistake in my Neovim configuration... The Neovim ~/.config/nvim directory I'm using is: https://github.com/andrewgregorywright/nvim-config/tree/main I've created an ...
Andrew's user avatar
  • 111
4 votes
1 answer
113 views

Why doesn't Vim recognize a pair of <\> as a single unit?

I'm kind of confused about why doesn't Vim accept di> operation on this piece of text: <This is a random text but has a backslash at the end\> but rather does on this: <This is a text with ...
nekomekoraiyuu's user avatar
0 votes
0 answers
45 views

Nvim-lspconfig sorting diagnostics floating windows

Is there a way to raise floating windows by their type in nvim-lspconfig? Like in this situation I would like to see the documentation window above the errors window. Many thanks in advance.
Thomas's user avatar
  • 1
0 votes
0 answers
26 views

Ugly border line after running shell command in Neovim

How to remove this kind of status line that appears after I get result of running shell command in Neovim using exclamation mark (!)? NVIM v0.8.1 with lualine.
Gleb Voitko's user avatar
1 vote
2 answers
181 views

Conditional keymap

Is it possible to map a key (e.g.: Alt h) to _ (to go to the first character in the line), but to |, when already there? Perhaps in nvim/lua? What I have tried is: vim.keymap.set({'v', 'n'}, '<A-...
Alois Pichler's user avatar
1 vote
0 answers
84 views

How to prevent the ansible format from getting overwritten?

I am using this plugin for ansible: ansible-vim, I am installing it with lazy like this: return { 'pearofducks/ansible-vim', build = 'UltiSnips/generate.sh', lazy = false } When opening a file ...
nbari's user avatar
  • 131
2 votes
0 answers
41 views

Error setting up julia language server in Neovim

When I try to use julials I get the following prompt: Client quit with exit code 1 and signal 0 These are the lsp log [ERROR][2023-09-24 23:12:43] .../vim/lsp/rpc.lua:677 "rpc" "/...
kay's user avatar
  • 61
2 votes
1 answer
91 views

How do I tell (*Neovim*) that `.ipynb` files have 1 space indents, so indent guides are correctly shown?

I'm using the Indent Blankline plugin to show indent guides. My Jupyter Notebook/.ipynb files have 1 space indents. Vim identifies them as JSON files. One way to tell Neovim that Jupyter Notebook ...
simonzack's user avatar
  • 125
0 votes
1 answer
108 views

How to overwrite ftdetect from a plugin loaded with lazy?

I am using ansible.vim I am loading it with lazy: return { 'pearofducks/ansible-vim', } and this is the configuration I have for ansiblels: ["ansiblels"] = function() ...
nbari's user avatar
  • 131
0 votes
0 answers
39 views

How to change spelllang alias in vim-airline (option `vim.g.airline_detect_spelllang = 1`)?

I have enabled the vim.g.airline_detect_spell = 1 and vim.g.airline_detect_spelllang = 1 options (config is written in Lua and can be found here). The vim.g.airline_detect_spelllang = 1 makes the vim-...
Vladyslav Rehan's user avatar
0 votes
0 answers
19 views

switch to terminal opened from autocomand

I am trying to create autocommand to run current python file in a terminal, when it is saved. It is working with the following autocommand: vim.api.nvim_create_autocmd("BufWritePost", { ...
user48990's user avatar
0 votes
0 answers
230 views

How to fix 'error pwsh: not available' in Neovim healthcheck?

I am on Windows 11. I do not understand what the issue is about or how can I fix it. I just know that 'pwsh' is not recognized as an excutable but I can execute powershell by running powershell.
samuelnihoul's user avatar
1 vote
1 answer
107 views

How can I edit a file in real-time?

I would like to edit a file using Neovim and have changes saved in real-time (changes should be written to the file as I am typing), which will be displayed by an OBS plugin. Is this possible?
CoffeeDev's user avatar
2 votes
1 answer
163 views

How can I prevent the present working directory to sync between tabs in Neovim?

I think this behavior is annoying because I want to use tabs specifically to be able to work on two directories simultaneously.
samuelnihoul's user avatar
1 vote
1 answer
84 views

What are the differences in use case between tabs and buffer in Neovim?

Especially in the case of having a buffline.
samuelnihoul's user avatar
2 votes
1 answer
612 views

How can I go to the definition (gD) in a new tab?

I am using Typescript and I have this config for going to the definition when hovering over a function name: vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) -- does not work vim.keymap.set(...
bigpotato's user avatar
  • 123
2 votes
1 answer
373 views

Use treesitter to jump to next argument without going into nested function calls

I'm hoping to write a macro that involves jumping to a second argument of a function call and deleting it. The function arguments will sometimes include nested function calls, sometimes not, will ...
Michael's user avatar
  • 121
0 votes
0 answers
187 views

How do I configure NeoVim to use angularls when working on Angular code?

I work with AngularJS an I'm really missing a good way to navigate the code with NeoVim. I would like to have the same facilities, if possible, that I have using the angularls for Angular. How do I ...
Anderson's user avatar
2 votes
2 answers
263 views

How to exclude filetype in autocmd using Neovim's Lua API?

Translating this excellent Vimscript answer for creating an autocmd that applies certain options only to the focused window into Lua, I have the following: local focused_window_group = vim.api....
Jethro Cao's user avatar
0 votes
1 answer
59 views

I've switched to nvim and init.lua, which pulls in onedark colorscheme. How can I add a custom rule?

I have C-style comments inside PHP strings that contain SQL code, so I can easily understand what the query is doing when I see it running on the server. DB::runQuery('/* this is my SUPER complicated ...
Codemonkey's user avatar
2 votes
1 answer
224 views

How do you pass options to a lua plugin?

In many Neovim plugins these days, configuration is done in a new way, and the readme just says to "pass option_name = someval to enable some behaviour". For example, archibate/nvim-gpt, ...
TamaMcGlinn's user avatar
1 vote
2 answers
226 views

How can I ignore default filetype indenting?

Can I tell Neovim not to load a bundled indentation file? For example, when I edit a .tex file, "share/nvim/runtime/indent/tex.vim" loads automatically. I don't want those settings. Do I ...
Alan's user avatar
  • 123
1 vote
1 answer
1k views

Neovim v0.9.2 Treesitter Update: Repeated Parser Installation Issue and Permissions Problem

I've updated my neovim from v0.8.x to v0.9.2, so my treesitter just stopped to work. Every time a opened a file (js, ts, tsx, jsx, lua, html, css, etc...) it run the parser installation for that file ...
Lai32290's user avatar
  • 275

1 2 3
4
5
34