You are not logged in.

#1 2011-10-27 13:02:31

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Vi is such a useful tool!

Today, I was learning Vi and did this sample work:

 Vi is a simple and powerful editor that allows you to have full control over your work.

Key features include:
- Insert mode and command mode.
- Does not use many resources.
- Find and replace: Oh oh, you done a mistake. It's rich not rick. You can fix everywhere in your work.
- Increase of work done, because you don't have pick up the mouse to do something.
- Bookmarking: Allows you to return to that line at page 513 fast.
- Code formating: (Only in vim) Allows you to code just like if you had Notepad++ in low-resource edition.
- Edit all files at once: You can edit a couple of files, having just one window open.
- Buffers: Copy that essay into another essay in Vi, using the 36 buffers that come with Vi.

All included in Vi.

This work is done by VOT in Vi.
All problems in this work have to be reported to VOT or he might use Vi to destroy the planet.
Therefore, it is best to move to Mars. 

I was frustated at first, having to go to command/insert mode, switching between lines/characters is ugly, etc. But then I realized, that vi is a really powerful tool.
I actually wrote this work in Leafpad, but it was way slower. I had to use the mouse to switch lines, etc.

I've also learned a lesson: Never press a key in command mode unless you know what it does. I pressed . and my whole line was gone. Any ideas what . does?

Offline

#2 2011-10-27 13:10:28

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vi is such a useful tool!

Have you tried vim? More features, more awesome :-)

Offline

#3 2011-10-27 13:35:10

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: Vi is such a useful tool!

You should also consider Emacs. It's superior in some ways (particularly customizability, extensibility and documentation), but it takes a major investment to master it, some would say a lifetime investment. Generally Vim is a better choice for sysadmins working on many systems (since some variant of vi is available on every *nix system and vi(m) is great for quick edits), and Emacs for heavy coders.

Last edited by JohannesSM64 (2011-10-27 13:39:10)

Offline

#4 2011-10-27 14:30:23

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Re: Vi is such a useful tool!

karol: I should try it, thanks!
Johannes: vi is enough really for me.

Offline

#5 2011-10-27 14:48:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Vi is such a useful tool!

Please, oh please, oh please.  If this turns into an editor war, so help me, I'll close this.

You have been warned tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2011-10-27 14:50:10

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Re: Vi is such a useful tool!

Do not want: A editor war.
Do want: Tips and Hints for vim, congrats posts, how to teach parrots to use it, etc.

Last edited by VOT Productions (2011-10-27 14:50:50)

Offline

#7 2011-10-27 14:57:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vi is such a useful tool!

Tips and Hints for vim are plentiful on teh interwebz.

Parrots do not need to use an editor because pirates use a magnetized hook and a steady hand :-)

Offline

#8 2011-10-27 15:17:56

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: Vi is such a useful tool!

No one has answered the "technical" question yet: '.' repeats your last change command [:help .]. It seems in your case this was 'delete a line'. This is very useful when you want to do some repetitive task, like e.g. adding something at the end of some lines. Related but even more powerful are "complex repeats" [:help complex-repeat].

I would recommend you to do a short emacs tutorial now, so that you get an impression of how it feels, and then you choose what fits you better. I myself am a vim lover, but emacs has also a great deal to offer.

Offline

#9 2011-10-27 15:39:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vi is such a useful tool!

davvil wrote:

No one has answered the "technical" question yet

Sorry, I didn't think it was an actual question ;P


You can use 'undo' if something unexpected happens e.g. you deleted instead of yanking.

Offline

#10 2011-10-27 16:00:42

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Vi is such a useful tool!

I just started using Vim on an experimental, text-only Arch system. I've been an Emacs user for some years now, but I want to be at least competent in Vim.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#11 2011-10-27 16:15:45

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: Vi is such a useful tool!

karol wrote:

You can use 'undo' if something unexpected happens e.g. you deleted instead of yanking.

Mind you, vi has only one level undo, while vim has full undo capabilities. For me a very important difference.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#12 2011-10-27 16:20:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vi is such a useful tool!

SanskritFritz wrote:
karol wrote:

You can use 'undo' if something unexpected happens e.g. you deleted instead of yanking.

Mind you, vi has only one level undo, while vim has full undo capabilities. For me a very important difference.

Yup, that's why I use only vim. I'm not too sloppy with my typing but had 5k+ lines disappear on me a couple times in my life :-)

Offline

#13 2011-10-27 16:20:20

lijpbasin
Member
Registered: 2011-08-09
Posts: 28

Re: Vi is such a useful tool!

vimtutor and vim user manual are good for starters

Offline

#14 2011-10-27 16:57:04

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Re: Vi is such a useful tool!

Woah, thanks for the topic activity.
Ah, thanks for telling me . is a repeat command thingy.
lijpbasin: Is vimtutor a app or a manual?
Oh and by the way, what if there isn't a pirate around and parrots want to type something up? big_smile

Offline

#15 2011-10-27 16:58:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vi is such a useful tool!

VOT Productions wrote:

lijpbasin: Is vimtutor a app or a manual?

It's a command you run in a terminal. It's not exactly a manual, more like a guide or some e-tutor, hence the name.

Last edited by karol (2011-10-27 16:59:18)

Offline

#16 2011-10-27 17:59:49

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Vi is such a useful tool!

I like vi, but I do not like vim.

Offline

#17 2011-10-27 19:17:57

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Vi is such a useful tool!

Congratulations VOT, I also like Vim. I like it because it had a fairly shallow learning curve at the start (it isn't hard to get in and out of insert mode using 'i' and ESC), and yet after several years I still feel like I am learning new tricks.

Offline

#18 2011-10-27 20:04:09

jondkent
Member
From: London
Registered: 2005-09-13
Posts: 123

Re: Vi is such a useful tool!

I love vim (or vi).  Been using it for years.  Its totally essential if (like me) you look after tons of servers, as you can bet vi[m] is there, where the others may not.  Therefore I consider it an essential for any *nix user.

Once you get the hang of it, its worth looking at tuning it to your needs via the .vimrc file.  Tons of examples out there on how to do this, and worth while doing, especially the syntax highlighting.

Enjoy, its more powerful than people realize.

Offline

#19 2011-10-27 20:05:47

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Vi is such a useful tool!


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#20 2011-10-27 20:16:22

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Vi is such a useful tool!

Surely no Community Contribution. Moving to Newbie Corner.
Please take care to select the proper forum for new threads.


To know or not to know ...
... the questions remain forever.

Offline

#21 2011-10-28 08:41:30

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: Vi is such a useful tool!

Stefan Husmann wrote:

I like vi, but I do not like vim.

Interesting. Why is that, if I may ask?

Offline

#22 2011-10-28 11:06:39

jiyuu
Member
Registered: 2010-04-13
Posts: 63

Re: Vi is such a useful tool!

I love the "vi experience" but I really dislike vimscript. So I switched a while back to Emacs + Evil extension (was called vimpulse back then) and now I have the best of both world \o/

Offline

#23 2011-10-28 11:50:12

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: Vi is such a useful tool!

I have tried emacs and vim, but I always go back to vi. But, I have been using various UNIX-type systems since the early 80's.

One great thing about vi is that if you have to work on a partially disabled system in one of those little ash shells, you still have vi when nothing else is available. If you are used to using vi, no problem.

Tim

Offline

#24 2011-10-28 11:52:27

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Re: Vi is such a useful tool!

Ah cool, dw deletes words. oh and f replaces, oh and I can run Thunar while running Vim! And directory listings! Yanking and pasting... and more!

Offline

#25 2011-10-28 12:36:16

lijpbasin
Member
Registered: 2011-08-09
Posts: 28

Re: Vi is such a useful tool!

karol wrote:
VOT Productions wrote:

lijpbasin: Is vimtutor a app or a manual?

It's a command you run in a terminal. It's not exactly a manual, more like a guide or some e-tutor, hence the name.

Thanks karol, for answering this question for me

Offline

Board footer

Powered by FluxBB