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
2answers
67 views

Vim; Shortcut to add comment at beginning of line

When I code, I tend to execute the following manually a lot after having selected multiple lines of code. :'<,'>s/^/#/ I want to add this to my .vimrc but I am having troubles making it work. ...
2
votes
0answers
114 views

VIM: Characters not displayed correctly in GVIM 7.4 on Ubuntu 14.04 LTS

Using GVIM 7.4.52 on Ubuntu 14.04 LTS in a Virtualbox VM. Sometimes the characters are not displayed correctly as can be seen in the following image This totally renders GVIM unusable. The problem ...
2
votes
1answer
64 views

How to insert special characters with zsh line editor?

In vim we can type Ctrl+v then Number in insert mode to insert special characters. This is mostly used to insert control characters. But any characters can be inserted if we know the ASCII number. ...
1
vote
1answer
29 views

Does auto complete work in command line mode(help command) in vim?

Suppose that I am working in a vim buffer and would like to get help on a command that I heard/read about earlier but can't remember now the full name but can only recall the start of the name. Is it ...
0
votes
1answer
96 views

Using vim with Putty results in X server error

I used Putty to remote to Linux machine, and when I use vim to open a file it always delays and display message PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection ...
0
votes
1answer
74 views

How can I bind two distinct actions to Ctrl-Shift-Key and Ctrl-Key in vi

I am trying to map two different actions to e.g. CtrlShifta and Ctrla: map <C-S-a> :echo "ctrl-shift-a received"<CR> map <C-a> :echo "ctrl-a received"<CR> But all I ...
0
votes
1answer
40 views

Does resourcing my .vimrc unset the mark created when writing buffer?

The first line returns the cursor to the line i was on, the second sources the resource file. both work on there own but will not work together. The marks set by Return cursor seem to still be set, ...
1
vote
1answer
31 views

Vim Return to last point in file

can anybody provide an explanation as to what this is doing or point me to vimdocs? line("'\"") function! ResCur()$ if line("'\"") <= line("$") normal! g`" return 1 endif$ endfunction ...
0
votes
2answers
60 views

How to make vim to load specific colorscheme automatically?

New to vim here. I'm trying to use vim on OSX 10.10.5. Every time I do vim somefile it opens the file with default colorscheme. My theme file is ~/.vim/colors/customtheme.vim. adding colorscheme ...
1
vote
1answer
71 views

How to get vim syntax highlighting to work?

I cannot get vim syntax highlighting to work on a suse box. I have (only this two lines) in my ~/.vimrc filetype plugin on syntax on If I open a shell script with .sh an do :set filetype? I get ...
2
votes
0answers
37 views

“Atomic” Multiple Substitution in Vim

I know how to do multiple substitutions at once in vim but this only behaves correctly if none of the substitutes match a subsequent item to be replaced. This can be worked around by using temporary ...
0
votes
0answers
63 views

vim - syntastic is highlighting valid syntax

I've just installed syntastic and it's all over the place. Variables are errors, imports are errors, modules don't have dot operator, you name it. What can I do about this ?! (I would've included an ...
0
votes
0answers
26 views

vim C-n Shortcuts with iTerm2 and SSH

I read about similar issues before but I'm not sure it's the same. I use vim on a server through SSH with iTerm2 on my Mac. For some reasons some bindings don't work in vim, e.g. <C-n> or ...
0
votes
1answer
33 views

Vim ~/.vimrc au! FileChangedShell

I put this command in ~/.vimrc. au! FileChangedShell img.dat | r img.dat which also contains set autochdir " pwd is always directory of current buffer I hoped to ensure that, if ...
0
votes
1answer
275 views

How to enable arrow keys on vim used from msysgit bash

I just need a simple solution that will enable the arrow keys in the vim included with Git For Windows. I did found a solution to enable backspace. But no solution for the arrows problem. The arrows ...
1
vote
1answer
236 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 ...
1
vote
0answers
133 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 ...
0
votes
1answer
185 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
1answer
104 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
19 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 ...
0
votes
1answer
116 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 ...
0
votes
2answers
179 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 ...
0
votes
1answer
47 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 ...
1
vote
1answer
38 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 ...
0
votes
2answers
143 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, ...
0
votes
0answers
32 views

Does VIMProbable have register support?

VIMProbable is a browser that works using vi keys. Does it have support for storing text in registers?
10
votes
2answers
678 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 ...
0
votes
0answers
201 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
103 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 ...
0
votes
1answer
21 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 ...
0
votes
1answer
60 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
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
189 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
88 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 ...
2
votes
2answers
74 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 ...
0
votes
0answers
48 views

numlock not behaving as expected with vim

I'm trying to use the numeric keypad with vim and am having difficulty doing so. I hit numlock in the terminal and punch numbers in on it and it works as expected. I then go into vim and punch ...
1
vote
2answers
160 views

vim doesn't reload vimrc with pathogen

Pretty much the title. When I edit my vimrc file and it has the line call pathogen#infect() the changes don't take effect until I restart vim. This holds true even if I don't have the bundle folder ...
0
votes
1answer
506 views

Highlighting the current line in vim via the sign ('gutter') column

When using vim in a terminal, set cursorline results in the current line being underlined. I find this visually clunky and would prefer to only change the background (or foreground) color of the ...
2
votes
3answers
46 views

Command to “go to end of last line that has content, in insert mode”

With plaintext files, when I reopen them in Vim to add content, I want to go to the end of the last line of content and get to insert mode. In ideal circumstances, a simple GA after opening the file ...
0
votes
1answer
316 views

How do I fix vim colors in OS X Yosemite?

I've been trying to fix this for weeks, to no avail, and it's been really frustrating. Here is the issue: Fed up with the wrong colors and general plugin mess, I decided to wipe my .vim and ...
2
votes
1answer
324 views

How to disable the leader key in vim insert mode

I mapped the leader key in vim to <Space> and I set timeoutlen to 250 to have time to use shortcuts with the leader key. But, this is annoying in insert mode, because when I hit space, there is ...
1
vote
1answer
58 views

Add additional paths to VIM on Windows

I want to add additional $paths to vim74 under windows. I use $VIM/vimfiles and $VIM/vimfiles/myfunctions a lot and wanted to add them as paths, i.e. $VIMFILES. I had worked out how to do it in ...
2
votes
1answer
84 views

What does this vim cmd mean? :%y+

I found a command to select all text in Vi/Vim file. :%y+ Could someone explain the line, please?
0
votes
0answers
75 views

setup vim script to execute python file

I searched SO extensively and I can't get to fix this: I'm trying to code a pathogen friendly python plugin in windows. The setup would be: In \vimfiles\bundle\plugin I have a myscript.vim with: ...
0
votes
1answer
65 views

Why does my vim colorscheme stay after I close vim?

I recently used vundle to install the solarized theme for vim on my Arch Linux machine. Whenever I open vim, the theme is applied, but it stays applied to my terminal window after I close it. I can ...
0
votes
0answers
66 views

Vim: change guicursor to empty rectangle shape?

The only cursor shape options I found were ver, hor and block. But what I actually want is this: It appears for a couple of milliseconds when I unfocus gVim and give focus to another window (e.g. ...
0
votes
1answer
93 views

Swap Left Alt and Right Alt on Kinesis Keyboard (or Any Keyboard)

Let me back up my problem a little bit for context. I am trying to use the same modifier-key-plus-letter combination between both vim and tmux so that, if I have a vim pane/whatever on one side and a ...
0
votes
1answer
41 views

Editor with dictionary word completion [closed]

Is there an linux editor which can autocomplete words from a dictionary? I don't ask for autocompletion of already written words in a document (like gedit does). Also I am not looking for (personally ...
1
vote
2answers
251 views

How to autocomplete single-double quotes, parentheses, etc in VIM editor?

I need that everytime a write a single or double quote, parentheses, curly braces, square braces... automatically vim should create the closing one and put the cursor inside in order to continue ...