All Questions

0
votes
0answers
9 views

How to omit dictionary source file in dictionary completion

<C-X><C-K> complete words with long dictionary file name, such as /home/xxx/.vim/mydict. I'd like to omit or shorten the descriptive info. I have googled but got no hints. Any advice?
1
vote
0answers
14 views

Why does renaming with :saveas not open the new named file in the current buffer?

When editing a file named oldFile, with the command :saveas newFileName I expected vim to save the current buffer under the new named file (i.e. newFileName) and set the filename of the current buffer ...
1
vote
1answer
14 views

ftplugin script not loading

I'm really new to Vim, and trying to proceed as described here: https://vim.fandom.com/wiki/Keep_your_vimrc_file_clean for language specific customization. I'm trying to implement automatic line ...
0
votes
1answer
13 views

How can I make Vim not use the entire screen for spelling suggestions?

If I type z= on a spelling suggestion it uses the entire screen. Is there any way to disable that?
1
vote
1answer
29 views

Cycle through autocomplete menu using tab

I am activating my autocomplete menu in vim using: inoremap <C-@> <C-n> and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when ...
0
votes
2answers
19 views

visual line mode is ended by inner block motion

When I do Vi{y to select inside a { block and yank it, it doesn't paste how I expect. I noticed that after V (which puts me into VISUAL-LINE mode), the i{ object takes me into VISUAL mode. Here's a ...
0
votes
1answer
25 views

How to clear multi lines in command zone

I'm working with vim + some plugins to code c++. Sometimes, because of some bug or some executing sequence issue, the command zone will show me two or three lines as below: As you can see, I got two ...
1
vote
1answer
25 views

When does the file depending plugin kicks in?

I'm learning to use Vim with vim-latex and I'm wondering when does the plugin actually activates once I open a file. My intuition tells me that any file with the .tex extension should do it, but if I ...
0
votes
0answers
9 views

Is There a Way to Make Vim Provide an Error Message Whenever it Beeps?

I know that when vim beeps at me it is generally telling me I did something wrong. Sometimes it displays a helpful error message and sometimes it does not. Is there a way to make it always show a ...
1
vote
1answer
24 views

NERDTreeMenu Remapping

I'm a Colemak keyboard layout user and I recently started to learn and use Vim. I was able to map the arrow keys in the normal mode by putting custom mappings such as noremap u k in .vimrc (because ...
1
vote
1answer
18 views

Split same file into multiple windows “extending” each other

Suppose I have a long python file which is limited to 79 character or so in width. One very helpful feature would be if I could view the whole file separated into multiple vertical splits which "...
0
votes
1answer
21 views

NeoVim: Single-Line Comments Also Format the Next Line [duplicate]

So, I started using NeoVim a little while ago and discovered a rather annoying quirk when using C++-style single-line comments // in source code of any language. Specifically, when you create a new ...
1
vote
0answers
25 views

Change/Set color to a string in statusline

I'll preface by saying that I am using Airline, plytophogy/vim-virtualenv plugin and gruvbox as the Airline theme. I am trying to change the color of some string in the status line to, say, orange. ...
0
votes
0answers
17 views

Execute a file from nerdTree

With the default file explorer (netrw) you can press x to open a file or directory with the system default application. Is there an easy way I can do the same with nerdTree? I can't find the option. ...
0
votes
2answers
34 views

In Vim ex mode how to re-use a string from the default buffer in the command

I'm trying to modify this file, by extracting the very first line in the file and append it to each of the consecutive lines until end of the file black widow card Friday berry I used ex command (...
4
votes
3answers
128 views

How to get all distinct words within a set of lines?

I would like to extract a list of distinct words from a set of lines. Is there a way of doing this ? Say for example I have lines that look like this: [ [(isPhysicallySettledFxFwd, NO,"Y"),(...
0
votes
1answer
11 views

How to check if a string is a substring of another string

I was wondering what is the proper way to test whether a substring is included in some other string. If I want to check if string a is part of string b, I'm currently using matchstr(b, a) != "" to ...
0
votes
0answers
20 views

Run commands before and after a buffer is externally changed

Imagine I have a Vim buffer open and the file is changed externally (example: I switched git branches or the file was just edited normally). Any time that happens, I want to have 2 commands run. The ...
0
votes
0answers
8 views

syntastic plugin files getting sourced twice

Many moons ago, I made the common newb mistake of tricking out vim with all kinds of plugins and plugin loaders without really knowing what I was doing. I'm trying to clean things up a little. I'm ...
0
votes
1answer
35 views

Echoing a message when grep has no result

Is there a way echoing a message if grep has no result and getqflist() is empty? I've tried this, but it doesn't work: au QuickFixCmdPost grep call g:GrepPostActions() function! g:GrepPostActions()...
1
vote
0answers
37 views

How do I make vim's terminal use my emulator's cursor shape?

When I switch to terminal mode in vim, it changes the cursor shape to block and doesn't restore it after I quit the terminal. This is problematic when you are using other cursor shapes like ibeam a.k....
0
votes
0answers
17 views

How to use visual mode in python/dyn?

Vim documentation states how to run command and normal mode commands (source): vim.command(str) python-command Executes the vim (ex-mode) command str. ...
0
votes
0answers
8 views

Where could I find documentation of python/dyn or python3/dyn?

I guess that :py command is executed by some kind of extended Python interpreter. This extended Python has vim package available: :py import vim; print(dir(vim)); print(vim.__package__, vim.__name__) ...
0
votes
0answers
23 views

Change background color of git conflict marker sections

If git is performing a 3-way merge and has a conflict it can't resolve, it marks up that area of the file like this: No unresolvable conflicts here <<<<<<< HEAD xyz ||||||| ...
0
votes
1answer
27 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 ...
0
votes
0answers
11 views

Ctrl-] matching single word in custom tags

When using vim's help I can jump to multi-word tags, but when creating my own tags Ctrl-] tries to match individual words. Consider the following example: file.txt |a-tag| *a-tag* When ...
0
votes
1answer
23 views

How to replace a word with spaces

Suppose I have the following text: This is a test of the emergency broadcast system What I want to do is delete the word "test" and replace it with four spaces: This is a of the emergency ...
0
votes
0answers
25 views

Open all but one buffer in a separate tab

I have following in my ~/.vimrc to make sure that nerdtree opens for every tab: autocmd VimEnter * NERDTree I also have this in the ~/.vimrc to make sure that every new buffer opens in its own tab: ...
0
votes
0answers
13 views

How can I get swap files for new/unsaved files/code in empty buffers? Any way to recover unsaved files?

I'm trying to configure Vim to make it so that if my system crashes I can recover my work from swap files set in set directory=. I tested this out on Vim in Windows using gVim. If I forcibly crash ...
0
votes
1answer
20 views

Why does backslash-escaping a CJK character cause a very-magic regex match to fail?

My understanding of very-magic regexes is that you can escape any character outside [A-Za-z0-9_] with a backslash to make it match literally. However, I don't see that behaviour with CJK characters. ...
0
votes
0answers
22 views

How do I fix <DEL> behavior on macOS in VIM 8.1?

I've recently installed "huge" VIM 8.1 with Lua support (on macOS via MacPorts). This installation is side-by-side with my "normal" VIM 8.0 which lacks Lua support, so I have access to both versions. ...
0
votes
0answers
12 views

Disable E303 warning when swap directory isn't writeable

I sometimes run vim as another user than me, using my own vimrc. In this case the swp and undo directory aren't writeable, and vim warns me with E303. I don't care about not having swap file in this ...
1
vote
1answer
28 views

Send current vim line to seperate tmux pane and move cursor down

I am trying to send the vim line that is under the cursor to another tmux pane and then move the cursor on vim down 1 line. For context, I have vim open on 1 pane, and python open on another. I want ...
1
vote
1answer
35 views

How can I search for Unicode characters by hex code in very magic regexes in vimscript?

I am working on UTF-8 support for my editorconfig-core vimscript plugin. I have hit a strange snag. This is in official GVim 7.4 Win32. I would like to get this working on 7.4, rather than ...
1
vote
3answers
43 views

Why cannot I make Vim (not gVim) fullscreen?

I use Vim on windows (not gVim) because I think, that windows menu bar is ugly. So I use Vim, but I cannot fullscreen it. When I try it caps at cmd max size (1/4 size of screen) and won't be bigger. ...
1
vote
5answers
52 views

How to write on multiple places at once

I'm familiar with vertical blocks, and I often ctrl+v down down down shift+I foobar esc to write foobar in various locations at once. This is useful if I want to replace <td> to <th> in a ...
-1
votes
1answer
34 views

Vim split screen opens blank split

I am trying to open a different file at some different location while i am working on a file in vim using split screen feature using vsp:cd.. / folder/filename after I hit enter it just shows me ...
0
votes
1answer
15 views

Using a login shell only for the :term command

I'm on MacOS, so basically all terminals are login terminals for me which source my bash_profile and load everything I need. However, the :term command does not source my bash_profile, I believe ...
3
votes
2answers
174 views

Detect existing key binding before creating one

A plugin I've recently started maintaining currently checks to see if any bindings exist to its functions before creating the default ones. This makes it easy to setup custom bindings and not have to ...
2
votes
2answers
27 views

vimrc and finding errors in latex document

To find errors in a latex document, I open vim on the .log file. Then I type manually /^l\.\|[Ee]rr\|[Ww]ar followed by RETURN This extended regular expression works well. It matches a line starting ...
3
votes
1answer
19 views

remap “undo key” to no op

I have a keyboard with an undo key right next to the esc key. I often miss esc, hit undo, which causes the vim process to be stopped. How can I remap the undo key in vim such that it doesn't do ...
1
vote
0answers
22 views

custom fold expression to fold functions

I would like to create a custom fold expression for functions of the form x <- function(a,b,c) { ... ... body ... } where the lines starting from function(...) until the closing brace are ...
1
vote
2answers
38 views

Switch order of three “words”

When writing code, I often have code of the form variableA operator variableB and I would like to edit it to be variableB operator variableA. Right now, I do this by deleting/pasting variableB to ...
-1
votes
0answers
24 views

How to configure VIM to drop all IDEs [closed]

So this is kind of a follow-up to this answer over on stackoverflow. I have been naivly using vim for quite some time now and recently finished my first small c++ project in production with it. I got ...
1
vote
3answers
47 views

reset sequence of numbers

I have 50 lines of code private const CODE = 0; private const DESC = 1; // ... private const TRIM = 19; // instead of 24 private const SMURF = 35; // instead of 25 private const DOG = 31; // instead ...
2
votes
2answers
36 views

Vim Statusline colors not appearing

I want my vim statusline to have some color and I can't figure out why it does not with this code: set laststatus=2 set statusline+=%1*\ %f\ %* set statusline+=%2*\ %<%F%* set statusline+=%2*%m%* ...
2
votes
2answers
57 views

past yanked content in rectangular selection

I have some long text on Yank var e.g. "Hello all how are you ?" I have a rectangular selection between abc and ABC /a llC-vjj a A b B C C And I want to past my long text without having to type it
1
vote
0answers
18 views

Latest Vim on Cygwin

Why can I not get Vim 8.1 on Cygwin? The latest version I can find is 8.0.1567-1. I found out that patch 8.1.0372 fixes the slow scrolling when 'cursorline' is set.
-2
votes
0answers
52 views

After update to VIM 7.4 editing a path of remote mounted share no longer automatically switches to explorer

In VIM, when opening a directory path usually switches to Explorer mode. It still works like that for local drives. However, a few months ago most of my system got updated and VIM is now version 7.4. ...
-1
votes
1answer
54 views

How to copy and paste arguments into function parenthesis?

I constantly need to copy existing variable names or expressions as arguments for my current typing function: // int TyrionLannister; int JonSnow; ... int AryaStark; ... // int DaenerysTargaryen;...

15 30 50 per page