vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

4
votes
3answers
592 views

Can't open syntax.vim error when using vimrc

When I try to open my .bashrc file. then it shows these lines: Errordetected while processing /etc/vimrc: line 45: E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim Press ENTER or type ...
4
votes
1answer
496 views

How to automatically refresh Vim on buffer/window focus?

I often use Control+L to redraw the screen in Vim. In particular, when I come out of sleep or change monitor configurations I often find that Vim needs to be redrawn. I thought it might be simpler to ...
4
votes
2answers
466 views

Modeless vs modal editors

I just started learning Linux and all my previous experience of programming has been using the Windows platform. I came across Vim editor and read that it is modal editor unlike notepad which is ...
4
votes
1answer
199 views

Switching between split buffers in vim

recently starting trying to use VIM as my full-time text editor since I spent a lot of time SSH'ed anyways. Recently installed NERDTree so I can quickly swap between files in a project. Easy question ...
4
votes
2answers
252 views

echo a customized message with VIM editor

How can I deltect if there is a file modification in VIM upon exiting (:q)? If there is a file modification Vim echos E37: No write since last change (add ! to override) I want to override this ...
4
votes
2answers
541 views

Can I make Tmux tell Vim when its pane loses focus?

I use Vim and Bash side-by-side in Tmux. I have Vim configured to autosave files as I switch between them, but I'd really like it to autosave when I switch to the Bash pane. Is there a way to get ...
4
votes
2answers
2k views

Using vim to view the contents of a directory file

As I understand, in Linux directories are mostly normal files w/ some special handling (e.g. 'rm' a file is ok; 'rm' a dir will complain w/o -r). When I execute the following bash commands: mkdir ...
4
votes
2answers
209 views

Indenting multiple files

I want to indent multiple files which are poorly indented and indent them properly as would vim do when I type gg=G. Is there someway to enter the = command or its alias in the command mode? i.e ...
4
votes
1answer
273 views

Why is Vim eating up Ctrl when used with Ctrl+v and how to fix it?

I'm using Vim /etc/zsh/zshrc to add key bindings for zsh because it doesn't work with inputrc. In my terminal with tmux when I type Ctrl+v then Ctrl+LeftArrow the shell will show ^[OD. However, when ...
4
votes
3answers
178 views

vim - how can i do a 'change word' using the current paste buffer

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar' and I want to replace it with my paste buffer. To replace the text ...
4
votes
1answer
87 views

Customised vimrc for subfolders and projects

I use vim in many different contexts ... actually, probably most people do: There is the editing of configuration files, programming, documenting, email and so forth. I very frequently found myself ...
4
votes
1answer
98 views

Can I access X11's clipboard from tty1-6?

Sometimes, when I'm running on battery and don't need a window manager, I'll log into tty1, fire up fbterm and Vim and work. Later, if I need the window manager, I'll use the log in GUI but switch ...
4
votes
4answers
207 views

Vim: copy, then paste more than once

I use the highlight mode in vim to copy a few characters. I then want to paste more than once. My current technique does not work well. Sample text: Linux Solaris Irix HP-UX Suppose I want to copy ...
4
votes
1answer
2k views

How to set the bash display to not show the vim text after exit?

My question is simple, but I am finding it hard to frame/explain it easily. I log into several Unix boxes with different accounts. I see 2 different things for user1 and user2, while editing text ...
4
votes
3answers
1k views

E763 with vim and spell checker

I want to add germand spell checking to vim. So I set :set spl=de_de spell then there is a dialogue, where I can create a directory called .vim/spell. And then there is another question where I can ...
4
votes
1answer
313 views

Repeat the nth last command in vim

I've noticed vim can be pretty intuitive, but I'm having trouble finding a way to repeat the second-to-last command (or third-to-last, fourth-to-last, etc.). By typing . in normal mode it will repeat ...
4
votes
1answer
158 views

How does this vim command work `:g/#/+1t.`

I was playing vimgolf (very addictive by the way) and I can't understand one of the solutions to this challenge http://vimgolf.com/challenges/4d1a34ccfa85f32065000004 The challenge is to convert this ...
4
votes
1answer
120 views

How to write any Unicode Key without Pre-programmed key for it in kbd?

I am trying to find some Unix tool to input any Unicode key. I am fine with X application or console but I use Vi/m and it may have this property. For example, suppose I want to input key "U+0303" or ...
4
votes
1answer
114 views

creating vim plugins

I would like to attempt my first VIM plugin and wondered where there are some good docs on this? From going threw the plugins I use it seems to me that it is a mix of BASH and some sorts of VIM api is ...
4
votes
2answers
751 views

cursor position after pasting in vi / vim

One thing that has always bothered me in vi / vim: If I "yank" (a.k.a. "copy") some text, then move to another place in the file and do a "paste", my cursor remains at the beginning of the text I ...
4
votes
1answer
268 views

How to add a feature to Vim if it's not compiled with that feature?

I am trying to use clewn (full gdb support in the vim editor), but the vim I have on my box doesn't have the netbeans_intg feature enabled. Is it possible to enable it without recompiling vim? I am ...
4
votes
2answers
45 views

Stop vim from messing up my indentation on comments

For some reason Vim thinks all of my comments should have all indentation removed. If I add # to the beginning of a line, suddenly all leading whitespace is removed. How can I stop this? I have ...
4
votes
1answer
125 views

How can I jump to files from vim opening them in a separate tab?

I have installed tags so I can jump to a function body in another file via CTRL + ] I know that I can do gf to jump to another file. I know that I can do CTRL-w s to split the vim window. What I don't ...
4
votes
1answer
443 views

Match word containing characters beyond a-zA-Z

To match a word one can use \v(\w+) From the vim help :h \w: \w word character: [0-9A-Za-z_] This works exactly as described in the manual. However, I want to match words that contain ...
4
votes
1answer
363 views

Is there a Vim syntax file for ANSI-colored output of CLI apps?

I have quite a lot of Perl scripts which print colored output to the terminal, using Term::ANSIColor. This is the same as when a shell script does e.g. echo -e '\e[1;31mError:\e[0m Your fault.' ...
4
votes
1answer
633 views

How to skip vim message “Press Enter…” after running bash commands

After running bash commands(e.g !mv file1 file2) vim outputs result of that command and prints this message: Press Enter or type command to continue Is there a way to skip this message and return to ...
4
votes
1answer
224 views

Configure vim's :make to switch or open tabs on error

When I run :make from vim and there's an error, it opens that file on the error line number in the current buffer. If possible, I would prefer it switch tabs to the file if it's already open, or make ...
4
votes
2answers
286 views

vim horizontal line count

Using set number you can turn on vertical line count. Is there also a command to turn on horizontal line count? I hate talking my hands away from typing and would like to be able to quickly address ...
4
votes
2answers
941 views

How to install light-weight vim and to be able to efficiently load files into one instance vim?

On my laptop with Ubuntu I'm able to have just one instance of vim, launched with vim --servername VIM After this I'm able to open files from console with vim --remote-silent filename I use ...
4
votes
1answer
142 views

Rewrite a Vim function to a one-line map

This works: nmap <silent> <S-t> :call InventTab()<CR> function InventTab() set expandtab! if &expandtab retab echo 'spaces' else retab! ...
4
votes
2answers
528 views

viewing info documentation with vim

I'm trying to use the ManPageView addon to view info documentation within vim. Although I find ManPageView very useful for, well, viewing manpages, its info-reading functionality doesn't seem to work ...
4
votes
2answers
93 views

Difference in behavior of `<Esc>` and `inoremap jk <Esc>` in vim

I just installed Ubuntu 12.04 on a new computer and apt-get install[ed] vim and I'm having some weird behavior with my aliased Esc - if I'm in INSERT mode and I type the Esc key, I exit INSERT mode ...
4
votes
4answers
377 views

Export terminal display to PDF

