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

3
votes
2answers
378 views

vim “modeline” equivalent for eclipse?

In our project different developers use different editing tools. Some use vim, some use eclipse. The nature of the project requires some files with DOS line endings, some with Unix line endings. It ...
-1
votes
0answers
14 views

ctrlp does not search any more in wild mode

I updated ctrlp today, and it does not search any more. For example, I have a list like this after I press ctrl+p > a/b/c/d.js > a/b/c/e.js > a/b/c/f.js then i entered af, it gave me ...
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 ...
251
votes
5answers
188k views

How to open files in vertically/horizontal split windows in Vim from the command line

There must be a way, something like this: vim -[option] <file-list> to open files from command prompt and not from within Vim. split windows vertically or/and horizontally in separate tabs
36
votes
10answers
55k 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 ...
6
votes
6answers
11k views

Are there any autocompletion plugins for vim?

Is there an autocompletion plugin for vim? What are my options here? At the moment I'm using AutoComplPop, but it has bad integration with snipMate that I use and dead slow on Ruby files (even < ...
4
votes
3answers
672 views

Autoformat for Perl in Vim

I've got a piece of badly formatted Perl code: if ($a==1){ &err_report("$a"); while($b!=1){ &err_ok(); } } I want to reformat it in Vim. After using the command gg=...
0
votes
1answer
28 views

VIM save-execute-reload file

While I am editing a file I occasionally want to save it, execute a command that may modify the file, then reload it. I.e. First :w, then :!something %, and later :e Can I somehow automate this so I ...
9
votes
2answers
3k views

Can I add a set of words to the Vim autocomplete vocabulary?

In Vim, I'm aware of using CTRL-n and CTRL-p to autocomplete words found in the document. This is great for promoting the use of descriptive method and variable names. I would like to add a set of ...
1
vote
1answer
168 views

vim and macvim are not reading my .vim directory

I have installed vim and macvim using macports, and tried copying over my .vim directory from linux. Neither seems to read anything from that directory: my customizations for folding and indenting ...
15
votes
3answers
6k views

Auto-reloading a file in VIM as soon as it changes on disk

Assuming that a file doesn't have unsaved changes in the VIM buffer, I'd like it to reload automatically if the file changes on disk. The most frequent use case for this is when I update the working ...
0
votes
0answers
33 views

Why does vim-common conflict with vim-minimal on fedora23 and centos?

I generally need both vim-common and vim-minimal to have a usable system. I need vim-minimal because package sudo unconditionally depends on it (and I need sudo). vim-common in turn is a dependency of ...
2
votes
2answers
888 views

Vim: How to install plugin for a particular filetype?

Yesterday I came across jedi-vim plugin which provides auto-completion for python. I installed the plugin using pathogen by placing it in bundle directory and it is working fine. Now, as I have ...
-1
votes
0answers
20 views

Enable 256 colors in VMWare terminal

As part of my work I am creating a lot of virtual machines and often powering them down and starting back up. Since I work in QA, I often need to reset the virtual server to default configurations to ...
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 ...
4
votes
1answer
49 views

Why does sudo depend on vi?

the package sudo-1.8.15-2.fc23.x86_64 in fedora 23 depends on vi, as attested by: $ rpm -qR sudo | grep vi /usr/bin/vi Why? Is it a mistake on the side of the package maintainer? This dependency ...
48
votes
5answers
9k views

How reverse selected lines order in vim?

For example, if I have four lines as follows: the first line the second line the third line the fourth line I want to reverse them to the fourth line the third line the second ...
10
votes
3answers
5k views

vim not loading _vimrc file when launched from git bash

I have downloaded and installed git for windows (msysgit) and frequently used the included git bash. Whenever I run vim from git bash my _vimrc file is not loaded because there is syntax highlighting ...
0
votes
1answer
24 views

