LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-14-2008, 08:17 PM   #16
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122

You will need to know vi type commands at some point, even if you are using a simple command like "crontab -e"

You can get by with the very basics, but they are very useful
 
Old 05-14-2008, 08:29 PM   #17
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
If you do any kind of programming or system administration, learning vi or vim is definitely worth your time. The fact that it has a command mode allows you to move around and edit files tremendously faster than any other editor. I use it extensively on both Linux and Windows.

Many people like to dismiss vi because it's foreign to them and human nature tends to make us stay with what we are comfortable with. Therefore people point to the fact that it's old, it's been around forever and therefore, must be useless, but this is just human nature fighting against learning something new. If you decide you want to master linux, spend some time learning vi.
 
Old 05-14-2008, 10:13 PM   #18
ubume2
Member
 
Registered: Oct 2006
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Thanks for all the responses. I am fiddling with vim now.

I plan to learn a little about it, and we'll see where it takes me.

It's another learning adventure. Lots of opportunities in Linux. Not many opportunities for that in Windows.

I love Linux, and it's free!
 
Old 05-15-2008, 02:38 AM   #19
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Quote:
Originally Posted by rlhartmann View Post
Many people like to dismiss vi because it's foreign to them and human nature tends to make us stay with what we are comfortable with. Therefore people point to the fact that it's old, it's been around forever and therefore, must be useless, but this is just human nature fighting against learning something new. If you decide you want to master linux, spend some time learning vi.
Since I was the only one who said that vi is old and dated, I suppose this is directly or indirectly meant to my comment.

I am very familiar with vi. I've done programming with to some extend and I still use it if I have to do some quick edit AND I happen to have a command line window open, otherwise I don't even bother.

So in my case, is not my "nature" fighting against learning something new. What it feels like for me when using vi (and even the command line sometimes) is that I am fighting against evolution itself, with so many, better, faster, easier to use and far more efficient editors than vi.

Than again, what is dated for me, maybe is not dated for some... for me using vi brings me back memories of granpa listening to the news and music in his huge mono radio. It is a sweet memory indeed, but I ratter browse the web from my cellphone for the news and listen to my music with an Ipod touch...
 
Old 05-15-2008, 06:52 AM   #20
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
vi is easier to use and faster than gedit and even than ultraedit. It has a lot more useful functionalities.
As an advanced editor, it has a learning curve, though. For graphical vi, there is gvim.
Let's take an example:
You want to delete 5 paragraphs. in vi, you type :d5}, whereas in gedit, you have to select and visualise. It can take ages in gedit to do some tasks that vi can doo in half a second easily.
If you know vi, you can be efficient in editing text.
What you have to ask yourself is: do you have to be efficient when editing text? If you're not a programmer or don't have to edit many text files efficiently and don't need to be productive, then gedit may be enough. If you do edit text files often, or even all day, like I do as a programmer, then vi or emacs is a must.

Last edited by Agrouf; 05-15-2008 at 09:08 AM.
 
Old 05-15-2008, 08:40 AM   #21
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Since the OP asked why would one would want to learn vim, I can think of two reasons. First, a rescue disk will have vim-minimal on it. So if you ever have a cause to use a rescue disk it would be a good thing to know how to use vim. Secondly, if you need to edit /etc/sudoers, /etc/passwd or /etc/group, you need to use visudo, vipw or vigr respectively. So at least knowing how to get into & out of edit mode "i" key & escape; and how to save the file and quit: ":wq" are good things to know.

Using gvim on occasions when you are running X is a good way to learn what the commands are.
 
Old 05-15-2008, 09:07 AM   #22
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Quote:
Originally Posted by jschiwal View Post
Since the OP asked why would one would want to learn vim, I can think of two reasons. First, a rescue disk will have vim-minimal on it. So if you ever have a cause to use a rescue disk it would be a good thing to know how to use vim. Secondly, if you need to edit /etc/sudoers, /etc/passwd or /etc/group, you need to use visudo, vipw or vigr respectively. So at least knowing how to get into & out of edit mode "i" key & escape; and how to save the file and quit: ":wq" are good things to know.

Using gvim on occasions when you are running X is a good way to learn what the commands are.
EDITOR=gedit visudo
 
Old 05-15-2008, 09:20 AM   #23
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Because you almost can always count on its being there

vi/vim is everywhere. Memorize a few commands, and you can do a lot. Of course, vim is not going to measure up to someone's favorite IDE or text editor -- mine being Epsilon -- but vim's minimalism comes in handy, especially when I'm not in a GUI environment and working as root.

Edit:
---------------------------------------------------------
On Ubuntu installs, I found out that vim-tiny is best replaced with the full-featured vim. My reason was handling of arrow keys while using insert mode.

Last edited by cmnorton; 05-16-2008 at 06:13 AM. Reason: Add technical fact.
 
