All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
38 views

Escape newlines when breaking text

I'm using Vim to typeset some Latex documents, and resizing it to take up half my screen so I can reference other materials on the other half. Therefore, formatoptions+=t would be very helpful here. ...
3
votes
1answer
62 views

Is ESC involved in any key combinations?

Just starting to get into Vim and facing the classic escape problem. I'm thinking binding CapsLock to be control when used with another key, and escape when released without pressing anything else ...
1
vote
0answers
28 views

Vim unknown colored block

My vim on WSL has some unknown colored blocks. The weird thing is it happens randomly and some colored blocks would disappear when I pass them using cursor. The following is my .vimrc settings: ...
0
votes
2answers
50 views

Vi formatting to ignore a section of text

I do a lot of plain text file editing, and many times I need to mark a section of text as 'DO NOT FORMAT' as it is pre-formatted, or even contains ascii art. Many years ago I did this by marking the ...
2
votes
1answer
38 views

How to remap ci$

I am using the plugin vimtex. It offers the functionality (from the introduction of its documentation) Text objects ic ac Commands id ad Delimiters ie ae LaTeX environments i$ a$ ...
10
votes
2answers
2k views

What does `idem` mean in the VIM docs?

One example would be in the List docs: :unlet list[3] "idem
1
vote
1answer
17 views

How to get a function to print something to colon command and let user edit it?

I need to write a function that when executed it opens colon command and paste some stuff on to it and let user edit it before executing the command. for example function! EditRelativePath() :e ...
1
vote
0answers
25 views

Ignore a specific error

How to ignore a specific error (E303 in this case) globally? (don't display it in the console) I wish not to use try...catch if possible.
0
votes
3answers
61 views

How to clear neovim terminal buffer

I have a terminal buffer with 10000 lines of previously executed output. In order to search for the particular sequence of words I have to go through all 10000 lines before getting to my last executed ...
10
votes
6answers
1k views

Delete n lines skip 1 line script

I want to create a basic Vim script that simply deletes n lines, skips 1 line and repeats until the end of the document. I don't care about specific matches, I just want to delete the line. For ...
1
vote
1answer
52 views

Visual delete items from quickfix list

I am trying to delete items from the quickfix list, using the same delete interface I am used to, visual delete and dd. The .vimrc code I am trying to use to accomplish this is below. It does not work....
3
votes
0answers
63 views

YouCompleteMe on remote files

I use YouCompleteMe on vim and it works great for me on the files in my local machine. However, when I open files in a remote server, for example, using :e scp://user@remote//path/to/file.cpp None ...
2
votes
1answer
29 views

Neovim 0.17.5: bash command top failed tty get

please be gentle, I am trying to learn neovim, coming from vim the command :!top executed inside neovim returns top: failed tty get shell returned 1 After googling, only search results from fzf ...
1
vote
3answers
26 views

vim : how to set current buffer to a string using `:python`

As example, my current buffer contains below lines di=01;34 ln=01;36 mh=00 pi=40;33 I want to join all lines with :, and set entire buffer to the joined string. How to achieve that, using :python ...
2
votes
1answer
41 views

I can't escape square brackets for syntax matching

I have the following code in my ini.vim: augroup HiParens autocmd! autocmd Syntax c :syn match Parens /[(){}]/ autocmd Syntax c :syn match Bracks /[\[\]]/ augroup End And highlighting is ...
0
votes
0answers
31 views

Running vim in Windows CMD messes with text wrapping when resizing the window

Normally, resizing CMD works normally for me, where the directory prompt (is that what it's called?) stays on the left side of the screen no matter the size of the terminal. However, if I open vim (or ...
2
votes
0answers
25 views

How to set syntax keywords dynamically

I'm trying to highlight the keywords for my c++ project. So what I've done is to create a file here: ~/.vim/after/syntax/cpp.vim and put some custom configuration into it. For example, putting the ...
2
votes
1answer
39 views

Plugins working in vi but not gvim

I am using a Windows 10, 64 bit machine, with gvim 8.1.1 installed (See screenshots below). I am using Vi version 8.1 which was installed as part of my git bash - version 4.4.23. I have never ...
1
vote
1answer
46 views

How does p really works as related to content put in registers?

I've read this question and answer already, however it could not solve my doubts. As far as my understanding is correct, p always has the same effect (pastingutting the content of a bufferregister, ...
2
votes
1answer
50 views

Change to standard regex syntax?

This might rustle some feathers, but I do not like how vim's regular expression syntax differs from standard regex syntax (I've read this answer, but I don't think this is worth remember two syntaxes ...
1
vote
2answers
35 views

How to highlight class name of c++

I'm trying to configure the highlight to highlight keywords of my C++ project. Here is the content of ~/.vim/syntax/cpp.vim: syn match cCustomParen "?=(" contains=cParen,cCppParen syn match ...
0
votes
1answer
35 views

How to replace entire buffer with the contents of a variable?

I am trying to replace the entire buffer with the output from an external command. Similar to :% !myprog, but only if the command succeeds: let output = system('myprog') if v:shell_error == 0 " ...
2
votes
1answer
77 views

How to break-up gutter fights?

There a number of types of plugins use the Vim gutter to display Git status, syntax correctness, linting and code formatting. But how can conflicts be managed when multiple plugins want to update the ...
1
vote
0answers
57 views

How to get YouCompleteme to work with kernel headers

I am taking an OS class and we have an upcoming assignment involving Kernel modules. I'm reading Wiley OS text to prepare and they have the below code. I keep on getting an error that the header files ...
2
votes
0answers
29 views

MacOS Terminal CPU spike after exiting Vim

I'm using Vim 8.1 from homebrew on MacOs 10.14.6. Whenever I exit vim back to the terminal, the first keypress in the terminal afterward results in a beachball and CPU spike to 100%, with terminal ...
1
vote
1answer
51 views

Filter file completion list

When I write markdown and want to insert an image, i_CTRL-X_CTRL-F comes in handy. I know that I can filter by typing a few characters that precede the filename, but actually what I want is either ...
0
votes
1answer
38 views

Using <space> as prefix key in normal mode, cursor will advance one character itself

I put key mapping like this nnoremap <space>d "_d in my .vimrc, so I can delete text more comfortable. But when I in visual mode or visual block mode, the cursor will advance one more column, ...
2
votes
1answer
30 views

Can't unmap key mapping to its default permenantly

I mapped <C-X> to "*d and now I can't revert it back. I want it to subtract number by 1 like default, but I can't unmap it permanently, it's set to <C-X> in every new session. I'm sure ....
0
votes
1answer
33 views

Syntax Question for exec (executing two commands)

In my .vimrc, I have the following exec command: inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b.vimtex.root.'/figures/"'<CR><CR>:w<CR&...
1
vote
1answer
64 views

Same plugins for every .vimrc file (vim-plug)

I have a question regarding the following situation: I want to use a default .vimrc and a vimrc (name it .vimrc2) for a special purpose. However, when I start vim with vim -u ~/.vimrc2 I have the ...
2
votes
1answer
44 views

Everytime I call :Explore netrw creates a new unlisted buffer

Is there any way to stay always in the same netrw buffer after selecting a file to edit?
2
votes
1answer
45 views

How do you set the name of a tab page?

I have a couple of tabs open. Is it possible to set custom tab page names for each individual tab page? For example, I want to name one tab "database", another "backend", and another "frontend". I ...
0
votes
1answer
16 views

Allow text to reflow in terminal mode after resizing

I opened up a terminal with :terminal. Then I ran a server process that prints logs whenever someone hits the API. Next, I resized gnome-terminal, but I noticed vim didn't update the view of the ...
2
votes
1answer
33 views

Standard way to implement a :tselect-like menu?

In the context of developing a plug-in, what is the most portable (various versions of vim, nvim, ...) and readable way to implement a "menu" similar to what :tselect gives i.e. that appears in the ...
1
vote
2answers
53 views

Toggle between two most recent syntax highlighting settings

I often nest one programming language within another (e.g. HTML inside python). This can be done per-language, and written items in ~/.vim/after/syntax/ for that purpose, but I don't have the patience ...
1
vote
0answers
51 views

How do I securely remap the current split's width and height keys?

Iam trying to put nnoremap <C-Right> <C-w>3> in the ~/.vimrc But it's not working. Also, VIM has a PRETTY ANNOYING line erasing binding to ctrl+Right in the Normal Mode. I would like ...
1
vote
1answer
69 views

How to do :Sex but with a vertical split?

When viewing a file /tmp/vim_split_demo/test.txt, the parent directory can be opened in a horizontal split screen using the command :Sex, as shown in these screenshots: What command gives same ...
1
vote
1answer
16 views

Unable to conditionally test for presence of a plugin command & invoke it

I have the following code in my vimrc if exists(":Goyo") augroup LatexGoyo autocmd! autocmd BufReadPost,BufNewFile *.tex Goyo augroup END else augroup LatexColumnSet ...
2
votes
1answer
50 views

Why does gvim --remote change order of files?

When I open multiple files in gvim with no options, they are assigned to buffers in the order I specify on the command line: gvim foo.cpp foo.h bar.cpp bar.h Doing :ls then yields: 1 %a "foo.cpp" ...
1
vote
0answers
35 views

Strange control line when opening a file

Sometimes (about once/twice a day), when I open a file in vim, I get a strange line containing meta control characters right at the top of the buffer. The line goes away when I refresh the buffer, so ...
1
vote
1answer
107 views

Plugin to display a smarter method tag list

Note this may be a duplicate, but I couldn't really find an answer. From a C++ perspective: With universal ctags on, doing a C-] on top of a method call presents you with a tag list matching the ...
2
votes
1answer
63 views

Named capture groups in vim regex?

Does vim allow us to assign names to capture groups for search/replace that can be used in place of \1, \2 etc... for back-references and substitution? Like in in Python: >>> import re >...
0
votes
1answer
50 views

Why doesn't Vim recognize that I have Python installed?

I'm on the latest version of Arch Linux. The version of Vim from the Arch repos doesn't have python support, so I downloaded the source code and built it from that. I have checked, and Python support ...
2
votes
0answers
29 views

How to have gutentags build tags from the .git folder in a repository?

I want to have my tags file generated from gutentags/ctags to be in the .git folder, because I am working on a project with other people where I don't want to edit the .gitignore file. So, I have ...
1
vote
4answers
335 views

Converting multiple assignment statements to single comma separated assignment

A vim newbie here. Would like to know an efficient way of converting self.mat = material self.epsilon=epsilon self.x = x to self.mat, self.epsilon, self.x = material, epsilon, x
3
votes
0answers
28 views

Keep function “keyword = arguments” together when reformatting across multiple lines using “gq”?

One thing I find myself doing often is using visual mode to select a block containing a long function definition containing one or more keyword arguments, and then using gq to reformat the code across ...
3
votes
1answer
62 views

When searching for the string under the cursor, how does an atomic group prevent a match outside a string?

TLDR I have this text in a buffer: a 'string' and 'another one' ! ^ cursor is here And I search for this regex in a / command: \%(.*\%#\)\@=\%('[^']*'\)\@>\%(\%#.\+\)\@&...
2
votes
1answer
42 views

Session - start with buffer 1

Note: Possible fixed bug. See comments. A somewhat minor nuisance, but as the pedantic for these things :P When saving and opening a Session file the Session.vim file does: badd +1 file1 badd +1 ...
4
votes
1answer
34 views

gq in visual mode indents just first two lines of enumeration

Some markdown as an example. I select the following paragraph in visual mode and press gq. The result is: - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ...
2
votes
1answer
50 views

Only Open Folds With z Commands

If I navigate the first line of a folded function with h,l, etc it will open the fold. Navigating search matches with n will also open a fold if there is a match inside the fold. Can you configure ...

15 30 50 per page