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
2answers
56 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
47 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
48 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 ...
1
vote
1answer
353 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
35 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
40 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
51 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
35 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
39 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
24 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
73 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
46 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
14 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
16 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
43 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
41 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
176 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
49 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
52 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
139 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
119 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
56 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
25 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
49 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
37 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
123 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
43 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
110 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
41 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
25 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
62 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 <...
0
votes
1answer
27 views

Is nvim's documentation corrupting my windows installation?

I recently decided to try out nvim, after using vim for a few years. I started following these instructions I noticed after running these two commands :call mkdir(stdpath('config'), 'p') :exe 'edit '....
1
vote
0answers
66 views

How can I change the airline font color from white to black?

I've seen someone who has these things (that I marked) colored as black, but as you can see mine are white. How can I have these things black ?
1
vote
1answer
44 views

How I can add <C-6> to a mapping

I am trying to create a mapping that will close the current buffer and replaced by the previous buffer. I tried this noremap <silent><Leader>bd :<C-6><Bar>bd #<CR> But ...
0
votes
1answer
115 views

How to set the intelephense workspace for CoC phpls?

I'm using coc-phpls to edit a plugin project inside a bigger project. i.e. the dir structure is like /var/www/example/ /var/www/example/libraries/ /var/www/example/plugins/myplugin ← my working dir. ...
0
votes
0answers
272 views

neovim lsp icons are not appearing in color

I am configuring native lsp of neovim. I have installed neovim-lsp and neovim-lspconfig plugins using vimplug. I have also installed hrsh7th/nvim-compe for auto completion suggestions. Functionally ...
0
votes
0answers
16 views

Is there a simple way to pull in type specs from a language server?

This is a neovim + erlang_ls language server specific problem of mine. How can I inserting a type specification right above an Erlang function, that coming from the erlang_ls language server? (If it ...
0
votes
1answer
64 views

How to remove a file from oldfile list - or how to avoid a file from being added to oldfiles when visited?

I'm using a plugin called startscreen to customize my start screen. The problem is that whenever I enter vim the startscreen will be added to the oldfiles list. How can I avoid this. Is there any ...
0
votes
1answer
160 views

How to use vim.loop interactively in Neovim?

I want to read texts with Neovim scrolling them down automatically. The following code provides such functionality: local M = {} function M.down() local timer = vim.loop.new_timer() local ...
1
vote
1answer
52 views

How to provide modifier keys in lua?

If I want to move a cursor one line down with Lua in Neovim I can use :lua vim.cmd('normal j') How do I move the screen down one line? For example, this does not work: :lua vim.cmd('normal \<C-E&...
0
votes
1answer
21 views

Neovim autoupdating file in multiple terminal buffers, not warning with swap

I've been noticing some rather confusing behavior in my neovim setup and I'm really not even sure if it's a problem, just a feature that surprised me. I recently noticed that the classic "This ...
0
votes
0answers
36 views

How to get strings between `[ and `] in lua?

I'm trying to play around with text objects in lua, here's what I got: https://learnvimscriptthehardway.stevelosh.com/chapters/33.html On that webpage, I found that I can operate on the text send to ...
0
votes
1answer
33 views

How to detect if script is running in floating window using vimscript?

The title pretty much says all. I have the following custom script (which resizes windows for me): " CUSTOM WINDOW SPACE MANAGEMENT ************************************ function! s:...
1
vote
0answers
98 views

NeoVim make terminal window automatically close when program exits

The vim version has a ++close option that automatically closes the terminal when the job terminates, but since the NeoVim terminal came first it doesn't have that feature. I need this because i am ...
0
votes
1answer
41 views

Can't enter a tab character when previous character is not a tab or space in insert mode

When pressing tab in any language in edit mode, nothing happens if the character before the cursor is not a space or a tab. Doing ctrl-v tab works, but I don't want to have to do that every time and ...
0
votes
1answer
75 views

How to call function with lisp style via mappings from lua in neovim?

I'm trying to use v:lua to call functions written in lua (actually it's fennel, which compiles to lua). Now I have a function named lisp-style , then I can't directly use v:lua.lisp-style() because it'...
0
votes
0answers
31 views

Neovim Treesitter: How Do I Get the Name of a Node?

How can I figure out the name of a treesitter node in neovim? It seems weird that the node type is so readily available with node:type() but the name is not.
0
votes
1answer
29 views

force close windows and last empty buffer

when i open multi windows like bellow: vim foo.txt bar.txt then , if i'm closing foo.txt by :bw then ,i'm closing bar.txt by :bw vim still open ! , i must close by :q i don't want vim open if last ...

1 2
3
4 5
18