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
1answer
105 views

Vim and the Shell - How close should their bond really be? [closed]

Bridging the gap After years of daily swims in the vast sea of Vim-plugins, ranging from 2-line snippets to full-blown superstar programs, I have observed how a very significant amount of these ...
2
votes
1answer
689 views

How can you switch the j and k keys in vim?

Is there any way to map the k key to 'down' and the j key to 'up'? This seems much more intuitive to me, since the right arrow will also move the cursor down, if it's at the end of the line. Why was ...
1
vote
1answer
348 views

Open all files in a VIM split window view with grep/ack command

I did a ack-grep on files that contain a string. I then want to open these files in a VIM veritcal split window view. How can this be done via the terminal?
0
votes
3answers
17 views

gVim closes automatically when opening python file

I'm using gVim 7.4 , it was running smoothly before installing Plugins after installing pathogen gVim window closes automatically when opening python files. It's working fine for other files except ...
0
votes
0answers
50 views

Strange behaviour of vim inside of gnu-screen

I use screen a lot and inside one of my screen windows, I use vim a lot. I have, however, sometimes, some strange behaviour of vim: After a while of using vim and switching forth and back between ...
1
vote
2answers
27 views

Updating the emacs style Time Stamp comments in vim

How can I implement this emacs auto time stamp in vim? I have the following string at the top of a file: // Time-stamp: <> Here // are comment characters. What do I need to do so that ...
1
vote
4answers
61 views

Select all matching text in Vim?

I have a bunch of data, and I want to yank everything that matches the following regex to a register : /'user': '[a-Z]*' Is there any way to copy all the matches to a register in vanilla vim? I've ...
1
vote
2answers
88 views

vim: library of common substitutions without plugins?

I would be wanting to perform thinks like :'<,'>s/^\ \ \ \ // in an abbreviated form, like :'<,'>s_lw (no matter what would actually be that s_lw) using vim base functionality, initially ...
0
votes
0answers
42 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. ...
0
votes
1answer
28 views

Strange backspace behavior

In both command line vim and gvim alike, I have a situation where the backspace functionality behaves like some of my old vi experiences. If I press backspace in edit mode, the character is not ...
0
votes
1answer
180 views

How do I configure gvim to open files from the current directory?

