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

learn more… | top users | synonyms

0
votes
2answers
19 views

how to make a large command line broke in two lines be executed as a single line inside of a script

I am very begginer with Unix. I am using IBM z/OS390 and I am using the OMVS shell. I don't have "vi" installed at all so I use "oedit". If I try to initialize the app.jar straigh from OMVS shell it ...
1
vote
1answer
4k 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 ...
1
vote
1answer
35 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 ...
0
votes
1answer
41 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
2answers
25 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?
3
votes
1answer
181 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 ...
2
votes
2answers
391 views

How to toggle mouse support in vim?

I have been working on my laptop a lot lately, and I am accidentally clicking while typing. I know I could remove set mouse=a in my .vimrc, but sometimes I like using the mouse. What can I do to ...
6
votes
1answer
163 views

Problem using Ctrl+Arrow keys in Vim when using Byobu with tmux

In Vim, I had set the Ctrl+Arrow keys to skip words. This works just fine when running Vim inside the gnome-terminal. However, when using byobu (tmux), it shows weird behavior : it deletes ...
1
vote
1answer
24 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 ...
11
votes
4answers
8k views

Transaction check error in installing vim?

I recently updated my fedora to 20 and wanted to install vim.but running sudo yum install vim returned this error: Transaction check error: file /usr/share/man/man1/vim.1.gz from install of ...
0
votes
0answers
63 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 ...
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: :% ...
25
votes
6answers
4k views

Why is it risky to give sudo vim access to ordinary users?

I'd like to create a new user and give him sudo access. To be specific, I want him to use sudo vim and edit httpd.conf. I wrote this in sudoers: user ALL=(ALL) /usr/bin/vim ...
23
votes
7answers
32k 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 ...
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 # ...
1
vote
1answer
4k views

YouCompleteMe not working after default install

I was trying to install YouCompleteMe with Vundle and it installed fine (it downloaded the git repository I pointed it to). I went into the folder and ran install.sh with the clang semantics and ...
10
votes
3answers
514 views

How do I modify the ci command in vim

Just like "ci(" changes everything between parentheses, I want "ci$" to change everything between dollar signs (for editing LaTeX.) Is this possible?
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 ...
3
votes
3answers
395 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 ...
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 ...
10
votes
3answers
417 views

vim: Can I make *only* y perform a copy?

I'm learning to like vim, but one thing that I haven't yet fully embraced is the copy and paste situation. In a muggle text editor I would Ctrl-C copy a piece of text and then edit/delete and then ...
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 ...
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 ...
3
votes
4answers
2k views

Turn NumLock on on startup?

I usually edit in Vim,and when pressing +, I'd rather move my hand to the right part of the keyboard where + resides rather than doing shift + =. But when NumLock is not on, in Vim it just opens a ...
1
vote
1answer
878 views

Vim keep showing error message about color scheme for no reason

Error detected while processing /usr/share/vim/vim74/syntax/synload.vim line 19: E185: Cannot find color scheme 'MyColor' Those lines of errors keep yelling about cannot find color scheme. But, ...
57
votes
1answer
19k views

What's the recommended way of copying changes with vimdiff?

When comparing files, and updating a source code repository, I like to use vimdiff. To copy changes made from one file to the other, I usually use a key sequence like this:- Shift + V (select line) k ...
1
vote
1answer
42 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 ...
4
votes
3answers
42 views

Edit columnar data in vim

Data Name Age Madhavan 29 saravana<Tab Press> ! How can i edit this data in vim in a tabular fashion? When i press tab key from column 1 in row 3, ...
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 ...
7
votes
6answers
950 views

Terminal and Vim

I open a terminal then I open Vim. Then I work on my source code, but unfortunately I click on the close button of the terminal title bar and my work is lost. Is it possible to configure Vim such that ...
13
votes
4answers
5k views

Preserve modified time stamp after edit

For files within a specific folder, I would like vim to never touch "modified" timestamp at all. The background is that I use Bloxsom for blogging, which uses plain text files in ~/bloxsom as source ...
20
votes
2answers
8k views

What is meant by a shell is in “vi” mode or “emacs” mode?

This question follows directly from the answer. In this case I am specifically unable to understand the part which says: In that regard, its behaviour is closer to emacs' than with ...
0
votes
0answers
19 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 ...
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. ...
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 ...
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 ...
2
votes
1answer
198 views

Tmux is not able to distinguish between insert and shift-insert

Insert when in xterm, gives ^[[2~ and, Shift+Insert gives ^[[2;1~ All this is good until I start tmux. Note that the $TERM variable remains the same, so this issue should not be related to ...
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
59 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 ...
1
vote
1answer
71 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 ...
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
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 ...
0
votes
1answer
4k views

Can't install vim in fedora 20

When I tried to install VIM in fedora 20, appear this message below How can I fix this problem?
0
votes
0answers
22 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 ...
2
votes
3answers
2k views

How to turn off permanent highlighting of all braces (not just pairs) in vim [closed]

I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. How do I do that? The usual highlighting of matching braces works fine.
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?