All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
12 views

Starting vim with a command typed in, but not executed (i.e. waiting for argument)?

I know I can start vim with a command by executing vim +"MyCommand", but if MyCommand takes a parameter it would be nice to start vim, as if I already typed :MyCommand but not actually ...
2
votes
1answer
33 views

How to input <CR> into ex command from script or commandline?

I recorded a macro, that has an enter in it ggd/{<CR>Gdd but of course is ^M. What I want to do is run this on a bunch of files from the commandline which I guess would be something like ex +&...
0
votes
1answer
15 views

How to use cmdline to send key `<ESC>`?

As title. I need to use this in a script to close the current floating window.
1
vote
1answer
14 views

vim regular expression like word movement

I have a bit of a head scratcher. Given a line of text like the following let FindTargetsByRegexp = { re -> {lnums -> s:_FindTargetsByRegexp(re, lnums) }} I want the expression \(\n\|[^A-Za-z]\)...
1
vote
2answers
16 views

<cmd> key code?

An article on key-mapping uses <Cmd> where I would expect : nnoremap [q <Cmd>cprev<CR> nnoremap ]q <Cmd>cnext<CR> nnoremap [t <Cmd>tprev<CR> nnoremap ]t <...
0
votes
0answers
16 views

Treat fold markers as paragraph boundaries?

I'm trying set up text inside default fold markers to be treated as a distinct paragraph. To see, in a new buffer: :set foldmethod=marker This is a paragraph 1 {{{ Want text inside this fold treated ...
0
votes
0answers
12 views

How to pass arguments to `:map gx <Plug>(SomeFunction)`?

Context I'm evaluating https://github.com/tyru/open-browser.vim which looks really promising. I figured out how to set the default search engine and add a mapping " vim-openbrowser let g:...
1
vote
1answer
13 views

unbind all keybindings starting with [ and ]

I put this: noremap [ { noremap ] } in my .vimrc. However, since there are other keybindings starting with [ and ], vim waits for the next keybinding before executing my desired command. After ...
0
votes
1answer
28 views

How to change foreground color of character underneath cursor?

I've tried setting the highlight rules below but it does not work. Whatever color I choose, the color of the character stays the same. I'm using xfce4-terminal on Linux and Terminal.app on Mac OSX. ...
1
vote
2answers
49 views

How can I quickly get to a set of commonly used files?

I tend to edit particular text files much more often than others. There might be 30 or 40 or so different files I tend to edit most often. Plus there are others that kind of rotate in and out as ...
0
votes
0answers
13 views

Easiest way to highlight/underline specific words (by location) in a file based on the output of an external program?

I have a program that I run on a file and the output of the program is a line number. If I save this line number in a temporary file, can I get vim to automatically highlight or underline this word/...
0
votes
1answer
21 views

Can't fully remove color scheme's background in nvim

I want to keep my acrylic powershell background while using neovim, which requires blocking my colorscheme's background (currently trying sainnhe/everforest). I've put hi Normal guibg=NONE ctermbg=...
1
vote
1answer
23 views

vimtex: fully indent a '{ ... }' block

Concerning indent in vimtex, it has some settings controlling indenting of delimiters, the option seems to be g:vimtex_indent_delims. However, I would like to not only indent the text between opening ...
0
votes
0answers
12 views

How can I create a key combination that sends the content of a markdown code cell to a tmux pane with slime?

I am a happy user of nvim-R, which enables to send R markdown chunks to an R console with <localleader>ca. R cells code blocks look like this in R markdown files: ```{r} head(faithful) ``` When ...
0
votes
0answers
18 views

Formatting markdown text: Respect code blocks and tables

I set setlocal formatoptions+=tl textwidth=80 setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+ in my ftplugin/...
0
votes
0answers
12 views

Lua syntax errors when using `Packer` plugin manger with `config=require()` in Neovim

I'm using neovim 0.6.0 and my config is written in Lua. My init.lua file requires files such as mappings and plugins. I use packer to manage plugins, and when calling the packer use command I can pass ...
0
votes
1answer
23 views

Vifm Visual Block Mode

Using visual block mode in vifm via Ctrl-v appears to do nothing. I've had this same result in several terminal emulators, including gnome-terminal, xterm, and alacritty. I am using the default vifmrc ...
0
votes
1answer
18 views

Compile C++ in vim

I want to make a shortcut for compiling C++ file. I use :map <F5> :!g++ % -o app && ./app <CR>. How can I edit it to set output file's name, C++ file's name without .cpp instead of ...
0
votes
1answer
29 views

How to `source` a path stored in a variable in Vimscript

tldr: The title pretty much summarizes the entirety of the question I am trying to make my configuration more adaptable to different machines so that I can use git to keep them in sync between my ...
0
votes
0answers
17 views

Why does Neovim load from both .config/nvim/ and .local/share/nvim/?

Neovim will load configuration from ~/.config/nvim/, and it also loads configuration found in ~/.local/share/nvim/site/ . In contrast, Vim loads configuration from ~/.vimrc and ~/.vim/ , it doesn't ...
1
vote
1answer
28 views

How do I install a package in Neovim without a package manager?

I would like to install a package in Neovim (nvim), but I don't want to use a package manager like vim-plug. I want to keep my configuration as minimal as possible, which is why I want to avoid a ...
2
votes
0answers
13 views

Does TermDebug have an option to open source files readonly?

Vim's TermDebug is brilliant. A real game changer for my development workflow. My only problem with it is that I often have multiple separate gvim windows running, with different sources in each (...
1
vote
1answer
13 views

Buffer specific remap of a global map to a plugin command

I have this in my .vimrc as global for gf: map gf :edit <cfile><cr> from the help on gf, but I want to remap gf in markdown files for a plugin command with the following: autocmd FileType ...
1
vote
1answer
14 views

highlighting: match dot in group

I have several syntax match patterns, that logically belong together. Currently I match them like this: syntax match FOO /\v<(foo1|foo2|foo3)>/ What I actually want to match is .foo1, .foo2 and ....
1
vote
1answer
24 views

Visually select two words in Vim

Say I have a phrase is later found at and what to delete a phrase later found, then what I do would be In the normal mode, I put a cursor on l, and press vww. This will select from l to a of at. This ...
0
votes
0answers
26 views

nmap in vimrc is working in wrong way

I was trying map a function to key "0". This is the code I used in vimrc nmap 0 :exec "nohlsearch"<CR> This mapping will allow me to non highlight the word under search But ...
2
votes
4answers
323 views

How to move cursor up to nearest upward smaller level of indentation

Imagine my cursor is where the ^ is in this document: { "first": [ { "second": { "third": [ "fourth" ] } }, {...
0
votes
1answer
16 views

Command to go to Normal-mode and Visual-mode (or exiting insert-mode) - pressing ESC without the escape-key

I'm working on a server, that I can only SSH into via a browser. In there, I have to edit some files. The problem is, that let's say I go to INSERT MODE and write some text. If I then want to go back ...
0
votes
0answers
20 views

How can I config vim to show me value of a variable / const?

I have a vim configuration with COC installed where I can gd to jump to a definition. How can I config it, so it will, upon hovering on the word (with cursor, not mouse), will do the following: if is ...
0
votes
1answer
19 views

Where are neovim's cached, file-specific settings?

Vim has a ~/.vim/view/ directory for storing file-specific settings, such as saved cursor position and any command manually ran while viewing a file. Sometime, when I would update and source my vimrc, ...
1
vote
1answer
47 views

nvim popup vs vim popup

I'm planning to write a simple pop-up for myself and I found a nice beginning point for this in this question, but I want to make the code compatible with nvim as well. I can't seem to find a similar &...
1
vote
1answer
20 views

How do I delete a self closing html tag?

I'm trying to delete self closing html tags, like the img tag below. <div><img src='http://mypic.com/1.jpg' /></div> I've tried dit, dat, the tpope/vim-surround plugin, and other ...
3
votes
1answer
52 views

How to insert to the beginning of a word with one key stroke?

Is it possible to start insertion in the beginning of a word when standing in the middle of it with a single keystroke? Currently I am using bi or Bi, but it does not allow me to use . to repeat the ...
2
votes
1answer
23 views

Manage syntax groups in Vim Latex (how to create new ones, or add to existing ones)?

I'm trying to optimize for my needs the syntax highlighting offered automatically by Vim for Latex. For example by changing colors to my liking or link colors to new commands/environemnts. After a ...
1
vote
0answers
14 views

Reformatting with neovim LSP and clangd adds double carriage return (^M) on line breaks

I am using neovim (0.6) and its built-in LSP with clangd-12 for C++. When reformatting a file that uses DOS-style line endings, it for some reason uses a double carriage return, resulting in one ^M ...
0
votes
0answers
14 views

How to map a key to toggle keymap function?

I would like to map a function key to turn on a specific keyboard layout, like set keymap=x, and toggle it on second keypress as in CTRL+Shift+^. How to achieve this?
2
votes
1answer
26 views

Prevent Vim setting Application Keypad Mode on my VT520

I am attempting to use Vim via a serial console and every time I launch it, vim sends ESC= and instructs the console to enable Application Keypad Mode and my numpad stops working. How do I stop it ...
0
votes
1answer
15 views

How to fetch latest neovim appimage from terminal?

I would like write a script that automatically fetches the latest Neovim Appimage from the releases page, I was trying to see if I can use wget to access the latest appimage, but that would require me ...
0
votes
1answer
18 views

How to check if the current tab is the last tab?

As title. I want to check that if current tab is the last (rightmost) tab, how?
8
votes
4answers
1k views

How to append to the end of word with one key stroke?

Is it possible to start insertion in the end of word with a single keystroke? Currently I am using ea, but it does not allow me to use . to repeat the same action. I really love A and I which operate ...
0
votes
1answer
16 views

How to check if a buffer hidden in all tabs?

As title. I want to check that a buffer is not shown in any tabs. How to do so?
0
votes
1answer
26 views

How can I switch to the `[No Name]` buffer

As title. Is it possible to change the current buffer by vimscript to the (only) [No Name] buffer? I need these tools: an API to return all (loaded) buffers loop through each of them if the buffer ...
0
votes
2answers
27 views

How could I create a terminal window in the background?

I want vim to launch rails console(it's like relp) within terminal windows when vim is launched on my project directory. To launch rails console, I need to run three commands like below and it's ...
1
vote
0answers
16 views

How to customize how neovims "shell command buffer" is shown?

I am wondering about the behavior of the buffer that appears in the bottom of the terminal when running a shell command in neovim. How can I make it appear the right side instead? How can I make the ...
2
votes
0answers
18 views

Plugin for tips on startup screen

Many of the IDEs I've tested throughout the years feature a sort of startup dialog, showing beginner to intermediate tips to become more proficient at it. While ways to customize Vim startup screen ...
0
votes
1answer
39 views

Exit insert mode and write to file in one command

Is there a command to exit insert mode and perform :w or :wq in the same command? I am tired of pressing esc + :w every time I need to write to a file after making edits. Alternatively, is there an ...
1
vote
1answer
29 views

How do I get vim to read syntax files from `/usr/share/vim/addons/syntax`?

According to the Debian documentation about vim, a Debian package (Ubuntu, really, in my case) is expected to place <name>.vim files under: /usr/share/vim/addons/... Syntax files go under a sub-...
0
votes
0answers
16 views

How to add more than one skeleton file with the same extension?

So I have a skeleton file for leetcode/hackerank stuffs, with the extension .cpp, achieved with the following: :autocmd BufNewFile *.cpp 0r ~/.config/nvim/skeleton/cp.cpp but I would also like a ...
0
votes
0answers
8 views

Change the cursor appearance in :terminal that uses cmd.exe?

How can I change the style of the cursor in :terminal under Win32 gvim? Using a clean config my cursor in Terminal mode (typing to shell) looks too much like my cursor in Terminal-Normal mode. gvim --...
0
votes
0answers
11 views

Remove highlighting of a csv file in nvim 0.4.4

I have nvim 0.4.4. I tried to install a csv plugin from there, but now, when I open a csv file there is some (unwanted) highlighting as follows: I can I remove the highlighting? Here is my vimrc file:...

15 30 50 per page
1
2 3 4 5
238