All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
7 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
22 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
0answers
44 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
39 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
24 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
45 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
37 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
28 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
30 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
58 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
38 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
35 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
13 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
29 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
51 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
37 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
52 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
14 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
40 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
32 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
95 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
55 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
47 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
22 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
325 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
27 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
46 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
36 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
32 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
44 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 ...
2
votes
1answer
24 views

Disable All Default Mappings in vim-go

Is there a way to disable all mappings for vim-go? So I can only have the mappings that I explicitly set myself?
0
votes
1answer
32 views

Use line's 'folded state' in a mapping, so it's `zc` closing but `zv` opening?

When I'm opening a fold, I would say 100% of the time the behaviour I want is zv - open all folds covering the current line, so that I can actually see it. But zv won't close a fold. How can I use ...
1
vote
1answer
38 views

Sophisticated autocompletion in Vim in a VScode manner

I'm currently switching to Vim as my main text editing tool and I try to investigate if it is possible to make Vim behave like VScode when it comes to autocompletion. I got really used to the way ...
1
vote
3answers
61 views

Is it possible to edit the name of files by opening their root folder on Vim?

Let's say I have a folder located on ~/question with 4 files: $ ls _file1 _file2 _file3 _file4 I've realized that it's possible to open folders with Vim and it'll list the file names of all the ...
0
votes
0answers
17 views

Microsoft (MS) SQL server connection profile string for vim database plugin dbext

I am attempting to connect with a local instance of MS SQL Server using the dbext plugin. I run a simple sql statement (a create table statement, from a file where ft=sql), by placing the cursor over ...
0
votes
1answer
18 views

YCM compilation database NOT on a per file basis

I am using YCM to work on a pretty large C project. I generate multiple executables/static libraries hence have multiple makefiles and so multiple compilation databases (generated using BEAR) for ...
1
vote
0answers
32 views

How to configure Syntastic to process mixed Jinja/Html files correctly?

I've searched around for how to configure vim/syntastic to process mixed Jinja/Html files but not found the steps. Does anyone know if there is a way to configure Syntastic to handle filetype jinja....
0
votes
1answer
29 views

Reuse brace pair in abolish.vim

I want to replace all these at once: Heading Name --> Another New Title headingName --> anotherNewTitle I tried this: :%S/heading{, }Name/another{, }New{, }Title/g It replaces correctly ...
4
votes
4answers
188 views

How to apply a register to a command?

I have the given file 4 apples 2 bananas 6 peaches 3 grapes 1 pineapple 5 pears 3 tomatoes What I want to do is to recieve the following result instead: apple apple apple apple banana banana peach ...
1
vote
1answer
61 views

Editing file in splits breaks the folding

My current workflow looks something like this: Open a file in different splits, each split showing a different section Make appropriate edits in each split :wq from the split after editing Repeat as ...
0
votes
2answers
113 views

How to restart vim from within vim?

Here's how I restart vim: $ vim :q $ vim Is there a way to restart vim so that there is no need to type the second vim in the shell?
2
votes
0answers
14 views

How to mimic Alt key functionality from ubuntu gnome to OSX iTerm2?

When I use Vim on my home Ubuntu computer, I am able to use alt-[key] as a quick way to jump from insert mode to normal mode and immediately run the [key] command. One thing I frequently do is: alt-j ...
0
votes
1answer
15 views

Quickfix and building a CMake project on windows

I'm trying to get to the point where I can build a CMake project in neovim and have it output a quickfix list that I can quickly step through. In Visual Studio, I would typically hit CTRL+b for build,...
1
vote
0answers
36 views

vim syntax highlight

Syntax highlighting just stopped working on my mac (v 10.14.6). I've been trying to get it back over the past 2 days with no success. I have neovim (v 0.3.8) and when I use :syntax, the command line ...
3
votes
1answer
18 views

Is it possible to use <C-H> (and J/K/L) for navigation inside a Vim 8 terminal?

I rebound control + H/J/K/L to navigate between splits without needing <C-W>: nnoremap <C-J> <C-W><C-J> nnoremap <C-K> <C-W><C-K> nnoremap <C-L> <C-...
3
votes
1answer
134 views

If one can diff from Vim without the need to boot `vimdiff` then why is it a binary program?

Before you start reading. Before having answers, I thought vimdiff was a binary program because I'm used to Debian's file, which seems not to honor POSIX (but I didn't knew); but then I used macOS 10....
3
votes
2answers
345 views

Vimscript - Surround word under cursor with quotes

I'm writing a Vim plugin which will need to surround the word directly under your cursor with a quotes. I have tried using simple solutions which use commands like "b" and "e" executed in normal mode, ...
3
votes
2answers
207 views

Regex pattern matching cursor-position

Considering the following regex pattern: /\s*<<.\{-}>>/ I want to match those patterns only when the cursor is somewhere on this pattern. So, if have the line (the character enclosed in ...
2
votes
1answer
25 views

How to go back after accidentally hitting H in visual mode?

While selecting in visual mode I often accidentally hit H or L instead of h or l due to having used Shift for some previous command (like e.g. V to start selection by line) and not yet released it ...
2
votes
2answers
96 views

How do I list only modified buffers in vim?

Sometimes when there are a lot of buffers, it becomes hard to see which buffers have been modified using :ls.

15 30 50 per page