Emacs or VIM should I try it?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Pinkfloyd
Posts: 4
Joined: Sun May 25, 2008 7:53 pm

Emacs or VIM should I try it?

Post by Pinkfloyd »

Right now I'm using Kate for all of my coding but I always hear how nice Vi and Emacs are if you learn them.Is there a huge advantage like people who use these editors say?
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

I'm an emacs addict and my answer to your question is : YES. When I first used emacs I didn't think it was that great. But then I got more into it and I fell in love with being able to do everything in emacs. For example, I had a terminal on the top, a main file on the bottom left and a side pane which allows me to view to files. This allows me to see the header files with all my structs and everything so I don't have to continuously cycle through files to make sure that the names of all my identifiers are correct. Also emacs allows me to do all my editing without taking my hand off the keyboard(using the mouse takes too much time).

VIM probably also has most of these advantages but I'm not very experienced in vim.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

For some people, vi\emacs can be a huge productivity booster.

Personally, I use vim. As iammisc said, at first you'll say to yourself: "What is this? How can this be so productive?" However, after using it for awhile, and learning its workings, you'll get quicker and more accustomed to it.

Recently, seeing my success with vim, I've switched from GNOME to xmonad. So far, I like it a lot. Lesson of the story: shift around to various tools and try them all.
C8H10N4O2 | #446691 | Trust the nodes.
Osbios
Member
Member
Posts: 116
Joined: Fri Jun 10, 2005 11:00 pm

Post by Osbios »

I didn't know xmonad. I tried ion 2-3 years ago for notebooks. But the standard keys are horrible. But right now I have no notebook. :/
And on the desktop I stay on xfce... pushing my mouse.

I know that the advantage is the speed by using only the keyboard. But how long do you need to learn/get used to it and how much faster do you work?
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Vi is the best

Post by DeletedAccount »

:P Vi is cool and slick , The most important feature for the productivity of vi is that for most of the time your finger remain in the centre of the keyboard unlike many (non vi ish and so called true programs ) editors . Vi is the best editor om the whole wide world .<evil laugh> Mu ha ha ha h ha </evil laugh>
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Your choice on whether to use emacs or vi depends on whether you are more comfortable with a modal or modeless editor.

Vi is a modal editor - it has a command mode and an insert mode (among others) where the same keys do different things - e.g. in command mode 'j' moves up a line, in insert mode it inserts the letter 'j'.

Emacs is modeless - 'j' will always insert a character 'j'. All its functionality is accessed using key modifiers - generally with combinations of keys and the CTRL and ALT keys (referred to a C- and M- (for META)).

For example, to save a file and then quit in Vi(m), you press ESC a few times to make sure you're in command mode then type

Code: Select all

:wq
the 'w' being write, and the 'q' being quit.

In emacs, you would do this:

Code: Select all

C-x C-s C-x C-c
control-x is a modifier used to access emacs standard functions (because emacs has so many functions that it needs multiple modifiers to map them all). C-x C-s saves the file, and C-x C-c quits. It sounds more complex than the vi(m) version but really because of the locality of the keys it's very simple and automatic.

I personally use Emacs, but this has come about after using both and deciding that I preferred a modeless editor. I would, however, prefer an Emacs without any of the bells and whistles it currently has (emacs is almost an OS, it's got so much stuff, in fact one common insult is that "Emacs is a great operating system, all it lacks is a decent text editor")

Cheers,

James
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

I know that the advantage is the speed by using only the keyboard. But how long do you need to learn/get used to it and how much faster do you work?
Use it solely for a week and you'll get used to it. In regards to speed, I work a lot faster. Consider this: in text editors like gedit and kate, each file is kept in a separate tab. To switch you have to take your hands of the keyboard(about 2 seconds if you're on a desktop. a little easier on a laptop) and then you have to position the mouse on the tab and click( and be careful not to hit the close button). In emacs, I just hit C-x C-b and type in part of the name and click TAB for emacs to fill in the rest. Most of the time, I don't even have to type anything other than C-x C-b ENTER because emacs will automatically select the most recent buffer. Also, opening a file is much quicker, emacs has tab completion so I just type in the first few letters and voila, the file comes up. Lastly the great thing about emacs and vim is that you won't have to switch between a text editor and a console. Emacs and Vim(AFAIK) can both run a console so it will save you on compilation time.
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

iammisc wrote:In emacs, I just hit C-x C-b and type in part of the name and click TAB for emacs to fill in the rest. Most of the time, I don't even have to type anything other than C-x C-b ENTER because emacs will automatically select the most recent buffer. Also, opening a file is much quicker, emacs has tab completion so I just type in the first few letters and voila, the file comes up. Lastly the great thing about emacs and vim is that you won't have to switch between a text editor and a console. Emacs and Vim(AFAIK) can both run a console so it will save you on compilation time.
Just for information sake, Vim has Tabs. To move to another tab it's 'gt' (move to the next tab left). to create a new tab its ':tabnew' (or can be maped to a simple key combo (imap ,t <Esc>:tabnew<CR> would map it to ',t' keys). To move to a specific tab it's ':tab <tab number>'.
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
Pyrofan1
Member
Member
Posts: 234
Joined: Sun Apr 29, 2007 1:13 am

Post by Pyrofan1 »

Image
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

B.E wrote:
iammisc wrote:In emacs, I just hit C-x C-b and type in part of the name and click TAB for emacs to fill in the rest. Most of the time, I don't even have to type anything other than C-x C-b ENTER because emacs will automatically select the most recent buffer. Also, opening a file is much quicker, emacs has tab completion so I just type in the first few letters and voila, the file comes up. Lastly the great thing about emacs and vim is that you won't have to switch between a text editor and a console. Emacs and Vim(AFAIK) can both run a console so it will save you on compilation time.
Just for information sake, Vim has Tabs. To move to another tab it's 'gt' (move to the next tab left). to create a new tab its ':tabnew' (or can be maped to a simple key combo (imap ,t <Esc>:tabnew<CR> would map it to ',t' keys). To move to a specific tab it's ':tab <tab number>'.
Does anyone actually use vim tabs? I was under the impression everyone just :sp\:vsp their windows or opened a new terminal..
C8H10N4O2 | #446691 | Trust the nodes.
Osbios
Member
Member
Posts: 116
Joined: Fri Jun 10, 2005 11:00 pm

Post by Osbios »

If I work on more then one file I just open several instances of the editor and then tab/alt-tab between them.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

By the way, if you do choose to use Emacs make sure you get the snapshot, latest version as it has antialiased font support, which is teh awesome.
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

Alboin wrote:Does anyone actually use vim tabs? I was under the impression everyone just :sp\:vsp their windows or opened a new terminal..
Your right, tabs were only just added in v7.0 (May 7, 2006).
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

By the way, if you do choose to use Emacs make sure you get the snapshot, latest version as it has antialiased font support, which is teh awesome.
I second that. The only bad thing about regular emacs is the horrible fonts. But the new anti aliased fonts are just plain beautiful.
User avatar
fingerprint211b
Posts: 13
Joined: Thu May 29, 2008 2:34 pm

Re: Emacs or VIM should I try it?

Post by fingerprint211b »

Pinkfloyd wrote:Right now I'm using Kate for all of my coding but I always hear how nice Vi and Emacs are if you learn them.Is there a huge advantage like people who use these editors say?
I'm using Kate myself, and always have an open terminal on my other monitor.
Before that, when I was using GNOME, I used gedit, which I find to be excellent. Both editors can do syntax highlighting, and gedit has an embedded terminal (plugin), and auto-complete plugins...

I heard stories and examples of how vim and emacs are good and why, but I can't get myself to learn them :)
But from what I saw they seem worth it.
Post Reply