I want to include the display of my terminal in a beamer presentation. Simply taking a screenshot, however, produces a fairly low-resolution png that looks poor in the presentation. I would like it ...
4
votes
2answers
90 views

Editing a sequence of fields in vim

I have a file like this: INSERT INTO `example` (`name`, `location`, `height`) VALUES ('A', '', ''), ('B', '', ''), ('C', '', ''); I want to fill in the middle set of quote marks (the ones under ...
4
votes
1answer
122 views

Using Regex in vim movment

Is there any way to use regular expression for movement in vim. For example, I want to move my cursor to the first occurrence of the pattern abc. So can I do something analogous to fa but now a ...
4
votes
1answer
618 views

How can I search for and highlight multiple strings in VIM?

In VIM, how can I search for multiple strings and have a different color highlight for each match?
4
votes
2answers
1k views

Vim NERDTree re-size vsplit

I am using the NERDTree plugin for Vim. When using the s: open vsplit command, is it possible to resize the windows so that the file takes up a larger portion of the screen than the directory tree?
4
votes
2answers
214 views

Vim - buffer names in the cmd line area

When I edit files with vim there is always this in the cmd line area,under the status line,all buffers' names(image : ) Is there any way I can remove it?
4
votes
1answer
90 views

Vim syntax highlight length-delimited fields

I'm trying to write a vim syntax file for SVN dump files. The part I can't figure out is the section like this: Fooprop: Val1 Text-content-length: 20 Barprop: Val2 ...
4
votes
1answer
1k views

How to allow Page Up in GNU Screen?

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows. I use GNU Screen commonly as well. When using Vim inside Screen I am unable to use the ...
4
votes
2answers
1k views

No syntax coloring in vim for me, but ok for my students

My students get syntax coloring in vim, but I don't! Even when I "syntax on" as a command syntax on or put it in my .vimrc and/or .exrc. The terminal is xterm. I am missing something in vim or is ...
4
votes
1answer
151 views

How to preserve special characters highlighting when converting to HTML?

I have an issue with the :TOhtml command. It works great, but it doesn't preserve the list option. If I do: :set list listchars=tab:>-,trail:.,extends:> :TOhtml The special characters ...
4
votes
1answer
779 views

GNU Screen makes Vim ESC key slow

Screen makes my ESC key wait for more commands I beleive, and if it does not get those commands, it sends it to my terminal Session (which I am running VIM in). ESC is used alot in VIM and currently ...
4
votes
1answer
210 views

vim auto complete custom list

I had these two questions about this function " how do I load a file into a list here? " set some variable func! CustomComplete() " and then read the variable here so that b:list = a \n split ...
4
votes
1answer
371 views

How to run gVim in a single instance

I want it in such a way that on double clicking an already opened file, or a new file, gVim uses the same window. From this question asked previously on Stackoverflow I figured out how to do this by ...
4
votes
1answer
208 views

How can I make VIM a full fledged IDE [closed]

How could I make VIM a full fledged IDE by using different supported plugins for YUI, JQuery and git integration etc.
3
votes
6answers
542 views

Add consecutive numbers succintly and elegantly to index lines

I usually do this $ wc questions 33 36 3105 questions $ seq 1 33 > nums $ paste nums questions 1 Content 2 ... . . 33 End Content but I feel there could be faster way to do ...
3
votes
6answers
341 views

How to comment multiple lines at once? [duplicate]

How can I select a bunch of text and comment it all out? Currently I go to the first line, go to insert mode then type # left-arrowdown-arrow and then I repeat that sequence, perhaps saving a few ...
3
votes
2answers
1k views

vim - but with scrolling, clickable text, and copy-paste

I like vim. I think touching mice is dirty. But sometimes when my hand is already on a mouse, it sure would be nice to be able to scroll the text or click a location in the text and have the cursor ...
3
votes
2answers
1k views

In Vim, how can I delete all text from the current cursor position until the next space?

In Vim, I know 'd$', that deletes everything to the end of line. But how can I delete all text from the current cursor position until the next space? dw doesn't work, since it treats symbols like ...