Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created March 15, 2012 13:51
Show Gist options
  • Save bradwright/2044293 to your computer and use it in GitHub Desktop.
Save bradwright/2044293 to your computer and use it in GitHub Desktop.
ERC configuration
;; erc configuration for IRC
(require 'erc)
(require 'erc-services nil t)
(erc-services-mode 1)
;; don't show join/part etc.
(setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
;; from: http://emacs-fu.blogspot.com/2009/06/erc-emacs-irc-client.html
(defun djcb-erc-start-or-switch ()
"Connect to ERC, or switch to last active buffer"
(interactive)
(if (get-buffer "brewdog.bradleywright.net:60667") ;; ERC already active?
(erc-track-switch-buffer 1) ;; yes: switch to last active
(when (y-or-n-p "Start ERC? ") ;; no: maybe start ERC
;; I use ZNC so I need to hit my server
(erc :server "server1" :port 6067 :nick "nick1" :password "password1")
(erc :server "server2" :port 6067 :nick "nick1" :password "password2")
)))
;; switch to ERC with Ctrl+c e
(global-set-key (kbd "C-c e") 'djcb-erc-start-or-switch) ;; ERC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment