summaryrefslogtreecommitdiff
path: root/org
diff options
context:
space:
mode:
Diffstat (limited to 'org')
-rwxr-xr-xorg/emacs.org87
1 files changed, 82 insertions, 5 deletions
diff --git a/org/emacs.org b/org/emacs.org
index 2c8cf35..cc26c78 100755
--- a/org/emacs.org
+++ b/org/emacs.org
@@ -832,6 +832,76 @@ Hook with ~dired-mode~
#+end_src
+* Eshell
+#+begin_src emacs-lisp
+ ;;;; sudo completion
+ (defun pcomplete/sudo ()
+ "Completion rules for the `sudo' command."
+ (let ((pcomplete-ignore-case t))
+ (pcomplete-here (funcall pcomplete-command-completion-function))
+ (while (pcomplete-here (pcomplete-entries)))))
+
+ ;;;; systemctl completion
+ (defcustom pcomplete-systemctl-commands
+ '("disable" "enable" "status" "start" "restart" "stop" "reenable"
+ "list-units" "list-unit-files")
+ "p-completion candidates for `systemctl' main commands"
+ :type '(repeat (string :tag "systemctl command"))
+ :group 'pcomplete)
+
+ (defvar pcomplete-systemd-units
+ (split-string
+ (shell-command-to-string
+ "(systemctl list-units --all --full --no-legend;systemctl list-unit-files --full --no-legend)|while read -r a b; do echo \" $a\";done;"))
+ "p-completion candidates for all `systemd' units")
+
+ (defvar pcomplete-systemd-user-units
+ (split-string
+ (shell-command-to-string
+ "(systemctl list-units --user --all --full --no-legend;systemctl list-unit-files --user --full --no-legend)|while read -r a b;do echo \" $a\";done;"))
+ "p-completion candidates for all `systemd' user units")
+
+ (defun pcomplete/systemctl ()
+ "Completion rules for the `systemctl' command."
+ (pcomplete-here (append pcomplete-systemctl-commands '("--user")))
+ (cond ((pcomplete-test "--user")
+ (pcomplete-here pcomplete-systemctl-commands)
+ (pcomplete-here pcomplete-systemd-user-units))
+ (t (pcomplete-here pcomplete-systemd-units))))
+
+ ;;;; man completion
+ (defvar pcomplete-man-user-commands
+ (split-string
+ (shell-command-to-string
+ "apropos -s 1 .|while read -r a b; do echo \" $a\";done;"))
+ "p-completion candidates for `man' command")
+
+ (defun pcomplete/man ()
+ "Completion rules for the `man' command."
+ (pcomplete-here pcomplete-man-user-commands))
+
+ ;; hut completion
+ (defcustom pcomplete-hut-commands
+ '("builds" "export" "git" "graphql" "lists" "help" "hg"
+ "init" "meta" "pages" "paste" "todo")
+ "p-completion candidates for `hut' main commands"
+ :type '(repeat (string :tag "hut command"))
+ :group 'pcomplete)
+
+ (defvar pcomplete-hut-user-commands
+ (split-string
+ (shell-command-to-string
+ "hut |while read -r a b; do echo \" $a\";done;"))
+ "p-completion candidates for `hut' command")
+
+ (defun apollo/hut ()
+ "Replace."
+ (replace-match "Usage:" "Someasdf"))
+
+ (defun pcomplete/hut ()
+ "Completion rules for `hut' command"
+ (pcomplete-here (append pcomplete-hut-user-commands)))
+#+end_src
* Misc
** Random functions
#+begin_src emacs-lisp
@@ -941,6 +1011,11 @@ Hook with ~dired-mode~
(interactive)
(switch-to-buffer (get-buffer-create "*Keimenografos*"))
(text-mode))
+
+ (defun create-scratch ()
+ (interactive)
+ (switch-to-buffer (get-buffer-create "*scratch*"))
+ (emacs-lisp-mode))
#+end_src
** Keybindings
#+begin_src emacs-lisp
@@ -948,9 +1023,7 @@ Hook with ~dired-mode~
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
- (global-set-key (kbd "C-=") 'text-scale-increase)
- (global-set-key (kbd "C--") 'text-scale-decrease)
- (global-set-key (kbd "C-k") 'copy-region-as-kill)
+ (global-set-key (kbd "C-c c") 'copy-region-as-kill)
;; Pass
(global-set-key (kbd "C-c p i") 'password-store-insert)
@@ -1040,12 +1113,16 @@ Hook with ~dired-mode~
#+end_src
** Circe
#+begin_src emacs-lisp
- (setq circe-network-options
+ (use-package circe
+ :ensure t
+ :config
+ (setq circe-network-options
`(("Libera Chat"
:host "irc.libera.chat" :port 6697 :tls t
:nick "thanosapollo"
:sasl-username "thanos_apollo"
:channels ("#emacs" "#emacs-circe")
:sasl-password ,(password-store-get "liberachat/thanos_apollo")
- )))
+ )))
+ (define-key thanos/applications-map (kbd "i") 'circe))
#+end_src