All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

How can I pass extra arguments to gdb with Termdebug?

While using Termdebug, occasionally it would be useful to pass extra arguments to gdb (for example, -x). I've tried :Termdebug -x <my_file> <command_to_debug>, but that just seems to ...
1
vote
1answer
17 views

Repeating a combination of commands mapped to a single key

I have a mapping to "Stamp" text over the current word that cursor is on: nnoremap S "_diwP. When I do S and then try to repeat it with dot . only the last command will be repeated: P. Is it possible ...
0
votes
1answer
29 views

Stop the normal mode delete commands from copying text

When editing text, I find it quite irritating that the normal mode commands, x, d and s all copy the text they remove. Don't we have y for copying? Perhaps I am "just doing it wrong", but for example ...
1
vote
1answer
26 views

Tab does not work with vim for me [closed]

Problem statement :- Tab does not work with vim for me Description :- I am using vim-awesome for plugin in vim. Now the tab does not work. My expectation is pressing should result in tab being ...
0
votes
1answer
24 views

How can I create mappings for replace mode?

I know how to create key mappings in normal mode using nmap and in insert mode using imap. However I do not know how to create mappings in replace mode. I would assume it's either rmap or Rmap, but ...
3
votes
2answers
72 views

Within .vimrc what is the difference between “:nnoremap …” and “nnoremap …” [duplicate]

I am using latest available version of NeoVim v0.4.3 and latest Arch build with kernel 5.6.4-arch1-1. Within .vimrc what is the difference between :nnoremap ... and nnoremap .... Or, what effect, ...
1
vote
1answer
28 views

Is there any way to prevent modelines getting reapplied when files are saved / written?

For some Markdown documents, I like them to open with some sections initially folded (I use the plugin vim-markdown-folding). I've tried setting a modeline that looks like this: <!-- vi: set ...
1
vote
0answers
44 views

How do I make the contents shift less when vertically resizing a vim window?

If I open a long file in vim or neovim, and my cursor is not on the first line, and I make the window shorter by either resizing the terminal, or adding another split with <C-W>s or :sp<cr>...
0
votes
2answers
42 views

How to toggle `modifiable` property

When I edit .vimrc (for example), I often want to view the file as write-protected. noremap <C-a> : sview $HOME/.vimrc <CR> \| : set noma <CR> sets the nonmodifiable property for ...
0
votes
0answers
22 views

Automatic preview with vimtex

Is it possible to compile and open the pdf file on write? Normally I would open the pdf file with Zathura, edit the .tex files in vim and use :VimtexCompile. However, I would like to compile only on ...
0
votes
1answer
24 views

Set color of Comment only using .vimrc

I am using some preset colorthemes, but it seems that the types Identifier and Comment always use the same color -- which makes my .asm files basically just one color. I tried to change the color of ...
2
votes
2answers
114 views

How can I change the colorscheme of the vim terminal buffer?

