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

4
votes
3answers
729 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
31 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
171 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
61 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
918 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 ...
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 ...
5
votes
1answer
54 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 ...
49
votes
5answers
10k 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
28 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 ...
0
votes
0answers
36 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
147 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
2answers
35 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
34 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 ...
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 ...
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
29 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
40 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
32 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
28 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
24 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
10 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 ...
96
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
29 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
4k 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
57 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
27 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
41 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
11 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
18 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
12k 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
916 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 ...
0
votes
1answer
34 views

Vim python code formatting

I'm using the plugin auto-pairs to help auto close brackets. In vim when defining dicts or lists it'll auto formatting like this | is the cursor position a_dict = { | # the indent is 8 ...
1
vote
0answers
48 views

Quickest way to copy text in a pdf

I'm looking for the most efficient way to copy text from a pdf using only my keyboard. I want to emulate what I do in Vim, which is to place my cursor at the point where I would like to begin my ...
1
vote
0answers
115 views

Vim Plugins within Git Bash for Windows

In an effort to improve the terminal usability in Windows I have setup ConEmu to use Git Bash for Windows as the default terminal. I use Vim Plug to manage my Vim Plugins, and have already set up the ...
0
votes
3answers
58 views

How can I remove the dependency of having a `vimfiles` folder in windows?

On linux I can put my colors/syntax/bundle folder right into .vim which doesnt seem to work on windows, it forces me to put them into a subdirectory called vimfiles. Ill try to visualize what I want ...
0
votes
0answers
58 views

change the font style only for attributes in MacVim

I have the font called Operator Mono Light and I am using it in Macvim. My question is in Vim, can I get the font changed to the italic version of Operator Mono ONLY for attributes like in this ...
7
votes
3answers
2k views

Is there a way to start vim in read only mode

I use /bin/view as it is a safe way to view text files and not have accidental changes persist once I am finished. /bin/view seams to be lack features that normal vim has. Is there a way to start vim ...
1
vote
2answers
706 views

Vim: How to create autocomplete/chooser from entries in buffer?

Found out today that if you press Ctrl-Opt-Cmd-V in Textmate, it produces a cute little "chooser" dialogue in-place that allows you to page through your recent clipboard entries. It looks very similar ...
0
votes
3answers
572 views

CTRL+] in Vim on Macbook

I have an annoying issue with the Ctrl+] key combination in Vim on my Macbook. I have a Scandinavian keyboard, so I do not have a ] key. Normally I make a ] character by Alt+9. This is an issue when ...
7
votes
1answer
4k views

How to open a new file in gvim? E303: Unable to open swap file

I use gvim on Windows. How can I open a new file? I have tried with :e ~\mypath\myfile.txt but I get this error message: E303: Unable to open swap file for "C:\Users\Jonas\mypath\myfile.txt", ...
0
votes
0answers
116 views

YouCompleteMe Error: Tern server is not running(crashed)

I updated YCM few days ago then I found js completion is missing. I've recompiled it by ./install.py --tern-completer, and YcmDebugInfo command shows Tern server is not running(crashed). This is ...
0
votes
0answers
46 views

vim comment issue with GNU screen and solarized

I just installed solarized. I am using the Xresources and vim color file. All works fine when not inside GNU screen. When running vim from inside GNU screen, the comments look different - they are not ...