All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
7 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 ...
0
votes
0answers
5 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
12 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 ...
1
vote
0answers
9 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?
0
votes
1answer
10 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 ...
271
votes
9answers
209k views

How can I copy text to the system clipboard from Vim?

Is there a way to copy a block of text to the system clipboard, so I can paste it in another program?
1
vote
1answer
23 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 ...
2
votes
2answers
158 views

Making gVim behave with the English International keyboard layout

I run gVim7.4 on Windows 7 with the English International keyboard layout. The keyboard layout works in a way so that pressing ` + i gives you ì. In Vim insert mode that's the desired behavior. ...
1
vote
2answers
104 views

Can I define something in .vimrc to speed up pasting of large amounts of data?

Occasionally, I paste large amounts of data into vim, using Ctrl+v in my terminal emulator (in Linux). This takes several seconds before vim is responsive again. I have tried two other methods, which ...
1
vote
2answers
43 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 ...
0
votes
1answer
42 views

How to view document as right-aligned without modifying it

I have a log file in which some lines are just a few characters while other lines are about a thousand. Is there a way to view the ends of each line without modifying the file? I have two sub-optimal ...
1
vote
1answer
64 views

How do I make this vimscript function (taken from another question here) 'forget' about a previous search term?

Based on the accepted answer to this previous question, I put the code below in my .vimrc, which changes the color of my statusline depending on whether my search (started with / or ?) yields results ...
1
vote
0answers
25 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 ...
2
votes
0answers
19 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
1answer
48 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
86 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 ...
0
votes
2answers
79 views

How to match autocmd pattern for unique file

I'm trying to make autocommands that will run only when the buffer is a man page (:Man) but I can't get the right pattern as i'm not too familiar with regexp and globs. here's what i've tried so far: ...
2
votes
1answer
2k views

How to safely switch from vim-athena to vim-gtk?

I have vim 7.4 Huge version with X11-Athena GUI installed on my laptop running ubuntu 16.04. I would like to safely switch to vim-gtk. Do I have to uninstall existing vim installation and install vim-...
1
vote
1answer
13 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 ...
1
vote
0answers
30 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
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 ...
2
votes
1answer
50 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 >...
1
vote
3answers
60 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
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 ...
1
vote
4answers
321 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
2
votes
2answers
248 views

How to set a colorscheme that still shows spelling errors?

How to set a colorscheme that still shows spelling errors? I am looking for two combined effects that I can acquire separately but not yet together. Set Colorscheme alone: OK. If I want highlights ...
2
votes
2answers
55 views

`.vimrc` unsuccessful in setting highlight style

1) To underline misspelled words, I can execute the following in an open buffer: :hi clear SpellBad :hi SpellBad cterm=underline :set spell 2) However, if I write in my .vimrc the first two lines, ...
2
votes
0answers
21 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 ...
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 ...
3
votes
1answer
44 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: \%(.*\%#\)\@=\%('[^']*'\)\@>\%(\%#.\+\)\@&...
4
votes
2answers
153 views

How to display in the statusline the number of matches from a search?

I've seen this question: Is there a way to count the number of occurrences of a word in a file? but most of the time I search using * or just /. It is possible to display automatically in the ...
4
votes
4answers
187 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 ...
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 ...
10
votes
3answers
2k views

How do I reverse a string with Vim script

I am trying to reverse a string, so that 'abc defg hij' becomes 'jih gfed cba'. The solution I came up with is join(reverse(split(l:text, '.\zs')), '') Is there a more elegant solution or should I ...
4
votes
1answer
30 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 ...
0
votes
1answer
31 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
0answers
26 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....
2
votes
1answer
22 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?
2
votes
1answer
43 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 ...
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 ...
1
vote
1answer
37 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 ...
5
votes
1answer
148 views

How to disable folding while typing?

I'm programming mostly in Python/Cython and use foldmethod=syntax (and foldclose=). Overall, this works fairly well, i.e. functions/classes/methods are folded reliably mostly. However, I have one ...
1
vote
3answers
462 views

How can I change the cursor moving on fzf?

Similar to the question about ctrlp, I would like to know how to change the key remapping to move the cursor on fzf library. Right now, only the ctrl + k works to move the cursor upward, but all the ...
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 ...
3
votes
2answers
2k views

Installing or building vim with +python3 support for Python 3.7.x on linux

I've got Vim installed on MacOS using Brew and it installs with +python3 support for Python 3.7.2 by default. I'm writing a Vim plugin which utilises some Python 3.7 and would like this to be able to ...
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
1answer
32 views

Is it possible to `lmap` a key to multiple characters?

I want to use f and t command for Unicode characters, so lmap is the way to go. I can map a letter to a Japanese kanji: :lmap k 中 then after i_CTRL-^, I can press fk to locate 中。 However, there is ...
4
votes
2answers
73 views

How to enable “on-the-fly” autocompletion?

How can I make it so that no command or extra keystroke is required for the autocompletion menu to pop up? i.e. what I want is the menu to be always present while in insert mode and to be constantly ...
1
vote
1answer
40 views

vim and enhancedcommentify weird behavior for C

I am trying to use EnhancedCommentify plugin for vim and mostly using C. However I can't figure out the issue but when I comment/uncomment it uses (* ---- *) instead of /* ----- */. I tried to change ...
0
votes
2answers
92 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?

15 30 50 per page