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
1answer
30 views

Vim delete motions include under the cursor

If you delete backwards in vim, it doesn't delete the character under the cursor. What do you need to do to have it delete, say, back to the last space?
0
votes
1answer
82 views

Line length highlighting works correctly in console Vim, not GUI

This question is related to this one. Damian Conway provided a nice snippet for marking excessive line length in his recent OSCON 2013 talk about Vim. highlight ColorColumn ctermbg=magenta call ...
1
vote
1answer
37 views

Make (g)vim buffer a remote file

I regularly work remotely on a linux machine using vim. Sadly the connection to the remote host is not very good, giving me a very tough time. Is there a way to make my locally running vim or gvim ...
2
votes
1answer
52 views

vim: insert enough spaces to align text to column number

COMP_ID=` echo $SRC | sed -e 's/.*COMP_ID=//' -e 's/:.*$//'` SRC_TYP=` echo $SRC | sed -e 's/.*SRC_TYP=//' -e 's/:.*$//'` DOC_TYP=` echo $SRC | sed -e 's/.*DOC_TYP=//' -e ...
-1
votes
1answer
47 views

Vim output of external command [closed]

Can anyone explain the various ways of doing external command like :! :%! and how to put them at the end of a file? I understand that :X puts them after line X, but :G does not appear to put them at ...
3
votes
2answers
43 views

In vim, how can I remap <tab> without also remapping <Ctrl+i>?

I like to use tab to jump between split windows, so I have map <tab> <C-W><C-W> in my .vimrc. Yet I noticed that this makes it so that Ctrl+I doesn't behave as Ctrl+I anymore, but as ...
0
votes
1answer
33 views

Do sed-like delete commands in vim

I'm comfortable doing search/replace in vim, but how do I delete all lines in a file (or between certain lines) if they match a condition? Currently I shell out and run a sed command, for example: ...
5
votes
2answers
310 views

How to a open a file in vim using pipe

I get to use the locate command extremely often. So if I run the following command. locate updatedb | head -1 Then it gives me the O/p /usr/updatedb.conf I wonder if there is any such command ...
3
votes
1answer
52 views

Mapping s-tab in vim

I'm trying to set up some basic configuration for vim to make it more useful for myself. One of the things I'm trying to do is map shift+tab to a literal tab character, since my vim configuration sets ...
-1
votes
2answers
58 views

add line number after matched pattern in vim

I have raw sequences and I have to convert it to fasta format. so reads are like this: CTACGGTGTGCTCTTCCGATCTGACTATG AGTTGGTGTGCTCTCCCGATCTCGCTCCCTC GTGAGGTGTGCTCTTCCGATCTCCGGCAGTGTGCT and i want ...
0
votes
0answers
40 views

Seamless vim and tmux panes between ssh client and host

This article describes assigning the same key binding to transitions between and within vim and tmux panes, allowing "seamless" transitions. ...
3
votes
2answers
75 views

How to go to the n'th character, not byte, of a file?

In vim one can get to the 5th byte of the file with the following command: :goto 5 However, in a UTF-8 text this could be the 5th, 4th, or even 2nd character in the file. How to go to the 5th ...
2
votes
2answers
56 views

How do I create CTRL key bindings in vim when using tmux?

I use Vim inside tmux, and have recently added the following to my .vimrc file: " easy navigation nnoremap <C-Left> :tabprevious nnoremap <C-Right> :tabnext But this seems to have no ...
0
votes
1answer
22 views

Mapping key to make new vertical window in Vim

This is really odd. Here's the key mapping from my .vimrc: noremap <C-n> :vert new<CR> The expected behaviour when I press CTRL-n is that it opens a vertical window but it somehow opens ...
0
votes
4answers
112 views

Can I rename files in a directory with Vim?

If I open a directory in vim using vim . I will get a file-browser-type interface of the current directory. From there I am expected to browse to a file, and then start editing it. I want to use ...
0
votes
1answer
45 views

Hide non printable characters in vim

Vim shows non-printable characters prefixed with a ^ (for instance ^@ for a NUL byte). I have a column based file containing both printable and non-printable characters which is difficult to read, ...
-1
votes
1answer
30 views

VIM: scroll on mouse move

I have a trackball, which I don't use much when in vim. I would really like to be able to use it to scroll up and down. Is there a way to set mouse move up/down to scroll up/down?
1
vote
2answers
26 views

Why are my Erlang indent settings different on MacVim vs. gVim?

I'm using the same .vimrc and .vim folder on my Mac (MacVim) and on my Linux box (gVim). As far as I can tell, this means that my vim configuration should be more-or-less identical on both. However, ...
0
votes
3answers
44 views

Vim Colorscheme

What do I change in vimrc to make the while and if/else/elseif in this screenshot a different color? EDIT----------------------- This is a custom colorscheme and I am wondering what I change in ...
1
vote
1answer
57 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
38 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
67 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
42 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
62 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
23 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
77 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
38 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
56 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
40 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
84 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
53 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
26 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
38 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
52 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
59 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
66 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
82 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
42 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
46 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
276 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
30 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
40 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
52 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
48 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
33 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
38 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
20 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
57 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
49 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
67 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 ...