I use GVim with the gruvbox colorscheme. When I open a terminal inside vim with :term, the colors are different, it looks like another colorscheme is applied. The other terminals I use (urxvt and ...
1
vote
1answer
11 views

UltiSnips not substituting text properly

I am trying to define a snippet which substitutes text in multiple places. As a trivial example see the following which works for me : snippet abc "Testing" bmA \begin{${1:text_here}} $0 \end{${1:...
0
votes
1answer
27 views

Indentation is slow in vimtex

If you try to indent a moderate size .tex file (~ 3,000 words/500 lines) using the normal mode command gg=G, vimtex seems to take some time. However LaTeX-Box seems to indent faster. I didn't ...
2
votes
1answer
32 views

Is there a way to get a count of the number of spelling errors in a buffer?

I'd like to be able to show the number of spelling errors in a buffer in my status line. Is there a vimscript way of getting a count of the number of spelling errors? I could write some code to count ...
0
votes
1answer
34 views

How to open pdf from local path with parameters using gf/gx like command?

I have a path name with page number in vim buffer and I want to open it using Sumatra PDF. d:\drivers\instruction.pdf -page 40 Instruction above works fine using command line - cmd.exe and it opens ...
2
votes
0answers
26 views

Concealing \begin and \end lines in latex with MathZone

I'm trying to get the lines that have \begin{equation} and \end{equation} to be concealed. I've tried using call matchadd('Conceal','\\begin{equation\*}', 10,13,{'conceal':' '}) and it works, but it ...
3
votes
2answers
49 views

Keep <C-X> <C-F> filename completion menu alive between directories

I'd like to use <C-X> <C-F> to autocomplete a long filename in insert mode, say /foo/bar/baz.txt. When I type in /f, I can press <C-X> <C-F> to complete to /foo/. However, ...
0
votes
1answer
16 views

Includeexpr + substitute not behaving as I would expect

I am using includeexpr and substitute() in a ftplugin to remove a portion of an include string for gf functionality (in twig template files, for the curious), but I get an error instead. Twig ...
1
vote
2answers
104 views

Is there a 'let' equivalent for setting an option only local to a buffer/window?

When working with options that often have complex or calculated string values (e.g. formatprg, which might have additional parameters, separated by whitespace), it's often easier to use let to set ...
2
votes
1answer
47 views

Put cursor at arbitrary line and column

Normal, insert, and visual modes restrict cursor movements to locations occupied by some characters. They don't allow moving to the right from the end of line and down beyond end of file. For example:...
1
vote
1answer
28 views

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

I'm trying to make a protable Neovim so I can use my plug&play IDE from a USB thumbdrive on any offline Windows computer. I managed to store my plugins and my sysinit.vim onto the USB drive and ...
0
votes
1answer
44 views

Unintended automatic join behavior and move in editting

I have to following lines in my .vimrc file (being .vimrc is irrelevant, other files the same), noremap D "_d "Make Y behave like other capitals (C, D) nnoremap Y y$ When I started to delete "_d ...
1
vote
1answer
43 views

How do I get the name of the current terminal in Vim?

I'm currently running Vim in Windows 10. I want to specify in my config file certain settings for when I'm running Vim in Cmder, different settings when I'm running Vim in Alacritty, etc. When in ...
1
vote
2answers
48 views

Portable NeoVIM configuration / Folder confusion

I'm attempting to create a portable Neovim configuration for Windows. I'm a bit confused about all the directories. Maybe someone can shed a little light on me :) So I downloaded a pre-built archive ...
1
vote
3answers
94 views

How to delete everything except urls?

I have string like this: 1668955,,, bunch of text</figcaption><br /><a href="https://the_url/article_detail.php?article_id=10003414" target="_blank">w..... </a><br />&...
0
votes
1answer
22 views

How to use settings for Vim Explorer?

I tend to use vim . to explore my directories. However, settings from ~/.vimrc only seem to take effect for vim FILENAME rather than vim DIR. For example, i have set rnu in my ~/.vimrc file, but ...
2
votes
1answer
48 views

Create a mapping in .vimrc that accepts an argument

I want to create a mapping in my .vimrc file that takes an argument. I'm constantly defining latex commands which require arguments inside of curly brackets and writing them instead inside regular ...
1
vote
1answer
30 views

How to move past a closing parenthesis in insert mode

so I've been learning vim the past few weeks and am having trouble with defining functions and the such. e.g. every time I define I function in python I write: typing in insert mode: def foo<...
2
votes
2answers
170 views

Include the value of a system environment variable when setting title in vimrc

I have the number of my xterm (i.e., the value of /dev/tty??) saved as an environment variable, TTY e.g., echo $TTY returns 11. I'd like to include this number in the title, along with the name of ...
2
votes
1answer
20 views

$TERM specific NeoVim configuration

I spend half the time in a TTY (Linux console as in Ctrl+Alt+F2) and the other half in a X session. Unfortunately the color scheme I use for NeoVim in the graphical environment on xterm does not look ...
1
vote
2answers
22 views

Problems after update to OSX Catalina

I recently updated my MacBook to OSX Catalina and now I am getting some unwanted behavior in vim (though it seems to be working overall?). On opening vim I see the following stream of errors (...
1
vote
0answers
17 views

Why is Neovim highlighting the cursor line numbers after the cursor has moved off?

I have turned on CursorLineNr highlighting as shown in this init.vim file. When I have my cursor on a line that wraps, it highlights all the individual "lines" on that line, as usual. However once my ...
1
vote
1answer
26 views

Mapping for expression register with langmap active

I am using Vim with a QWERTY/BÉPO langmap setting which allows me to use the French dvorak-like keymap for inputting text and the QWERTY commands for the normal and visual mode. Background: I am ...
2
votes
1answer
28 views

'endofline' option stays false after write operation

When one opens a file with an incomplete last line (File does not end with 0x0A / a new line character), the endofline option is set to false (:echo &endofline will print 0) and the [NOEOL] ...
2
votes
0answers
12 views

What pattern could I use to set a filetype for files ending in '.ot.txt' [duplicate]

I'd like to use VimOutliner with files ending in .ol.txt. This entry in ~/.vim/ftdetect/votl.vim doesn't do that au! BufRead,BufNewFile *.ol.txt setfiletype votl Is there a [pattern] for this?
1
vote
1answer
16 views

Opening and compiling tex files in subdirectory

I am using Linux mint cinnamon. Let's say I have .tex file in the sub-directory ~/MyTexfiles/Integration. When I double click on the .tex file to open it, it opens in vim since vim is my default ...
1
vote
1answer
19 views

toggle listchar settings

I have a listchars setting in my .vimrc, which shows some characters, but not all. Sometimes I would like to see it differently. I could map two key combos to the two settings and change between them ...
1
vote
1answer
29 views

Possible to set vimrc variables based on the current vim 'incantation'?

I wasn't sure how to word this properly in the title.. what I'm looking to do is set variables one way or another depending on how vim is invoked. Specifically I have just discovered the Man plugin, ...
2
votes
3answers
50 views

wrap a long line with specific format

I have a problem with breaking long line in markdown file. Given the following line * "fo" : You can use the 'formatoptions' option to influence how Vim formats text. 'formatoptions' is a string ...
1
vote
1answer
40 views

How do I append to the unnamed register?

In particular, I'd like to append to the unnamed register with the :global command.
1
vote
1answer
42 views

How do I increment a variable?

My question might be silly since I'm a new vimscript user. I need to define a variable as follows: let foo = 1 "Implementing foo :echo foo Without success, I tried to increment my variable with the ...
0
votes
0answers
10 views

How to prevent Smart-Tabs plugin from overriding youcompleteme tab completion

I've been looking for a solution to "tabs for indentation, spaces for alignment" and found that the Smart-tabs plugin does exactly what I want. However, when this plugin is active, it breaks the tab ...
0
votes
1answer
39 views

Quickfix won't parse :make output

My makeprg is set to: cd build/ && cmake --build . --config Debug && ctest && gdb -q -ex run ./a This allows me to build application, run tests and start debugging session ...
1
vote
1answer
32 views

Does anyone know how to highlight spelling errors?

While using gVim on my Windows 10 machine at work, I discovered and started using the amazing spell checker when writing markdown. In gVim, misspelled words are underlined with the red squiggly ...
0
votes
1answer
25 views

prevent printing control-character in insert mode and command line

When in insert mode, if no mapping is associated to a sequence, Vim will print the character corresponding to the signal. For example, typing <c-b> will input ^b as a character. It is more ...
2
votes
1answer
24 views

Markdown toc disappears on save since I installed ALE linter

I am using the markdown extension plasticboy/vim-markdown to navigate inside large markdown files: " :Toc : create a quickfix vertical window navigable table of contents with the headers." Since I ...
4
votes
2answers
679 views

Why isn't this implemented by default in vim? (line by line Scroll) [closed]

Very often, my preferred way of navigating a file in vim is by "scrolling" line by line. By scrolling, I mean shifting the lines up/down while keeping the cursor on the same line and position. <c-d&...
0
votes
1answer
23 views

What does c<CR> do?

What does cEnter (not ctrlEnter) do in Vim? I didn't have any mapping about it and it behaves like the S command. See below image:
1
vote
1answer
11 views

execute + colon character doesn't work

I want to :retab selection in my vimscript function. When I write execute "normal! :'<,'>retab" nothing happens. If I write: let cmd = "normal! :'<,'>retab" echom cmd The output is ...

15 30 50 per page