vim how to unmap [[

The :map [ shows following n [[ *@m':call search('^\s*fu\%[nction]\>', "bW")<CR> n [c <Plug>GitGutterPrevHunk n [ * :w<CR> :unmap [c ...
2
votes
0answers
29 views

Print (cat) a vim encrypted file

I used -x option in vim to encrypt a file. I read this files much more times than I write to it, so I always use cat and then remember it is encrypted because of what it shows.. So then I have to ...
0
votes
0answers
33 views

Mac command button working in the MacVim GUI but not when I run MacVim in the terminal?

I am running MacVim in my terminal (iTerm2) using alias vim='mvim -v' (mentioned in this thread: http://stackoverflow.com/questions/2056137/how-to-run-mvim-macvim-from-terminal). In my ~/.vimrc file ...
6
votes
2answers
130 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 ...
0
votes
0answers
18 views

VIM syntax highlighting works in MacVim but not vi in terminal?

When I edit a file with mvim (Installed via MacVim) I see syntax highlighting in colour on a large range of files. However, when I edit with the built in vi there is never syntax highlighting. Is ...
0
votes
2answers
34 views

Keybinding to make End go one character past the last character on the line

By default the End key takes me to the last character on the line in Vim. However, I have set virtualedit=onemore in my vimrc, and I actually want End to take me one character past the last character. ...
6
votes
3answers
3k 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 ...
2
votes
1answer
33 views

In vim, is there a way to delete all current line except the given text object?

For example, if I have this line printf("something\n"); // any comment Doing da" gives me : printf(); // any comment But I what I would like : "something\n"
1
vote
0answers
32 views

Vim doesn't respect fileformat setting on windows share [Solved]

I have mounted several SMB shares (folders are located on windows server) on my linux machine gvfs-mount smb://user@domain@fileserver/sharedfolder I can access files and edit them in vim, but vim ...
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> <C-w>...
1
vote
5answers
2k views

How to use a text editor WITHIN the Command Prompt in a Windows OS?

I would like to be able to create and edit the text of a file, all from the command line. No pop-up window (like with notepad), just create the file and start editing. I know this can be done with ...
-1
votes
0answers
54 views

What is the order of the colors in a terminator palette?

The order I enter the colors into the terminator palette effects which element has which color in vim. So how do I know the order in which I have to enter the colors into the terminator palette so I ...
53
votes
2answers
12k 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 ...
0
votes
1answer
23 views

Vim: unexpected behavior of c-n in insert mode

When I press Ctrln in insert mode to insert the next matching word, my cursor jumps to the next blank line instead. This happens only to a .markdown file as far as I can tell. I didn't map c-n to ...
1
vote
1answer
37 views

Delete a buffer and all traces of it in vim

Is there vim command (or plugin) to delete a buffer and all traces of that buffer? Including, for example, .swp files, undo files, backup files, and so on?
0
votes
1answer
22 views

Is it possible to have vim use different colors than the iTerm profile?

My vim currently uses the colors defined by my current iTerm profile. Is it possible to have vim use a separate set of defined colors? This way I could have one look for my terminal and a different ...
0
votes
1answer
26 views

Prevent Vim from selecting less than 2 characters?

I use Vim more and more, and I installed the plugin ideaVim in my IDE from JetBrains (pyCharm, phpStorm). I still use the mouse a lot to navigate and select text, and sometimes when I click in the ...
1
vote
0answers
22 views

Vim got corrupted and print unsual lines, block number, how to fix from printing junk values?

I am getting these lines whenever I am trying to read/write any file or syslog. I am using vim. If I press any keys, it will print these lines, how to get rid-off to these junk lines: "/var/log/...
0
votes
0answers
8 views

neovim not schemecolor on tmux multiplexor

I dont know why I dont have schemecolor when I use tmux on my neovim, here something of data of my console: gnome-terminal tmux 1.9 neovim this look so: I try a lot of this possible solutions but ...
4
votes
5answers
6k views

Compiling vim with xterm_clipboard support

I checked out latest vim7 from cvs repository. cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout vim7 I tried: ./configure --enable-xterm_clipboard but I got - WARNING: ...
7
votes
3answers
1k views

how do I use a variable content as an argument for vim command?

for example suppose I did :let foo=pattern and now I want to perform Ggrep patter but use variable foo instead of the literal patter string. :echo foo outputs pattern, but :Ggrep foo just ...
94
votes
4answers
11k views

How do you reuse a visual mode selection?

Often when editing code, I'll select a block in visual mode and do a search and replace over the block. After I make the changes, however, it leaves visual mode. How do you do a new find and replace ...
3
votes
1answer
26 views

Not able to set up key maps involving <Tab> in Vim in a terminal

I'm a Vim noob who liked the instructions in this wiki to set up key mapping for quickly cycling through several files. The only problem: I can't get it to work! My ~/.vimrc contains these lines (...
8
votes
3answers
3k views

textwidth=0 and wrapwidth=0 in .vimrc.local not being respected

I have the following lines at the bottom of my .vimrc.local: set textwidth=0 set wrapmargin=0 However, whenever I open a new file, both these values are set to their defaults (72 and 2, ...
2
votes
1answer
54 views

Why does `zsh` insert a `~` when I press the delete key?

I have set my zsh to use vim style for editing command lines. However, when I use the Delete key, it inserts a ~ character. Have I misconfigured my zsh? How do I turn this off? Do I need to go ...
1
vote
0answers
24 views

How to undo specific line in vim?

I have lots of modifications in a file, but I want to undo specific line to initial state which keep other lines at current state. Is there a way to do it in vim?
1
vote
1answer
34 views

vim seems not loading .vimrc on OSX sometimes

In .vimrc there is a line set expandtab, but sometimes this doesn't work. The problem is When I press tab key a new tab is inserted and it is not expanded to space. I can see the 'tab' is there with ...
0
votes
0answers
10 views

Is it possible to prioritize file order in vim's CtrlP?

I have a django project "myproject", and when I launch ctrlp to open "myproject/users/models.py", the first suggestion is "test/users/models.py". Is it possible to configure CtrlP so that it would ...
0
votes
0answers
13 views

Vim solarized seems to mixup color

My vim: This is how my looks, look at the change in color from line 38 onwards. Any solution for this?
0
votes
0answers
15 views

MINGW64 (downloaded from www.git-scm.com) - How can I set it to use my system version of vim, rather than the build in version?

I'm trying to set up vim as a GO IDE. I also use the version of MINGW64 that git ships with as my terminal. Everything works as expected. I can run gvim from the terminal no problem, but when I try ...
7
votes
2answers
11k 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 ...
1
vote
2answers
905 views

How do I run gvim within the same shell window?

I'm running gvim on my mac from /usr/local/bin. If I invoke it from a terminal window it opens it up in a new window. I'd like to get it to just run in the same window I'm already using. How do I ...