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

9
votes
7answers
16k views

What's the easiest way to delete Vim swapfiles I've already recovered from?

Sometimes Vim crashes and leaves me a swapfile. That's awesome. Then I open the file I was editing and Vim asks me if I want to recover. I do, thanks. When it's done, Vim tells me, You may want ...
4
votes
3answers
4k 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 ...
1
vote
0answers
43 views

Can vim be used to view a growing file?

I often use vim's view for viewing files. Is there a way to use it for a growing file so that I can see the progress as it's happening? Something similar to tail -f or less +F I have two use ...
3
votes
2answers
84 views

Like the J command in Vim, but take a motion

I like the J command for joining many lines, but don’t like having to count how many lines I want to join. I’d prefer to give a motion. This can be faked with V{motion}J; is there a way that doesn’t ...
0
votes
0answers
23 views

Vim: mapping for <PageUp>, <PageDown> not working in vim, but working in tmux

Did a clean install a couple days ago, copied over my .vimrc and .tmux.conf, and now Ctrl-F / Ctrl-B doesn't page down / up in vim. Ctrl-F / Ctrl-B work in tmux when selecting text. Weirder still, ...
10
votes
8answers
3k views

Emacs equivalent to VIM ci"?

Does emacs have the equivalent of VIMs ci" command? Basically I want to replace the text inside a set of quotation marks. In vim I can ci) or ci] or ci} to "change inner *"...
0
votes
2answers
34 views

Gvim: Disable alt-letter behaviour inserting accented/unicode chatacters?

I was using alt-j, alt-l, alt-i and alt-k to go to the beginning/end/top/bottom of the current line. Over the years I noticed there's so much stress on the alt key, so now I decided to go try other ...
1
vote
1answer
38 views

How do I change the hilighted length of git commit-messages in vim?

I'm of the opinion that the orthodox 50-character limit on git commit messages is absolutely ridiculous. (Primarily because I think using an 80-character wide Terminal in 2015 is equally ridiculous.) ...
1
vote
5answers
509 views

What's the equivalent of Vim's matchit in Emacs?

With Vim's plugin matchit, you can match not only parens, but also a lot more language structures that come in paris (e.g. , if..end, do..end). Now I'm using Emacs (for fun!), and I wonder if there ...
0
votes
1answer
43 views

after SSHing into another machine and starting vim, run terminal command in original terminal

I use ssh to remotely login to a machine where I subsequently work primarily from Vim. Sometimes I want to run some shell command on my original machine without leaving Vim. What is a non-disruptive ...
9
votes
4answers
5k views

tmux copy mode - select text block

I'm using tmux with vi keys, and copy/paste works fine as long as you're selecting one line of text, or if you have only one window. When I want to select a block of text (multiple lines, but not full ...
1
vote
1answer
555 views

Copy vertical text block in Vim on Mac

How do I copy a vertical text block in vim on a Mac? On a PC on would just do ctrl-c at starting point and ctrl-c at the end point and it would copy between these two coordinates. How do I do that on ...
2
votes
4answers
333 views

Copy and paste in VIM?

When I copy some lines in the VIM by marking and then right clicking sometimes there are some insert operations that happen and the letter 'p' is added to the file. How can I copy and paste without ...
1
vote
1answer
37 views

Vim: changing tabs to spaces

I know this question has been asked many times, but I'm not finding a solution to my problem in particular, mostly because I can't even really identify the problem. Here's the timeline of events: ...
56
votes
6answers
33k views

How to show the current column in the statusbar in vim?

I would like to show the current column in the statusbar, as is common in many other text editors. E.g. it's good to know if you are around column 80 or above. How to show the current column in the ...
0
votes
0answers
31 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.
2
votes
3answers
2k views

Pair programming with tmux and Vagrant

Does anyone have a clear step-by-step guide for setting up a shared tmux session on a Vagrant vbox that my coworkers (on our local office lan) could SSH into? The articles I've found online only seem ...
0
votes
3answers
33 views

VIM How Can I Force VIM to Arrange Words According to My Choice?

Well I am writing and learning. I just want to write some text in this way.... - First line. Second line. Third line. But the problem is the lines are starting in this way... - First line. ...
3
votes
1answer
298 views

How do you create a vim key mapping that requires numbers before the hotkey (like <G>)?

I want to create a mapping like the G hotkey that jumps to a line (e.g., to jump to line 10: 10G). How can I do that?
3
votes
0answers
35 views

How to provide user “hints” to “diff”? [closed]

Sometimes, when I am diffing two text files (usually in vimdiff), the diff algorithm gets confused and associates the wrong lines with one another. Once that's happened, the rest of the diff is often ...
28
votes
2answers
5k views

vim freezes inside tmux

I'm using split panes in tmux - one being vim, other shell. Sometimes, around once a day, vim freezes. I can move between panes, perform any tmux commands, just vim doesn't react to anything. This ...
16
votes
4answers
12k 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). ...
1
vote
3answers
360 views

