LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-08-2011, 09:42 AM   #1
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Rep: Reputation: 2
Which editor is better, vim or emacs


I am a newbie in linux, while, I can use vim well now, but sometimes I found emacs very popular too. But it seems a little complicated to me. I just don't want to memorize so many shortcuts again...
What's your favorite editor?
 
Old 09-08-2011, 09:47 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This is an ongoing discussion ever since vi and emacs came into life and has sparked many flame wars

Both are very powerful editors. It all comes down to personal preference (or which you "grew up with").

I'm a vi(m) person myself and never had the need to use emacs (and others will tell you the opposite).

Hope this helps.
 
Old 09-08-2011, 09:57 AM   #3
0men
Member
 
Registered: Mar 2011
Location: Brisbane
Distribution: Windows 10, Red Hat, Debian
Posts: 183

Rep: Reputation: 22
I've always been vi myself. But it's personal prefernce I guess.
 
Old 09-08-2011, 10:06 AM   #4
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
druuna said it all....
 
Old 09-08-2011, 10:22 AM   #5
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Original Poster
Rep: Reputation: 2
When I am viewing source code, is there a way to go to the header files directly? I found the "gD" command does work at all...
 
Old 09-08-2011, 10:41 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Are you trying to open a file that's under the cursor?

If so: gf

Have a look here Open file under cursor for other ways and some tips/tricks.

Hope this helps.
 
1 members found this post helpful.
Old 09-08-2011, 11:10 AM   #7
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by druuna View Post
Hi,

Are you trying to open a file that's under the cursor?

If so: gf

Have a look here Open file under cursor for other ways and some tips/tricks.

Hope this helps.
Thank you. Is there a way to open all buffers in tabs. I think splitting into windows makes the readable region too small for me on the laptop.
 
Old 09-08-2011, 11:19 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

vi(m) doesn't use tabs. gvim might be able to do this (not sure, never really used gvim). Either way I can't tell you how to do this.

I rather have multiple open vi(m) sessions then 1 that holds all the session (again, personal preference).

Hope this helps.

Last edited by druuna; 09-08-2011 at 03:14 PM. Reason: I was wrong! See post #10
 
Old 09-08-2011, 03:02 PM   #9
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
You're not going to be able to browse source code without some kind of index.

"ctags" is a common choice; it works with both vi and emacs (and, of course, with other tools, and from the command line):

* http://www.thegeekstuff.com/2009/04/...-code-browser/

PS:
You might also be interested in CScope:

* http://cscope.sourceforge.net/

PPS:
My longtime favorite is "gid":

* http://www.gnu.org/s/idutils/manual/idutils.html

id-utils is particularly well suited for browsing through kernel code

Last edited by paulsm4; 09-08-2011 at 03:06 PM.
 
Old 09-08-2011, 03:10 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by druuna View Post
vi(m) doesn't use tabs.
Sure it does.

http://www.swaroopch.com/notes/Vim_e...#Multiple_Tabs
 
2 members found this post helpful.
Old 09-08-2011, 03:12 PM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by dugan View Post
Learned something today!
 
Old 09-08-2011, 07:33 PM   #12
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
+1 to vim and +1 to learning about tabs ... cheers dugan
 
Old 09-08-2011, 10:46 PM   #13
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Original Poster
Rep: Reputation: 2
I found that you can split the window vertically, is there an option of :set which can make the default split action vertical?
 
Old 09-08-2011, 11:34 PM   #14
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by dspjm View Post
Which editor is better, vim or emacs
The question is pretty much pointless (unless you want a flamewar). Use whatever works best for you. Regardless of your preference, it makes sense to learn vim - it is present on nearly every linux machine, and unlike emacs, usually it is not customized to the teeth.

Quote:
Originally Posted by dspjm View Post
What's your favorite editor?
Microsoft Visual Studio. Closest linux alternative is Kate. If it isn't present, then I"ll use whatever is available - jedit, kwrite, vim, mcedit.
 
Old 09-09-2011, 01:58 AM   #15
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
gvim is my default windows application for all kind of text files.
 
  


Reply



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
Quitting emacs and vim xeon123 Linux - General 2 08-25-2011 06:13 PM
LXer: Personalize and Optimize Vim editor using Packt’s new Vim 7.2 book LXer Syndicated Linux News 0 05-20-2010 10:20 PM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
compile code from within the editor - vim or emacs noir911 Programming 3 05-21-2008 02:46 AM
regarding colors in vim and emacs pranith Linux - Newbie 0 02-10-2005 03:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration