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

learn more… | top users | synonyms

1
vote
2answers
23 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
29 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
21 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
40 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
274 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 ...
1
vote
3answers
35 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
24 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 ...
3
votes
6answers
345 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
24 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
40 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. ___________ ...
1
vote
2answers
473 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
29 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
175 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 ...
6
votes
2answers
171 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 which support 256 colours even with tput colors that tells me they are ...
0
votes
2answers
47 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
52 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 ...
3
votes
1answer
47 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
66 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
39 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
41 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
33 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
82 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
128 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
82 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.
0
votes
2answers
30 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
34 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
67 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
280 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
70 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
56 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
133 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
56 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
79 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
76 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
271 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
97 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
24 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 ...
0
votes
1answer
239 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
55 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
39 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
59 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
68 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
102 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 ...
6
votes
1answer
86 views

How to highlight logs with bash coloring on vim?

I have some nicely colored logs from some tools with bash color codes. When I view them through less or similar tools it get color rendered by bash (obviously). However it is pain to watch and edit ...
1
vote
3answers
63 views

Emacs's <C-l> vim equivalent

There's a neat Control-L hotkey in Emacs that repetitively moves the cursor to the top/middle/bottom of the screen. I'm quite sure there's a vim equivalent for that, but I couldn't find it.
2
votes
2answers
63 views

Why is vim not being opened in its own screen?

When I type vim in xterm the program is not opened in its own screen, but in the very same I am writing commands in. Let me explain: for example, lets say I type in the terminal ls -l /usr/bin and get ...
0
votes
1answer
32 views

Insert mode in all windows in VI

Suppose I am using vim with two or more files opened in split-screen mode. The open files are very similar, and I want to perform a few identical changes to all files. I already know of :windo set ...
1
vote
1answer
124 views

Can vim display ASCII characters only, and treat other bytes as binary data?

I already know vim -b, however, depending on the locale used, it displays multi-byte characters (like UTF-8) as single letters. How can I ask vim to only display ASCII printable characters, and ...
1
vote
1answer
49 views

Minimize the current width of a window in Vim

To maximize the width of a current window in Vim, we type: ctrl-w | Is there a similar alternative for minimizing a current window in Vim?
0
votes
2answers
95 views

Trouble getting help in vim

I have just finished the vimtutor and everything went fine except for the last part (Lesson 7.1: Getting Help). I type :help and the help manual is shown as it is supposed to. But then I try (as ...