All Questions
13,477
questions
0
votes
0
answers
6
views
How to run current python file in floating terminal? Using neovim and NvChad
FYI noob here.
I want to run current file in floating terminal. I'm using NvChad and when I execute ALT+i I get the following:
I already played with some key binds, but I haven't achieved what I need....
0
votes
1
answer
9
views
What's the Vim option to make indentation matches source file?
I just started at a new company where apparently there is no standardization on tab/space setting at all. Everything goes.
That culture is not going to change. What I want to do is make Vim matches ...
0
votes
0
answers
5
views
Can't find any documentation for a TCP client in Neovim
I'm trying to write a simple server and client in Lua using the loop API, so that multiple Neovim instances can communicate 2-way over a network port. The server was easy enough to write, since :help ...
0
votes
1
answer
10
views
Why does :!python3 differ from g:python3_host_prog?
I am using Ubuntu 22 and the default (OS) Python version is 3.10.6.
I don't need this python version; rather I need 3.8.16. I've installed it and
set the g:python3_host_prog to its path to use it when ...
0
votes
0
answers
4
views
Neovim plugin cmp autosuggestion box timing
Is it possible to configure the event of Neovim CMP suggestion window to pop up after I typed an n number of characters.
0
votes
0
answers
4
views
How to customize the output of vim.lsp.buf.document_symbol?
I'm using nvim lsp, and I got this keyboard mapping:
vim.keymap.set('n', '<C-h>', vim.lsp.buf.document_symbol, bufopts)
The problem is that its output is very verbose, it looks something like ...
1
vote
2
answers
35
views
How to get floating result in expression register?
I want to write a macro to set line height in fraction.
font-size: 18px;
line-height: 22px;
The problem is with expression register.
I set 2 variables
@f = font-size
@h = line-height
And
=@h/@f - ...
0
votes
1
answer
11
views
How to set up LuaSnip in NeoVim w/LSP-Zero?
I'm trying to enable snippets in my auto-completion but they are only working for lua files and nothing else. I ve been messing around with nvim-cmp and luasnip itself and even downloaded friendly ...
0
votes
1
answer
12
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/...
0
votes
0
answers
8
views
Neovim lua promise libraries as dependencies
Is there any standard way to depend on lua github code?
https://github.com/evaera/roblox-lua-promise (lib/init.lua)
Eg the Promise/A+ library only has /*.lua files
0
votes
0
answers
8
views
Cannot setup virtualenv inside neovim terminal poetry
I'm using the zsh-autoswitch-virtualenv plugin to automatically activate virtualenv when I enter a directory.
In the neovim terminal however, I have to run poetry shell in order to properly populate ...
1
vote
1
answer
81
views
How to map a number followed by another key?
[I have read How to debug a mapping? and although that is a great starting point I am still clueless why this does not work.]
I want 2* to search for the next occurence of the previous word in ...
0
votes
1
answer
24
views
Lightline and airline with neodark.vim
I have installed the neodark.vim plug-in by Keita Nakamura following this answer.
Currently my .vimrc looks like this:\
But the lightline theme doesn't appear on the status bar:
What is wrong here ...
0
votes
0
answers
24
views
How to highlight all the columns of a window?
Consider the following snippet:
vim9script
var winid = win_getid()
var winwidth = winwidth(winid)
var range = []
for lnum in range(10, 20)
add(range, [lnum, 0, winwidth(winid)])
endfor
var m = ...
0
votes
0
answers
8
views
Is there a lua api for mapcheck or workaround?
I have used a vimscript function for many years that toggles mapping the " key to french quotes including the non breaking space. I managed to convert this to lua and its working! My only issue ...
1
vote
2
answers
183
views
How to install Vim configuration from github?
I am new to vim and Linux in general.
I am using Vim on Windows Subsystem for Linux with ubuntu as OS.
I really like this neodark.vim theme and wish to use it for my Vim editor.
I would like to know ...
0
votes
2
answers
34
views
How can copy the matched string into register +?
For the below data:
-150000 2023-03-30
421.67 2023-04-20
575 2023-05-20
I can substitute the whole line with the first string
:%s/\v.{-1,}\s+(.+)/\1
Then the content was changed into:
-...
0
votes
0
answers
28
views
Plugin function scope issue
I have recently discovered this guide that was very eye opener under many aspects.
So I decided to do things "by the book" by moving my plugins in ~/.vim/pack/bundle/start/myplugin/plugin/...
0
votes
0
answers
15
views
NvChad: How to add a theme into the builtin list of `nvchad themes`?
I have installed a new theme called "rigel" in NvChad. I can switch to this theme from commandline using the command :colorscheme rigel.
Is it possible to add this theme to the builtin list ...
1
vote
2
answers
173
views
Is it possible to populate the quickfix list with files based on criteria that are independent of the files content?
I am interested in populating the quickfix list with filenames selected according to a criteria that is independent of the files content.
For example, I want to populate the quickfix only with python ...
0
votes
0
answers
10
views
Creating a better ftplugin for rmarkdown
The Rmarkdown files have markdown formatting interspersed with R language chunks, denoted as follows:
# markdown header
markdown regular text
```{r}
# comment: some R code...
a <- pi * r^2
```
...
1
vote
1
answer
20
views
Parameters at end of line, no value
When I have a program like this:
int main(void) {
printf("Hello world!\n"); format: // <-- this shows up, colored a bit darker than a comment
return 0;
}
Do you know how to fix ...
0
votes
1
answer
17
views
Nvchad: Is it possible to reuse existing .vimrc file?
I checked the documentation but couldn't find an answer to this basic question: Is it possible to reuse my existing .vimrc file in Nvchad? Currently, nvchad ignores my settings in .vimrc file.
0
votes
3
answers
32
views
Prevent: 'are you sure' popup on exit when closing the gVim window
Is there a setting that will allow you to just close the window without bothering with the save changes dialog when you exit?
Do you have to attach it to an event that answers for you?
1
vote
1
answer
34
views
synstack is always empty
Whenever I do :echo synstack(line("."), col(".")) it prints []
I've tried this in html and svelte files in my neovim with treesitter, in neovim with -u NONE, and in Vim 9 with -u ...
0
votes
1
answer
18
views
Help in defining a custom command when -nargs=? : how to determine if the arg is passed or not in the repl part?
I am struggling with this line (Vim9script):
command! -nargs=? MyCommand :call <sid>MyFunc(???)
What I would like to do is to replace the ??? in the MyFunc call in the above example so that I ...
0
votes
0
answers
20
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 ...
1
vote
1
answer
38
views
A problem with special character in Vim script
I'm trying to build a diacritic plugin which It's just a list of commands like
ia <leader>'e é " this one is source just fine
ia <leader>ae æ " This one causes error
But I'm ...
0
votes
0
answers
8
views
Neovim does not self-report minor/patch version when built on Linux
I use two different methods to install and update neovim to the latest version (something that I do regularly these days): it depends on the operating system
macOS: brew upgrade neovim --fetch-HEAD. ...
1
vote
1
answer
38
views
Is there a way to make marks in color or at least visible?
Is there a way to make marks in color or at least visible?
Actually I need to put visible marks on the text (code) in Vim.
0
votes
2
answers
32
views
Problems in defining a buffer variable depending on FileType
I am trying to define a buffer variable based on the FileType as it follows:
vim9script
def g:MyComment(comment_symbol: string)
# Do something
enddef
augroup commenting_blocks_of_code
...
0
votes
1
answer
32
views
Add a string at the beginning of a line through builtin functions
I am practicing some vimscript and, although there are very good plugins out there, I am writing a function for commenting/uncommenting code for the matter of experimenting.
So far, I wrote the ...
-1
votes
0
answers
25
views
How do I prevent running bc from killing syntax highlighting?
Consider the following simple file with filename Test.wiki.
= Simple header =
1 + 2
When I originally load it, it has syntax highlighting.
However, if I navigate to the second line and run :.!bc, the ...
0
votes
0
answers
29
views
in vim-script is it possible to open command-line window, like by "q:"
I would like in a vim-script to write commands that do following:
Suspend the running vim-script.
Open a command-line window, put the cursor into it, as normal mode "q:" does.
Do ...
0
votes
0
answers
16
views
How can I copy the contents of an error message in NeoVim
I'm using TSServer with LSPConfig to provide in-line typechecking with NeoVIM.
Is there a way for me to grab the value of a given type error message? Especially to my system clipboard?
0
votes
1
answer
23
views
How to set the mode from a vimscript?
If I save the result of :call mode() in a variable, how can I restore that mode later?
0
votes
1
answer
23
views
coc-pyright is using buffers irresponsibly
I've been noticing that my buffer number increases really fast without me even using them. I rely on buffers quite a lot to switch between files, and it's really annoying when I open a second file and ...
0
votes
2
answers
16
views
How to get the number of columns to the left border of the current window?
As title. I want to know the offset regardless of the current buffer. It's not the column number of the current buffer.
-1
votes
1
answer
39
views
What is the meaning of command `:4w`?
As title. I just read a post that people accidentally delete(wipeout) their unsaved work by trying the command :4w. A bloody lesson to him, but I also want to prevent this from happening to myself. ...
1
vote
2
answers
43
views
Disable E173: X more files to edit warning in neovim
How can I make :q and other standard ways of exiting quit immediately even if E173 would ordinarily have stopped me in my tracks?
Because this doesn't seem possible in regular VIM, how can I do it in ...
0
votes
0
answers
10
views
Why recording typed characters by "qa" into reg a has different behavior for typed <M-Z> vs. <M-z>?
Case 1:
In Excmd line I give
qa to begin recording.
I type \Alt Z
(upper case Z)
error message:
E11: Invalid in command-line window:\<blank\>:q<CR> closes the window
I give q for end ...
-1
votes
2
answers
32
views
Mapping key sequence begining with underscore (e.g. _x) cannot be used, why?
For a special application I am invoking vim with following mapping:
vim -u /root/.vimrc ... -c "nnoremap _z \"zyyq:"
If I map to another key sequence, e.g. <F5>, all works fine.
...
-1
votes
1
answer
24
views
What does Ctrl+e & Ctrl+y do in insert mode of Vim? I have accidentally found out a funny cmd which I don't know what's the application
In normal mode:
Ctrl+y Scrolling screen dw with the cursor staying on the same line
Ctrl+e Scrolling screen up with the cursor staying on the same line
However in insert/edit mode:
...
0
votes
0
answers
13
views
Problem regarding Lua Packages for Neovim Compilation
ninja: build stopped: subcommand failed.
16:28:05:633 1> [CMake] -- CMAKE_INSTALL_PREFIX=C:/Program Files (x86)/nvim
16:28:05:633 1> [CMake] -- CMAKE_BUILD_TYPE=Debug
16:28:05:633 1> [...
1
vote
1
answer
16
views
How to escape commas in au patterns and comma separated lists?
How do you specify a comma literal in the kinds of comma separated lists that are ubiquitous in vim configuration?
The first example I can think of off the top of my head is in autocmds:
au! BufRead,...
0
votes
1
answer
21
views
Remap p if no register is specified
To stop pasting over a selection from yanking that selection, I would like to remap p so that it doesn't yank the just-rewritten selection:
vim.keymap.set("x", "p", [["_dP]])
...
1
vote
0
answers
27
views
How to manually implement autochdir?
'autochdir' 'acd' boolean (default off)
global
{not in Vi}
{only available when compiled with it, use
exists("+autochdir") to check}
...
0
votes
1
answer
37
views
Caps Lock indicator
I would like if there is any way to have some sort of a indicator on screen for when Caps Lock is on.
The status line seems like the right place but I am looking for any method whether for vim or ...
0
votes
1
answer
14
views
Toggle NERDTree in seperate window
I want to toggle vim in a whole new window and as I searched, I can open vim in new window using:
:NERDTree | only
So I set this in my vimrc:
nnoremap <C-n> :NERDTreeToggle <bar> only<...
0
votes
2
answers
38
views
Vim in Alacritty and inside tmux cannot display italic text
I am trying to have a better visualization while editing Markdown file in vim, I try to visualize the italic and bold text. However, I found the bold italic text work, while the italic itself doesn't ...