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

learn more… | top users | synonyms

5
votes
1answer
441 views

will the same pid be used after getting killed?

I had a file opened using vim editor. It was in a ssh session and since I had been idle for a long time, the session got closed and I had to establish the connection again. I opened the file again ...
8
votes
0answers
91 views

vim/gvim failing to put X11 clipboard in registers “+ or ”*?

Due to the lack of security with standard vino server, I switched to use x11vnc on my linux (with Xubuntu 14.04) box and SSVNC on the windows side. With vino, cut and paste from windows to Linux ...
1
vote
2answers
141 views

Negative lookbehind/ahead assertions in Linux less pager (or vim)

I want to find all instances of "index" not followed by .php in a log using less. /index(?!\.php) does not work. Is this possible? What is the regex for less and vim (do they differ?). Is this not ...
5
votes
1answer
370 views

How is `vi` Aware of the Format of Configuration Files?

When I edit configuration files in vi, it seems like vi is aware of the syntax of the file. For example, vi will color tokens one way or another depending on whether its a key or a value. ...
3
votes
1answer
64 views

Remap Up and Down arrows to gj-gk in vim input mode without using <c-o>?

I have mapped my arrows keys to move in a visual-line mode, leaving the hjkl keys for normal, logic line movement: " Visual movement with the arrows and End-Home nnoremap <Down> gj nnoremap ...
1
vote
0answers
74 views

Can't open vim in zsh? [closed]

I recently decided to try out zsh, but for some reason I cannot open Vim in a zsh shell. Currently, my default shell is bash. If I open up a terminal window, then run zsh to enter a zsh shell, I have ...
4
votes
3answers
562 views

What does [converted] mean at the bottom of vim?

I have a log file, and when I open it via vim, it looks not readable, and it has [converted] at the bottom. What does [converted] mean? Is there a way to fix the format issue so that it is human ...
1
vote
2answers
52 views

Difference between vim’s normal-mode S and cc commands?

Is there a difference between the vim normal-mode commands S and cc? In my use cases, both commands seem to delete the current line and move into insertion mode.
0
votes
1answer
43 views

Open list of files in vim to specific lines

I know about vins command line operator but I need a version that works on multiple files . For instance I have a stack trace file and would like it to open all of the files to the line in a ...
1
vote
1answer
114 views

vim “caught deadly signal HUP”, what files are it preserving?

I logged out, apparently forgetting to bring back a vim session to the foreground. As expected, vim spat out "Vim: caught deadly signal HUP" followed by "Vim: preserving files". My question is: What ...
1
vote
1answer
90 views

How to give each variable a different color?

