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

27
votes
9answers
23k views

How to remove this symbol “^@” with vim?

I have some files that are corrupted with this symbol: ^@ It's not part of the string; it's not searchable. How do I substitute this symbol with nothing, or how do I delete this symbol? Here ...
2
votes
2answers
682 views

Is it possible to launch MacVim NOT in full screen mode?

Whenever I Launch MacVim it takes up the whole screen. I don't want this. Is there any way to prevent it from happening? I run OS X 10.8.
1
vote
1answer
23 views

256color terminal flickering in Konsole

I'm trying to setup 256 color mode at work for my Vim setup and it just refuses to work correctly. I'm using Konsole as my terminal emulator and my shell type is tcsh. I found a perl script named ...
33
votes
3answers
10k views

Reload .vimrc in Vim without restart

It bothers me when I wrote something into .vimrc and I have to close it first and open to get my changes be applied. Is there a way of reload .vimrc in Vim without closing it? E.g. I've added set nu ...
2
votes
2answers
2k views

How do I compile gVim.exe as a 64 bit executable? (Windows 8)

Very straight-forward question. I have downloaded mingw32 and the Vim source code and I have edited Make_mind.mak to use the correct Python version and location. I'm located in the src directory and I ...
0
votes
2answers
77 views

How to disable Pentadactyl per site?

Is there a more definitive way to disable Pentadactyl on a url basis that is not -- PASS THROUGH -- ? When I try to use codepen.io I cannot edit any text fields, with or without pass-through enabled. ...
1
vote
0answers
9 views

Vim / NeoVim: Map <CR> to <Esc> and <S-CR> to <CR>

