It's hard to live without: (fset 'yes-or-no-p 'y-or-n-p)
[deleted]
Ask HN: What's in your .emacs file?
41–50 of 60 posts
Re: Ask HN: What's in your .emacs file?
#42Some key ones (setq transient-mark-mode t) ; visually show region (setq line-number-mode t) ; show line numbers (setq global-font-lock-mode 1) ; everything should use font (windmove-default-keybindings) ; shift-arrow key moves to window in that direction I set up `webjump' to search online API documentation http://justinsboringpage.blogspot.com/2009/05/emacs-searchin... I like to send gmail http://justinsboringpage.b…
Granted, you could probably do that with transient mark mode, but seeing everything highlighted would be too annoying.
Re: Ask HN: What's in your .emacs file?
#43Most important: ;; Don't mix tabs and spaces (setq-default indent-tabs-mode nil) ;; Use "newline-and-indent" when you hit the Enter key so ;; you don't need to keep using TAB to align each line. (global-set-key "\C-m" 'newline-and-indent) ;; Get rid of the with duplicate file names (require 'uniquify) (setq uniquify-buffer-name-style 'post-forward-angle-brackets) And then a whole bunch of autoload statements for diff…
Re: Ask HN: What's in your .emacs file?
#44And then I have this in my .emacs:
(require 'anything-config)
(global-set-key "\C-c\C-a" 'anything)
(global-set-key "\C-c\C-e" 'anything-for-files)
I try to get in the habit of using C-cC-e instead of C-xC-f or C-x b. Anything is just too useful as a file/buffer finder.Re: Ask HN: What's in your .emacs file?
#45Now, I used to work for Google and most people there let you see their own home directories and I used that as an opportunity to learn from Stevey's setup.
There are a lot of customization going on and I should do a separate blog post about the setup. Here are I just cherry-picked some recent configuration favorites of mine:
;;
;; Superb way to move between Emacs windows
;; Shift+arrow keys
(windmove-default-keybindings)
;; Resize emacs according to the display resoluton
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
(if (> (x-display-pixel-width) 1900)
(add-to-list 'default-frame-alist (cons 'width 260))
(add-to-list 'default-frame-alist (cons 'width 80)))
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 50) (frame-char-height))))
(add-to-list 'default-frame-alist
(cons 'top 10))
(add-to-list 'default-frame-alist
(cons 'left 5)))))Re: Ask HN: What's in your .emacs file?
#46 (require 'ido)
(ido-mode t)Re: Ask HN: What's in your .emacs file?
#47 (setq load-path (append load-path (list "/Users/diN0bot/.emacs.d")))
some useful .el's
auto-save-list/ highlight-current-line.el
auto_save_list/ psvn.el
backup-file-list/ pycomplete.el
cpp-font-lock.el python-mode.el
django-mode.el vc-.el
doctest-mode.el zenburn.elrebindings are useful, such ctrl-q for M-x goto-line: (global-set-key "\C-q" 'goto-line)
I cribbed the following from someone else, but i find it most awesome:
; ===== Put auto-save, backup files in one place ===
;; Put autosave files (ie #foo#) in one place, not ;; scattered all over the file system! (defvar autosave-dir (concat "/Users/diN0bot/.emacs.d/auto-save-list/"))
(make-directory autosave-dir t)
(defun auto-save-file-name-p (filename) (string-match "^#.*#$" (file-name-nondirectory filename)))
(defun make-auto-save-file-name () (concat autosave-dir (if buffer-file-name (concat "#" (file-name-nondirectory buffer-file-name) "#") (expand-file-name (concat "#%" (buffer-name) "#")))))
;; Put backup files (ie foo~) in one place too. (The backup-directory-alist ;; list contains regexp=>directory mappings; filenames matching a regexp are ;; backed up in the corresponding directory. Emacs will mkdir it if necessary.) (defvar backup-dir (concat "/Users/diN0bot/.emacs.d/backup-file-list/")) (setq backup-directory-alist (list (cons "." backup-dir)))
Re: Ask HN: What's in your .emacs file?
#48I wrote a long article and at the last paragraph, I decided to edit a sentence, I selected the "region" and pressed C-w to remove it :-( For uninitiated, C-w is "yank text", i.e. cut it, and Firefox it is "close current tab without warning".
Re: Ask HN: What's in your .emacs file?
#49I use anything: http://www.emacswiki.org/emacs/Anything And then I have this in my .emacs: (require 'anything-config) (global-set-key "\C-c\C-a" 'anything) (global-set-key "\C-c\C-e" 'anything-for-files) I try to get in the habit of using C-cC-e instead of C-xC-f or C-x b. Anything is just too useful as a file/buffer finder.
(defun anything-for-files-create-if-not-found ()
"Just like anything for files, but gives the option to create a file."
(interactive)
(anything '(anything-c-source-ffap-line
anything-c-source-ffap-guesser
anything-c-source-regular-filename-completion
anything-c-source-recentf
anything-c-source-file-not-found
anything-c-source-buffers+
anything-c-source-bookmarks
anything-c-source-file-cache
anything-c-source-files-in-current-dir+
anything-c-source-mac-spotlight)))Re: Ask HN: What's in your .emacs file?
#50The default undo history is only 32. I like to be able to go further back.