tags:

views:

168

answers:

8

how can i change the initial directory on emacs (i start using it today, and there are a lot of things to learn!!), right now im using M-X cd and then i change the directory that i use for C-x C-f, but in a daily work im gonna use heavily one particular directory so i need to make the change permanent... also if you have some tips for a starter it will be nice

+4  A: 

To set a default directory, simply put

(cd "/default/path/")

in your ~/.emacs file.

Emacs has a steep learning curve, but with constant use the most common commands will soon become second nature. As you discover more, emacs may become your favorite text editor, file manager, and email reader :)

To learn emacs, I'd start by pressing C-h t to start plowing through the excellent tutorial. Have a pad of paper beside you and write down the commands as you learn them. You'll use the crib sheet at first, but after a while, as I mentioned before, your fingers will learn the key combinations without your brain conciously intervening.

Good luck and have fun!

unutbu
thanks!, i suppose this line is in Lisp, is really a necessity learning lisp to get full advantage of Emacs? i have already add a couple of lines in .emacs to get work Auctex, and i really don't understand em very well, just copy paste by instruction, :)
voodoomsr
First you may copy and paste, and little by little you'll understand what it means. To use emacs, you don't need to know Lisp. But eventually, you may find it convenient to extend emacs' functionality with macros. At that point you'll want to learn elisp.
unutbu
It is indeed necessary to learn lisp to get the full advantage of emacs. You can nevertheless use it effectively without learning lisp.
offby1
+1  A: 

Check out Emacs Wiki for a bunch of tips and tricks.

zetetic
+1  A: 

If you're starting emacs, take a look at the Emacs Starter Kit:

http://github.com/technomancy/emacs-starter-kit

It doesn't have tutorial information, but it sets up keybindings in a way that's somewhat better than the default. I also learned stuff just by reading through the starter-kit-bindings.el file.

Noah Lavine
I decided to just start with 'blank' emacs and not to prejudice myself. It's probably a harder way, but I feel more comfortable downloading a blank emacs and getting going with it.
Paul Nathan
You should certainly do what works for you. However, I tried that myself a few months ago when I first tried to learn Emacs. I decided that I strongly disagree with the way the Emacs maintainers update their defaults (as far as I can tell, they don't), and I'd rather start from someone else's version.
Noah Lavine
I am with @Paul in that I prefer starting with my blank .emacs, but at the same time, I think @noahlavine suggestion is good. I have been learning heaps by reading other people's .emacs files, and the starter-kit-bindings.el is probably a good one to check. I will do just that! I am also a newbie :)
Vivi
A: 

Print out the Gnu Emacs Reference card and keep it by the desk.

Paul Nathan
I would say make your own reference card!! The gnu emacs ref card is useful, but I found that it has a lot of stuff I don't need, and it doesn't have a lot of stuff I need :)
Vivi
+2  A: 

Start up emacs only after changing to that "initial directory", effectively setting the current directory for emacs.

ndim
+1  A: 

I like GNU's A Guided Tour of Emacs page for a beginner's introduction to Emacs and what you might get out of it.

Trey Jackson
+1  A: 

This isn't much different than ~unutbu's answer, but it's maybe a smidgen more useful:

(dired "/default/path")

Make sure it's the last thing in your .emacs, lest subsequent stuff open some other buffer.

offby1
A: 

Default directory is determined by:

(setq default-directory "~/")

in this case, set to the users home dir, but it could be somewhere else.

If this variable is not set, the initial load point for find-file will be the directory where the emacs executable lives.

klang