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

learn more… | top users | synonyms

2
votes
2answers
56 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
71 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
41 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
41 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 ...
2
votes
2answers
49 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 ...
0
votes
2answers
26 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 ?
0
votes
1answer
61 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 ...
3
votes
2answers
81 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 ...
0
votes
1answer
16 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
163 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
38 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 ...
4
votes
0answers
56 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
30 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
79 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: ...
3
votes
1answer
49 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
0answers
68 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
24 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, ...
2
votes
0answers
58 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 ...
0
votes
1answer
64 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 ...
1
vote
0answers
43 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
65 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
198 views

How to match two lines at once in vim

I have a file that contains records with tab separated format but in two lines, I want to arrange records in one line with tab separated values using vim editor pattern match. Ex. Abc PQR ...
4
votes
1answer
149 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
36 views

Can I/how to specify colors in hex or RGB in nano syntax highlight config?

I enabled syntax highlight in nano (PHP), but not happy with the default, I would like for example to have the comments displayed in very light grey. However, the documentation I found seems to ...
1
vote
1answer
40 views

Find files and send to a temp file

Vim does support a nice option to accept a file with list of files that are then opened in a Quickfix list. Rough example, I find all files in ~ that are smaller than 1KB and pass this to Vim: find ~ ...
1
vote
1answer
29 views

How can I selectively modify the lines in a file where the modifications depend on analyzing the select lines as a whole rather than individually [duplicate]

TL;DR I need to align the columns of the entries in fstab while ignoring the comments: /dev/foo /foo ext4 defaults 0 2 # comment line 1 /dev/bar /bar ext4 defaults 0 ...
3
votes
0answers
24 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 ...
1
vote
1answer
61 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 ...
1
vote
1answer
35 views

With crtl-p can I open a file outside the current tree?

In looking to have functionality that can match my textmate friends for opening files with quick regex capability I found ctrl-p - https://github.com/ctrlpvim/ctrlp.vim It builds, indexes and then ...
2
votes
0answers
138 views

vim makefile syntax highlighting issue

Vim doesn't want to highlight my target named " * .o " and its dependencies because of the char ' * ' that I use to target all object files. When I replace the ' * ' by letters the highlighting ...
1
vote
1answer
46 views

vi needs two <enter> keystrokes instead of one

If I want to open a file using "vi", it needs two <enter> keystrokes instead of one. Any idea, how to fix it? Just few hours back it was working perfectly. I have been searching on the net ...
0
votes
1answer
30 views

Create remote file stream into terminal

I'm not experienced unix user so terminology may be not correct. Suppose I have a remote unix hosting which I'm connecting to from windows by ssh with putty. So I have terminal window with access to ...
1
vote
1answer
19 views

Accessing to the lastly executed command and modify it before executing in VIM

Scenario. Imagine, that I want to search replace something. :%s/foo/bar/g Now, imagine that I made a mistype and executed the command :%s/fop/bar/g Every vim user knows than @: executes the ...
16
votes
3answers
2k views

Vim - how to replace one new line \n with two \n's

In vim editor, I want to replace a newline character (\n) with two new line characters (\n\n) using vim command mode. Input file content: This is my first line. This is second line. Command that I ...
4
votes
3answers
396 views

Open file with started vim from outside (in terminal)

I have a started vim. I suspended it (Ctrl+Z). So I was in terminal session and I would like to open some file with the same vim session (new tab). I can open the file in new vim session. Actually, ...
1
vote
1answer
97 views

vimdiff to compare output instead of files

I am trying to compare two command output (no files) vimdiff "$(tail /tmp/cachain.pem)" "$(tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem)" I tried playing with redirection, pipe, and vim - ...
0
votes
2answers
36 views

How to make a .vimrc command dependent on a file existing?

My .vimrc uses pathogen by doing execute pathogen#infect() However if I set up a new computer and haven't installed pathogen with mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ...
2
votes
1answer
64 views

VIM with Python - Multiple # do not get colored as a comment

Something changed on my system and now VIM screws up syntax highlighting of commented lines. This makes having 'debug' lines very difficult as it looks like the line is still active based on the ...
0
votes
1answer
46 views

Show colors in gVim embedded terminal

Does anyone know how to show colors in the gVim embedded terminal? For instance when you do a !git diff file.c.
0
votes
1answer
25 views

syntax highlghting in vim

I have text files which have extensions *.sc. So to make syntax highlighting for some of the keywords in that type of text files I created ~/.vim/syntax/sc.cim. Below is the file content. user $ cd ...
2
votes
2answers
80 views

Screen - weird behavior after exiting Vim

I am facing problems with my configuring screen. My screen.rc is very simple and looks like this: altscreen on termcapinfo xterm ti@:te@ I wanted to configure screen to have the same behavior as ...
1
vote
1answer
41 views

Why CR sequence (\r) getting entered in .vimrc file?

Please look at my '~/.vimrc' file below. :map g :w :map g :w See, the same line repeated. After writing 1st line, I pressed the "Enter" key. Now see the output of the od command below. ...
0
votes
1answer
50 views

Color encoding for shell script

I using KSH shell as my linux environment. I am writing shell script for one of my project. Currently shell script does not shows color encoding for variable ,etc. It comes in black and white mode. ...
1
vote
1answer
56 views

Why do I have to press space after a command in Vim?

I frequently run into the situation that I have to press space to "actuate" the command I entered, e.g. after I hit ~ to swap case of a letter. Why is that?
0
votes
1answer
226 views

How to upgrade Vim 7.2 to 7.4 latest on Red Hat 6.6 the easiest way? [duplicate]

I'm a Vim user, and usually I just install vim via a one liner "apt-get install vim", but for red hat how can I update the 7.2 version to 7.4 with a one liner? I googled it and many places tell me to ...
4
votes
2answers
279 views

Set the bash display [while using GNU Screen utility] to not show the vim text after exit

Currently when I am not using screen utility, I am able to see the VIM content wiped out of the display when I quit VIM. However when I am using GNU Screen utility and opening a file in one of the ...
0
votes
2answers
30 views

Edit text with vim

I am trying to write command in Vim which can delete 9 and 11 symbols in third line. I did this 3s/9, 11/// but nothing happened as I expected it to be. It would be grateful to do this with your ...
1
vote
1answer
50 views

vim: Match WORD in current block with balanced brackets

When matching in vim there are words, WORDs and blocks among other things. Now for editing code, blocks are useful, words are somewhat useful, but WORDs are mostly useless, because they often include ...
0
votes
0answers
97 views

Tmux session name background color persists between sessions

I have tmux set to display the session name in the left status bar. The background color of the session is either red or green depending on if I have failing tests or passing tests. When I switch to ...
0
votes
0answers
61 views

How to run a command from vim and direct output to /dev/null

When writing a .tex file, I want to be able to view the pdf of the file. I remapped \e to show the pdf file in evince as below: nnoremap \e :!nohup evince %:r.pdf & >/dev/null ...