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

learn more… | top users | synonyms

6
votes
1answer
96 views

What is this view in vim?

What is this view in vim called, and what is it for? Somehow when I type colon to enter a command in vim I accidentally bring up a view that looks like this. But I can't get it to happen ...
4
votes
2answers
296 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; /* ...
0
votes
0answers
13 views

How do I override vim's behavior when I execute set bg=XXX?

In the default RedHat distrubtions of vim, the default syntax-hilighting colors are horrible against a black background. If I do :set bg=dark, better colors are loaded. Magically. What I can't figure ...
0
votes
0answers
28 views

Differences between Vim and Evil Mode Emacs

I normally use emacs on my system however all of the computers at my university have vim installed which I normally ignored (I know basic vim but I'm not very efficient) and used gedit when I needed ...
2
votes
2answers
30 views

vim find and replace around a string

In VIM, if, for example, I have the text http://a.com http://b.com is it possible to find all lines (the whole line) and replace it with something before and after it, such as: <a ...
0
votes
1answer
19 views

Vim Powerline is only working when 2 buffers are open

I'm having some trouble with the Vim Powerline plugin. I've installed it but it is only working when I have two buffers open. Below are pictures describing the issue visually as well as my .vimrc. ...
1
vote
1answer
22 views

Vim Open file in multi split modes

I want to open 3 files in multiple split mode. For example let's say I have 3 files file1 file2 file3 I want to open file1 & file2 in vertical split mode , and both of the vertical split must be ...
0
votes
1answer
28 views

Why does piping filenames into VIM break bash when I return to the shell?

I searched for a few files with find and I wanted to open all of them in tabs in Vim. So I tried this: find . | xargs fgrep -l myExpression | xargs vim -p This worked great, except when I was done ...
20
votes
6answers
24k views

What is `^M` and how do I get rid of it?

When I open the file in vim I am seeing strange ^M characters. Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here: What is ...
0
votes
2answers
16 views

Create a macro for vim paste management

I would like to create a macro that does: set paste <paste> set nopaste This will save me from <paste> (Oh, forgot I again!) Delete. Execute the above. Over and over. :-) But I can't ...
0
votes
1answer
47 views

In vim, how to detach/open an exist window to a new tab?

For example: I'm editing a file, and I use command-line mode (:help) to open help file but this help file is be opened in the some tab with my file so, I want to open/detach this help window to a new ...
2
votes
2answers
39 views

Autocomplete from grep output

How might I more easily use a filename found by grep as an argument to vim: $ grep -r foo * lib/beatles/john.c lib/pantera/phil.c lib/pinkfloyd/roger.c lib/pinkfloyd/richard.c ...
7
votes
3answers
3k views

How to enable and use code folding in Vim?

How can I enable and do code folding in Vim? Do I have to change anything in ~/.vimrc? I type z+a and z+c and z+o and nothing happens. Here is an article about folding: Code folding in Vim.
1
vote
0answers
23 views

Vim with foreign QWERTZ keyboard

Vim is optimized for the standard US keyboard: If we want to use it with the following QWERTZ keyboard (common in Austria and Germany): What should we do? (aside from using the US keyboard map, ...
0
votes
1answer
19 views

How do I run two shell commands in one line in Vim?

I want to sort and uniq some lines. I did :'<,'>! sort -f|!uniq But it gives an error. Is possible to run two commands on one line?
7
votes
4answers
2k views

How to search the current word in all opened tabs in Vim?

I have started learning Vim word-search using * and # while the cursor is over the current word. But this search is limited to the current file buffer. Is there a command or a shortcut to extend this ...
2
votes
2answers
39 views

How to re-show this vim's welcome screen?

this screen is very beautiful, and I love But when I type a char, the screen just gone How can I manually show it again ?
3
votes
3answers
44 views

backreferences in `rename` regex

I have A LOT of files named "bar_foo.txt" in a directory, and I'd like to rename them to "foo_bar.txt" instead. In sed and vim the regex to to this would be something like ...
3
votes
1answer
90 views

“Press ENTER or type command to continue”: why am I seeing this?

I'm familiar with this message when a command's output is more than one line. However, on one of the systems I use, I see it every time I write with :w, despite having plenty of horizontal space for ...
3
votes
1answer
35 views

How to enter vim user manual without being in VIM

I want to simply browse the VIM user-manual, but the only way I get access is by opening a session of vim and the typing: help user-manual. The problem with this is that this ends up creating a screen ...
1
vote
1answer
34 views

Equivalent to 'w' in Vim to next non alphanumeric character?

I was wondering if there is a single key (like 'w') that specifies "from the current cursor position to the next non alphanumeric character". This is the scenario: In the example below, with the ...
1
vote
1answer
3k views

Terminal colors for Vim Airline and Tmux Tmuxline

When using Vim on its own with Vundle and Airline the theme appears normally: When I have loaded it up in Tmuxline, the theme uses different colors and even Vim looks different: Here's my Tmux ...
8
votes
3answers
3k 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 ...
0
votes
2answers
19 views

In xterm(mintty,bash), how can I open a file in the exist vim process?

I used to open file in multiple tab like visual studio or eclipse do. How can I open the a file into the exist vim process ?
3
votes
2answers
39 views

How to add hostname display to VIM statusline in Linux?

I'd like to add the short hostname to the statusline in vim. I've looked around but short of installing the Powerline plugin, it doesn't seem posible. Below is my .vimrc. How can I add thehostname ...
4
votes
2answers
2k views

How to use CapsLock instead of Escape in Vim?

I would like to map my CapsLock to Escape. How do I represent CapsLock in .vimrc? I know to map space to a command I would do something like this: :map <space> viw How would I map CapsLock ...
0
votes
1answer
15 views

vim multiple substitutions: three or more

This solution works fine for two strings,but for three or more substitutions? I have tried :%s:one:two:e | s:three:four:e | s:five:six:e But the third line on this example remain the same one two ...
2
votes
1answer
65 views

Vim: replace all line starting with string with line

On this text hardware mac 33:33:333:33:33 hardware mac 33:13:333:33:33 hardware mac 33:23:333:23:34 hardware mac 33:033:133:33:35 ... I want to replace all lines starting with hardware mac with ...
0
votes
1answer
35 views

Vim Syntax Highlight for Configuration Files

The vim version on my faculty cluster has a great feature in highlighting the syntax for Linux standard configuration files (like /etc/network/interfaces or httpd.conf). I've tried a lot of settings ...
9
votes
1answer
331 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?
16
votes
3answers
3k views

How to change the name of a vim buffer

Is it possible to change the name of a buffer in vim? Specifically, I'm using Conque Shell to open shells in vim (each shell is in a buffer) and with multiple shells, I see: 10: bash - 1 11: bash - ...
4
votes
0answers
26 views

How do I *completely* disable the Ctrl-O shortcut in Midnight Commander?

I like using both Midnight Commander and Vim. In Vim, Ctrl-O is the "go to previous position" command, and in MC, by default, it toggles between the shell and the panel. I would like to be able to ...
1
vote
0answers
28 views

bug in vim editing, caused by tab or diacritics?

I have the following line in a file (notice the tab in the beginning): $q = "select pl.id, pl.pltag tag, tf.nome família, tg.nome Gênero, ts.nome espécie, l.nome localidade When I try to edit ...
0
votes
1answer
51 views

Can't exit Vim with :!q [closed]

I have made wrong changes in a text, and now I want to leave Vim without saving. I know I have to type :!q while in normal mode, but when I do this, it says: [No write since last change] /bin/bash: ...
14
votes
4answers
12k views

How do I cycle through panes inside a window in tmux like in screen?

I thought Tmux - move window to pane was the same question but it doesn't seem to be. Coming from using GNU screen regularly, I'm looking for tmux to do the same things. On of the things I do ...
3
votes
2answers
1k views

Vim script check running platform

" Get running OS let os = "" if has("win32") let os="win" else if has("unix") let s:uname = system("uname") if s:uname == "Darwin" let os="mac" else let os="unix" endif ...
3
votes
1answer
35 views

Vim - Is there a way to get immediate visual feedback during Insert in Visual Block Mode?

I often press: <Ctrl> V to go into visual block mode and highlight a column hit <shift>-i (to insert at the beginning of the line), type a few things (at this point, I see my changes on ...
3
votes
2answers
2k views

Help understanding modifiable in Vim

During a OS upgrade (Linux), Vim or some part of it has been updated as well. Now it happens that sometimes when I save a file (the file is not saved) I get this error: E21: Cannot make changes, ...
64
votes
10answers
49k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
3
votes
0answers
44 views

Suspend a process silently with ctrl-z

With my current workflow, I frequently use CTRL-z to suspend Vim so I can enter a quick few commands before resuming editing my code with fg (actually, it's CTRL-z again, thanks to the handy ZSH tip ...
-1
votes
1answer
21 views

Specify cursor position and mode when opening file in vim

I want cursor to be in the last character of first line, in INSERT mode when I open a file in vim. It should work in all cases:: Open file from CLI, like, $ vim fileName Open file from inside vim, ...
0
votes
1answer
53 views

vim editor on Linux: How to reduce numbering indentation

I am working on RHEL 6.6. When i open vim editor and set numbers, the line numbers appear but there is a very big indentation from the left side of the screen. is there a way to reduce that gap: Here ...
2
votes
0answers
31 views

Making vim the default editor when I double click a file

When I run vim from the start menu, it opens up an xfce terminal window and runs vim. However, when I set vim to be my default text editor and double-click a file, it runs in xterm instead of the xfce ...
2
votes
2answers
209 views

How to use vim-slime from within a single tmux session?

I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
2
votes
1answer
228 views

Supress standard output in vim-latex-suite

I use Vim Latex-Suite together with the PDF reader Zathura. In the last versions of Zathura they decided to output the following warning: "warning: Failed to loads bookmarks" whenever a document ...
1
vote
0answers
30 views

Vim losing ability to copy to client clipoard over SSH

I have setup vim to be able to yank text from the server instance of vim to the clipboard on My client's operating system (through the SSH connection). The basic setup is Client side ...
-3
votes
2answers
48 views

C Programming on command line [closed]

What to do after opening vim name.c and writing the source code? I mean, to compile and execute.
1
vote
3answers
354 views

vim/emacs plugin to view recursive grep search search results?

Suppose I have a file formatted like this: file1:123 file2:4444 some/other/file:2233 This represents the search results from a command grep (i.e. the format file:line-number). I'd like to have a ...
1
vote
1answer
42 views

vim sudo hack auto reload

I've installed and aliased some a newer version of vim and aliased vim to call that version. I also aliased sudo so that it can just call the system default vi when I need to edit a file as sudo but ...
3
votes
0answers
22 views

How to remap “dead_hook” in Emacs and Vim?

I would like to remap some common symbols like ( and ) to the base line of my keyboard combining Alt Gr with other keys like j or k. I can remap Alt Gr+k to ) because that combination prints ĸ. The ...