Is it possible to have a vim color scheme where each variable is given a unique color? If so, how? This feature would be really helpful when visually scanning code. (I think I saw this feature in ...
4
votes
3answers
317 views

Any way to provide a separate vimrc file just for 1 session

I would like to know, if there is a way in vim/vi to provide a different vimrc file. I am looking at managing 2 different vimrc files. For the contents I checkout/checkin in version control I want to ...
2
votes
3answers
51 views

Replace string with another string in vi editor

I have a template.php file where I want to change every occurence of apple with grape throughout the file. At the moment,I am having to painstakingly edit the entire file to find where to change. ...
0
votes
1answer
31 views

Localized wrapping in vim

I have wrapping turned on in vim, but is it possible to disable it for certain regions in the file I'm editing? To be specific, I'm editing LaTeX files, I would like the contents of some environments ...
4
votes
6answers
1k 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 ...
1
vote
1answer
44 views

Set makeprg to gradlew

First a bit of context for those who don't know gradle. It's basically like make except that you don't have to have gradle installed on your computer. It ships with projects as a file called gradlew. ...
1
vote
1answer
50 views

How to hardcopy to multiple pages per sheet?

Let's suppose I have a single sheet of text to print (8.5''x11''). Can I create multiple hardcopies of said text and scale them so that I can fit 4 copies per print sheet using VIM? ex. ___________ ...
3
votes
3answers
2k views

Transaction check error in installing vim?

I recently updated my fedora to 20 and wanted to install vim.but running sudo yum install vim returned this error: Transaction check error: file /usr/share/man/man1/vim.1.gz from install of ...
1
vote
0answers
45 views

vim and tmux on the same line

I would like to figure out a way to get my vim statusline and tmux statusline on the same line if such a thing is possible and not immensely difficult (ideally, the vim prompt, or whatever it's called ...
5
votes
1answer
422 views

tmux, Vim and Solarized

Premises Browsing around tmux, Vim and Solarized I can find lots of complains about 256 colours and "user experience". Well, I'm having the opposite "problem", i.e. Vim works well with a full ...
8
votes
2answers
682 views

tmux, TERM and 256 colours support

Introduction My question arises from the necessity of understanding why I have now (after multiple trials) Terminal and tmux supporting 256 colours and tput colors telling me there are only 8 of ...
0
votes
2answers
73 views

vim how to keep cursor position while copying text

I am (having to) using gvim in windows. I was used to the linux environment where when I select text using mouse the cursor position wont change. Now , with gvim in windows, My problem is something ...
2
votes
2answers
151 views

vim colors not automatically loaded (probable Vundle conflict)

I've been trying to port my Windows .vimrc to Linux, to use on the command line (on gnome-terminal). Everything works fine, except for the colorscheme. It looks like it's loaded (:colorscheme returns ...
6
votes
2answers
77 views

How do I only undo pasted text in vim?

TL;DR; version - How do I undo text that was pasted in from my OS copy buffer without undoing other text that was typed in since I went into insert mode? Longer description: Put something in your ...
1
vote
1answer
231 views

Configuring Vim with clientserver and clipboard

On OS X I have vim working just fine from homebrew. The default homebrew install compiles vim with these flags. ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.161/share/man ...
1
vote
2answers
43 views

Vim: What is difference between motion mark shotcut `. and `"?

While reading vim info motion marker says: |`quote| `" go to the position when last editing this file |`.| `. go to the position of the last change in this file Above ...
5
votes
2answers
47 views

How do I pick up a previous modification in VIM?

If I did several modifications to the original file, i.e. 1 delete a line 2 insert some text 3 delete another line 4 delete the text added in step 2 5 insert some other text 6 ... Now I want to ...
1
vote
1answer
73 views

Mapping C-1 does not work in VIM

I'm trying to bind 1gt to CTRL + 1, so in vimrc I added nmap <c-1> 1gt But pressing these keys in normal mode does not work. Either VIM (konsole) or gVIM Anything wrong with my command?
2
votes
2answers
146 views

Command-line editing vim style [duplicate]

I recently discovered terminal's feature, you can set the keys emacs or vi style I prefer the second. so if you do set -o vi You can use k j l h keys to navigate on the command line. And you can ...
1
vote
3answers
334 views

Arrow keys spontaneously stop working in vim

I recently upgraded from OS X 10.6 (I think) to 10.9. Since then it seems, while editing in vim, the arrow keys will "spontaneously" stop working. At one point, in frustration I "mashed" one of the ...
2
votes
1answer
153 views

Auto indent C++11 lambda functions Vim

Is there any way to get Vim to auto indent C++11 lambda functions correctly? I have tried many different permutations of smartindent, cindent, etc. in .vimrc.
1
vote
2answers
45 views

Anyway to navigate percentage-wise in vim?

I often open large files, looking through logs for finding info. As all lines have timestamp in my case and I am sure of in which part of the whole file the info is present which I am interested in. ...
0
votes
1answer
45 views

Piped search queries in vim or less

I would like to be able to search a log file for lines that being with ^2014-02-18 15:30:[0-9:,]* and have UserName:someguy much later in the same line. I am sure I could do a regex to include any ...
3
votes
1answer
80 views

What does the search flag 'z' do in VIM?

I was looking for a way to show a bit of context around my searches when doing g/mysearchtext/p When I stumbled across this page Search-a-pattern-and-provide-a-context-few-lines-above-and-below ...
8
votes
2answers
316 views

Is there a command reverse search in vim?

In linux cli I can do ctrl-r and do a reverse search and choose something I have done easily. Is there something similar in vim? I mean I may run a command using : (could be anything like a long ...
2
votes
1answer
101 views

Search for “not newline” in vim?

To search for A T\n in vim I can just do /A T\n What would be the equivalent for not newline at the end? /A T[^\n] did not work.
0
votes
1answer
117 views

When I type vim in terminal my bodhi linux complains emacs is not installed (bodhi linux) [closed]

jcress@jcress$ vim The program 'emacs' can be found in the following packages: * emacs23 * emacs23-nox * e3 * emacs23-lucid * jove Try: sudo apt-get install <selected package> I can't ...
8
votes
2answers
166 views

Vim - map last shell command to the key

Is there any way to map leader-r to repeat last command sent to bash? For example, when working with C files I would like to compile and run program from vim without typing :!make or gcc. I know I ...
3
votes
2answers
152 views

How can I make shell aliases available when shelling out from Vim?

In my .zshrc, I declare some aliases. Eg, which dbstart shows the contents of that alias. If I open vim from that shell, it is a child process. In Vim, I can run shell commands with :! some_command. ...
0
votes
2answers
108 views

How can I paste something to the VIM from the clipboard

How can I paste something to the VIM from the clipboard? In Windows "*p works as expected but in Debian both "*p and "+p doesn't work with both clipboard=unnamed and clipboard=unnamedplus.
0
votes
1answer
186 views

How do I join the next line when a line matches a regex for whole document in VI?

As title, for example, I have lines like abcdefg join! abcdef no join abcdefg join! If a line matches regex ^a.+g$ then I would like them to be joined, so it would be: abcdefgjoin! abcdef no join ...
11
votes
3answers
384 views

How can I constantly see the current filename in vim?

I am using vim and I need a way to always be able to see the file that I am working on without having to do ^G. I see the file name when I start vim but when I start to work and use various functions ...
1
vote
3answers
121 views

Can Vim be made simpler? [closed]

I have a 300MB file I want to edit, search, remove duplicate lines, compare 2 files, that sort of stuff. I tried Sublime Text 3, which was slow and crashed often. I asked for recommendations and was ...
1
vote
1answer
26 views

Avoid completing directory names when changing vim buffers

Suppose I have a directory structure, such as dir ├── foo │ ├── bar.c │ ├── bar.h │ ├── foo.c │ └── foo.h └── config └── foo.conf And I have each of the files in foo/, as well as ...
1
vote
1answer
830 views

Copy/paste into SSH'd VIM from local (Windows) clipboard

I would like to copy from a local machine and paste into vim on a remote box which I am SSH'd into. That's it. I have tried "+p and "*p, mouse middle-clicking, and a couple other things to no ...
1
vote
3answers
82 views

vim avoid selecting underscore

So I know that an underscore (_) is considered part of a word in vim. Working with Python, I normally end up having a lot of underscores. Is there a way to select part of a word excluding the ...
1
vote
0answers
54 views

Blank lines of unknown origin when running vim after tput clear

I have a rather bizarre issue with terminal behaviour. If I execute tput clear to clear the screen, my cursor (as expected) goes to the top of the terminal. If I run vi after that (vim actually), ...
5
votes
1answer
69 views

How to put current line at top/center/bottom of screen in vim?

Any quicker navigation trick to place the line at which the cursor is at the moment to the top of the screen? center of the screen? bottom of the screen?
0
votes
1answer
113 views

Can not install any color scheme in Vim in Kubuntu

I have installed the latest Kubuntu. I am trying to set a nice color scheme for my terminal, but it does not work.For example I tried wombat256. I copied the wombat256mod.vim under ~/.vim/colors as it ...
0
votes
1answer
419 views

How to install vim-gtk in debian wheezy

this is the terminal trace root@wheezy:/home/me# sudo apt-get install vim-gtk Reading package lists... Done Building dependency tree Reading state information... Done ...