Search
The Caboteria
/
Tech Web
/
EmacsTips
(revision 14) (raw view)
_(back to ProgrammingNotes)_ Emacs is more than an editor - it's a lifestyle. I spent years using vi but have fairly recently started to make the investment to join the cult. I prefer emacs to IDE's because I feel that the investment in time that I spend learning it will be more likely to pay off because emacs has been around for a long time and will continue to be around for a long time. Also, more of the smartest people I've worked with have used emacs than all other development environments combined (although lately Eclipse is gaining). *C style* - p.322 =M-x c-set-style= <code>GNU|K&R|BSD|Stroustrup|Whitesmith|Ellemtel</code> Vovida code appears to use =Stroustrup=. *Tabs* - to replace tabs with spaces mark a region then =M-x untabify= (=M-x tabify= goes the other way). Useful variables related to tabs are * =indent-tabs-mode= - =t= for spaces, =nil= for tabs * =tab-width= - number of spaces per tab * =c-tab-always-indent= - if =t=, will always indent a line of code. if =nil=, will indent only if you hit the tab key at the beginning of the line. You can embed these commands in a comment on the first line of a file. Let's say you want to interact with files created by people using Eclipse with its completely retarded default config of hard 4-character tabs. Just make sure that this text is somewhere on the first line of the file, either inside a =/* ... */= or after a =//=: =-*- indent-tabs-mode: t; tab-width: 4 -*-= *Ant* - to use ant instead of make to compile programs inside emacs, you'll want to run ant with the =-emacs= flag which makes the output more plain but allows emacs to find error messages. The easy way to do this is to add =(custom-set-variables '(compile-command "ant -emacs"))= to your .emacs file. *Compiling* - =M-x compile=, then =C-x `= (i.e. back-tick) to go to the next error. *Code Browsing* - http://ecb.sourceforge.net/ I haven't played with this package yet but it looks good *Java* - a good integrated development environment for Java is JDEE at http://jdee.sourceforge.net/. It's not that easy to install (it has lots of dependencies). *SQL* - yes, there's a mode for editing SQL queries: http://www.pezaris.com/sql-mode/ *DOS* - If you have to edit DOS files (which is likely if you program for a living ;) ) then Emacs works very well indeed. You can use it to translate into DOS or Unix format : =C-x RET f unix RET= or =C-x RET f dos RET= (don't forget to save the file after you do). For more info see the [[http://www.gnu.org/manual/emacs/html_node/emacs_558.html][manual]]. *XSLT* - http://xslt-process.sourceforge.net/ *Windows* - you can use cygwin's bash as a shell within emacs by putting =c:\cygwin\bin= in your windows path before running emacs. [[http://www.gnu.org/software/emacs/windows/ntemacs/discuss/bash-setup][this link]] might also help. * [[%ATTACHURL%/.emacs][.emacs]]: .emacs file for Windows emacs *Tips* - http://wttools.sourceforge.net/emacs-stuff/package.html<br/> http://www.emacswiki.org/cgi-bin/wiki/EmacsNiftyTricks<br/> http://news.slashdot.org/article.pl?sid=08/11/07/0533222<br/>
Attachments
Attachments
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
emacs
.emacs
manage
2.7 K
29 Sep 2003 - 11:51
TobyCabot
.emacs file for Windows emacs
Edit
|
Attach
|
P
rint version
|
H
istory
:
r20
|
r16
<
r15
<
r14
<
r13
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria?
Send feedback