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

2
votes
2answers
2k views

Solarized Dark + Gnome Terminal + Vim + Vim-Airline

I installed the solarized dark theme for gnome terminal using https://github.com/Anthony25/gnome-terminal-colors-solarized and then with Vundle installed ...
3
votes
3answers
159 views

How to jump to top or bottom of script with keyboard shortcuts?

I'm looking for the VI/VIM equivalent of 'gg' and 'Shift+g' but within PyCharm. Searched through their docs and didn't find anything.
32
votes
3answers
75k views

installing plugins in vim

I had a real difficulty installing vim plugins on mac. I know for a plugin to be installed it has to be seen by runtimepath. According to vim docs, this is Macintosh: "$VIM:vimfiles, $VIMRUNTIME, ...
0
votes
0answers
20 views

cVim in Chrome Browser OSX

What are the very first steps for using cVim after enabling it in the Chrome Browser? I would expect that after entering ESC and : a command bar opens, but nothing happens. What is the basic ...
0
votes
0answers
35 views

change the font style only for attributes in MacVim

I have the font called Operator Mono Light,and am using it in Macvim. My question is in Vim, can I get the font changed to the Italic version of Operator Mono ONLY for attributes like in this ...
1
vote
2answers
24 views

Import previous commands to edited command

I'm playing with zsh to change image modification time according to the 'Date/Time Original' exif attribute. For this I one command I do: PDATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ...
0
votes
0answers
10 views

OSX - Remapping Capslock without admin privileges

What I really want is to use Capslock as a escape key inside Vim (which is being run inside iTerm2). The solution I'm looking for could, for instance, remap Capslock not necessarily to Esc but to ...
3
votes
4answers
3k views

Vim is not reading gzipped files automatically

I want to see some zipped log files .gz in unix through putty. When I open them in vim the contents are not readable. I think vim is not able to unzip them.
10
votes
4answers
4k views

Count highlighted string length in VIM

I wonder is there a way to count highlighted symbols in vim (including white spaces)? UPDATE It shows rows count if my selection is on multiple rows. I need symbols count.
1
vote
0answers
23 views

vim recent changes breaks vmap?

The same procedure works on my VIM 7.4 patch 1-1572 but not on my VIM 7.4 patch 1-1718, is there anything changed in between that affects this? Procedure: $ vim -u /dev/null some-file Then in vim ...
5
votes
3answers
3k views

Turning on XML syntax highlighting in vim for a non-XML file

I'm using vim to browse through some log files (the file extension is .log) which contain a lot of XML. How can I turn on XML syntax highlighting after opening the file? Of course, I don't actually ...
3
votes
2answers
3k views

iTerm2 vim cannot map alt key

I'm having trouble trying to map the alt-key bindings on vim in iTerm2. I want to map shortcuts for switching between buffers like this: map <A-Right> <C-w>l map <A-Left> ...
0
votes
0answers
7 views

sublime text 3 vim cursor in command mode same as sublime text 2

In sublime text 2 in preferences, even though it is not mentioned, you can set caret_style to wide and when in command mode it will only underline the character that you are currently on. In sublime ...
30
votes
2answers
4k views

How can I select an HTML tag's content in Vim?

Is it possible to select an HTML tag's content in Vim? For example: <p>I am a silly butterfly</p> I would like to select "I am a silly butterfly". I know that you can use vi" to ...
17
votes
3answers
9k views

How to add a new line with the same indentation

Then I press Enter in Insert mode, a new line is created, but the cursor is placed at the beginning of the line. How do I create a new line with the same indentation as the current one?
6
votes
2answers
1k views

How to select a whole HTML block, including the tags in VIM?

Suppose I have: <div id="help"> <table> ... ... ... </table> </div> How do I select the whole block, starting from <div id="help">?
2
votes
1answer
232 views

How to select the currently indented lines in VIM

How I can selected the lines with the same indent? For example: if true: line 1 line 2 ... line n If the cursor is over line 2, how I can selected from line 1 to line n?
1
vote
1answer
21 views

How to keep Vim's visual mode selection while scrolling with Ctrl-F?

When I select text in Vim's visual mode, scrolling with Ctrl-F cancels the selection. How can I keep the selection while scrolling (with Ctrl-F)?
0
votes
0answers
9 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' ...
6
votes
2answers
10k views

“Emulate” 256 colors in PuTTY terminal

At my job, I ssh into a development server everyday. I usually use exceed XStart to ssh in, but I downloaded PuTTY to see if I could do anything that I couldn't do with XStart. I spend almost the ...
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
17 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 ...
5
votes
4answers
6k views

Vim Solarized dark theme looks weird on iTerm2

I just installed the solarized colorscheme following instructions on the project's page. This is what it looks like now: which is not like those screenshots on the official page. Any idea how to ...
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 ...
42
votes
4answers
28k 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). ...
19
votes
7answers
33k 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
21 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 ...
28
votes
2answers
20k 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
20 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 ...
1
vote
0answers
7 views

Vim normal and insert mode cursor not changing in GNU screen [migrated]

I use vim in a few different contexts; typically, I like to put this in my .vimrc: let &t_ti.="\<Esc>[1 q" let &t_SI.="\<Esc>[5 q" let &t_EI.="\<Esc>[1 q" let ...
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
517 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
217 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
33 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
28 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
100 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
7k 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
83 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
48 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" ...
1
vote
2answers
38 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
88 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
48 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
15k 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 ...