diff options
author | Joe <bousset.rudy@gmail.com> | 2022-06-26 21:33:40 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-06-26 21:33:40 +0200 |
commit | 433c1067a166d88cef7d1c12cc0c6180bf497f47 (patch) | |
tree | 6c7e219c6654ebd5e4550f908629aff7de00b209 | |
parent | Comfort update (diff) | |
download | dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.gz dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.bz2 dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.xz dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.zst dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.zip |
update
-rw-r--r-- | .config/emacs/org/config.org | 92 | ||||
-rwxr-xr-x | .local/bin/fathddmnt | 21 | ||||
-rwxr-xr-x | .local/bin/fathddumnt | 13 | ||||
-rwxr-xr-x | .local/bin/hddmnt | 23 | ||||
-rwxr-xr-x | .local/bin/hddumnt | 12 |
5 files changed, 75 insertions, 86 deletions
diff --git a/.config/emacs/org/config.org b/.config/emacs/org/config.org index 5ab3b5b..c008a33 100644 --- a/.config/emacs/org/config.org +++ b/.config/emacs/org/config.org @@ -606,7 +606,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (define-key markdown-mode-map (kbd "\C-c\C-o") 'toc-org-markdown-follow-thing-at-point) #+END_SRC -*** lsp, ccls, company, yasnippet +*** lsp, ccls, clangd, company, yasnippet #+BEGIN_SRC emacs-lisp (require 'lsp-mode) (require 'lsp-ui) @@ -653,50 +653,52 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." ;; (setq company-transformers nil company-lsp-async t company-lsp-cache-candidates nil) (add-hook 'company-mode-hook 'company-box-mode) - (setq ccls-executable "ccls") - - (defun ccls/callee () (interactive) (lsp-ui-peek-find-custom "$ccls/call" '(:callee t))) - (defun ccls/caller () (interactive) (lsp-ui-peek-find-custom "$ccls/call")) - (defun ccls/vars (kind) (lsp-ui-peek-find-custom "$ccls/vars" `(:kind ,kind))) - (defun ccls/base (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels))) - (defun ccls/derived (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels :derived t))) - (defun ccls/member (kind) (interactive) (lsp-ui-peek-find-custom "$ccls/member" `(:kind ,kind))) - - ;; References w/ Role::Role - (defun ccls/references-read () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 8))) - - ;; References w/ Role::Write - (defun ccls/references-write () - (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 16))) - - ;; References w/ Role::Dynamic bit (macro expansions) - (defun ccls/references-macro () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 64))) - - ;; References w/o Role::Call bit (e.g. where functions are taken addresses) - (defun ccls/references-not-call () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :excludeRole 32))) - - ;; ccls/vars ccls/base ccls/derived ccls/members have a parameter while others are interactive. - ;; (ccls/base 1) direct bases - ;; (ccls/derived 1) direct derived - ;; (ccls/member 2) => 2 (Type) => nested classes / types in a namespace - ;; (ccls/member 3) => 3 (Func) => member functions / functions in a namespace - ;; (ccls/member 0) => member variables / variables in a namespace - ;; (ccls/vars 1) => field - ;; (ccls/vars 2) => local variable - ;; (ccls/vars 3) => field or local variable. 3 = 1 | 2 - ;; (ccls/vars 4) => parameter - - ;; References whose filenames are under this project - (setq ccls-sem-highlight-method 'overlay) - (ccls-use-default-rainbow-sem-highlight) + (require 'lsp-clangd) + + ;; (setq ccls-executable "ccls") + + ;; (defun ccls/callee () (interactive) (lsp-ui-peek-find-custom "$ccls/call" '(:callee t))) + ;; (defun ccls/caller () (interactive) (lsp-ui-peek-find-custom "$ccls/call")) + ;; (defun ccls/vars (kind) (lsp-ui-peek-find-custom "$ccls/vars" `(:kind ,kind))) + ;; (defun ccls/base (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels))) + ;; (defun ccls/derived (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels :derived t))) + ;; (defun ccls/member (kind) (interactive) (lsp-ui-peek-find-custom "$ccls/member" `(:kind ,kind))) + + ;; ;; References w/ Role::Role + ;; (defun ccls/references-read () (interactive) + ;; (lsp-ui-peek-find-custom "textDocument/references" + ;; (plist-put (lsp--text-document-position-params) :role 8))) + + ;; ;; References w/ Role::Write + ;; (defun ccls/references-write () + ;; (interactive) + ;; (lsp-ui-peek-find-custom "textDocument/references" + ;; (plist-put (lsp--text-document-position-params) :role 16))) + + ;; ;; References w/ Role::Dynamic bit (macro expansions) + ;; (defun ccls/references-macro () (interactive) + ;; (lsp-ui-peek-find-custom "textDocument/references" + ;; (plist-put (lsp--text-document-position-params) :role 64))) + + ;; ;; References w/o Role::Call bit (e.g. where functions are taken addresses) + ;; (defun ccls/references-not-call () (interactive) + ;; (lsp-ui-peek-find-custom "textDocument/references" + ;; (plist-put (lsp--text-document-position-params) :excludeRole 32))) + + ;; ;; ccls/vars ccls/base ccls/derived ccls/members have a parameter while others are interactive. + ;; ;; (ccls/base 1) direct bases + ;; ;; (ccls/derived 1) direct derived + ;; ;; (ccls/member 2) => 2 (Type) => nested classes / types in a namespace + ;; ;; (ccls/member 3) => 3 (Func) => member functions / functions in a namespace + ;; ;; (ccls/member 0) => member variables / variables in a namespace + ;; ;; (ccls/vars 1) => field + ;; ;; (ccls/vars 2) => local variable + ;; ;; (ccls/vars 3) => field or local variable. 3 = 1 | 2 + ;; ;; (ccls/vars 4) => parameter + + ;; ;; References whose filenames are under this project + ;; (setq ccls-sem-highlight-method 'overlay) + ;; (ccls-use-default-rainbow-sem-highlight) #+END_SRC *** diff-hl diff --git a/.local/bin/fathddmnt b/.local/bin/fathddmnt deleted file mode 100755 index 62bfff6..0000000 --- a/.local/bin/fathddmnt +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -e - -if ! diskinfo da0 >/dev/null; then - notify-send -u critical 'fathdd' ' HDD not detected' - exit 1 -fi -if mount | grep -F /dev/da0p1; then - notify-send -u critical \ - 'fathdd' \ - " HDD already mounted to \ -<b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>" - exit 1 -fi -if ! dmenu -p 'Enter password: ' -P | - geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then - notify-send -u critical 'fathdd' ' Failed to mount HDD' - exit 1 -fi -mkdir -p "$HOME"/hdd -mount /dev/da0p1.eli "$HOME"/hdd -notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>' diff --git a/.local/bin/fathddumnt b/.local/bin/fathddumnt deleted file mode 100755 index 4a883f7..0000000 --- a/.local/bin/fathddumnt +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -e - -if ! mount | grep -F /dev/da0p1; then - notify-send -u critical 'fathdd' ' HDD not mounted' - exit 1 -fi -if ! umount /dev/da0p1.eli; then - notify-send -u critical 'fathdd' ' Failed to dismount HDD' - exit 1 -fi -geli detach da0p1.eli -rmdir "$HOME"/hdd -notify-send -t 5000 'fathdd' ' HDD dismounted from <b>~/hdd</b>' diff --git a/.local/bin/hddmnt b/.local/bin/hddmnt index 242f4d0..62bfff6 100755 --- a/.local/bin/hddmnt +++ b/.local/bin/hddmnt @@ -1,8 +1,21 @@ #!/bin/sh -e -tmp=$(mktemp) - -dmenu -p "Enter password: " -nb '#1d2021' -nf '#1d2021' <&- >"$tmp" -geli attach -k /root/geli_keys/hdd_ext.key -j "$tmp" /dev/da0 +if ! diskinfo da0 >/dev/null; then + notify-send -u critical 'fathdd' ' HDD not detected' + exit 1 +fi +if mount | grep -F /dev/da0p1; then + notify-send -u critical \ + 'fathdd' \ + " HDD already mounted to \ +<b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>" + exit 1 +fi +if ! dmenu -p 'Enter password: ' -P | + geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then + notify-send -u critical 'fathdd' ' Failed to mount HDD' + exit 1 +fi mkdir -p "$HOME"/hdd -mount /dev/da0.eli "$HOME"/hdd +mount /dev/da0p1.eli "$HOME"/hdd +notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>' diff --git a/.local/bin/hddumnt b/.local/bin/hddumnt index d81d969..4a883f7 100755 --- a/.local/bin/hddumnt +++ b/.local/bin/hddumnt @@ -1,5 +1,13 @@ #!/bin/sh -e -umount /dev/da0.eli -geli detach da0.eli +if ! mount | grep -F /dev/da0p1; then + notify-send -u critical 'fathdd' ' HDD not mounted' + exit 1 +fi +if ! umount /dev/da0p1.eli; then + notify-send -u critical 'fathdd' ' Failed to dismount HDD' + exit 1 +fi +geli detach da0p1.eli rmdir "$HOME"/hdd +notify-send -t 5000 'fathdd' ' HDD dismounted from <b>~/hdd</b>' |