vi is a screen-oriented text editor originally created for the Unix operating system.
2
votes
1answer
130 views
Beep when typing backslash in cvim normal mode
I installed the cvim plugin for vim.
Almost all the cvim commands start with '\'.
But I when enter this character in normal mode, all I hear is a beep. Nothing happens. What might be causing this ...
3
votes
3answers
76 views
console space eaten up by file contents
see the example below to understand my problem ; consider my console prompt look like this
user@server $ ls
"I opened a file temp"
user@server $ vi temp
"temp will open in the same window, when I ...
7
votes
2answers
641 views
why inode value changes when we edit in “vi” editor?
When I edit a file in "vi" editor the inode value of the file is changing. But when edited with cat command the inode value is not changing.
2
votes
1answer
870 views
Replace using VIM, reuse part of the search pattern
I am working with VIm and trying to set up a search and replace command to do some replacements where I can re-use the regular expression that is part of my search string.
A simple example would be a ...
1
vote
2answers
415 views
Color of the fonts in my remote terminal screen when using VI in linux
I notice one of my linux remote login window shows color in VI editor interface but another window doesn't show color. These 2 windows are remotely connected to 2 different server IP addresses.
May ...
6
votes
2answers
743 views
How different is Elvis from Vim?
I've been using Slackware for a while now, which ships with Elvis as its default editor.
Most other Linux distributions seem to ship with Vim, instead of Elvis. Having gotten quite used to Elvis, ...
2
votes
2answers
263 views
How to delete the line after a search pattern, globally with vi?
Assume I have a big file, ~1k lines, and I need to delete the line after some pattern, lets call it: somePatern.
Conditions:
cannot be done by hand (no searching -- /somePattern, and/or manually ...
0
votes
1answer
262 views
Vi for cygwin syntax
How can make vi in cygwin highlight syntax when I open a file by default? I know that I can type in the command "syntax on" but I would prefer to not do this all the time.
12
votes
2answers
2k views
What is the difference between vi and vim?
As far as I know vi is more commonly found on out-of-the-box unix systems while vim often has to be installed. Also vim stands for vi improved, but improved how?
What are the main differences?
8
votes
3answers
1k views
Advantages of using set -o vi
I have seen many developers using this command to set the option to vi. I never understood the real use of this?
When using bash commands, what help does switching to vi provide?
4
votes
1answer
703 views
How to enable ctrl-R in zsh
I recently switched to zsh (finally) and am loving it!
So far one thing that I am missing is ctrl-R to do incremental history search.
I have the history set up properly
HISTSIZE=10000
...
5
votes
3answers
258 views
Search and replace next n words in vi [duplicate]
Possible Duplicate:
Vim :s replace first N < g occurrences on a line
In vi, how do I search and replace a word's first n occurrences with a word, say "hello", and the next m occurrences ...
19
votes
1answer
1k views
How to get root inside of vi? [duplicate]
Possible Duplicate:
Becoming root from inside Vim
It could happen to anyone. The admin types:
vi /etc/resolv.conf
as a regulare user. He edits the /etc/resolv.conf file, but when he ...
2
votes
1answer
114 views
Expanding text format in VI
The following code is taken from the superfish module for websites:
(function($){$.fn.hoverIntent=function(f,g){var
...
8
votes
4answers
362 views
How can I paste (overwriting) with vim?
In vim I use yy and p all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use yy p dd p because the dd deletes the line to the clipboard ...
5
votes
2answers
758 views
Pasting from clipboard to vi-enabled zsh or bash shell
I'd like to be able to paste from the system clipboard (or text selection) into my "vi-like" shell prompt using the keyboard. I normally use zsh and sometimes bash. In both cases, I have the shell set ...
7
votes
4answers
372 views
Bash vi mode configuration to default to command mode
Is it possible to configure bash vi mode so that initially it is in command mode instead on insert mode? I find that I have to press Esc far too much. It seems that there is possibility to specify ...
3
votes
5answers
382 views
vi - how to join differents specific lines
I'm looking for a solution about a "paste" problem on vi/vim .
How to join specific lines in a text file? I have a file like this:
15/10/2011 Revolution day
16/10/2011 About Rome
- differents ...
2
votes
1answer
100 views
How to open a file in the last closed position in VI
I want to open a file which is closed in line xxx. So I can easily continue editing
5
votes
1answer
3k views
Switch VI to use backspace key instead of Control+H for backspace?
I'm on Solaris 10 and by default vi version SVR4.0, Solaris 2.5.0 is installed.
The system was set up so that when I ssh to it Control+H does backspace, and backspace outputs ^?
I added stty erase ...
1
vote
5answers
1k views
How can I check what version of the VI editor I have?
How can I check what version of the vi editor I have? What's the best way to upgrade it or install vim on Solaris?
7
votes
2answers
218 views
Vi mode in other console programs
I quite like the Vi mode of bash. Is there any way to make it work in other programs (gnuplot for instance)?
EDIT: As Shawn suggested below, configuring .inputrc and using rlwrap -a -c gnuplot gives ...
17
votes
3answers
1k views
Change cursor shape (or color) to indicate vi mode in bash
To clarify: I am not asking how to change the cursor when using vim within a terminal. I want the cursor to change when switching between input and command mode within Bash's vi-mode:
set -o vi ...
2
votes
1answer
264 views
vi - how to add specific characters at the end of line
I would like to know if is possible in vi to add at the end of a line some specific character of ther line itself.
Example:
Before
donald /mount/donald_01
mickey /mount/mickey_01
mickeym ...
2
votes
2answers
590 views
Unable to type some special characters in vi on a debian
on a machine I have access to, when I type "€" in vi, "~B� " is displayed instead, and when I type "£", "£ "
What can cause this strange behavior, how can I fix it?
Typing it in the console gives even ...
7
votes
1answer
354 views
Note-taking and outlining using Vi: On startup, highlight tags and display tags in a preview window
I am using vi as a note-taking and outlining tool and therefore I thought that this stackexchange site would be appropriate to ask this question. I am constructing the "tags" file by myself. What I ...
2
votes
1answer
163 views
Vi: On startup, highlight tags and display tags in a preview window
I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or
outline file, vi reads the tags present in this ...
3
votes
1answer
226 views
Select between given characters in vim
Given three sample lines:
some('lorem _ ipsum');
$some['lorem _ ipsum'];
<span class="some _ class">
(cursor is in _ position)
Which is the fastest way to select (for pasting in other ...
1
vote
1answer
236 views
How to set keycodes manually in vim?
Sometimes when I fire up vim, my Insert key doesn't work (need to use i) and my arrows don't work (they give me letters instead).
I'm guessing this has to do with my keys not being mapped correctly. ...
2
votes
1answer
140 views
Why does Vim have different cursor positions for different modes?
Why does vim have different cursor positions for the different modes? First, in insert mode, the cursor is between characters (like every other editor), second, in command mode, the cursor is under a ...
6
votes
4answers
512 views
Indent several lines with VIM?
For eample, I'm editing this code:
<html>
<body>
<script>
var a = 10;
a += 100;
</script>
</body>
</html>
now I need to indent the script line:
...
7
votes
2answers
161 views
How do I get just the user-manual for Vim
To get the vim user-manual I am doing
vi test
and then, once the file is opened, I do
:help user-manual
This opens up a split window, which makes reading manual inconvenient to read. How do I ...
1
vote
3answers
243 views
Redirection of output from the terminal to a file in unix/linux
I am facing a slight problem in my project. I have a menu driven program and one of my options is Display all, which displays all the entries from a map using a loop. The display is on the terminal ...
3
votes
5answers
2k views
vi command for adding blank line?
In vi, I can use o or O to add a blank line and go into insertion mode. But what if I want to stay in command mode, is there a command for this?
In googling, I'm seeing suggestions to add stuff to my ...
2
votes
1answer
1k views
Edit really big files with vi
How can I edit a really big file with vi? e.g.: a 20 GByte log file. Are there any modifications for it to handle this size?
20
votes
3answers
2k views
Why does `ESC` move the cursor back in vim?
In vim, when I hit ESC to return to command mode, the cursor moves one character to the left. This is not what I would hope for, occasional I immediately hit l to move back to that spot, perhaps to ...
6
votes
4answers
2k views
delete line in vi
How can I delete a line in VI?
Here what I am doing right now:
Open up the terminal alt + ctrl + t
vi a.txt
I move my cursor to the line which I wan to delete, then what key-combination is should ...
2
votes
1answer
273 views
How to cancel :X encryption in vi
This has annoyed me for years but I've never found a solution.
Instead of pressing Esc then :x to save an exit from vi, I accidentally type a capital X and press Enter. The only way to continue is to ...
2
votes
1answer
2k views
vim: delete lines before cursor
We can delete lines after the cursor (e.g.: the next 3 lines) with:
3dd
But how can we delete the lines before the cursor? (e.g.: 3 lines before cursor)?
2
votes
1answer
281 views
How to stop Vim from changing my directory when executing a makefile?
OK, I posted this question before I knew the extent of what was happening. Suppose I have a mix of Python and C++ code. I use a simple makefile which copies the files from my editing directory to ...
3
votes
2answers
302 views
Jump to start of the line in Bash's Vi mode
I'm using Bash Vi mode (aka set -o vi). Still I miss the Ctrl-A shortcut from Emacs mode, which is very handy. Many times I'm retrieving the last command and append an echo to the beginning of the ...
8
votes
2answers
999 views
Can less invoke vim instead of the default vi when I hit the 'v' key?
I want to launch vim instead of the default vi editor when I hit v in less.
Are there any settings I can modify to allow me to do this?
5
votes
1answer
367 views
As we call `#!/bin/perl` 'shebang', what we call `-*- perl -*-`?
The first line of a script may be in format of #! interpreter, so the shell will execute the script using the specific interpreter. This is so called shebang or shbang.
Similarly, there can be some ...
3
votes
2answers
450 views
cursor position after pasting in vi / vim
One thing that has always bothered me in vi / vim:
If I "yank" (a.k.a. "copy") some text, then move to another place in the file and do a "paste", my cursor remains at the beginning of the text I ...
3
votes
1answer
262 views
Ex and Vi: buffers and regexes
I want to put regex matches to buffer but cannot get even simpler example y :.put myNewBuffer return msg [line] [put] [buffer] working ie how to put something to buffer?
So to regular expressions ...
2
votes
2answers
369 views
lookbehind and using it with grep in Vi?
Trying to get into Vi (not Vim), after learning Vim.
Vim has a lookabehind like /\(Not this\)\@<!$, how to do it in Vi?
If I want to search recurvively down directory in Vim, I could do :vimgrep ...
9
votes
2answers
296 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?
8
votes
2answers
298 views
Vim command for inserting a character
I'm looking for the opposite of x. I want to insert just one character and stay in command mode.
16
votes
3answers
7k views
Delete from cursor to end of line on VI
I know I've probably looked over this a million times in all the VI documents I've read, but I can't seem to find the delete from cursor to end of line command.
1
vote
2answers
897 views
What is a vi equivalent of vim's 'set ruler' command?
Is there a way to show the current row and column position in vi? In vim, I know there is the set ruler command, but what are my options when using vi?