vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

1
vote
1answer
88 views

How to give each variable a different color?

Is it possible to have a vim color scheme where each variable is given a unique color? If so, how? This feature would be really helpful when visually scanning code. (I think I saw this feature in ...
2
votes
3answers
51 views

Replace string with another string in vi editor

I have a template.php file where I want to change every occurence of apple with grape throughout the file. At the moment,I am having to painstakingly edit the entire file to find where to change. ...
1
vote
1answer
44 views

Set makeprg to gradlew

First a bit of context for those who don't know gradle. It's basically like make except that you don't have to have gradle installed on your computer. It ships with projects as a file called gradlew. ...
1
vote
1answer
99 views

Why is this copy/paste in vim configuration not working properly?

I have the following in my .vimrc vmap <C-c> y imap <C-p> <esc>P So that I can do my classic sortcut for copy/paste. It works fine on Cygwin but not in my ssh session to ...
4
votes
6answers
1k views

How to comment multiple lines at once? [duplicate]

How can I select a bunch of text and comment it all out? Currently I go to the first line, go to insert mode then type # left-arrowdown-arrow and then I repeat that sequence, perhaps saving a few ...
0
votes
2answers
313 views

(g)vim - NerdTree and tagbar above each other left to edited file?

Any chance to get (g)vim displaying NerdTree and tagbar above each other left to edited file? +-----------+-------------+ | nerd tree | edited file | | contents | | +-----------+ ...
5
votes
1answer
418 views

tmux, Vim and Solarized

Premises Browsing around tmux, Vim and Solarized I can find lots of complains about 256 colours and "user experience". Well, I'm having the opposite "problem", i.e. Vim works well with a full ...
1
vote
1answer
50 views

How to hardcopy to multiple pages per sheet?

Let's suppose I have a single sheet of text to print (8.5''x11''). Can I create multiple hardcopies of said text and scale them so that I can fit 4 copies per print sheet using VIM? ex. ___________ ...
1
vote
0answers
45 views

vim and tmux on the same line

I would like to figure out a way to get my vim statusline and tmux statusline on the same line if such a thing is possible and not immensely difficult (ideally, the vim prompt, or whatever it's called ...
0
votes
2answers
73 views

vim how to keep cursor position while copying text

I am (having to) using gvim in windows. I was used to the linux environment where when I select text using mouse the cursor position wont change. Now , with gvim in windows, My problem is something ...
2
votes
2answers
147 views

vim colors not automatically loaded (probable Vundle conflict)

I've been trying to port my Windows .vimrc to Linux, to use on the command line (on gnome-terminal). Everything works fine, except for the colorscheme. It looks like it's loaded (:colorscheme returns ...
1
vote
3answers
330 views

Arrow keys spontaneously stop working in vim

I recently upgraded from OS X 10.6 (I think) to 10.9. Since then it seems, while editing in vim, the arrow keys will "spontaneously" stop working. At one point, in frustration I "mashed" one of the ...
6
votes
2answers
253 views

Is there a method for making Google Chrome open textareas in vim?

I used to use Firefox on a daily basis but have switched to Google Chrome, and have been using it for 2+ years now. The one plugin that I miss is this one, It's All Text!. This plugin allowed for the ...
12
votes
3answers
1k views

Vim interface on web browser input fields?

I am looking for a browser plugin which inputs textin of input boxes with the same keyboard interface of the Vim text editor. I have adopted Vimium which makes general navigation much more effective, ...
4
votes
2answers
593 views

viewing info documentation with vim

I'm trying to use the ManPageView addon to view info documentation within vim. Although I find ManPageView very useful for, well, viewing manpages, its info-reading functionality doesn't seem to work ...
1
vote
3answers
88 views

Emacs's <C-l> vim equivalent

There's a neat Control-L hotkey in Emacs that repetitively moves the cursor to the top/middle/bottom of the screen. I'm quite sure there's a vim equivalent for that, but I couldn't find it.
5
votes
2answers
47 views

How do I pick up a previous modification in VIM?

If I did several modifications to the original file, i.e. 1 delete a line 2 insert some text 3 delete another line 4 delete the text added in step 2 5 insert some other text 6 ... Now I want to ...
1
vote
2answers
43 views

Vim: What is difference between motion mark shotcut `. and `"?

While reading vim info motion marker says: |`quote| `" go to the position when last editing this file |`.| `. go to the position of the last change in this file Above ...
1
vote
1answer
72 views

Mapping C-1 does not work in VIM

I'm trying to bind 1gt to CTRL + 1, so in vimrc I added nmap <c-1> 1gt But pressing these keys in normal mode does not work. Either VIM (konsole) or gVIM Anything wrong with my command?
2
votes
2answers
146 views

Command-line editing vim style [duplicate]

I recently discovered terminal's feature, you can set the keys emacs or vi style I prefer the second. so if you do set -o vi You can use k j l h keys to navigate on the command line. And you can ...
2
votes
1answer
152 views

Auto indent C++11 lambda functions Vim

Is there any way to get Vim to auto indent C++11 lambda functions correctly? I have tried many different permutations of smartindent, cindent, etc. in .vimrc.
2
votes
2answers
529 views

How to enable vim addon packages?

I have installed vim-nox as well as vim-latexsuite and vim-outliner on Ubuntu 12.10. There's nothing wrong with Vim but neither of the add-on packages does anything. What do I have to do to in order ...
1
vote
2answers
45 views

Anyway to navigate percentage-wise in vim?

I often open large files, looking through logs for finding info. As all lines have timestamp in my case and I am sure of in which part of the whole file the info is present which I am interested in. ...
0
votes
1answer
45 views

Piped search queries in vim or less

I would like to be able to search a log file for lines that being with ^2014-02-18 15:30:[0-9:,]* and have UserName:someguy much later in the same line. I am sure I could do a regex to include any ...
6
votes
4answers
7k views

What causes swap files to be created?

As part of the program I wrote, I constantly read and write data from files. I noticed that as part of doing so, I am inadvertently creating swap .swp files. What do you think is going on? What would ...
24
votes
4answers
3k views

Why does `ESC` move the cursor back in vim?

In vim, when I hit ESC to return to command mode, the cursor moves one character to the left. This is not what I would hope for, occasional I immediately hit l to move back to that spot, perhaps to ...
0
votes
0answers
78 views

Installing cppman

I've tried to install cppman in Fedora 19 or Linux mint 15 and it installs successfully. But when I try to use it I get the error: Python IOError: [Errno 13] Permission denied I've installed it in ...
11
votes
4answers
2k views

Replacing Multiple blank lines with a single blank line in vim / sed

Question more or less says it all. I'm aware that /^$/d will remove all blank lines, but I can't see how to say 'replace two or more blank lines with a single blank line' Any ideas?
3
votes
1answer
80 views

What does the search flag 'z' do in VIM?

I was looking for a way to show a bit of context around my searches when doing g/mysearchtext/p When I stumbled across this page Search-a-pattern-and-provide-a-context-few-lines-above-and-below ...
2
votes
1answer
214 views

vim and tmux are conflicting. How can I fix this? [duplicate]

I'm having a painful experience with tmux. I'm using solarized in vim but when I run tmux then my vim configuration does not work. It's as if solarized is not configured in my .vimrc. Out of tmux ...
8
votes
2answers
315 views

Is there a command reverse search in vim?

In linux cli I can do ctrl-r and do a reverse search and choose something I have done easily. Is there something similar in vim? I mean I may run a command using : (could be anything like a long ...
2
votes
3answers
443 views

How to reverse-match a string in the Vim programming language?

I want to find the last index of any character in the [abc] set in the abcabc string but the search should start from the end of the string: " Returns the 0th index but I want the 5th. let ...
2
votes
1answer
100 views

Search for “not newline” in vim?

To search for A T\n in vim I can just do /A T\n What would be the equivalent for not newline at the end? /A T[^\n] did not work.
0
votes
1answer
117 views

When I type vim in terminal my bodhi linux complains emacs is not installed (bodhi linux) [closed]

jcress@jcress$ vim The program 'emacs' can be found in the following packages: * emacs23 * emacs23-nox * e3 * emacs23-lucid * jove Try: sudo apt-get install <selected package> I can't ...
3
votes
2answers
149 views

How can I make shell aliases available when shelling out from Vim?

In my .zshrc, I declare some aliases. Eg, which dbstart shows the contents of that alias. If I open vim from that shell, it is a child process. In Vim, I can run shell commands with :! some_command. ...
0
votes
2answers
108 views

How can I paste something to the VIM from the clipboard

How can I paste something to the VIM from the clipboard? In Windows "*p works as expected but in Debian both "*p and "+p doesn't work with both clipboard=unnamed and clipboard=unnamedplus.
0
votes
1answer
183 views

How do I join the next line when a line matches a regex for whole document in VI?

As title, for example, I have lines like abcdefg join! abcdef no join abcdefg join! If a line matches regex ^a.+g$ then I would like them to be joined, so it would be: abcdefgjoin! abcdef no join ...
11
votes
3answers
377 views

How can I constantly see the current filename in vim?

I am using vim and I need a way to always be able to see the file that I am working on without having to do ^G. I see the file name when I start vim but when I start to work and use various functions ...
1
vote
3answers
121 views

Can Vim be made simpler? [closed]

I have a 300MB file I want to edit, search, remove duplicate lines, compare 2 files, that sort of stuff. I tried Sublime Text 3, which was slow and crashed often. I asked for recommendations and was ...
14
votes
4answers
1k views

Automatically create matching braces in vim

How do I automatically create matching braces in vim? It should work as follows: If I input an open brace the closing one should appear automatically and the cursor should be placed in between. To ...
1
vote
0answers
54 views

Blank lines of unknown origin when running vim after tput clear

I have a rather bizarre issue with terminal behaviour. If I execute tput clear to clear the screen, my cursor (as expected) goes to the top of the terminal. If I run vi after that (vim actually), ...
1
vote
1answer
26 views

Avoid completing directory names when changing vim buffers

Suppose I have a directory structure, such as dir ├── foo │ ├── bar.c │ ├── bar.h │ ├── foo.c │ └── foo.h └── config └── foo.conf And I have each of the files in foo/, as well as ...
1
vote
3answers
82 views

vim avoid selecting underscore

So I know that an underscore (_) is considered part of a word in vim. Working with Python, I normally end up having a lot of underscores. Is there a way to select part of a word excluding the ...
4
votes
4answers
13k views

“Swap file xxx already exists” when editing apache configuration file in vim?

Using vim I keep getting a message saying "Swap file xxx already exists" when I'm editing an apache config. However, I don't see it in the working directory on in tmp. How do I delete this?
1
vote
2answers
579 views

Loading a color scheme has no effect in Vim

I had selected some really smart looking color schemes for Vim here Following the instruction inside those files I've copied them in my $VIMRUNTIME/colors directory. When Vim is launched in normal ...
5
votes
1answer
69 views

How to put current line at top/center/bottom of screen in vim?

Any quicker navigation trick to place the line at which the cursor is at the moment to the top of the screen? center of the screen? bottom of the screen?
0
votes
1answer
113 views

Can not install any color scheme in Vim in Kubuntu

I have installed the latest Kubuntu. I am trying to set a nice color scheme for my terminal, but it does not work.For example I tried wombat256. I copied the wombat256mod.vim under ~/.vim/colors as it ...
3
votes
3answers
4k views

vim how to configure backspace and delete key's both as normal

How to configure following keys in vim? Backspace key to delete a character backwards. Delete key to delete a character forwards. After reading some posts, I got to know that only one of those can ...
8
votes
5answers
10k views

delete line in vi

How can I delete a line in VI? Here what I am doing right now: Open up the terminal alt + ctrl + t vi a.txt I move my cursor to the line which I wan to delete, then what key-combination is should ...
47
votes
6answers
4k views

Exit vim more quickly

I use Vim mainly for quick edits rather than long work sessions. In that sense, I find the keyboard sequence for quitting especially laborious: Esc, Shift + ;, w, q, Enter. How to quit Vim (possibly ...