Hot answers tagged

4 votes
Accepted

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

The relevant commands are documented at :h current-directory. Basically, you should use :lcd and/or :tcd instead of :cd.
Matt's user avatar
  • 20.1k
4 votes

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

I have noticed that regression, too, which seems to affect all text objects with single character boundaries: i< i" i' i{ etc. You should report it if it hasn't been reported already. EDIT ...
romainl's user avatar
  • 38.4k
3 votes

How do you pass options to a lua plugin?

require'nvim-gpt'.setup { no_default_keymaps = true, } is the correct way. It is not dependent on the plugin manager. (my mistake was elsewhere, calling this setup function accidentally from two ...
TamaMcGlinn's user avatar
2 votes

How do I add a custom LSP to `nvim-lspconfig`?

You must do something like this (this example is for a different LSP, please adapt accordingly): require('lspconfig.configs').templ = { default_config = { cmd = {"templ", "lsp&...
fiatjaf's user avatar
  • 123
2 votes
Accepted

How to map Ctrl-Delete?

I would do: nnoremap <C-Del> dw inoremap <C-Del> <C-o>dw
Vivian De Smedt's user avatar
2 votes
Accepted

Error wihle reading ShaDa file

It looks like your shada file is corrupted. The file should be located into ~\nvim-data\shada\main.shada I would propose to: Stop Neovim Delete the shada file Restart Neovim
Vivian De Smedt's user avatar
2 votes
Accepted

How can I debug a nerd font not working on Windows + Neovim?

nvim.exe If you run the console version of Neovim (nvim.exe) then the font used is the font of the console you are using (e.g. cmd.exe) To control the font you have to configure it in your console. ...
Vivian De Smedt's user avatar
2 votes
Accepted

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

I believe you don't have the distinction declaration and definition in typescript like you have it in C or C++. myfile.h // declaration int myfunction(int a, char *name); myfile.c // definition int ...
Vivian De Smedt's user avatar
2 votes
Accepted

How to traverse folders in :edit command dropdown menu

Use <Right> to enter a directory and <Left> to leave it. Note that :help 'wildoptions' only lazily points to :help ins-completion-menu, which doesn't cover that special case anyway… so you ...
romainl's user avatar
  • 38.4k
1 vote

Switch modes without losing the selection

The VSCodeVim extension for VsCode: Has support for the surround extension: With this extension you can: Add quote to your selection with the following action (in visual mode): S". Change from ...
Vivian De Smedt's user avatar
1 vote

How can I edit a file in real-time?

Pretty trivial augroup foobar | au! autocmd TextChanged ?* update augroup end You could also catch TextChangedI event but that would be overkill, IMO.
Matt's user avatar
  • 20.1k
1 vote
Accepted

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

windows Within a tab you can split the viewport in windows to see multiple buffers at the same time. Plugin use also windows within a tab to let you: Browse your files (e.g.: nvim-tree) or Browse ...
Vivian De Smedt's user avatar
1 vote

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

If the syntax file already matches the /**/ comment in the string, you only need to add a highlight for it. Check the syntax group (e.g., using zS from scriptease or synstax#UnderCursor() from ...
D. Ben Knoble's user avatar
  • 24.8k
1 vote
Accepted

What is the syntax to use character classes inside Vim regex bracket expression?

You are right the character atom (e.g.: \s, \S, \d, ...) cannot be part of a collection ([]) To get the reference in the doc you can look for the NOTE in the section: :help collection: NOTE: The other ...
Vivian De Smedt's user avatar
1 vote
Accepted

How can I ignore default filetype indenting?

You can do: ~/.config/nvim/indent/tex.lua as: vim.o.indentexpr="" Remark on version prior to 9.3: ~/.config/indent/tex.lua is executed after $VIMRUNTIME/indent/tex.vim Where ~/.config/...
Vivian De Smedt's user avatar
1 vote

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

I found the point, it's in conflict with Packer, that I had installed before - WARNING found existing packages at `/Users/lai/.local/share/nvim/site/pack/packer` So I deleted the folder /Users/lai/....
Lai32290's user avatar
  • 245
1 vote
Accepted

Question about LuaSnip

You are mixing up 2 ways , or rather 2 functions , here. It is true : ... Unfortunately there were some breaking changes in LuaSnip ... : Snippets are now added via `ls.add_snippets` instead of with ...
Prem's user avatar
  • 206
1 vote

Neovim Markdown toggling bold keybind

I usually use surround.vim for this. You could do nmap <buffer> <your keys> ysiw* nmap <buffer> <more keys> ds* In ~/.vim/after/ftplugin/markdown.vim or equivalent. Make sure ...
D. Ben Knoble's user avatar
  • 24.8k
1 vote

Resize a vertical split to just fit the max width of the file contents

I would do: function! GetMaxLength() let i = 1 let maxlength = 0 while i <= line('$') let l = len(getline(i)) if l > maxlength let maxlength = l endif let i = i + 1 ...
Vivian De Smedt's user avatar
1 vote
Accepted

VimTeX omnicompletion for bibliography

Thanks to @D.Ben Knoble I fixed it. As I said in the comment, the omnicompletion for bibliography used to work without the \addbibresource{path/to/bib_file}, now it you have to have it in the files to ...
enrico223's user avatar
1 vote

jump to definition goes to import statement rather than actual file defintion

running :lua =vim.lsp.get_active_clients() made me realize that the only language server attached was copilot! So after some online searching I installed the mason language server package manager, ...
abbood's user avatar
  • 643
1 vote

Portable Neovim. How to change default data folder? How to avoid registry entries?

The Windows environment variable %APPDATA% contains the path to a folder (%USERPROFILE%\Appdata\Roaming) intended for application specific data in a Windows domain environment (Windows computer ...
anon's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible