0
votes
1answer
28 views

How to apply “set number” to vi on root?

I'm using vi on centos 6.5 and added "set number" script to /etc/bashrc in order to look line numbers whenever boot. It works well to show it on user login but not root. How to apply "set number" of ...
0
votes
1answer
29 views

How to add a prefix to every row of a particular column in a csv file via command line on linux

So basically i am trying to achieve the following.    File before editing.  column-1,   column-2,  column-3,  column-4,  column-5 Row-1-c1, ...
0
votes
1answer
21 views

How do I use / interpret vi shortcuts on linux?

I've found myself in the dreadful predicament of having to use vi, and I don't understand this list of shortcuts for it. I'm in insert mode, and I want to save the changes that I've made so far and ...
0
votes
1answer
123 views

vi Error | Out of memory saving lines for undo - try using ed

While executing the following command on a large file: vi largeFile.log I get the following error: Out of memory saving lines for undo - try using ed My environment is: AIX6 I cannot add any ...
-1
votes
1answer
70 views

When editing hosts file with vi , the added line gets repeated ad infinitum

Sometimes when I edit the hosts file by adding a new line, and when I do Esc, :, W, Q to save and exit, that line gets repeated infinite times in the file, and then gets saved. What am I doing wrong? ...
0
votes
2answers
58 views

Terminal Program To Save VI State

For a few years now at work I have been using the GNOME Terminal, and have gotten very used to that. I usually organize my work by categorizing each task on its own virtual desktop, then within each ...
0
votes
1answer
63 views

Getting rid of characters when doing gf in vim

I am using vim for coding. When I have something like the following: SomeModule->actualMethod() if I take the cursor to SomeModule and I do a gf I get a complaint that SomeModule- does not exist in ...
-1
votes
1answer
184 views

Cannot use vi editor

When I try to launch vi using vi or vim, it fails to start. ozzesh:~ # clear ozzesh:~ # vi ozzesh:~ # echo $? 0 ozzesh:~ # The above vi / vim command can't launch vi.
1
vote
1answer
102 views

Bash readline move cursor to previous forward slash

In bash , we can move back or forward by 1 word or character. Is there any option where i can move the cursor to the previous character that i specify, for example Forward Slash. ? Something like the ...
1
vote
2answers
32 views

