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

Keystroke to clear the current line at the prompt

How can the current line be cleared? I'm using bash. I don't like ctrl+c because it leaves crap printed on the screen. If the cursor is at the end of the line I can use ctrl+u and it does ...
1
vote
1answer
41 views

How to remap backspace when using ibus and vim?

First I do :inoremap <BS> x and then enter insert mode. Then switch to Hangul input in ibus. Now I try to type 마 and it shows up as ㅁx마 I guess that makes sense, right? ibus must have ...
1
vote
1answer
85 views

Better mouse-click behavior with gVim's virtual edit

I like using Vim's virtualedit=all feature, but I also like being able to click after the end of a line and have the cursor go directly to the end of the line (instead of going to the exact position I ...
0
votes
1answer
64 views

Can grep in vim be made to be conditionally case sensitive?

When I do a in-document search with / or ? it only performs a case sensitive search when a capital letter appears in the search pattern because of the combination of the ignorecase and smartcase ...
1
vote
1answer
91 views

Vim: How to delete a vim buffer when you quit a file in vim

I open 15 files in vim. vim -p *.php I close one file without saving :q Then after closing some I get this E173: 15 more files to edit. It seems quitting a file does not remove it from a ...
0
votes
1answer
33 views

How to remove sign column after doing :grep in vim

I'm not sure exactly what is adding the '>>' to the sign column, but it appears to be there for anything from the quickfix window. Is there a way to clear the whole column without doing a funky :grep ...
0
votes
2answers
91 views

What's Sublime Text 2's equiverlant to vim's Ctrl-P?

Sublime Text is great but Ctrl-P (and Ctrl-N) in vim (inserting a word with same starting characters in insert mode) is such an essential feature that I just cannot live without it. Is this ...
1
vote
1answer
73 views

windows env variables not resolving

I have the following env variables: VIM_HOME: %ProgramFiles(x86)%\Vim\vim74 CMD: %USERPROFILE%\cmd PATH: ...%CMD%;%VIM_HOME%;... C:\Users\me\cmd\vim.bat @echo off start vim.exe %* Prompt: > ...
1
vote
1answer
33 views

In gvim on windows C-] does not work (but C left mouse works)

For some reason the follow tag (ctrl+]) in gvim on windows does not work for me, I know that the tags file is loaded since the ctrl+left mouse button works as intended. There is nothing on the help ...
2
votes
1answer
131 views

Editing a .jar with `vim`

On an Amazon Linux instance I'm trying to edit a jar file remotely through putty. vim provides a convenient navigator, which displays a prompt with a list of the contained files in the jar: > vim ...
0
votes
0answers
32 views

Why is Vim suspended when I copy to system clipboard if my shell is interactive?

I've just added set shellcmdflag+=i to my .vimrc. This causes it to load my .zshrc when I shell out, which makes zsh alises available (see man zsh). That's all very nice. However, now when I copy to ...
1
vote
1answer
204 views

Customize vim cursor style under Mac OS X Terminal

I want to customize the vim cursor to be a blinking rectangle block. I tried this and this and many other similar stuffs after some searches, but none of them works as expected. Currently my cursor ...
0
votes
2answers
129 views

vim - Autosave file to disk, efficiently

I keep a log file, and want it to be written to disk without having to manually save it after every edit. I've used the :au! CursorHoldI,CursorHold <buffer> silent! :update command that I found ...
0
votes
1answer
73 views

Linux changing vimrc theme color with alias

I recently started running Ubuntu 12.04 on an Oracle VM VirtualBox 4.3.6 and I'm really liking it. I managed to install the Solarized theme and I used sigurdga's gnome-terminal-colors-solarized to ...
2
votes
2answers
89 views

How can I pop-up a cheat sheet in GVIM on command?

I know there are lots of cheat sheets for VIM out there, but I hate having to print out so many cheat sheets. Is there a way I can pop-up a cheat sheet with a shortcut? I am using GVIM on Windows, ...
1
vote
0answers
102 views

AWS EC2: Compile vim with clipboard support

I'm using a free EC2 instance using Amazon Linux AMI 2013.09.2. I want to install the latest version of vim and include clipboard support. I've seen a few guides, but none seem to be too current. ...
1
vote
2answers
48 views

How to vimgrep swap files in a directory

I accidentally closed a terminal window which had some vim tabs were open. Now how can I find these swap files using vimgrep or terminal grep?
2
votes
3answers
79 views

SELECT LINE mode in vim

While editing in vim, I was trying to get the line count in a selection (gC-g with the lines selected) I missed the first g by mistake(so in visual line mode press C-g), and vim went from -- VISUAL ...
0
votes
1answer
30 views

How to move to a tab to edit in Vim

I have 10 tabs are open in my Vim. I know how to go to next tab by gt and previous tab by hitting gT. But I'd like to know how to go to tab 4, 5 or 7 from tab 10?
0
votes
2answers
142 views

Re-compile VIM with options

I have VIM installed but I need to compile it with specific options: In addition to the most commonly used features, the plugin requires: +python or +python3, +clientserver and +conceal. ...
1
vote
1answer
53 views

Best way to work on a small portion of a big file with vim

I spend my days working on 3k to 10k line files, and most of the time, I only work on 200 lines. I usually set a mark at the beginning and the end of the region I am working on, but this has ...
0
votes
1answer
34 views

Using vim for creating fixed width text?

I've got text in the form xxxx yyyyy xx yyyy xxxxxxxx yyyyy x y I'd like the second set in each line to begin at the same point ie xxxx yyyyy xx yyyy xxxxxxxx yyyyy x y I ...
1
vote
1answer
35 views

Yanking multiple inner words in vim

The inner and outer word text objects in vim behave differently when combined with a count. Given the text (cursor is within the word first) first second third fourth both y2iw will put the first ...
0
votes
2answers
26 views

:!ls in vim closes the current file rather than open a window at the bottom

When I use :!ls in Vim command line, it supposed to open a window at the bottom with Press ENTER or type command to continue. But my vim closes the current file. How can I fix it?
1
vote
1answer
215 views

Mouse scrolling in vim through tmux, how to configure?

I'm using a combination of PuTTY, tmux and vim. If I just open an SSH connection with PuTTY and then open vim, mouse scrolling works as expected. But if I open tmux and then open vim inside tmux the ...
0
votes
3answers
68 views

Moving to the beginning of line within Vim insert mode

While typing I realize that I need to move to the beginning of the line. Usually I use <Esc> and I. But I am wondering if there is another way to move to the beginning of the line in the insert ...
1
vote
4answers
43 views

Open multiple additional tabs at once within Vi

I often switch back and forth between multiple files at once in vi and am always adding more with tabe. Is there a way to add more than one tab at the same time while keeping all my open tabs? I've ...
0
votes
1answer
62 views

linux bash settings for vim

When I close vim in linux shell bash, part of it viewing is still seen, usually root, but in some other users, usually other than root, vim closed means no viewing document is seen. Where/how can I ...
0
votes
2answers
123 views

Remove vertical bar of vim's vsplit, vacating the space instead of hiding it

For the last decade I usually work in a full-screen mode terminal emulator (often xterm), and often with :vsplit in vim. 1280×720 offers 160 columns for typical 16px font (8px wide), just enough for ...
0
votes
3answers
286 views

Delete last word (Ctrl-W): Make bash shell behave like vim command line

Among the many useful keyboard shortcuts available in the bash shell, there is Ctrl-W to delete the word to the left of the cursor. Let's suppose my command line looks like the following: cp ...
1
vote
1answer
128 views

gvim latex interface not appearing after latex-suite installation

I have been installing gvim with the latex-suite plugin on a laptop running an Ubuntu 13.10 OS. The installation of gvim worked, but I'm not sure if the latex-suite installation did too. According to ...
0
votes
1answer
78 views

Is it safe to map a key to a custom escape sequence in iTerm?

There are some keys I use in MacVim that terminal Vim doesn't recognize. For example, Ctrl-Enter, Shift-Enter, Ctrl-Space, Shift-Space, Ctrl-Backspace. I'm using iTerm2, which lets you map keyboard ...
0
votes
1answer
162 views

How to find special characters in Linux Vim

I want to find special characters in a text file. It is known that the UTF-8 encoded file contains Chinese characters , "-", "^A"(control-A, which is one of special characters), numbers, ...
1
vote
1answer
26 views

