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

learn more… | top users | synonyms

0
votes
1answer
8 views

Vim color scheme not being applied

I'm trying to use this color scheme: https://github.com/Konstruktionist/vim/blob/master/colors/Kafka.vim Here is my ~/.vim/colors: xxx@xxx:~/.vim/colors$ ls -l total 16 -rw-rw-r-- 1 xxx xxx 15245 ...
1
vote
0answers
13 views

Getting Alt to Work in the Terminal with Tmux and Vim

I'm trying to make Alt + h/j/k/l switch tmux panes and vim windows. Yet for some reason my terminal (xfce4-terminal) and and Alt do not play nicely with each other. I got Alt + h/j/k/l to switch ...
0
votes
0answers
12 views

Global vim-like (hjkl) navigation with numlock & xmodmap?

I'd like to be able mimic vim's hjkl navigation everywhere in the system by utilizing num lock (or scroll lock), and making hjkl keys act as arrows whenever num lock is on, and regular behavior ...
3
votes
1answer
19 views

Vim: if specific version, then don't load plugin

I wonder what the best way is to decide whether or not some plugin should be loaded depending on some specific compilation/version of Vim. Any help would be appreciated.
0
votes
0answers
14 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
32 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
34 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 ...
2
votes
1answer
43 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
22 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. ...
0
votes
1answer
29 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 ...
6
votes
1answer
102 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 ...
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 ...
1
vote
0answers
25 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?
2
votes
2answers
41 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
38 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
35 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
40 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
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 ?
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 ...
3
votes
2answers
43 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
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
68 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 ...
4
votes
0answers
28 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
52 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
36 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
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, ...
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 ...
0
votes
1answer
54 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
32 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
49 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
193 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 ...
3
votes
1answer
91 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
25 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
29 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 ~ ...
2
votes
1answer
28 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
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 ...
1
vote
1answer
45 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
34 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
51 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
44 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
19 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
17 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
1k 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
334 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, ...
0
votes
1answer
33 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 - ...