- (add-to-list 'erc-modules 'scrolltoplace)
- (erc-update-modules))
-
-(use-package erc-fill
- :after erc
- :custom
- (erc-fill-column 77)
- (erc-fill-function 'erc-fill-static)
- (erc-fill-static-center 18))
-
-(use-package erc-pcomplete
- :after erc
- :custom
- (erc-pcomplete-nick-postfix ", "))
-
-(use-package erc-track
- :after erc
- :bind (("C-c a e t d" . erc-track-disable)
- ("C-c a e t e" . erc-track-enable))
- :custom
- (erc-track-enable-keybindings nil)
- (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
- "324" "329" "332" "333" "353" "477"))
- (erc-track-position-in-mode-line t)
- (erc-track-priority-faces-only 'all)
- (erc-track-shorten-function nil))
-
-(use-package erc-hl-nicks
- :after erc)
-
-(use-package erc-scrolltoplace
- :after erc)
-
-(use-package znc
- :bind (("C-c a e e" . znc-erc)
- ("C-c a e a" . znc-all))
- :config
- (let ((pwd (let ((auth (auth-source-search :host "znca")))
- (cond
- ((null auth) (error "Couldn't find znca's authinfo"))
- (t (funcall (plist-get (car auth) :secret)))))))
- (setq znc-servers
- `(("znc.shemshak.org" 1337 t
- ((freenode "amin/freenode" ,pwd)))
- ("znc.shemshak.org" 1337 t
- ((oftc "amin/oftc" ,pwd)))))))
+ (declare-function erc-update-modules "erc")
+ (erc-update-modules)
+
+ (set-face-attribute
+ 'erc-nick-default-face nil
+ :weight 'semibold
+ :background "#f2f2f2"
+ :foreground "#222222")
+
+ ;; erc-fill
+ ;; (csetq
+ ;; erc-fill-column 77
+ ;; erc-fill-function 'erc-fill-variable
+ ;; erc-fill-static-center 18)
+ ;; to disable:
+ ;; (erc-fill-mode -1)
+
+ ;; erc-match
+ (csetq
+ erc-pal-highlight-type 'nick
+ erc-pals '("aindilis" "blackbeard" "brettgilio" "civodul" "dto"
+ "ggoes" "jrasata" "mplsCorwin" "rwp" "technomancy"))
+ (with-eval-after-load 'erc-match
+ (set-face-attribute
+ 'erc-pal-face nil
+ :foreground 'unspecified
+ :weight 'unspecified
+ :inherit 'erc-nick-default-face
+ :background (face-attribute 'font-lock-string-face :background)))
+
+ ;; erc-pcomplete
+ (csetq erc-pcomplete-nick-postfix ", ")
+
+ ;; erc-stamp
+ (csetq erc-timestamp-only-if-changed-flag nil
+ erc-timestamp-format "%T "
+ erc-insert-timestamp-function 'erc-insert-timestamp-left)
+ (with-eval-after-load 'erc-match
+ (set-face-attribute
+ 'erc-timestamp-face nil
+ :foreground "#aaaaaa"
+ :weight 'unspecified
+ :background 'unspecified))
+
+ ;; erc-track
+ (csetq
+ erc-track-enable-keybindings nil
+ erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
+ "324" "329" "332" "333" "353" "477")
+ erc-track-position-in-mode-line t
+ erc-track-priority-faces-only 'all
+ erc-track-shorten-function nil
+ erc-track-showcount t)
+
+ ;; key bindings
+ (global-set-key (kbd "C-c w e") #'erc-switch-to-buffer-other-window)
+ (define-key erc-mode-map (kbd "M-a") #'erc-track-switch-buffer)
+
+ ;; hooks
+ (defun b/erc-detach-or-kill-channel ()
+ (if b/erc-detach-on-kill
+ (when (erc-server-process-alive)
+ (let ((tgt (erc-default-target)))
+ (erc-server-send (format "DETACH %s" tgt) nil tgt)))
+ (erc-kill-channel)))
+ (add-hook 'erc-kill-channel-hook #'b/erc-detach-or-kill-channel)
+ (remove-hook 'erc-kill-channel-hook #'erc-kill-channel))
+
+;; global key bindings
+(global-set-key
+ (kbd "C-c a e f")
+ (lambda ()
+ (interactive)
+ (let* ((auth (auth-source-search :host "znca"))
+ (p (if (null auth)
+ (error "Couldn't find znca's authinfo")
+ (funcall (plist-get (car auth) :secret)))))
+ (erc-tls :server "znc.emacsconf.org" :port 6697
+ :password (concat "bandali/freenode:" p)))))
+(global-set-key
+ (kbd "C-c a e o")
+ (lambda ()
+ (interactive)
+ (let* ((auth (auth-source-search :host "znca"))
+ (p (if (null auth)
+ (error "Couldn't find znca's authinfo")
+ (funcall (plist-get (car auth) :secret)))))
+ (erc-tls :server "znc.emacsconf.org" :port 6697
+ :password (concat "bandali/oftc:" p)))))
+(global-set-key
+ (kbd "C-c a e t")
+ (lambda ()
+ (interactive)
+ (let* ((auth (auth-source-search :host "znca"))
+ (p (if (null auth)
+ (error "Couldn't find znca's authinfo")
+ (funcall (plist-get (car auth) :secret)))))
+ (erc-tls :server "znc.emacsconf.org" :port 6697
+ :password (concat "bandali/tildechat:" p)))))