I'd like to use enter to escape insert mode, and use Shift+Enter to insert a new line instead. The problem is my terminal emulator (Konsole running under Lubuntu) doesn't capture Shift+Enter (nor ...
3
votes
6answers
5k views

Messed up keys in vim when running inside tmux

I have been playing with tmux and I'm loving it. However, there's an annoying issue when running vim inside it. Somehow the arrow keys get remapped, but only on certain times, like when firing up ...
2
votes
2answers
454 views

How to make vim sessions use relative paths?

I'm using such sessionopts: set ssop=blank,buffers,sesdir,folds,localoptions,tabpages,winpos,winsize The "sesdir" as opposed to "curdir" should store all the paths relative to the directory in ...
11
votes
4answers
1k views

vim : toggle number with relativenumber

with setl nu! I can toggle number (on/off), similar with relativenumber setl rnu! how I can toggle {off,number,relativenumber} ?
0
votes
1answer
25 views

c vim garbles 1st character of file when using via mobaxterm

this thing drives me crazy, and I am unable to find a solution... I am logging in to a FreeBSD machine via ssh using MobaXterm. Every time I open a text file with vim, it replaces the first character ...
0
votes
3answers
2k views

TMUX key bindings

I have a problem with TMUX key bindings. When I'm working on a terminal pane, if I press ctrl+pgup, it should scroll the screen one page up, as a normal terminal, but it doesn't. Also, while using ...
0
votes
2answers
27 views

Vim: map shift-K to open help on current word in a new tab

In conjunction with http://stackoverflow.com/questions/3131393/remapping-help-in-vim-to-open-in-a-new-tab , I'm looking to also make the shift-K shortcut that opens help in a new tab. I first tried ...
16
votes
3answers
11k views

Vim: can I disable continuation of comments to the next line?

In Vim, if I'm typing a comment in a code file, and I hit enter, it automatically makes the newline a comment, too. For instance, in a Ruby file: # I manually typed the pound at the start of this ...
1
vote
4answers
905 views

Don't let vim scroll below bottom line

How can I disable that vim lets me scroll past the end of a file?
0
votes
0answers
18 views

Highlight if-else-endif structures in Vim

Is there a way to highlight if-else-endif structures in Vim on demand based on their 'level' in the overall program hierarchy? I.e. I want something like if <<< highlight in red foo else ...
1
vote
1answer
14 views

Vim: Columising a long line of arrays

In writing tests I often want to compare a generated value to something I've previously generated, but dumping the output from my console into vim leads to a very long ugly line. Is there any way to ...
32
votes
3answers
7k views

How do I change until the next underscore in VIm?

If I have this text in vim, and my cursor is at the first character: www.foo.com I know that I can do: cw to change up to the first period, because a word (lowercase w) ends at any punctuation OR ...
0
votes
1answer
18 views

How to combine -p and -o options on VIM

I know how to use both the options: vim -p bit.c bit.h byte.c byte.h --> it opens these files in 4 different tabs. vim -O bit.c bit.h byte.c byte.h --> it opens these files splitting the window in ...
0
votes
1answer
17 views

How do I make vim use the syntax highlighting of another file location?

I don't ever use sudo vim /path/to/some.file; I always use sudoedit. However, this means that vim doesn't see the correct path. As an example, when I open /etc/http/conf/httpd.conf, sudoedit makes a ...
1
vote
2answers
3k views

My vim plugins are not loading

I am on a Mac. I want to install vim plugins. The problem like always is that after following exactly the instructions on https://github.com/tpope/vim-pathogen the plugin fugitive will not load. I ...
5
votes
3answers
5k 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 ...
0
votes
1answer
28 views

Vim solarized looks wrong

I have downloaded and set up vim solarized. But I get a weird output: The background of some keywords are slightly darker than the rest, and surprisingly everything else is in bold. How to fix ...
37
votes
4answers
7k 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 ...
0
votes
1answer
36 views

Is there a way to concurrently edit the same file in two different terminals with vim?

vim has a really cool feature that allows you to concurrently edit the same file in a single vim session. I use the i3 window manager. I like it because it allows me to tile my windows, tab them, ...
1
vote
1answer
13 views

Vim opens symlink even when given target path directly

If I open a file through a symlink first, then :bd that one and later try to open the actual target of the symlink directly, Vim instead opens the symlink. How do I change this behaviour? The ...
5
votes
3answers
6k views

gVim utf-8 in windows

When I open gVim it's localized to Sweidish, which is fine. But warning/error messages that has Swedish characters in them don't display correctly. When trying to delete a buffer with unsaved changes ...
9
votes
2answers
598 views

Write vim file as super-user?

This is a usability problem that happens often to me: I open a read-only system file with vim, even editing it, because I'm not attentive enough, or because the vim on the system is badly configured. ...
7
votes
3answers
932 views

Vim - delay when exiting visual mode

If I press ESC to exit Visual Mode after I select some text, there's a noticeable delay before the text gets unselected and I'm returned to Normal Mode (even if I only select 1-2 characters). Can this ...
0
votes
0answers
28 views

Does VIMProbable have register support?

VIMProbable is a browser that works using vi keys. Does it have support for storing text in registers?
79
votes
14answers
11k views

Why arrow keys are not recommended in Vim

"Never use arrow keys in Vim!" I heard this from a random speaker, but didn't have the chance to ask him why. Also, if you don't use the arrow keys, how can you move the cursor in the Insert ...
1
vote
1answer
95 views

Vim Color Scheme Overwritten by a Plugin

I’m trying to set up some prettier highlighting for Vdebug. I had a look at the source, and it says I need to target a DbgBreakptLine (I don’t know what they are called, but it’s the thing you put ...
32
votes
4answers
17k views

How to setup a line length marker in vim/gvim?

Some GUI text editors have a vertical line which serves as line length marker (it helps keeping lines shorter than 80 chars in source code files). Is is possible to have something similar in ...
0
votes
1answer
357 views

VIM: Yank multiple non-continous chunks of text into a registers

I have some lines of text that follow a pattern and some that don't. I'd like to copy the lines that follow this pattern and then copy/yank them into a register so that I can paste them as is ...
4
votes
2answers
2k views

Is it possible to install vim for a user?

I have a SSH Login to a dev computer (used for hosting PHP and Python files). It has vim installed, but a stripped down version of it - it has syntax and whole lot of other stuff disabled . So, my ...
10
votes
2answers
655 views

How to read Vim keystroke syntax?

I'm trying to learn Vim and I'm seeing a lot of documentation use syntax like <C-v>. Is there a general guide on how to read this correctly? I've attached an example SO post below that uses ...
2
votes
2answers
55 views

Do Vim Controls Outside Vim Exist?

I've been using Vim, in addition to the add-on called Vimium for Chrome on Linux Mint. I find it very enjoyable and productive to scroll pages with hjkl and search with /. Unfortunately, this ...
7
votes
4answers
2k views

How can I test for plugins and only include them if they exist in .vimrc?

In my .vimrc I am trying to use ftplugin and obviously use some commands relating to that under the assumption that it was loaded successfully. However, I have now encountered a few old machines that ...
0
votes
0answers
31 views

Creating an alias for in fish shell: The file 'vim' is not executable by this user

I'm trying to create an alias for vim to execute vimx. After creating a new terminal when I try to auto complete vi, I get the following error: fish: The file 'vim' is not executable by this user ...
2
votes
1answer
31 views

How come terminal vim take so long to open HTML files?

I've been using terminal vim with custom plugin for a long-time. I never can wrap my head around this, I've been searching the web for a few days but had no luck. I do a lot of web development, I use ...
0
votes
0answers
12 views

Cross-platform .vimrc/_vimrc [duplicate]

I use vim on windows (GVim portable off a USB stick) and Linux (standard command-line vim) and would like to synchronise my settings (_vimrc or .vimrc respectively). As far as I can see (I haven't ...
2
votes
3answers
1k views

Ctrl+W s not splitting windows in Vim

I am trying to use Ctrl+w s to split a window in Vim. However it is not working in my case. I opened a file using vim filename. Then I pressed Ctrl+w s. But as soon as I press just Ctrl+w it clears ...
8
votes
5answers
10k views

Solarized colors in vim don't seem to be working for me

I am running vim, and trying to get the vim solarized colors to work in terminal. I have this in my vimrc file: set syntax on set t_Co=256 " let g:solarized_termcolors=16 set background=light ...
0
votes
1answer
15 views

Pathogen not loading all bundles in Windows

I'm trying to load two VIM plugins on Windows 7 x64 using Pathogen. The plugins are NERDTree and vim-ipython NERDtree loads but IPython doesn't and I'm not entirely sure why. Any tips would help. See ...
6
votes
3answers
505 views

Generating help files for vim

Currently I write my documentation directly as vim help files. Sometimes I need to generate other formats (e.g. PDF). My work flow is to copy the content of the help files and transform them into ...
2
votes
1answer
5k views

How do I set up neocomplcache?

I just started using vim and saw a cool plugin: neocomplcache. My problem is that I can't get it to work properly. After installing, I took the example config from the help files of neocomplcache and ...
0
votes
1answer
38 views

I'd like to use vim on my work laptop, but my company does not allow us to install software. What are my options?

As the title says, I want to use vim but I'm not allowed to download or install software from the Internet. I'm on Windows 7, and have access to the following pre-installed software: Chrome 37 ...
0
votes
0answers
7 views

How to use Unite.vim history yank

According to the Unite.vim doc, I added the followings to my .vimrc. let g:unite_source_history_yank_enable = 1 nnoremap <leader>y :<C-u>Unite history/yank<CR> But I am not suer ...
1
vote
1answer
16 views

How to install missing bundles in vim for a .vimrc

I have download a .vimrc from web (here). It has Bundles in some of the lines for which I get Not an editor command : Bundle *****. How can I install those missing bundles in the easiest way. I am ...
16
votes
8answers
25k 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 ...