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

How to scroll in built-in Terminal?

I want to scroll the Terminal inside NeoVim, but it looks like this: That is, since I opened NeoVim inside tmux, and in tmux it "scroll" entire pane. And is there any recommended shortcuts ...
0
votes
0answers
19 views

how to copy text with mouse when nu and mouse=x is set in neovim

The only time the mouse does not select the numbers when mouse is set is if mouse is set to v. But you cant copy the text with right click or menu key.
-2
votes
1answer
107 views

Error while configuring nvim cmp

I am trying to configure nvim-cmp (https://github.com/hrsh7th/nvim-cmp), by adding the following lines to ~/.config/nvim/lua/lsp-config.lua. After this, when I start nvim, I get an error as shown in ...
-1
votes
0answers
53 views

How to run command when I first enter neovim?

I want to run some command-mode commands when I first open neovim. How to do it? For example the command I want to run is: :IndentBlanklineEnable
0
votes
0answers
37 views

Cursorline became black when cursor is moving

If I change the colorscheme by <option>+12345 :colorscheme newsprint Then when I will firstly got the expected result: But then if I move my cursor by j/k, the clean cursorline gone: I can ...
0
votes
1answer
75 views

How to use packer.use inside neovim?

I was switching vimscript to lua in neovim, and I saw packer.nvim is a famous plugin manager for lua. In this README.md file I saw I can use startup function, but it's not required and I can also use ...
0
votes
1answer
58 views

How to transform this Vimscript into Lua?

Can anyone help me transform this into nvim.lua? inoremap <silent><expr> <TAB> \ pumvisible() ? "<C-n>" : \ <SID>check_back_space() ? "<TAB&...
2
votes
2answers
229 views

How to run multiple commands sequentially in nvim?

What I have referenced in my .zshrc file: nvim --headless -c 'LspInstall tsserver | qall' This doesn't work. The qall is regarded as an argument of LspInstall while I didn't mean to. The LspInstall ...
0
votes
0answers
22 views

How to make vim show suggest current word in spellchecking suggestiong if current word is correct?

I often write code, and sometimes I check comments with z= when I am not sure of a spelling of some word. Vim then presents a list of suggestions. However, when I got the spelling right and the word ...
0
votes
0answers
16 views

highlight clear SignColumn isn't taking effect

I can't understand why the setting highlight clear SignColumn in my vimrc doesn't seem to work when nvim launches. I've tried appending a : :highlight clear SignColumn. And I've tried adding the ...
0
votes
1answer
57 views

Default init.vim file

For nvim, can anyone show me what the default init.vim file look like? I had to make my own and I don't know what they look like by default
0
votes
0answers
59 views

nvim: how to manually clear popups which do not clear themselves?

While it may not be the only culprit, coc.nvim is a bit notorious for leaving popups hanging around the screen long after they should be cleared. Sometimes, as in the gif below, dangling popups will ...
0
votes
1answer
214 views

How to add `~/.config/nvim' into runtime path for Lua?

In my init.lua I call: require('plugins') require('theme') This works when editing in the ~/.config/nvim directory, where init.lua, plugins.lua and theme.lua are located. But when I run vim outside ...
0
votes
0answers
19 views

Mapping an keyboard shortcut to interrupt the terminal window

I have program running in the neovim terminal window, and I want to interrupt it. I can do so by moving to the window, <C-W>l, going into insert mode, and pressing <Ctrl-C>. Normally, at ...
0
votes
1answer
44 views

Typescript add missing import on cursor?

I'm working on a TypeScript-React project using neovim, because I love it. I want a feature: when my cursor is on a name that has not been imported, I can press some key-combination to choose which ...
2
votes
0answers
54 views

Vim /usr/bin/bash: /s: No such file or directory

Repost from Stackoverflow; I read a comment which directed me here saying it would be more helpful. Just set up nvim; unfortunately, the following error is plaguing the setup. Whenever I try to ...
1
vote
1answer
50 views

expanding parentheses gives undesirable indentation in neovim

This post is not about curly brackets. It is about parentheses. I couldn't find a solution on how to expand parentheses with my ideal indentation. What happens now with expanding parentheses Before (|)...
0
votes
2answers
47 views

Run a Function Upon Exiting a Terminal

By using the following code... vim.fn.termopen("foo") I can open a terminal with a certain command. What I want to do is run a Lua function from a plugin upon exiting the terminal. Pseudo ...
1
vote
1answer
40 views

choose template option for newfiles in vim

I have different templates in this directory ~/Documents/Library/ like: Template.cpp, normal.cpp, advanced.cpp normally i use this autocmd BufNewFile *.cpp 0r ~/Documents/Library/Template.cpp I want ...
1
vote
1answer
30 views

How can I read the contents of a buffer or line then rewrite them, from a Lua script?

I am trying to write a pretty-printer Lua plugin for a LaTeX-like language. The idea is that if a user types \cup in insert mode then presses <Space> or <Tab> or <CR>, then my script ...
0
votes
1answer
59 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 ...
0
votes
1answer
37 views

Can you have relative numbers, but for characters/words in a line?

This is relativenumber. It shows the line numbers, relative to your cursor: 1 one line before your cursor 0 your cursor is here 1 first line after 2 second line 3 third line 4 and so on It's super ...
0
votes
1answer
22 views

Global variable not setting correctly when starting neovim

I'm trying to setup separate configs for my WSL, Windows, and MSYS2 environments in the same init.vim with simple if-else statements. So, I'll need to know what environment I'm in. To know that I ...
0
votes
2answers
39 views

how to make a word turn into certain commands in vim command line?

I want :cup in vim command line to turn into :tabdo call MapRunCmd()<CR> Hope that somebody can help me out PS: I've tried this nnoremap :cup :tabdo call MapRunCmd()<CR> but didn't like ...
1
vote
1answer
37 views

How to autocomplete from dictionary while typing?

I've set a dictionary with the command: set dictionary+=~/Dictionary.txt And add the following command to make more quickly to access it: set complete+=k But I still have to press <CTRL-N> to ...
0
votes
1answer
30 views

Run `vim -c <command>` before loading vimrc?

I'm adding some setup to my .vimrc, and what I want to do is to be able to run a command using the command line before the vimrc is executed. I tried vim -c 'command' but it runs after the .vimrc. The ...
0
votes
1answer
35 views

Need help to make a by-default `:RunWithFile` of this toggle function

related to this post, How to make a toggle function in .vimrc that toggles multiple configs of almost same type? @BLayer's code func! MapRunCmd() abort if exists("b:rwfcmd1") && ...
0
votes
0answers
19 views

How to set up a buffer to receive command output

In my $VIMRC, I would like to autocmd BufWinEnter *.ly call s:BufWinEnterLY() autocmd TextChanged *.ly call s:TextChangedLY() autocmd BufUnload *.ly call s:BufUnloadLY() I want s:BufWinEnterLY() to ...
0
votes
1answer
55 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-...
0
votes
0answers
27 views

How do I enable completion prompts in Neovim + LSP?

I am using Neovim 0.6.0 nightly (I also have the nvim-lspconfig and hrsh7th/nvim-cmp plugins installed) and have a few different LSP servers which do seem to be working (I have tested them by simply ...
0
votes
0answers
13 views

:checkhealth in neovim spits out gibberish next to branch name

I tried doing :checkhealth and found something similar which looks like this $TERM is xterm-256color, I'm on Ubuntu 20.04 LTS. This is interfering at other places as well, if I try formatting the ...
0
votes
0answers
15 views

How to hide or configure type labels when using Neovim+Treesitter+Rust

I installed Rust language support to Neovim's Treesitter via :TSInstall rust. All works well, but now there are extra labels showing the type to the right side of each variable assignment. While I ...
0
votes
1answer
40 views

Why vim creates an extra last line when importing a template?

My init.vim code: autocmd BufNewFile *.cpp 0r C:\Users\User\Desktop\cp\Template.cpp When i create a .cpp file, Template.cpp code is imported in that cpp file. upto this point, everything is fine. ...
0
votes
1answer
35 views

what's the difference between `tag` and `tags` command

I've recently come across the concept of tags in vim. I run ctags on a file and it generates tags for that file. When I try to access those tags Iuse the tag command which basically provides a list of ...
0
votes
1answer
101 views

How to change the color of the tabline of the vim-airline?

I'm trying to make transparent the tabline of the vim-airline, as in the second picture. I'm using the onedark colorscheme. They don't have a color specific for that. They use the same color variable ...
0
votes
0answers
15 views

Make nvim to show colors while performing external commands [duplicate]

By default my new neovim doesn't do this showing everything black and white. How could I make it show as on picture 2 (it works this way on raw vim)?
1
vote
0answers
30 views

coc.nvim having issues with background color and error messages

Above is what I see in NeoVim 0.4.4 (on Ubuntu) when I get a type error using coc.nvim and the Haskell Language Server. My configuration for all background and theme related things are: syntax on ...
0
votes
2answers
41 views

How to find line and column for a n-th byte in a buffer?

I want to find a line number and a column for a particular byte number in a buffer in Neovim. I can get it (sort of) with local b = 444 local line = vim.fn.byte2line(b) local line_start = vim.fn....
0
votes
1answer
74 views

Using the execute shell command (:!) on Windows and MSYS2

I'm new to neovim (and vim in general), and I'm trying to use it on Windows with MSYS2. I noticed they have a package for vim, but not for neovim. I used the neovim installed through chocolatey ...
0
votes
1answer
67 views

how to deduplicate packpath / runtimepath?

Problem: I noticed that my "&packpath" has some duplicates, I want to remove them. What I have tried: My viml knowledge is not very strong but I did manage to create a unique "List&...
0
votes
1answer
39 views

Make 'cabbrev' work from command-line but not search prompt?

I am using NeoVim, and I automatically define an abbreviation for the string W every time the commandline mode starts. However, it seems that commandline mode includes the search modes as well. I do ...
0
votes
1answer
17 views

Unable to resume backgrounded Neovim-terminal-emulator-process using `kill -CONT`

So, I'm trying to find an actual solution to another question on here that doesn't really have one. However, I'm running into a problem with backgrounding/foregrounding behaviour. I need to background ...
0
votes
0answers
31 views

How to require `luafile` not in a subdirectory

in my config of init.lua ,I want to load a luafile from anywhere or any directory so : can I source it without function vim.cmd() vim.cmd('luafile /full/path/to/file.lua')
0
votes
1answer
34 views

How to colorize words in a buffer, using type data and position data?

I am writing a plugin for Neovim using Lua. If I have a text and some predefined arbitrary types, for example: chita wolf grizzly types: dog(green), cat(blue), bear(yellow) And I know positions/...
0
votes
1answer
56 views

Data storage for a plugin

I would like to make a plugin for Neovim that does some pretty expensive processing for a text in a file. I would need to keep processed data as well as a hash signature of a file (to avoid processing ...
1
vote
1answer
28 views

Conceal HTML span and highlight content

I am currently writing some Anki cards in NeoVim. Anki supports HTML and I can therefore write cards in the following format. Forumlate the <span class="highlight">Central Limit ...
1
vote
0answers
65 views

What Neovim GUIs have GUI scrollbars as described in vim under :h gui-scrollbars?

TL;DR I am looking for a Neovim GUI with GUI scrollbars as described in vim under :h gui-scrollbars (accessed on 2021-08-21). What GUI Vim scrollbars are like 2. Scrollbars *gui-...
0
votes
2answers
37 views

Reduce lag in mappings that frequently switch between normal and insert mode

As a concrete (although hyperbolic) example: nnoremap , a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>...
1
vote
1answer
23 views

How to get the searchcount() total of matches into a lua variable

The searchcount() gives use something like: {'exact_match': 1, 'current' : 1, 'incomplete': 0, 'maxcount': 99, 'total': 5} It is a dictionary, I am trying to do something based on the help: local ...
0
votes
1answer
57 views

How to map <BS> to do nothing?

(I'm using Alacritty + NeoVim, I'm not sure about whether this issue is from Alacritty or NeoVim.) I want to map <BS> in insert mode to do nothing, i.e. <Nop>. I have tried: inoremap <...

1
2 3 4 5
16