Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

learn more… | top users | synonyms

0
votes
0answers
11 views

Composite shortcut for vimium

I want to make a composite shortcut in vimium, it should go to bottom and page up two times. It looks like this map w scrollToBottom scrollPageUp scrollPageUp But Vimium's 'Custom key mappings' ...
3
votes
2answers
2k views

Vim syntax highlighting disappeared for text files (.txt)

My to-do list is a plain text .txt file that I load in Vim. In .txt files Vim has always coloured hash marks (#) and the text following them on the same line, which I use to mark out urgent to-do ...
0
votes
0answers
23 views

cygwin: git commit - vim Editor always in line 5 but not on file edit

I am using cygwin on windows and git from the shell. VIM is configured as my default commit message editor. When I am editing my commit message, ie $ git commit my cursor always resides to line 5 ...
4
votes
2answers
1k views

Vim: How to change the current item highlight color when substituting

I have changed my Vim colours so when I do a /search, every match is highlighted in bright yellow. This makes matches much easier to see. However, when I perform a substitution with the confirm flag ...
47
votes
4answers
29k views

In vim, how can I quickly switch between tabs?

In gnome-terminal, I can just press Alt + (1, 2, 3, etc.) to switch to specific tabs. I can also use Ctrl + (PgUp / PgDn) to cycle through tabs (admittedly less convenient, but it can be remapped). ...
20
votes
7answers
34k views

How to get rid of the warnings when opening a file that has a .swp file?

How can I get rid of the annoying warnings when I open a file that has a .swp file? Or, how do I not generate the .swp files at all? Example warning: E325: ATTENTION Found a swap file by the name ...
0
votes
0answers
26 views

Remap `<C-n>` to `<Down>` when `<C-x><C-o>`'ing

In Vim, when using the omnifunc for completion, it's possible to browse through the completion results with <Down> and <Up> without the "selected" result actually being inserted before the ...
30
votes
2answers
21k views

How does one switch between windows on VIM?

I'm using both Vim and MacVim (or well, trying to). I installed the Tagbar plugin but find it impossible to switch to the actual Tagbar window to make my selection. I've been reading loads about ...
0
votes
1answer
27 views

How to control vim message display time

Is there a way to control display time of messages in vim? For example, when searching in vim and hitting the bottom, it will display: search hit BOTTOM, continuing at TOP Even if after several ...
31
votes
2answers
9k views

Where does VIM (gvim/macvim) keep swap files for unsaved/unnamed buffers?

Where does VIM (gvim/macvim) keep swap files for unsaved/unnamed buffers? (If it does so at all). Background: Throughout a semi intense seminar I was taking notes in an unnamed/unsaved MacVim buffer ...
6
votes
3answers
1k views

How to a open a file in vim using pipe

I get to use the locate command extremely often. So if I run the following command. locate updatedb | head -1 Then it gives me the O/p /usr/updatedb.conf I wonder if there is any such command ...
0
votes
1answer
539 views

let mapleader = “\<Space>” not working arch linux

I'm trying to map space bar to leader key by using the code above but there's a problem - whenever I press space, the pointer moves forward a character, which annoys me. What am I missing? (gvim@arch ...
3
votes
2answers
229 views

Getting CTRL+V to work in Vim inside Conemu

Conemu uses CTRL+V as the short cut to “paste first line of clipboad.” I want this functionality when I’m interacting with the command-line, but when I’m in Vim I’d like Vim to handle it.
0
votes
1answer
42 views

Open file in vertical split in Vim / netrw

If I open vim with vim . netrw provides me with a nice list of the files and directories in the current directory. If I open a file using v the file opens in a very narrow split down the left hand ...
0
votes
0answers
35 views

Vim 7.4 with syntax on will always Caught deadly signal SEGV

With syntax on inside .vimrc (that's the only line in my .vimrc file), opening a file with any sort of syntax highlighting will cause Vim: Caught deadly signal SEGV Vim: Finished. Segmentation ...
7
votes
3answers
11k views

Better syntax highlighting for Java in Vim?

I've found Vim to have fantastic syntax highlighting with my preferred color schemes for Ruby and Python, but whenever I need to write Java code, it's like I haven't even turned on highlighting in the ...
3
votes
1answer
142 views

iTerm 2 ZSH colors/themes not showed correctly

I have a clean installed mac, running OS X 10.11.4. I have installed iTerm 2, and set it up to use oh-my-zsh. I'm trying to set up a theme for my iTerm. I am trying to use the avit theme. It's ...
3
votes
3answers
8k views

changing the color of comments in vim

I use vim to browse the source code. In java source files comments appear in blue color on black background which is difficult to read, how to change this color scheme so that comments can appear in ...
25
votes
7answers
7k views

How do I replace-paste yanked text in vim without yanking the deleted lines?

So I usually find myself copying text from one point to another while overwriting old text where the new is pasted: blah1 newtext blah2 wrong1 blah3 wrong2 blah4 Suppose I visual-mark newtext and ...
3
votes
1answer
91 views

Vim: is it possible to add a modeline for :syntax sync fromstart in a file?

I'm writing a really long page to document a compiler and I was thinking that it would be nice if the doxygen highlighting would stick around. Only if I do a search to further down the file, it loses ...
1
vote
1answer
50 views

How can I make a searchable shortcuts cheat sheet?

So, just like most people it happens that my memory for shortcuts and commands is kind of bad until it gets into muscle memory, but since it is just painful to have a fancy configuration in vim + tmux ...
18
votes
7answers
8k views

Delete space-expanded “tab” in Vim with one keystroke?

I edit Python code with Vim. With the tab key I get four spaces inserted for indentation. How can I delete those spaces with one "Backspace"(?) stroke - instead of four? There has to be some "set" ...
2
votes
2answers
43 views

How can I permanently map the vim command :W to :w?

Sometimes in vim I am holding shift when I save, and wind up doing :W. How can I set my vimrc to recognize :W as :w?
6
votes
4answers
1k views

Close all locations list or quick fix windows in vim

Is there a way to close all locations lists and quick fix windows with a single command in vim/gvim?
13
votes
3answers
5k views

cygwin + mintty + vim backspace problem

I have installed vim, mintty via cywin on XP. The problem is when I try to hit backspace in VIM edit mode, the cursor move back a character instead of wiping the previous char. How can I tweak this ...
4
votes
1answer
105 views

Vim Syntastic not jumping to the error

I'm using ESLint with Syntastic in Vim. Errors are found correctly in Syntastic, but when I navigate to the error in the Error Location Panel, and hit Enter, it drops me off in the same position I was ...
4
votes
2answers
2k views

How do I set vim to support mouse scrolling, but keep text selection on left click?

I would like to scroll my files opened in vim using mousewheel, but at the same time using the left mouse button to select text into clipboard. Setting :set mouse=nicr (or :set mouse=a) will only ...
2
votes
1answer
52 views

How To find a word and replace with changing pattern

I have a text like the following: case "UID": if (!Convert.IsDBNull(objDataReader["XYZ"])) { objQualitativeAssessmentBiz.XYZ = objDataReader["XYZ"].ToString(); } break; case "GeneratedChaseId": ...
22
votes
4answers
16k views

Why does the system have /etc/sudoers.d? How should I edit it?

Last time, I asked about the risk of these (in /etc/sudoers): user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf %group_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf ...
1
vote
2answers
223 views

Do I need the meta-key for vim?

I'm looking in to learning emacs or vim. I started out with emacs but found the need for a meta key to be a hassle, especially since I have a non-english keyboard layout on my macbook. So far I ...
1
vote
1answer
420 views

Monospace font which supports at least both of Korean hangul and the Georgian alphabet?

Being both a language enthusiast and a programmer, I find myself often doing programming or text processing involving foreign language alphabets and scripts. One annoyance however is that CJK fonts ...
10
votes
4answers
9k views

What could cause strange characters in Vim?

I'm have this really strange problem in Vim using the NERD tree plugin, where, as you can see in the picture, the characters are showing up very strange. Where there is the ahat, ~V 3/4 it should be ...
3
votes
2answers
791 views

Using sed within a vi buffer

In a long text file listing dups-23Mar16.listing I want to delete lines beginning, for example, with .local. Here are some lines in this file: ...
7
votes
3answers
2k views

How to change the default location of .vimrc to inside ~/.vim/?

I use git to persist my ~/.vim directory. I'd like to store my vimrc file in this directory as well so that it will also live in the repository. How do I change the location where Vim searches for the ...
0
votes
0answers
14 views

Automatic documentation of dotfiles/config files configuration options

Has there been any work done on the front of automatic config file documentation? For example it is a good practice to add a comment line above/next to your config option, such as (source links at ...
1
vote
2answers
28 views

How to open VIM on Ubuntu (not from the command line)

I have a fresh install of Ubuntu with XFCE as the desktop environment. But there isn't a shortcut for Vim even though it is installed. It does work fine from from the command line by typing in ...
1
vote
2answers
32 views

Windows gVim edit file from Command Line

I have a Windows batch file that I use to edit files using Notepad++ @echo off if [%1] == [] ( C:\PROG\Notepad++Portable\Notepad++Portable.exe ) else ( ...
10
votes
5answers
4k views

Can I use perl regular expressions in the vim command line?

I want to use perl regular expressions on the vim command line. For example, to capitalize the words on the current line, you could type: :s/(\w+)/\u$1/g
0
votes
0answers
24 views

Vim: Execute Goyo plugin when opening Markdown file

So far I've got this: autocmd Filetype markdown call SetUpMk() function SetUpMk() colorscheme pencil execute 'Goyo' endfunction But that doesn't work. No errors or nothing, it just does ...
12
votes
4answers
2k views

In vim, how do I make the left and right arrow keys change line?

In vim, my arrow keys work correctly, moving up, down, left, and right as expected, with one exception. At the beginning of a line, left arrow does nothing, instead of going to the last character of ...
1
vote
2answers
68 views

How can I make MacVim as “Application” on Mac;

I would like to use Snap (free) to assign a shortcut for Vim on Mac (installed as macvim through brew on command line). However, Snap only works when the application is literally "found as an ...
0
votes
2answers
298 views

vim/gvim command line switches?

I've just spent 1/2 hour trying to find a list of command line switches for vim. Since vim is a "command line editor" a search on "vim command line ..." is not very useful. I got curious trying to ...
0
votes
0answers
20 views

MacVIM not displaying tab/buffer line in Fullscreen mode on OSX Captain

I used :Fullscreen command to send the MacVIM to full-screen mode. (This is a function in "vim-shell" written by xolox, available on Github through the author.) Everything worked fine (I started Vim ...
0
votes
0answers
15 views

Pentadactyl - How do I use extended hints to open multiple links?

When using ;F to open multiple hints, the help file only mentions that the hints are delimited with (carriage return/enter). It looks as though I can filter by links containing a partial match. How ...
1
vote
1answer
545 views

Why is my Gvim font so ugly and grainy under Windows 7?

I use Gvim on Linux and Windows. On Windows 7 Gvim just looks ugly. Mainly because of the font. The fonts looks very grainy and poorly rendered. I tried a few different fonts. ...
7
votes
5answers
447 views

Take screenshot on every keystroke

A while ago I saw a cool animation of an explanation to do something in Vim. I would like to be able to do that by taking a screenshot of the Vim window every time I press a key (automatically), does ...
16
votes
4answers
11k views

Vim shows strange characters <91>,<92>

while using vim over ssh I copied some content from a webpage to my ssh/vim session and got the following result SIZE=`df -h|grep $DISC|awk <91>{print $2}<92>` apparently <91> and ...
1
vote
0answers
40 views

Vim Airline - how to disable tabline filename?

When I use Airline's Tabline in Vim, I get the filename twice in my Tabline. Once on the left, and again on the right. I would like to use the extra space on the right for other filenames. Here is a ...
0
votes
0answers
15 views

In vim, is it possible to turn my bibliographic keys into links?

I write in pandoc markdown, which uses bibligraphic keys from biblatex that look like @smith_foo_1999, where "Smith" is the author name, "Foo" is the title, and 1999 is the year of publication. This ...
0
votes
0answers
27 views

elementary OS + Bash + VIM tab completion broken

When I type :q and press Tab, I get this output: :q^I Instead, it should complete it to: :quit My ~/.vimrc: " An example for a vimrc file. " " Maintainer: Bram Moolenaar <Bram@vim.org> ...