Automatically change to paste mode when pasting from clipboard

As far as I know, there is no autocmd event for copying and pasting. So I was curious if it is possible to write a script that toggles paste mode when the clipboard is used for paste. If it can handle ...
0
votes
3answers
39 views

How to concatenate pairs of cells; every second cell to the first

How to concatenate successive pairs of cells in a column, adding the second cell of each pair to the first. For example: santhosh kumar sagar sv sai deva And the result should be: santhoshkumar ...
1
vote
0answers
25 views

Tmux 1.9a - variable #{pane_current_command} doesn't work as expected

I'm trying to get vim-tmux-navigator to work on my my Cygwin (Win7 x64) + Tmux 1.9a but it doesn't. The reason is the variable #{pane_current_command} always returns bash instead of vim, so the ...
0
votes
2answers
88 views

Strange Vim/terminal use from ssh via Mac OSX

I am using terminal from a Mac OS X 10.10 (Yosemite) and SSH’ing into a fedora machine and am having a couple strange issues with the terminal: When I :q from vim, the contents of the vim screen is ...
46
votes
5answers
24k views

256 color support for vim background in tmux

while using vim within tmux I can see that 256 color support is enabled. with $tput colors However changing the colorscheme in vim while in tmux will change the colorscheme on a per line basis but ...
46
votes
6answers
24k views

Mac OS X Terminal: mouse support?

Is there a native option (ie. without installing extra soft/package/plugins) to enable mouse support in the Terminal app? Actually, I'm using a lot vim with the option set mouse=a (activating mouse ...
0
votes
0answers
17 views

Mouse works erratically/intermittently over remote SSH

I work remotely sometimes. I’ll use Vim inside a Screen session, over SSH. I use the mouse in Vim. Sometimes the mouse breaks. One of these things happens: Random characters get inserted into my ...
1
vote
0answers
30 views

vim leaves a swapfile after crash with unknown owner

I am running Cygwin on windows. Several times now I've had a swap file left behind from vim after a crash, but it can't be recovered or deleted. "ls -l" shows this: -rw-r----- 1 Unknown+User ...
1
vote
2answers
33 views

Make :Wq equivalent to :wq in vim

I'm always typing :Wq when I mean :wq. Is there a way to alias :Wq=':wq' in vim?
2
votes
0answers
61 views

Mouse click only works once with iterm2/tmux/mosh

I'm trying to set up iTerm2 + mosh + tmux to do my remote work. I can get everything to connect up, but for some reason, the mouse response is funky. If I split my tmux window so I have two panes and ...
1
vote
1answer
72 views

Searching all versions of a file in the undo tree in VIM

EDIT: I have "manually migrated" this question here: http://vi.stackexchange.com/q/2220/1060 Is there an easier way to find a particular change in Vim's undo tree than just looking at random old ...
0
votes
1answer
35 views

