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
6 views

vim throws errors about pathogen when run under sudo

I installed pathogen.vim by dropping it into ~/.vim/autoload and adding execute pathogen#infect() to my ~/.vimrc, which works great when I'm running vim as myself. But whenever I edit a file as root ...
43
votes
5answers
23k 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 ...
44
votes
6answers
23k 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
9 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
12 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
27 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?
0
votes
0answers
10 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
65 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
24 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 ...
0
votes
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
17 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
343 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 ...
-1
votes
0answers
15 views

Is there a plugin for VIM to popup the html in a Browser quickly? [on hold]

Is there a plugin for VIM to popup the HTML in a browser quickly? If there is a similar thing for cygwin, that would be useful too.
0
votes
3answers
44 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
11k 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?
33
votes
1answer
9k views

How to get vim to open multiple files into tabs at once

Is it possible to get vim to open multiple files into tabs, similar to the way the args <path> command will open multiple files into buffers? Doing something like :tabe ./* results in the error ...
0
votes
0answers
17 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
11 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
723 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
31 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
33 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 ...
41
votes
5answers
5k 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
703 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
19 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 ...
2
votes
1answer
25 views

How can I get Syntastic to recognize newer Ruby syntax?

I'm using Syntastic in Vim, and it highlights newer Ruby syntax as errors. For example, if I use required keyword arguments (introduced in Ruby 2.1), like this: def distance(from:, to:) # whatever ...
0
votes
1answer
23 views

How to I map “Ctrl + g” to open NerdTree

I use vim at work, but we have an IT guy who installed a bunch of magical plugins for vim on my work laptop so that now when I try to open vim on my home laptop, I am completely lost because I don't ...
0
votes
0answers
16 views

saving/:w a python file in gvim is creating two of the same files with different extensions [duplicate]

When I first :w test.py My file saves on my desktop with a picture of a python script and the file type is shown as Python File. Now when I go to save my file without including the name as in :w a ...
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 ...
6
votes
5answers
3k views

How do I delete the next line in vim?

In emacs, whenever I want to delete a few lines of text, I just use C-k until all the text is gone. However, in vim it seems a bit more complex. I know I can do d$ to delete until the end of the ...
0
votes
1answer
25 views

determine what changed the mapping of system command like dd - vim

This morning something, I suspect a function call, changed the mappings or actions for system commands like dd , e , j etc. dd moved horizontally, 'e' moved down a line and j and k moved horizontally ...
5
votes
2answers
3k views

Can I use the `<cmd>` key in terminal Vim at all?

Following on from my other recent question: How do I map <cmd>-<shift>-f to run Ack plugin in Vim? Is is possible to use the <cmd> key in Vim at all? If Vim doesn't recognise the ...
0
votes
2answers
31 views

Jumping to function in Vim

I have ctags and I would jump to functions by placing my curson to a function and pressing ctrl ]. However, I find this sometimes to be inconvenient. For instance, if my cursor is nowhere near a ...
0
votes
0answers
49 views

gvim (version 7.4.52 and 7.4.622) doesn't refresh properly on Ubuntu (14.04 LTS)

The problem is happening on Ubuntu 14.04 LTS running Unity desktop under vmware on Windows 7 host. My gvim is sometimes not refreshing its display unless I force it to using Ctrl+L. For example, when ...
2
votes
3answers
117 views

Adding parenthesis around highlighted text in Vim

Is there a functionality in Vim that allows parenthesis to be added around the highlighted text? For instance, if I highlight n = getchar() in if (n = getchar() == '\n'), I would want to put ...
1
vote
2answers
2k views

My vim plugins are not loading

I am on a Mac. I want to install vim plugins. The problem like always is that after following exactly the instructions on https://github.com/tpope/vim-pathogen the plugin fugitive will not load. I ...
1
vote
0answers
39 views

VIM paste error: E353 nothing in register “”

I just installed Ubuntu 14.04 and got my vim set up and I have run into a slight caveat and I am not sure why it is happening. When I try to paste something with the middle mouse button, I get: ...
-3
votes
1answer
25 views

Configure command line look in Vim

Is it possible to change the default Vim command line look when you are in some buffer to see some valuable information? How? What Vim help page corresponds to these options?
13
votes
5answers
16k views

How can I recover the original file from a .swp file?

I tried opening the .swp file using vi and cat but it displays junk.
3
votes
1answer
300 views

How to keep in visual mode after identing by shift+> in vim?

Current it quits the visual mode after indenting once,which is very annoying.
0
votes
0answers
16 views

vim gets stuck at top or bottom

When I scroll to the top or bottom of a document using a pressed j and k, vim temporarily gets stuck (around one second) as if it has to finish clearing the keyboard buffer. Can I correct this issue ...
2
votes
4answers
55 views

Vim copy/paste messing up indentaton

Whenever I copy something from another application and then go to paste it into vim, it messes up the indentation. For example, just now I tried to copy the manifest.json file from the hello-world ...
1
vote
1answer
64 views

How to “Edit with Vim” as administrator in Windows?

When you install gvim in Windows, you get a right-click Explorer context menu item: "Edit with Vim". Is there a way of either adding a "Edit with Vim as Administrator", or just changing the existing ...
0
votes
0answers
13 views

Can I get vim to install bundles and close in the background?

I've been playing around with Dockerfiles, and in setting up a development environment, there is one manual step I haven't been able to work around yet. To install the bundles in my vimrc, I have to ...
7
votes
5answers
14k 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 ...
8
votes
1answer
1k views

How to refresh vim layout when split

After setting up some splits/vsplits and resizing gvim or the console running vim, splitter positions are not updated. Is there a way to force updating splitter positions (by retaining them in the ...
0
votes
1answer
18 views

Vim macro: increase last number of a line by 1

I have a csv file whose last column contains either integers, or the character "-". I need a vim macro that does the following: If last element of current row is "-": Turn "-" to "1" Else ...
17
votes
2answers
3k views

How can I paste something at the end of the line in VIM?

How can I paste some text that I yanked at the end of the line? Currently I'm doing it by pressing $p. Is there any way to do this with a single keystroke?