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

Going from insert to normal in vim causes this to appear

Whenever I go from insert to normal mode, this shows up at the bottom of my vim screen. What is it and how do I stop it?
1
vote
1answer
34 views

Vim highlighting between editing sessions

Is there a way to disable vim from carrying highlighting between editing sessions? For example, I was looking for the definition of pi (M_PI) in /usr/include/math.h and searched /PI to find ti real ...
1
vote
2answers
89 views

Vim assembly formatting

Vim is not properly indenting assembly code, regardless of if I want it to do it automatically or if I try gg=G it'll just says ## lines indented even though it didn't change anything and all my text ...
0
votes
1answer
172 views

Vim YouCompleteMe

I see that the vim plugin YouCompleteMe is a great autocompletion tool but is there a way to get it to complete not just from a file I am working on but external files as well? Like, if I go to type ...
1
vote
1answer
179 views

`:cw` command in Vim: how to avoid auto jumping to first error?

In Vim, :cw command shows the quickfix window if there are any errors and let the cursor jump to the first recognized error in the quickfix window (not in the buffer where there is an error). Is there ...
0
votes
0answers
72 views

Vim YouCompleteMe plugin usage

I recently installed the YouCompleteMe plugin, which is great...works great, etc. But I do have one question: If I have typing up a source file from start to finish, it includes everything in that ...
1
vote
2answers
52 views

Which default encoding for Vim: utf8 or latin1?

I'm writing text in European languages as French, German, Italian. All characters are compatible with latin1 encoding. Thats why I decided to set the default encoding in vim to latin1. Once in ...
1
vote
1answer
199 views

VIM only storing first 50 lines when yanking between files

When I use Y to yank lines, I can yank any reasonable amount of lines (I've never knowingly hit a limit). However, if I close the file and then try to paste p into another file, only the first 50 ...
0
votes
1answer
36 views

Vim inserting C style comments

:command Linecomment :normal ^i/*<ESC>$a*/<ESC> The above command is one that I came up with in order to comment out an entire line in C, normally for debugging purposes and whatnot. I ...
0
votes
2answers
32 views

Changing vim/terminal open location

Before I dove into learning ruby my .vimrc file had this at the very end cd data It was perfect because the home directory is shared with my mac. I tried changing my home directory in OSX. This was ...
0
votes
3answers
54 views

Vim insert-mode abbreviations with normal mode commands

I am looking to make a vim abbreviation s that if I type "prf" in insert mode it prints printf(""); and immediately throws me back int insert mode but between the two quotes. I can't quite figure out ...
0
votes
1answer
22 views

Disable scrolling when launching an app (Vim) inside Windows console window

In Windows, when I'm using the command prompt and launch Vim, I have a habit of trying to scroll through files using the mouse-wheel (which of course works in gVim but not inside the terminal). Is ...
1
vote
2answers
36 views

Jump in vim on same line

I have log files of format 'date' 'filename' 'something 'return status' Often status goes beyond my screen. While I am reading 'something' I press End to see status and Home to see filename. But ...
0
votes
2answers
70 views

SSH'd (via Cygwin) vim to write to local file

Okay, so I'm trying to solve the problem of getting the contents of a yanked register from a SSH'd session in Vim, to go to the Windows clipboard. Here's the scenario: SSH into development ...
-2
votes
1answer
58 views

In Vim (with YouCompleteMe), can I limit the number of possible completions shown?

I am using YouCompleteMe for identifier completion in Vim. I would like to limit the size of the completion popup so that it is never more than 5 entries. Can this be done?
0
votes
3answers
2k views

How to set colors in OS X (Mavericks) terminal?

I want to set the color's palette of my terminal in order to use properly the Solarized colorscheme for Vim (http://ethanschoonover.com/solarized). I understand that i've to modify my .bash_profile ...
0
votes
1answer
43 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
163 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
61 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
210 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
60 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
58 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
40 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
428 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 ...
4
votes
1answer
66 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
81 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
62 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
83 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
178 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
27 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
279 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
72 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
35 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
37 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
59 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
108 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
41 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
105 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
46 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
105 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
31 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
100 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
50 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
95 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
45 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
160 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
55 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
28 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
59 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
62 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 ...