On Windows, no matter what I set as the current directory, gVim will always set its initial working directory to $home. (That is, if I launch gVim with the current directory at C:\something, or if I ...
3
votes
2answers
181 views

Open vim then save and close automatically

Using bash is it possible to open a file in vim and then automatically save and close e.g. "ZZ" | vim my.file.txt obviously the above isn't going to work, but how would I do the equivalent? - I ...
1
vote
1answer
52 views

VIM - How to search and replace multiple strings using leader?

I'd like to make a leader shortcut for doing multiple global search and replaces in the current buffer. For example, pressing leader then "fq", I'd like it to search and replace 3 times globally, ...
5
votes
5answers
2k views

Ubuntu vi Acting Strange

I just installed Ubuntu Server 8 and found vi to be acting strangely (compared to vi on Fedora, CentOS and OSX). When I use the 'a' command to enter text, pressing the arrow keys results in "C", "D", ...
1
vote
1answer
2k views

Replace text when in visual-block mode

Maybe I'm searching the wrong way, but I've failed to find out how to do this. Here's the scenario: I have a list in a text file where I want to insert the same word on multiple lines, here's an ...
1
vote
1answer
693 views

Changing text in current visual selection in Vim

I have some part of a line visually selected. I would like to remove all non-word characters in the selection and replace all whitespace characters with underscores. How would I go on about this?
0
votes
0answers
353 views

ubuntu:terminal+ssh+vim, resize

Background: OS:ubuntu 12.04 Display: two, one is laptop, and another is a extended monitor, which is bigger. Problem: Open a gnome-terminal in the bigger display, and log on the remote Linux ...
0
votes
3answers
497 views

Changing font in console Vim

I need to change the size of the font inside the terminal Vim (not GUI Vim!). I am working on Windows, what kind of command can I use (I'll map it to a key after that). I do not want to go and change ...
2
votes
1answer
256 views

why won't tmux resize terminal window to honor vi lines setting?

Say I open a terminal $ echo $LINES 25 $ vi :set lines? 25 :set lines=50 :!echo $LINES 50 -as I'd expect (and the terminal window resizes and everything works). But if I start tmux from a fresh ...
1
vote
2answers
232 views

vim - Autosave file to disk, efficiently

I keep a log file, and want it to be written to disk without having to manually save it after every edit. I've used the :au! CursorHoldI,CursorHold <buffer> silent! :update command that I found ...
0
votes
1answer
806 views

Map escape+s to save file in vim

I want a shortcut to save the current file in Vim. I want to map escape+s to :w. I tried :map <esc-s> :w but it doesnt work.
2
votes
2answers
51 views

Don't load undo file if it's too large in Vim 7.3+

I just copied a massive amount of text (on the order of millions of lines, I think) into a Vim register, opened a new file, pasted, and then proceeded to edit the new copy of the excerpt. Vim was ...
6
votes
2answers
2k views

How do you increase or decrease the height or width of a vim buffer in a way so that when you hold down the key combo, the size constantly changes?

How do you increase or decrease the height or width of a vim buffer in a way so that when you hold down the key combo, the buffer size constantly changes? I know CTRL W < works but it moves it one ...
6
votes
2answers
2k views

How can I set gvim's window width to 80 columns of text, plus the ones needed to show the line number

I use gvim with set number in my .vimrc so it shows the linenumber, plus a space, before every line. If the document has less than 10 lines, this takes 2 columns, If it has more than 10, 3 ...
5
votes
1answer
3k views

How to make Vim spellcheck remember a new word

I'm using gvim for latex editing. I write lots of scientific documents with words that the vim dictionary does not know. When running through spell checking I come across words that I know are ...
2
votes
2answers
671 views

`vi` command doesn't open newly installed Vim 7.4 on OS X

I just installed Vim 7.4 on my MacBook using Homebrew. When I enter vim on the command line, it successfully enters Vim 7.4, but when I use vi I still get the old 7.3. To install Vim 7.4 I used this ...
1
vote
2answers
26 views

How do I add a regular expression to a mapping command in vim?

I want to map :b<buffer_number><cr> to <leader>b<buffer_number>. I have: nmap <leader>b :b which is not enough, because I still have to press Enter. I also tried: ...
0
votes
1answer
23 views

How to bring vim back to foreground in Powershell

launch vim from powershell hit control+z (you are dropped back to powershell, vim is in background) ??? How do you bring Vim back to foreground? EDIT: I have tried fg
0
votes
1answer
23 views

Restore previous Vim search term?

Is it possible to save/restore Vim search terms in a map? For instance, I have the following in my .vimrc: map ,/ :s/^/\/\//<CR> If I have turned on highlighting (:set hls) previously in the ...
0
votes
0answers
32 views

Nerdtree crashes (mac) vim

I consistently get vim to basically fail when I use NERDTree and would like help! If I type :NERDTree & inside of any split (usually as a typo), macvim will become unresponsive and vim will throw ...
1
vote
1answer
38 views

Unable to find source of environment variable

So I did the mistake of removing an earlier version of Vim manually on Windows without going through the "Uninstall Program" dialog. The result left me with the enviroment variables of "vim" and ...
0
votes
1answer
20 views

vim: how to make the cursor as wide as the tab-character it is currently on?

When I navigate a file with vim, the cursor always highlights the current character. This works for normal characters having width 1. But for control characters or tabs which take up more space on ...
1
vote
1answer
25 views

Move to next fold of level 1 in vim

I am looking for a good way to jump between function definitions in C++ code. I like the idea of using folds for that, because I can move to the next function/method using zj, but that only works if ...
0
votes
2answers
23 views

How to reload vundle plugin after configuration change

I am using Vim with Vundle and I just changed a plugin specific setting in my .vimrc: let g:NERDTreeWinSize = 60 How do I reload the plugin to pick up this setting(s) without restarting vim?
1
vote
3answers
1k views

In vim, how can I move text to certain columns?

I have text files of poems with line numbers on the right that look like this: Bedded in store of rotten fig-leaves soft, 40 And corded up in a tight olive-frail, Some lump, ah God, of lapis ...
1
vote
1answer
17 views

How to set ouput of the command execution in gVim to be in gVim window in Windows?

From time to time I use gVim in windows. I am used to running commands with :!which in Linux outputs into gVim window but in Windows the new command line window is opened. How to force gVim to output ...
0
votes
1answer
30 views

Why was vim deleted after system (ubuntu 14.04) update?

Everytime I compile vim and install it (I always use manual from the site), it is deleted after an Ubuntu update (not all updates but some of them). After such updates ubuntu always ask me to use ...
1
vote
1answer
21 views

Hitting enter in the quickfix window doesn't work

Normally, hitting enter in the qucikfix window leads to jump to the corresponding line. But when I hit enter, there is a message in the status line, says "xxx matchs, xx lines", instead of jumping. It ...
7
votes
4answers
3k views

How to invert the selection in vim?

After selecting a range of lines with the V command, I would like to delete every line of the file that is NOT selected, so is a way to invert the selection -- select every line that is not selected? ...
1
vote
1answer
20 views

Vim replace occurences of word with and without first capitalized in one S&R command

eg I have this peace of Java code public String setType(String newType) { this.type = newType: } I select all of it and I would like to search and replace type by model, but regardless of the ...
0
votes
4answers
1k views

vim tmux backspace ^?

I'm having a strange problem: When sshing into a particular host (from OSX to RHEL5), vim seems to forget how to backspace, but only in a tmux session, ie: ssh foo@bar.com vim test Backspace ...
0
votes
1answer
29 views

How to switch windows in Vim in Windows (the OS)?

I've read that Ctrl-W + hjkl switches windows in Vim from this answer, but when I try that it simply closes my terminal. I'm on Windows and using vim on a remote account in my terminal.
16
votes
4answers
7k views

How do I edit an existing buffer in a new tab in vim?

Suppose I have started vim like this: vim foo bar Now I decide that I want each of those files in its own tab. Is there a way to do that without exiting vim and adding the -p option to my command ...
1
vote
1answer
1k views

Can't find .vim folder

I'm a Ubuntu 11.04, 64bit user. I have installed vim via apt-get and I need to install plugins, so after the installation process was done, I looked for .vim dicectory in $HOME, but I couldn't find ...
0
votes
0answers
38 views

Neither less or less -X clear screen on exit. (Trust me, I googled…)

Neither less or less -X clear screen on exit. At the same time, vim does.... Env iTerm2, protocol mosh, server Centos + tmux + zsh iTerm2: report term as xterm-256color tmux: set -g ...
0
votes
1answer
31 views

Cursor in gvim changes very slowly between insert and normal mode

I noticed rather annoying behavior in gvim which relates to changing my Linux distro to openSUSE. When switching from insert to normal mode (hitting ESC) the cursor needs at least second! to become ...
1
vote
1answer
96 views

E185: Cannot find color scheme for synload.vim (Line 19)

I've specified the location of .vimrc and .vim: .vimrc file saved at ~/.marslo/.vimrc .vim folder saved at ~/.marslo/.vim After set the rumtimepath, plugins (installed by vundle) and colorscheme ...
0
votes
0answers
32 views

Full Keyboard Navigation PDF Reader With Highlight Function on Windows

After being addicted to VIM, I feel I hate to move my hand out the keyboard to reach the mouse. I'm currently using Acrobat, sometimes I want to highlight some text. I have to select the highlight ...
7
votes
5answers
1k views

Highlighting a search term without moving the cursor

Using Vim, I sometimes find myself staring at a section of source code for a while and suddenly want some variable on the screen to pop out. That's easy: /<var> which highlights them all. My ...
6
votes
1answer
1k views

Can I get the Vim Ctrlp plugin to ignore a specific folder in one project?

The Vim Ctrlp plugin has a way to globally ignore certain folder names. Eg: let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' However, I have an ignore rule that's specific to one project. I ...