how to match string in “sk_term(” in vi

I have a sql file where I want to match the string "sk_term(" in the file when I am using :/sk_term( it giving the following error E486: Pattern not found: sk_term(
0
votes
3answers
2k views

What is the keyboard shortcut to go to the end of the file in vi?

I'm using putty to view a 30+MB file in vi on a Linux server, and I have to use PgDn to scroll to the bottom of the page. I realize I can use tail but I want to be able to move up and down the file ...
0
votes
1answer
46 views

When I try to change mode in VI it prompts ^[ char

I am using FreeBsd 9 and I need to use Vi. My problem related with the changing mode (command to insert or insert to command) in VI. I know that I need to use ESC key to change mode. But in Insert ...
1
vote
1answer
87 views

“autocmd FileType” doesn't work the same way in Mac and Linux

Here is a small vimrc snippet that I was trying to use on my Mac function SetCommonDefaults() " Set line numbers set nu endfunction autocmd FileType cpp call SetCommonDefaults() What I expect ...
0
votes
1answer
90 views

How can I switch vim mode quickly?

This question is not the same as In vim, how can I quickly switch between tabs?, but what I want is a bit similar to it, since we are all trying to find shortcuts when editing with vim:) Now I am in ...
2
votes
1answer
147 views

vi insert text for specific line ranges

Seeking help in vi editor. I want to insert in the begin of line. I wanted it to be insserted for specific line ranges. for eg, line number 1 to line number 20. Any idea
2
votes
4answers
413 views

Syntax highlighting in vi

I use vi in Linux to edit e.g. JSP files. The code is not syntax highlighted. I think this should be possible to enable, but I haven't found out how. Is this possible to do in vi? update1: # vi ...
2
votes
3answers
643 views

vi editor text is flashing and unusable

I'm using vi on linux - vi --version gives: VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 16 2010 12:47:47) A few weeks ago, for no apparent reason, every time I use vi the entire text is flashing, ...
0
votes
1answer
468 views

Remap shift-tab to tab in bash/screen/putty in Linux?

Well I use vi-mode in bash via the set -o vi command. What's annoying is when I'm typing words in capital then try to complete using tab but don't release the shift-key fast enough, it brings me out ...
1
vote
4answers
833 views

How do I edit a file currently being used by vi?

I am new to Linux and trying out Ubuntu 11.10. I am setting up a SSH server and one of the instructions asks me to edit sshd_config file using vi. In vi, I can't remember what happen (it's all a ...
0
votes
2answers
560 views

VI make every first letter that comes after a underscore uppercase

Found this site: http://unix.t-a-y-l-o-r.com/VMswitch.html And it works for the first character but my lines are line this this_is_a_string And I would like this This_Is_A_String Any ...
10
votes
2answers
106 views

vi / vim abrumpt buffer movements within window

When using :set wrap in vi/vim, the contents of an entire wrapped line are placed in the display buffer upon moving the cursor into a new line, even when navigating through a file by display line ...
4
votes
2answers
751 views

Whats the difference between vi editor in Red Hat linux and Ubuntu?

I realize a difference in vi editor of ReD Hat and Ubuntu. In my company, I'm working in Red Hat. In that, the vi editing commands working as usual. Say, 'dd' to delete,'p' to paste, 'yy' to yank, ...
4
votes
1answer
5k views

Vi on Linux: show ^M line endings for DOS-format files

On Solaris, if you open a file in vi that has Windows line endings, this shows up as ^M at the end of every line. On Linux, vi is cleverer and understands the Windows file format, and does not ...
5
votes
3answers
1k views

Linux: How can I edit all the files returned by find in vi?

Something I find myself doing a lot is running a find command and then editing all of them in vi, which looks something like this: > find . "*.txt" ./file1.txt ./file2.txt ./path/to/file3.txt ...
1
vote
0answers
76 views

How do I set the meta key with the meta convert feature in most *nix terminals?

.Xdefaults: xterm*eightBitInput: false This command apparently allows you to use a meta key + something to enter vi editing mode in a linux terminal. But what is the meta key and how do you set the ...
4
votes
6answers
6k views

UNIX - How to copy and paste between different bash windows with files opend with VI?

Lets say I log in to bash, open a file in vi, then using alt-f2 I open a new terminal. After logging in I navigate to a second file and open that in vi. How can I CnP between these two files? I found ...
0
votes
3answers
61 views

How to using redirection to create a file

I have a linux script that generates a string and prints it to the console. I want this string to be the name of a file and open it for editing in vi. How can this be done?
3
votes
2answers
1k views

Create file with 751 permissions at creation

I keep creating practice perl scripts in a linux directory using vi <filename> and need to chmod 751 <filename> before I can run it as I wish to. I'm sure there is a simple way to default ...
0
votes
2answers
842 views

Why is my vi Editor highlighting all the text?

All of a sudden all the text in my vi editor is highlighted.I have no idea how this happened. Please help.
9
votes
3answers
2k views

Any IRC clients with VI key binds?

Is there any IRC client that supports VI keys? The ''obvious'' script VimIRC is and has been broken for so long it's not even funny. Do you know any IRC clients on Linux, GUI or Curses, that provides ...
1
vote
2answers
1k views

in VI and man command, how to exactly match a string?

in VI and man command, how to exactly match a string? I don't know how to exact match a string~
2
votes
2answers
13k views

How do I save changes after editing vi /etc/hosts?

I am doing a Linux installation. I installed the system fine and am trying to change the vi /etc/hosts file. I have edited the file but am not sure how to save it. I have --INSERT-- showing at the ...
1
vote
2answers
57 views

Ignoring repeated lines in a text file

I have a file with repeated lines that have particular text on them. I need to view the file content ignoring these lines. Is there anyway I can achieve this using vi?
1
vote
3answers
1k views

Linux weird problem touch : command not found?

I occurred a really weired problem, which is touch : command not found. I was going to create a blank file, so I type the touch command which didn't work. I'm running centOS 5. Any ideas? BTW: the ...
5
votes
3answers
1k views

Logged in to vi, made changes, forgot to sudo first - now what

I made lengthy changes to a configuration file on a Ubuntu Linux computer with the vi editor. Unfortunately, I forgot to sudo first, so now I'm in the editor, but can't save my changes because of ...
2
votes
2answers
332 views

Where can I get a “cheat sheet” of vi commands?

I'm writing Perl programs using vi on Solaris. I want a cheat sheet for the vi editor that provides the keyboard shortcuts, so I can perform my work faster. For example, I'd like for the sheet to list ...
14
votes
6answers
16k views

Vim to replace Vi

Guys, anyone know how to change linux console editor from vi into vim everytime we execute vi? I'm using Ubuntu and Fedora Core