Ask HN Emacs Users: What's in your .emacs file?
51–60 of 67 posts
Re: Ask HN Emacs Users: What's in your .emacs file?
#52Viper mode gives you the best of both worlds, although I'm probably considered a heretic in both religions. (setq viper-mode t) (require 'viper) (custom-set-variables '(column-number-mode t) '(inhibit-startup-screen t) '(show-paren-mode t) '(tool-bar-mode nil) '(menu-bar-mode nil)) I used to have slime config stuff in there, but now Ubuntu does it all for me. Thanks Ubuntu!
So you're the other viper-mode user! We should have coffee sometime :)
Re: Ask HN Emacs Users: What's in your .emacs file?
#53If you use Viper, this is the single nicest tip I have: http://edward.oconnor.cx/2009/08/viper-tweaks
Some tips on running a dedicated Emacs instance for Gnus: http://edward.oconnor.cx/2010/08/standalone-gnus
Re: Ask HN Emacs Users: What's in your .emacs file?
#54My .emacs is on GitHub: http://github.com/avar/dotemacs/blob/master/.emacs along with the elisp library I use http://github.com/avar/elisp Some noteworthy things: It's a ~1200 line file (and expanding) this is how I navigate it: (defun show-dot-emacs-structure () "Show the outline-mode structure of ~/.emacs" (interactive) (occur "^;;;;+")) Which shows the outline of the file, e.g.: 74 matches for "^;;;;+" in buffer:…
With iswitchb, once completion is exhausted try using cursor left and right to switch between the remaining alternatives.
Re: Ask HN Emacs Users: What's in your .emacs file?
#55Re: Ask HN Emacs Users: What's in your .emacs file?
#56any .emacs for php/Mysql/html/css/js ?
(require 'zencoding-mode)
(add-hook 'sgml-mode-hook 'zencoding-mode)
http://www.emacswiki.org/emacs/ZenCodingRe: Ask HN Emacs Users: What's in your .emacs file?
#57 ;; fonts
(if (eq window-system 'x)
(set-default-font "Inconsolata-12"))
;; no tabs, spaces instead!
(setq-default indent-tabs-mode nil)
;; Changes all yes/no questions to y/n type
(fset 'yes-or-no-p 'y-or-n-p)
;; default modes
(iswitchb-mode t)
(icomplete-mo)
(column-number-mode)
(ido-mode)
(tabbar-mode)
(winner-mode)
;; ido-mode
;; do not confirm file creation
(setq confirm-nonexistent-file-or-buffer nil)
;; integrate copy/paste with X
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
;; scroll
(setq scroll-step 1)
;; save backup files in this directory
(setq backup-directory-alist (quote ((".*" . "~/.emacs.d/backups/"))))
;; global bindings
(global-set-key [C-tab] 'other-window)
(global-set-key "\r" 'newline-and-indent)
(global-set-key (kbd "C-;") 'comment-region)
(global-set-key (kbd "") '(lambda ()
(interactive)
(split-window-vertically 25)
(other-window 1)
(slime)))
; switch buffer with last previous buffer
(global-set-key (kbd "") '(lambda ()
(interactive)
(switch-to-buffer nil)))
(global-set-key (kbd "C-p") 'backward-char)
(global-set-key (kbd "C-S-p") 'previous-line)
(global-set-key (kbd "C-S-j") 'join-line)
(global-set-key (kbd "C-") 'tabbar-forward)
(global-set-key (kbd "C-") 'tabbar-backward)
;; fullscreen on F11
(defun toggle-fullscreen (&optional f)
(interactive)
(let ((current-value (frame-parameter nil 'fullscreen)))
(set-frame-parameter nil 'fullscreen
(if (equal 'fullboth current-value)
(if (boundp 'old-fullscreen) old-fullscreen nil)
(progn (setq old-fullscreen current-value)
'fullboth)))))
(global-set-key [f11] 'toggle-fullscreen)
http://github.com/kototama/unixconf/blob/master/.emacsRe: Ask HN Emacs Users: What's in your .emacs file?
#58Re: Ask HN Emacs Users: What's in your .emacs file?
#59 ; Fix copy-paste between emacs and other x programs
(setq x-select-enable-clipboard t)
(if (functionp 'x-cut-buffer-or-selection-value)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value))
All your problems with cut and paste between Emacs and other programs? Gone!The if statement stops it failing when you use it on other platforms.
EDIT: I also really really like this bit which I've not seen in other peoples lists:
(defun eshell-goto-current-dir (&optional arg)
(interactive "P")
(let ((dir default-directory))
(eshell arg)
(eshell/cd dir)))
(global-set-key "\C-cs" 'eshell)
(global-set-key "\C-cS" 'eshell-goto-current-dir)
That means I can switch to eshell with C-cs or a can switch to eshell and change the current directory to be the same as the file I was viewing with C-cS. It also passes through the argument so I can have multiple shells open and use the numeric argument (M-1, M-2 etc) to select them.Re: Ask HN Emacs Users: What's in your .emacs file?
#60My entire .emacs file:
(defun sbcl ()
(show-paren-mode)
(setq inferior-lisp-program "sbcl")
(add-to-list 'load-path "~/emacs/slime")
(require 'slime)
(slime-setup))
(sbcl)