R and gR difference in Vim

When I use R and gR in vim where there are tabs, I don't notice the difference. According to Practical Vim, Virtual Replace mode is triggered with gR and treats the tab character as though it ...
1
vote
1answer
46 views

Searching all versions of a file in the undo tree in VIM

Is there an easier way to find a particular change in Vim's undo tree than just looking at random old versions of the file one at a time (either using vanilla VIM commands, Gundo, or another plugin)? ...
2
votes
1answer
252 views

bash vi mode: What does # -*- mode: ruby -*- # vi: set ft=ruby : mean?

I'm looking through some random code, and at the top of it, it says this: # -*- mode: ruby -*- # vi: set ft=ruby : What does this mean? I know it's a simple question, but I couldn't find it out ...
2
votes
1answer
48 views

Map vim commands to compile-time features

Vim has the notion of features, i.e. subsets of functionalities that may or may not be supported in an actual installation, based on compile-time flags. Presence of a feature can be checked with the ...
3
votes
1answer
349 views

vim inside tmux: throws “E388” with <C-Left> in insert mode [duplicate]

I've read that in insert mode in vim, one can use <C-Left> and <C-Right> to move by words. This works for me, but only as far as I don't run vim inside tmux terminal splitter. When inside ...
1
vote
1answer
53 views

Vim: What is the difference between these two methods of setting a variable?

In my .vimrc, I have the following variable defined: let $VIMFILES = "~/.vim" Further in my .vimrc, I attempt to set the backupdir option like so: set backupdir=$VIMFILES/backup " `set backupdir?` ...
2
votes
3answers
57 views

Linux - Open nth File LIsted

I'm Ubuntu, I do ls and get a list of files. How would I open the nth file in the list in VIM in reference to its position from the ls command, and not its name? I want to do this cause a directory ...
2
votes
1answer
56 views

One file, syntax highlight for multiple filetypes

When taking notes during lectures, I find myself frequently wanting to highlight a segment of a file, say a 5-line code snippet with syntax for it's respective language, while leaving the syntax ...
6
votes
4answers
511 views

No syntax hightlight on .md files?

Vim properly highlights .markdown files, but it seems unfamiliar with .md filetypes. A comment on at the question http://stackoverflow.com/questions/10964681 seems to imply that .md is the wrong file ...
0
votes
1answer
62 views

Downloading correct vim packages

I need help reconfiguring my vim!! In the process of working with it, I decided to download the .vim files and reinstall. After reinstalling I have had some major problems with my vimruntime. My vim ...
0
votes
2answers
57 views

Replace whole line in vim

So I have the following text snippet in my file. I am using vim to edit it. Internal Problem Description ---------------------------- !!! Please enter the internal description of the problem. So to ...
0
votes
2answers
44 views

How to copy html content with original formatting to vim editor

Trying to copy/paste html from this source - second live demo example. When I copy the code, output is wrong formatted and it looks like the following in vim editor: What is the best way to copy ...
2
votes
3answers
94 views

Vim: Do you really use the registers? [closed]

To me, the cognitive process of having to explicitly store and retrieve values from the named registers in Vim still feels like a burden after 3 years and a couple of Vim books. I know it has ...
0
votes
0answers
323 views

Compiling Vim 7.4 with GUI support on Fedora 20

I've installed the following dependencies before trying to compile Vim 7.4 from source on Fedora 20 (Default Gnome). I've removed the vim-enhanced package via yum before proceeding: yum install ...
0
votes
1answer
61 views

VIM - How to change color of if, else, endif, for and endfor statements

I just Django html so I have the normal html tags as well as the if, else, endif, for and endfor statements. I use a customized version of the colorscheme called slate. There is a line in the ...
0
votes
1answer
17 views

VIM - in colorscheme file, how to have different colours depending on what the syntax is?

I use VIM and I want I use my own customized slate colorscheme (slate-mine.vim). In slate-mine.vim, is there a way for me to do something like if syntax == django html then apply the following ...
1
vote
1answer
111 views

VIM - how to open .html files with django html syntax rather than just html syntax?

I use Django a lot and I just want to open all .html files with the htmldjango syntax rather than html syntax. Is there a way for me to tell vim to open all html files with a htmldjango syntax? ...