Old 05-15-2008, 09:58 AM   #24
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Quote:
Originally Posted by Mega Man X View Post
Since I was the only one who said that vi is old and dated, I suppose this is directly or indirectly meant to my comment

.....

better, faster, easier to use and far more efficient editors than vi.

...
First of all, this comment was not directed at you specifically, I teach Linux and hear similar types of comments all the time, and vi is definitely not the easiest editor to learn, however, it is extremely efficient. The key to working efficiently in vi is to stay in command mode, and this is what is foreign to new users of vi. Using the search [/], change [c] or substitute [s], find next [n] or repeat [.] commands, you edit files much more efficiently than any other editor. It does take some getting used to. Most of my students just learning vi don't like it, but when they take the uplevel classes, and see how quickly I can move around and edit a file, the realize its true power.

Last edited by rlhartmann; 05-17-2008 at 08:33 AM.
 
Old 05-15-2008, 10:08 AM   #25
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Quote:
Originally Posted by Agrouf View Post
EDITOR=gedit visudo
This will not work if X is not runninig, such as if
your logged in remotely from a windows machine, which
is how many unix/linux systems are administered, but
you could assign EDITOR to a text based editor,

EDITOR=emacs visudo

etc.
 
Old 05-15-2008, 10:09 AM   #26
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Quote:
Originally Posted by cmnorton View Post
vi/vim is everywhere. Memorize a few commands, and you can do a lot. Of course, vim is not going to measure up to someone's favorite IDE or text editor -- mine being Epsilon -- but vim's minimalism comes in handy, especially when I'm not in a GUI environment and working as root.
Actually, it's my favorite.
I've tryed emacs but it isn't as straight-forward as vi to me.
 
Old 05-15-2008, 12:39 PM   #27
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,945

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
One point that I don't think has been mentioned is that the old editors are less likely to throw a hissy fit than the fancier ones. Try getting Gedit to open a 4MB file: when I had to do that, it just refused with the claim it couldn't recognise the encoding: plain ascii! I had to muddle through with *Nano* because I hadn't installed vi. It will never be my favourite program, but I've made sure I had vi available ever since.
 
Old 05-15-2008, 02:32 PM   #28
Cyhaxor
Member
 
Registered: Nov 2004
Location: UK
Distribution: Fedora 12
Posts: 129

Rep: Reputation: 15
Quote:
Originally Posted by ubume2 View Post
Ubuntu 8.04 is my distro. I use the terminal to do various routines. I have used gedit to make some simple scripts. I am not a programmer.

Am reading Sobell's book on Ubuntu and reading about vim. Looks complicated.

Why should I use vim? Why not just gedit?

Thanks
The reasons of learning a command based editor are:
1) In case of ssh you don't have GUI
2) If you become a system administrator you will rarely use GUI
3) If something goes wrong with the GUI and you're unable to start an X manager you have to use nano, vim, emacs(i'm not sure about this one) to fix the problem
4) Several other reasons which I can't think of them right now.

But I would prefer to use nano instead of vim as it's much easier and simpler but vim offer some syntax highlights etc...

Last edited by Cyhaxor; 05-15-2008 at 02:43 PM.
 
Old 05-16-2008, 09:46 AM   #29
ubume2
Member
 
Registered: Oct 2006
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Thanks to all. I'm having a blast with vim. Mostly using it as a text file now, like notepad, but learning the commands. An excellent sourcebook for vim is located on vim.org in pdf format.

Explains it better than the books I am reading
 
Old 05-16-2008, 10:39 AM   #30
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246
Blog Entries: 1

Rep: Reputation: 31
vi is fine for emergencies. I find it just to be a simple extension of ed which would have been regarded as fancy for its time. Salutations to its small memory footprint and ubiquitousness, but I think as a full fledged editor for a production environment, emacs is the best, largely because if you are quick at touch typing it wont take long to execute Meta-x and type in some obscure command which most probably has a very descriptive name.
I personally dislike the default modal nature of vi/vim. I had rather use Meta-x to change modes which I rarely have to do.

And ofcourse I dont think it is worth the effort learning to use vim for programming when so many intuitive IDEs are available, and IFF you are already familiar with one of them.

Emacs anyday for me. But I do agree that vi basics are essential knowledge for every person who has oppurtunity to login as root.
 
  


Reply

Tags
gedit, vim


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VIM Users: Do you use VIM via console or gui? JMJ_coder Linux - General 48 04-16-2008 03:12 AM
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 09:00 AM
LXer: Vim tips: Using Vim mappings and abbreviations LXer Syndicated Linux News 0 06-18-2006 01:54 PM
LXer: Cream for Vim - Making Vim more user friendly LXer Syndicated Linux News 0 06-17-2006 11:54 PM
^M and vim jrdioko Linux - Software 5 08-04-2004 11:36 PM


All times are GMT -5. The time now is 06:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration