Monday, May 11, 2009

My .emacs from a portable ubuntu distro @home

(add-to-list 'load-path "~/.emacs.d/")
(require 'rcirc)
(require 'rcirc-extension)
;; (require 'twit)

(global-set-key (kbd "C-c b") 'browse-url-at-point)
(global-set-key (kbd "C-c ") 'shrink-window-horizontally)
(global-set-key (kbd "C-c ") 'enlarge-window-horizontally)
(global-set-key (kbd "C-c ") 'shrink-window)
(global-set-key (kbd "C-c ") 'enlarge-window)

(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick (rcirc-nick process))
channels query-buffers)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (eq process (rcirc-buffer-process))
(remove-hook 'change-major-mode-hook
(if (rcirc-channel-p rcirc-target)
(setq channels (cons rcirc-target channels))
(setq query-buffers (cons buf query-buffers))))))
(delete-process process)
(rcirc-connect server port nick


;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(expand-file-name "~/.emacs.d/elpa/package.el"))

;; To install, add the following to your .emacs file:
(autoload 'kill-ring-search "kill-ring-search"
;; "Search the kill ring in the minibuffer."
(global-set-key "\M-\C-y" 'kill-ring-search)
;; Just call kill-ring-search and enter your search.
;; M-y and C-y work as usual. You can also use C-r like in a shell.
;; C-v, M-v, C-n and C-p will scroll the view.

;; emacs-fu
(blink-cursor-mode nil) ;; stop cursor from blinking
(setq search-highlight t ;; highlight when searching...
query-replace-highlight t)

(setq save-place-file "~/.emacs.d/saveplace") ;; keep my ~/ clean
(setq-default save-place t) ;; activate it for all buffers
(require 'saveplace) ;; get the package

(setq savehist-additional-variables ;; also save...
'(search-ring regexp-search-ring kill-ring) ;; ... my search entries
savehist-file "~/.emacs.d/savehist") ;; keep my home clean
(savehist-mode t) ;; do customization before activate

(push '("." . "~/.emacs.d/savefiles") backup-directory-alist)

;; mark current line:
(global-hl-line-mode 1)
;; color for current line:
(set-face-background 'hl-line "#e0f8ff")

No comments: