Ask HN: What is your .emacs file like?
1–9 of 9 posts
Re: Ask HN: What is your .emacs file like?
#2 (add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p)
It automatically makes files executable that look like they are scripts. (Start with #!/some/interpreter)Re: Ask HN: What is your .emacs file like?
#3That and loading extras and binding keys in a comfortable way.
Re: Ask HN: What is your .emacs file like?
#4Don't know where I found this, but I like this little gem: (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) It automatically makes files executable that look like they are scripts. (Start with #!/some/interpreter)
Now that you said that, I think I'll build some templates for commonly added files (like importing Django or GAE modules when the file is called "models.py").
Re: Ask HN: What is your .emacs file like?
#5(setq-default truncate-lines t) (setq truncate-partial-width-windows nil) ;; for vertically-split windows (setq inhibit-startup-message t) (setq make-backup-files nil) ; Don't want any backup files (setq auto-save-list-file-name nil) ; Don't want any .saves files (setq-default transient-mark-mode t)
Re: Ask HN: What is your .emacs file like?
#6Re: Ask HN: What is your .emacs file like?
#7Nothing really special: adds a bunch of modes that I use, tweaks clipboard behaviour & appearance, displays column data & full pathname, plus opens & renames a bunch of terminals.
Oh yeah, there's a VB.NET mode in there too. That was fun.
Re: Ask HN: What is your .emacs file like?
#8 ;; Shows last used files in menu on emacs startup
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
;; Improves buffer names (gets rid of etc names when filenames
;; are identical).
(require 'uniquify)
;; Copies from line above with meta-n, useful for some programming
;; languages that force such structures.
(fset 'prevlinecolcopy
[up ?\C- right ?\M-w left down ?\C-y])
(global-set-key (kbd "M-n") 'prevlinecolcopy)Re: Ask HN: What is your .emacs file like?
#9 ;; Map option-up/down do page-up/down
(global-set-key (kbd "ESC ") 'scroll-down)
(global-set-key (kbd "ESC ") 'scroll-up)
Now option up/down do paging. Win.(Probably already default in Aquamacs, but I prefer to use the 'real' Emacs.app)