Vim `cpp` Syntax highlighter prematurely ends macros mid-word

FINAL EDIT: I have "manually migrated" this question to the new Vi(m) SE site: http://vi.stackexchange.com/q/2219/1060 My Vim syntax highlighter for ft=cpp is prematurely ending some macros ...
1
vote
2answers
4k views

gvim options / Settings window cannot write buftype is set e382

I was trying to customize gvim a bit. I see under the Edit menu is an option to change Settings Window. It opens up but then I get the following error. E382 cannot write, 'buftype' option is ...
1
vote
2answers
33 views

how to set .vim color scheme to vim editor OS X

I downloaded some .vim color scheme files in github and moved them by sudo mv ~.vim /usr/share/vim/vim73/colors then I wrote colorscheme ~.vim in vimrc. The original schemes already existed, are ...
3
votes
2answers
360 views

Vim's syntax color-highlighting is lost from command-line

If I execute the following commands from within a vim session that's visiting a file of code, the resulting hardcopy is syntax highlighted in color: :syntax on :hardcopy >/path/to/hardcopy.ps ...
0
votes
3answers
56 views

Installing a vim color scheme

After some research, I've discovered that in order to properly install you need to create a .vim directory inside of the path represented by the $VIMRUNTIME variable from this StackOverflow post. When ...
27
votes
8answers
12k views

How do I open the directory of the current open file?

If I open a file with vim dir/to/my/file.c how can I easily open the directory dir/to/my in vim's filebrowser?
0
votes
0answers
35 views

gnu screen not to change my window titles

I set meaningful names to new windows I create in gnu screen, but then when I 'cd' or open vim that name gets changed to 'pwd' for instance. Is there a way to prevent screen from changing the title? I ...
18
votes
7answers
5k views

How to make Emacs read buffer from stdin on start?

With Vim I can easily do $ echo 123 | vim - Is it possible to do with Emacs? $ echo 123 | emacs23 ... Emacs starts with a Welcome message $ echo 123 | emacs23 - ... Emacs starts with an empty ...
0
votes
0answers
23 views

Jedi vim autocomplete fails

After installing jedi-vim with Pathogen, I noticed that several features weren't working correctly. To test the behavior of jedi-vim, I copied the 2nd code snippet featured in the demo at the demo for ...
25
votes
2answers
3k 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 select ...
1
vote
2answers
2k views

Vim: How to navigate between begin and end html tag?

For example, if I want to jump to the close form tag. how could I do this?
4
votes
2answers
760 views

How do I open separate tabs/windows for all buffers in Vim?

How do I easily open my current vim buffers/arguments in a separate window/tab each? I know about: $ vim one.txt two.txt three.txt -O However if I simply start vim with: $ vim one.txt two.txt ...
1
vote
2answers
39 views

Vim Avoid “Hit the enter key or enter a command”

I have the following configuration in my .vimrc file to switch between a .c File and it's corresponding .h File function SwitchHeader() w if(&ft=='cpp') e %:r.c ...
0
votes
1answer
41 views

Scroll in terminal while Vim is running

When I open vim in some terminals (on mac for example) and use the mouse scroll, I am able to see the terminal output again. If my terminal window would look like this: user@pc$ "I'm gonna start ...
43
votes
5answers
6k views

Invoking vi through find | xargs breaks my terminal. Why?

When invoking vim through find | xargs, like this: find . -name "*.txt" | xargs vim you get a warning about Input is not from a terminal and a terminal with pretty much broken behaviour ...
3
votes
1answer
729 views

VIM prepend lines using visual block

Trying to prepend a # to all lines in a visual block by highlighting, I (shift - i) but only the first line changes (even after hitting esc) This is the method I've found in a number of places ...
2
votes
1answer
24 views

Effectively manage sets of Vim settings

Is there any effective way to manage multiple sets of Vim configuration? I need this because I need different sets of configuration for different types of work. It depends a lot whether I'm writing a ...