]> git.armaanb.net Git - config.org.git/blobdiff - config.org
Improve irc config
[config.org.git] / config.org
index e74caa1cf64f8e8c1c509cfe9ae54ca65f24a4e8..57b8f8ca6455fa363aaaa5cf5574fd5f32571c50 100644 (file)
@@ -460,12 +460,19 @@ Some EWW enhancements.
     :straight (:type built-in)
     :config
     (load "~/.emacs.d/irc.el")
-    (acheam-irc)
-    (erc-notifications-enable)
-    (erc-smiley-disable))
+    (erc-notifications-mode 1)
+    (erc-smiley-disable)
+    :custom (erc-prompt-for-password . nil))
 
   (use-package erc-hl-nicks
     :config (erc-hl-nicks-mode 1))
+
+  (defun acheam-irc ()
+    "Connect to irc"
+    (interactive)
+    (erc-tls :server "irc.armaanb.net" :nick "emacs"))
+
+  (acheam-irc)
 #+end_src
 ** Emacs Anywhere
 Use Emacs globally. Use the Emacs daemon and bind a key in your wm to =emacsclient --eval "(emacs-everywhere)"=.
@@ -608,6 +615,24 @@ Abbreviate things!
 #+begin_src emacs-lisp
   (setq ispell-silently-savep t)
 #+end_src
+** Open file as root
+#+begin_src emacs-lisp
+  (defun doas-edit (&optional arg)
+    "Edit currently visited file as root.
+
+    With a prefix ARG prompt for a file to visit.
+    Will also prompt for a file to visit if current
+    buffer is not visiting a file.
+
+    Modified from Emacs Redux."
+    (interactive "P")
+    (if (or arg (not buffer-file-name))
+        (find-file (concat "/doas:root@localhost:"
+                           (ido-read-file-name "Find file(as root): ")))
+      (find-alternate-file (concat "/doas:root@localhost:" buffer-file-name))))
+
+    (global-set-key (kbd "C-x C-r") #'doas-edit)
+#+end_src
 * Keybindings
 ** Switch windows
 #+begin_src emacs-lisp
@@ -735,15 +760,15 @@ No more clogging up init.el.
 #+end_src
 **** Programs
 #+begin_src conf :tangle ~/.spectrwm.conf
-  program[aerc] = alacritty -e aerc
-  program[catgirl] = alacritty --hold -e sh -c "while : ; do ssh root@armaanb.net -t abduco -A irc catgirl freenode; sleep 2; done"
+  program[email] = emacsclient -c --eval "(mu4e)"
+  program[irc] = emacsclient -c --eval '(switch-to-buffer "irc.armaanb.net:6697")'
   program[emacs] = emacsclient -c
   program[firefox] = firefox
   program[calc] = alacritty -e because -l
   program[emacs-anywhere] = emacsclient --eval "(emacs-everywhere)"
 
-  bind[aerc] = MOD+Control+1
-  bind[catgirl] = MOD+Control+2
+  bind[email] = MOD+Control+1
+  bind[irc] = MOD+Control+2
   bind[firefox] = MOD+Control+3
   bind[emacs-anywhere] = MOD+Control+4
   bind[calc] = MOD+Control+5
@@ -889,7 +914,8 @@ No more clogging up init.el.
   alias unar='atool -x'
   alias wget='wget -e robots=off'
   alias lanex='~/.local/share/lxc/lxc'
-  alias vim='nvim'
+  alias vim=$EDITOR
+  alias emacs=$EDITOR
 #+end_src
 **** System management
 #+begin_src shell :tangle ~/.config/ash/ashrc