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

learn more… | top users | synonyms

0
votes
2answers
24 views

How to tell if tabs or spaces are being used in vim [duplicate]

I have a file that has data such as: 1 Foo 2 Bar 3 Kazam Is it possible using vim to know if a space is being used a delimited vs a tab?
1
vote
1answer
22 views

tmux: how to bind a key to launch shell command?

I use tmux to develop, with two panes: one to edit the code, and one to compile it. I need to switch pane very often to launch the compile command (say "mvn install"). How can I bind a key (say ...
0
votes
0answers
62 views

Strange VIM behaviour

I recently installed a minimal version of Fedora 23 Server edition. I use VIM as editor, and I noticed a strange behavior when I edit any text file that is not a new file during. Whenever I open ...
0
votes
1answer
61 views

Nano vs Vim or Vi [closed]

I have been using nano for quite a while now and I prefer using it anyway. But still I don't understand why people still emphasize on vi or vim. Can anybody specify me the reason why vim editor is ...
20
votes
4answers
1k views

How to invoke vim editor and pipe output to bash

Sometimes I need to write text and then pipe that text into another command. My usual workflow goes something like this: vim # I edit and save my file as file.txt cat file.txt | pandoc -o file.pdf # ...
0
votes
0answers
15 views

urxvt, vim and X clipboard [duplicate]

I would like to setup my rxvt-unicode with the following behavior Be able to paste primary clipboard with the keyboard (whatever combination is normally used) Copy selected text to primary clipboard ...
1
vote
1answer
34 views

zsh fails at path completition when command is vim

When I try to autocomplete files (with vim as argument 0): vim ~/.conf <TAB> It shows: _arguments:450: _vim_files: function definition file not found _arguments:450: _vim_files: function ...
19
votes
3answers
1k views

In Vim , how can I copy from several lines? (not a range);

Assume I have 1 - funct1 2- funct 2 3 - funct 3 4 line 4 how can I copy line 1 and 3 (not a range of lines) and paste them, for example at line 8? If I do this in way with | arg like ( 1y|3y), I ...
2
votes
3answers
189 views

sed regular expression behaving differently than in vim and perl?

Here's a sample 'test.txt' abcdX1yad45das abcdX2fad45das abcdX3had45das abcdX4wad45das abcdX5mad45das sample desired output: X1yad X2fad X3had X4wad X5mad I could get it working in vim with: :% ...
1
vote
1answer
41 views

Why vim is pasting 50 lines instead of 96?

I had a file of 96 lines i selected all lines and paste with vim in new file but..paste only first 50 lines. What to check? I see this only on newest version of vim on slackware-current,the old 14.1 ...
3
votes
2answers
26 views

How do I prevent vim from automatically editing my input?

Sometimes I copy/paste from one .cpp to another in vim, and vim, confident that it knows what I want to do better than me, edits my entry. For example, if I copy/paste this: // A comment. Some(code); ...
0
votes
1answer
39 views

Vim saved file not updating on webpage

I am attempting to update an HTML file on my server, but when I do so it doesn't appear to be updating, but rather, serves an old copy instead. I went through the usual process of pressing :w and ...
1
vote
0answers
29 views

Different vim colors and styles in Tmux and Gnome

I am using tmux, and recently found out that the same vim colorshemes inside and outside of tmux have different colors Left is tmux in gnome-terminal, right is plain gnome-terminal, gnome-terminal ...
2
votes
1answer
42 views

Using accents in Vim seamlessly

Very often I need to write text/program in foreign languages that need accents and special characters in vim, but sometimes it is very hard to get that working. What are the best alternatives to ...
0
votes
1answer
39 views

How to Execute !gvim current line in Viewer?

Code find-xargs(less)-gvim %http://unix.stackexchange.com/a/277889/16920 find . -name "*.tex" -exec grep -il "agent" {} + | less -s -M +Gg Output ./InfectiousDiseases/1.4.2016.tex ...
0
votes
0answers
18 views

Send-keys across tmux panes in vim in Cygwin is painfully slow

I am using vimux or vim-tbone to send code to an interpreter in another pane. It works fine with any shell, but I can't get it to work properly in windows. I can't have a VM, so I use cygwin at work ...
7
votes
1answer
88 views

What is the historical origin of CTRL + P for up and CTRL + N for down?

I am a moderately experienced vim user, who is now beginning to use GNU emacs. At about the same time as I learned that Ctrl-p and Ctrl-n are the default for up and down in emacs, I also learned they ...
3
votes
0answers
18 views

Open multiple files from ranger in vim

When I highlight multiple files in ranger from the same dir, I can open them all in vim with r and than 0 or @ and than add vim. But if I highlight files from different dirs, than this doesn't work. ...
1
vote
1answer
27 views

ack executed through vim

I am trying to execute ack from vim. But for some reason vim decides to stop after executing ack. How can I stop vim from stopping? (on some systems what I call ack is called ack-grep) What I am ...
0
votes
0answers
19 views

How do I add a vim configuration to a user who is restricted to a specific directory?

So basically, I have created a user that only has access to a specific folder with: useradd --home /some/dir username Now what I would like to do is add my vim configuration to this user's "home" ...
0
votes
1answer
57 views

problem editing utf8 text file with vim

I have a problem editing a html file on a server via vim. The file is utf-8 encoded. While editing with vim (v7.3, no plugins active) I can see umlauts and editing and saving a line before the umlaut ...
0
votes
0answers
21 views

vim + tmux: some shortcuts broken?

When I am using vim inside of tmux, some of my shortcuts are broken. E.g. I have bound Ctrl + up/down and Shift + up/down in my .vimrc and when I'm running vim inside of tmux these shortcuts do not ...
0
votes
0answers
21 views

vim: map capital 'Y' in .vimrc does not work

If I try to map capital 'Y' in my vimrc, this is getting ignored. For example, if I put something like nmap Y :w<CR> in my vimrc, this has no effect. However if I run vim and I enter :nmap Y ...
0
votes
1answer
31 views

shell commands with quotation marks in ranger

I like to open the highlighted file in ranger in split of remote vim session. :shell vim --remote-send "<C-\><C-n>:vsp %d/%f<CR>" Rather than file ...
1
vote
1answer
70 views

Execute a command in zsh vim mode

In zsh in vim mode, I write something foo foo bar bar Then I hit Esc to go in normal mode and type : foo foo bar bar execute: _ Then, I assume I can do that, I want to search and replace bar ...
3
votes
2answers
702 views

In vi/vim, how do I append to a file instead of overwriting it?

I know I can write to a file by simply doing :w <file>. I would like to know though how can I write to a file by appending to it instead of overwriting it. Example use case: I want to take some ...
1
vote
1answer
40 views

Copy path from vim netrw

I use vim's netrw to explore some files. How can I copy the absolute path of the currently selected directory in netrw to a register and use it to paste into another buffer?
1
vote
1answer
42 views

Two different versions of VIM

When I install just about any distribution of linux it's accompanied with an unorthodox version of vi. I most recently dealt with this on Ubuntu 14.04. I can vi a file but a number of the "hot" keys ...
0
votes
1answer
57 views

vi replacing characters on file opening

Whenever I open an existing file with vim, the first non-blank character in one of the lines gets replaced with a g. I am a beginner with vim and I might have entered a command by mistake (since I ...
2
votes
0answers
28 views

OpenLayers autocompletion with Tern

I use Tern with Vim and a plugin called YouCompleteMe. I develop principally with two JavaScript libraries: jQuery and OpenLayers. The first one is already supported by Tern. OpenLayers is not. In ...
0
votes
0answers
40 views

Vim not loading color scheme file at all

I have exactly same two CentOS 6 boxes. Trying to install vim and enable color scheme file. Same thing, same vim versions used but the color scheme works in one machine and not in other. Here are ...
0
votes
1answer
19 views

sequentially number a line of linked images with vim or other?

I have over 400 lines of html containing this code for images: <a class='gallery' href="galimages/boards/board34.jpg" alt="board large"><image src ="galimages/boards/thumbs/34.jpg" ...
3
votes
2answers
45 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
19 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
80 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
42 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
45 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
58 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
44 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
44 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
40 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 ␣ ...
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
55 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
63 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
27 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
32 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
24 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
63 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
50 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
67 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 ...