Tagged Questions

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

learn more… | top users | synonyms

2
votes
2answers
46 views

Navigation Motion to Skip Comments

To edit configuration files, I'm using Vim. In order to move the cursor upwards or downwards to other configuration entries, I'm using Ctrl+d or Ctrl+u, respectively. Large blocks of commented lines ...
4
votes
2answers
1k views

Copy-paste for vim is not working when mouse (:set mouse=a) is on?

I was trying to copy paste something from vim to another application and also, from that application to vim using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also ...
2
votes
2answers
89 views

Highlight extra white spaces and fixed length column in VIM

I want to highlight extra white spaces and fixed length column (e.g., 80 character in a line) using VIM I created two vimrc rule in my .vimrc file highlight ExtraWhitespacea ctermbg=darkred ...
54
votes
9answers
10k views

Why can't Vim open a 100 MB text file when I have 16 GB RAM?

I have a 100MB MySQL database backup file and I have trouble to open it in Vim on my Linux box that has 16G of RAM. Vim just hangs (at least unusable). This is something I don't understand. I have 16 ...
1
vote
4answers
272 views

Enclose multiple lines in quote Vim

I have blocks of the following form: String that is not supposed to be enclosed in quotes String that is supposed to be enclosed in quotes String that is not supposed to be enclosed in ...
0
votes
1answer
53 views

How to edit files with VIM through FTP

I'm trying to use: vim ftp://user@hostname// - this gives me a correct directory tree, but when I try to open given file, by pressing Enter, at the first time - nothing happens (just cursor jumps to ...
3
votes
1answer
184 views

Make vim stop splitting my Git commit messages

Vim has this awful annoying habit of splitting my commit messages and automatically line-breaking them, rendering the second line with a red background for some reason. How can I make vim stop ...
0
votes
1answer
1k views

Can't install vim in fedora 20

When I tried to install VIM in fedora 20, appear this message below How can I fix this problem?
1
vote
0answers
58 views

Why does vim color this .bashrc line incorrectly? Fixable?

I have the following line in my .bashrc that allows me to use rlwrap with sqlplus. Why does vim seem to color this wrong? alias sqlplus='rlwrap -c -f /usr/bin/rlwrap -b ...
3
votes
1answer
158 views

Collapse line vertically so that every word is on a new line

Given a string like: "Hello World, how are you today?" Is there a way in Vim to collapse this line vertically such that every word appears on a new line, i.e.: "Hello World, how are ...
2
votes
1answer
90 views

ability to view browser view for html file from vim

Is there a plugin / program / key binding that will let me preview html files that I am editing in vim in a browser? Background: I have abandoned traditional full-feature editors and IDE's (of which ...
2
votes
2answers
87 views

Running a vim key combination on startup

In my .vimrc, I've got the lines autocmd VimEnter * NERDTree autocmd VimEnter * TagbarOpen This results in a layout with two sidebars and a centre column containing the main editing buffer (i.e. ...
8
votes
3answers
416 views

Vim: pasting lines line by line

Let's suppose I have a file containing: xxx yyy zzz and another file: kkk qqq ppp I want to obtain: xxxkkk yyyqqq zzzppp Is that possible in Vim with some command? (I've tried using VISUAL ...
3
votes
1answer
2k views

Vim Error E138: Can't write viminfo file $HOME/.viminfo!

I'm afraid I've run into something rather strange. When I open a file normally, vim README.txt, everything is fine. But upon sudo vim README.txt, the file renders blank, and gives me a E138: Can't ...
0
votes
2answers
51 views

can't define command which executes Explore command

I wanted to make an easy way to open a directory. My first try was like this: command! RootDirRubyOpen :e ~/.rbenv/versions/2.0.0-p247<CR> But it didn't work. "Okay then," I thought. And ...
0
votes
0answers
58 views

Disable mouse scrolling in vim with tmux

I'm experiencing the same problem as in this Q&A titled: disabling mouse support in vim in a gnome-terminal environment, where it was found (in the comments for the top answer) the problem wasn't ...
1
vote
1answer
95 views

tcsh/vi-mode behavior difference between Solaris and Linux

We have both Solaris and Linux environments at work. We use tcsh as the standard shell for hundreds of users. My question is about vi-mode in tcsh: In Solaris, while I'm typing, I can backspace ...
0
votes
1answer
51 views

Why does vim jump down to same position after multiple spaces?

I really can't find the answer to this and I would like to understand what going on behind the scenes to make this happen. Is it a setting I have switched on? If so, which one? To give an example, I ...
4
votes
1answer
156 views

Right-align comments in vim

I'm writing C code using vim and are searching for a possibility to right-align my comments so that they all end at col 80. To give a short example: int a = 80; /* initialize a */ int b = 7; /* ...
3
votes
0answers
174 views

How do I use ctags functionality in vim with cscope installed?

When I install cscope by adding the line Bundle 'chazy/cscope_maps to my .vimrc file, my tags menu (g+[) is replaced with a cscope list, which seems to contain a list of files where the tag is called, ...
1
vote
2answers
91 views

How do I make a vim command run automatically with .vimrc?

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red: :highlight ColorColumn ctermbg=235 guibg=#2c2d27 rather than run this ...
6
votes
1answer
506 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 ...
11
votes
0answers
223 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 ...
3
votes
2answers
526 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
390 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. ...
4
votes
1answer
116 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
139 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 ...
5
votes
3answers
1k 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
97 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
2answers
74 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
320 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
140 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
331 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
84 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
38 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 ...
6
votes
6answers
8k 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
87 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
62 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. ___________ ...
7
votes
3answers
5k 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
1answer
99 views

Show status lines of 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 ...
6
votes
1answer
1k 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 ...
12
votes
2answers
3k 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
105 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
512 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 ...
7
votes
2answers
147 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
688 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
44 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
51 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
145 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
221 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 ...