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

1
vote
1answer
38 views

Vim command mode percent expansion

My typical day-to-day workflow in Vim involves having two vertical panes; production code on the left, and the tests on the right. I frequently switch languages (and test frameworks), so I like to ...
0
votes
3answers
37 views

set chars to uppercase between parenthesis

let's assume in vim I have following lines: all what (strong) people have to do is pushing (heavy) weights over (and over) again in order to gain muscles and I need to convert words inside ...
0
votes
2answers
46 views

Document map in vim

Before I used Vim I used Notepad++. What I miss in Vim is the Notepad++ document map. (https://www.youtube.com/watch?v=5Y6hE0SdgsQ) Sublime text editor has similar document map. Yes I know you can ...
-1
votes
1answer
41 views

How to automatically determine filetype by first line in file using vim? [closed]

My vim can determine filetype by first line of file (e.g. #!/bin/bash). But check of first line occurs only at the start of vim. How to do runtime checking of this?
-1
votes
1answer
38 views

How to define default path to CtrlP for Vim in windows 7?

This is what i put in _vimrc to make E:\Workspace as project folder after hit Ctrl+Space after activate Ctrlp nnoremap <C-Space> :CtrlP E:\Workspace\<CR> but when I hit Ctrl+Space it ...
0
votes
1answer
17 views

Derive vimfiles directory from runtimepath option

I want to set a $VIMFILES variable in my vimrc file to determine in a non-platform-specific way the file path of my vimfiles directory (a la How do I get Vim home directory?). This should be trivial ...
0
votes
1answer
73 views

Cygwin vim doesn't load files in runtimepath

I created a custom syntax file, and but none of the files in $VIMRUNTIME seem to load. I followed these pieces of the documentation: http://vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype ...
1
vote
2answers
24 views

Vim delete all paragraphs with matching regex

I have a series of paragraphs--a java thread dump--that I would like deleted but ONLY if the paragraphs contain the text /Executor\.getTask/ -- that is, the threads don't have a task. How can I do ...
0
votes
2answers
43 views

Insert numbered text on every even/odd line

In Vim I have the following text: Door Chair Table Uganda And I want to add numbered text on every odd line, which should give this: >item1 Door >item2 Chair >item3 Table >item4 ...
1
vote
1answer
36 views

How to use Massren with Vim?

I want to use massren renamer in vim in order to rename files within the texteditor. First, I used this command within Vim to set Vim as default editor for massren :! ...
0
votes
2answers
57 views

How to make Vim respect proper wrapping when opened from Mutt?

I am using the line below in my .muttrc Editing generally seems to work except that braking at 79 driving me nuts. I cannot get Vim to stop acting that way. I do not want any braking whatsoever but I ...
2
votes
1answer
47 views

Why does Vim still have vi-compatibility mode? [closed]

Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it? As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in ...
1
vote
3answers
22 views

Removing a custom vim configuration

I've added a lot of small mappings to my vimrc that help me work, like noremap H ^ and inoremap jk <esc>. It's diverged enough from vanilla vim that other people at work have trouble coding on ...
1
vote
2answers
29 views

Edit vim syntax highlighting options for a specific file type

When I edit a .markdown file in vim, the highlighting looks like this: I am using a light colour scheme and the builtin vim .markdown settings (no plugins - I found them to be worse). The problem ...
1
vote
3answers
46 views

How do I properly install and organize terminal software on OS X?

I've been learning vim and messing around with installing certain terminal extensions like zsh and tmux. So far I've been installing everything according to their online instructions, and this has ...
1
vote
1answer
49 views

How to avoid `.viminfo` in `$HOME`

In one of my setting files I set viminfo to set viminfo+=n~/.cache/vim/info Now both ~/.viminfo and ~/.cache/vim/info are created. If I deleted ~/.viminfo it gets recreated again. How can I tell ...
0
votes
2answers
54 views

Open multiple vim tabs and windows simultaneously from command line

I've got four files a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files a and b in the first tab and c and d in the second tab. ...
0
votes
1answer
59 views

Adding/displaying special characters in Vim

I currently work on a project where I need to write the Unicode characters ɛ and ħ, which I just added to my keyboard. It works great almost everywhere, even in the command prompt, except for Vim ...
1
vote
1answer
37 views

Vim cursor pauses when typing backslash

I use vim as my primary text editor, and one (seemingly) useless attribute is that when I type the \ character, the cursor doesn't move for a moment or until I type another character. Functionally, ...
3
votes
1answer
43 views

How do you perform a 2d search in vim?

I'm looking for lines in a file that match a 2-dimensional pattern. For instance, given the following input file: aaaba aabaa aaaba aaaaa aaaaa I'd like to use a pattern like ab ba ab to match ...
3
votes
3answers
233 views

Using vim to delete all lines except those that match an arbitrary set of strings

I use vim to remove all lines except those that match a particular string, e.g. :g!/[string that I want to remain in the editor]/d Works great. But what I really want, and haven't found anywhere, ...
1
vote
2answers
29 views

vim toggle based on var previous value

How to switch the value of mouse from empty to a and vice-versa? I'm finding myself switching a lot from those two modes. a is very nice when i'm a long time in the huge source file and have to use ...
1
vote
2answers
34 views

Vim: Open current windows/tabs in GVim instead

Let's say I have been working in a given Vim session for some time, and come to a point where I really would like to have everything I am looking at in GVim instead. The actual use-case is a terminal ...
0
votes
0answers
49 views

“Open with… Vim” does not load _vimrc settings

I use Vim (gVim to be precise) to write and edit files. When executing the editor directly, everything works fine. But if I open a file using the "Open with..." command on Windows, the _vimrc settings ...
2
votes
2answers
43 views

vim move to first non-blank in same column

In vim, how can I move the cursor down (or up) to the first line containing a non-blank character in the same column ? For example, in the following text: item1 item2 item3 item4 item5 ...
0
votes
1answer
27 views

Highlight endif in vim

I'm creating a colorscheme for vim and want to give the ifand endif distinct colors. I followed the tutorial on vimcasts and have the following file "set 256 colors for gnome-terminal if $COLORTERM ...
1
vote
1answer
36 views

Vim character that refuses to paint to Normal color

I have pointed to it in this image. I can't seem to figure out why it's there. Vim 7.4 Running in Tmux, but appears even outside of Tmux
2
votes
1answer
19 views

Showing which register is being used to record

Pressing q[letter] will make Vim start recording keystrokes in the register [letter]. While Vim is recording it will show the recording message. I'd like to see something like recoding in 'e', to help ...
0
votes
1answer
43 views

vim editor full screen in putty

I am using putty to connect to my linux server and if I open any files with vim or vi editor the editor margins are getting limited, whereas the same full screen is coming if I open in XTERM. My ...
0
votes
0answers
39 views

Can’t set color of vim

I've asked same question to stackoverflow but It evaluated offtopic at stackoverflow. http://stackoverflow.com/questions/23667728/cant-set-color-of-vim?noredirect=1#comment36357524_23667728 If it ...
0
votes
1answer
47 views

Windows Vim symlink config file persistent error

I'm trying to configure the native Windows Vim/gVim and the Cygwin Vim/gVim to behave nicely together. To this end, I created symlinks, ~/.vimrc and C:\Users\<myusername>\_vimrc, that both point ...
0
votes
1answer
29 views

how do I grep within vim using some default parameters?

I often run a command such as this from within vim: :grep -r --exclude-dir=./.git --include=\*.cpp --include=\*.hpp . But I would like to not have to write this everytime I want to grep within vim, ...
3
votes
4answers
78 views

How do I sort multiple blocks of text by the first line in each block in Vim?

I have multiple blocks of text, or in other words, multiple functions like this: def ==(other) ... end def to_s(full=false) ... end def to_a ... end def to_hash ... end def inspect ... ...
0
votes
2answers
43 views

Vim: How to append even lines to odd lines

I have the following lines. 1 4 2 10 3 20 4 35 5 56 ... ...(many more lines after this) And I want to change to the following in Vim. 1 4 2 10 3 20 4 35 5 56 ... ... How can I achieve this?
2
votes
0answers
108 views

Using vim / vimperator key bindings in Midori

I have recently been struggling to find a good lightweight browser with Vim keybindings that will run on Debian Linux (wheezy). Dwb crashes all the time, Luakit is very old, Chromium has memory ...
0
votes
1answer
33 views

How to expand lines in Vim Latex

As you can see when I open a LaTeX file in vim, lines are folded up. How can I expand them at once?
-2
votes
1answer
53 views

Vim - Using Functions to Search (.vimrc)

I'm have a timing problem with a function that I use to search in Vim. I need the search to be executed immediately, not after the function ends. I'm using "feedkeys" function (eg. ...
1
vote
0answers
75 views

I can't get XFCE terminal to display VIM's colorschemes

That's what I have in my .bashrc if [ -n "$DISPLAY" -a "$TERM" == "xterm" ]; then export TERM=xterm-256color fi In my .vimrc I have: set t_Co=256 echo $TERM prints xterm-256color tput ...
0
votes
1answer
52 views

Search for non-characters (character replacement indicators)

I have a text file (actually a .csv exported from .xlsx in LibreOffice) with lines that have gibberish when opened in LibreOffice Calc. In VIM they appear as the following: Joe User, joe@user.com, ...
0
votes
1answer
135 views

trouble installing powerline pre-patched fonts on mavericks 10.9.2

I have already installed vim-powerline in vim using vundle, but I am having trouble installing any of the pre-patched powerline fonts in the Lokaltog/powerline-fonts github repo. When I download one ...
0
votes
1answer
30 views

Open multiple files in vim some Read Only and some Read and Write

I know I can open files in Read only mode vim -R file and I can open multiple files with vim file1 file2. Is there a way, when opening multiple files at once, to open selected files as read only while ...
0
votes
1answer
209 views

VIM Colorscheme Gets Correct Only After vimrc Write

I have this weird problem that I've setup my VIM to use solarized colorscheme, but every time I open VIM, it shows wrong colors. In addition, I have a line in my vimrc that tells VIM reload vimrc ...
0
votes
0answers
28 views

Importing pygments' highlighting to vim

Usually, vim does very good job in highlighting, using the packaged syntax files. Unfortunately, it does bad job with MySQL. At first, I looked everywhere for a better MySQL vim syntax file, with no ...
0
votes
1answer
37 views

Why doesn't vim always give me the option to delete a swap file?

If I restart vim after a crash, it'll tell me that a swap file for my file exists, and ask me what to do--open anyway, recover the file, quit, abort, etc. Sometimes it gives me the option to delete ...
2
votes
1answer
60 views

vim: mouse click to resize split but not move cursor

How can I configure vim to use the mouse to resize window splits but not reposition the cursor when I click elsewhere in the buffer ? :set mouse=n enables window split resizing in Normal Mode but ...
0
votes
2answers
57 views

vim remap key mapped by a plugin

In vim, I have a key mapping conflict. The :map command gives me: n <C-N> * :<C-U>YRReplace '1', p<CR> ov <C-N> * :NERDTreeToggle<CR> How can I clear the ...
0
votes
1answer
56 views

Vim syntax highlighting lost on single file

I have a strange thing happening on a single file. When I open the file under it's original name, the highlighting is lost (":syntax on" does nothing). But if I cp that file with another name and open ...
0
votes
1answer
37 views

How to merge specific lines and remove specific newlines from a text that's in the form of a changelog, using vim?

I have a changelog that's like this: version 1.90 (1 newline) Released on 27 April 2014 (2 consequent newlines) Added feature x ---> (first entry for 1.90) (1 newline between ...
0
votes
1answer
99 views

Vim colors do not appear correctly in tmux terminal running within rxvt-unicode terminal

I am using Debian (Jessie). My ~/.vimrc file contains the following statement. colorscheme murphy My ~/.Xresources file contains the following properties. URxvt.background: #000000 ...
1
vote
1answer
51 views

Go to definition in different file in vim

I'm using slimv to create a small common lisp project. I would like a way to jump to the definition of a function I defined in another file. Is there a way to do that?'