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

learn more… | top users | synonyms

3
votes
2answers
51 views

vim: Force specific syntax via command-line argument

When I want to easily read my PostgreSQL schema, I dump it to stderr and redirect it to vim: pg_dump -h localhost -U postgres dog_food --schema-only | vim - This gives: vim does not have a ...
0
votes
0answers
26 views

Vim minimize current window and make remaining of equal size

I'm trying to get a mix of CTRL-W1| and CTRL-W=. I want to keep only 2 windows and make them of equal size so that they take all available space. I'm using vertical tabs all the time, but I guess ...
1
vote
1answer
81 views

How can my text file get filled with ^M characters all of a sudden?

I have a text file on a Mac machine, and I've only ever used vi/vim to edit it. Today when I opened it using vi I noticed a bunch of ^M characters everywhere. The only thing I did different today was ...
0
votes
1answer
43 views

Vim color scheme not always working

I have changed my color scheme in vim by adding this line to .vimrc: colorscheme desert When I open .vimrc or .profile the text is colored, but when I do for example vim test.txt the text I enter is ...
0
votes
2answers
46 views

Vim writes to file without having permissions [duplicate]

$ ls sess.vim -lh -rw-r--r-- 1 root root 11K Feb 26 18:52 sess.vim I want this file to be readable for everyone and writable by no one (except by root). Thus I set its permissions to ...
0
votes
2answers
70 views

disable cursor color in putty client ssh terminal when in vi

I use putty.exe in windows 7 to connect to my Linux system. I use vi. I would like the cursor in vi to remain white all the time, and not change to green or blue around my if statement { } brackets ...
1
vote
1answer
54 views

Setting Terminal tab names in OS X and using vim

I regularly ssh into a Linux cluster from an OS X (El Capitan) Terminal, sometimes with multiple Terminal tabs. I use bash and vim. I'd like to do the following: while ssh'd, set the Terminal tab ...
1
vote
1answer
49 views

Gnome Terminal error with VT100 cursor movement codes

I've got an ansi escape issue with Gnome Terminal. What could be causing and how do I fix an issue like this? Since I cannot describe the issue very well I have a screenshot to show it off. When I ...
1
vote
1answer
41 views

Display replacement characters for no-break space in Vim

I'd want to display non standard spaces in Vim so that I could distinguish No-Break space (U+00A0) from Narrow No-Break space (U+202F) by using for example replacement Unicode characters like ␣ (U+...
0
votes
1answer
20 views

How to define a shell variable as equal to the version of Vim presently installed?

I am intending to write a shell script (if specifics are required, it will be executed in Zsh) that will determine the latest Vim patch via running: git pull origin master vernew=$(git describe --...
3
votes
2answers
61 views

Inspecting vi .swp file to preview recovery

Feel free to close this as a dupe if you can find a question that deals with this case. This is NOT about HOW to recover a .swp file in vi. I'm not sure if I want to recover. I want to preview what ...
0
votes
1answer
77 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
34 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 ...
1
vote
0answers
44 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
26 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
68 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
51 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 href="http://...
2
votes
1answer
68 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
78 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
54 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
110 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 consistently,...
0
votes
2answers
19 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
54 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
45 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
67 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
85 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 's/\(bar\)_\(foo\)/\2_\1/g',...
3
votes
1answer
42 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
49 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
57 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 lib/whitestripes/...
0
votes
2answers
28 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
73 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
108 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
17 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
310 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
74 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
32 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
212 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: q:...
3
votes
1answer
57 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
77 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
28 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
83 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
75 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
65 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 gnome-...
-3
votes
2answers
81 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
205 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
205 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
42 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
47 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 ...