From 174a736ced0ebe5e0df6ffb6b42fa5db637cd061 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 21 Sep 2022 09:18:52 +0700 Subject: [PATCH] NNN alias, emacs go, GOPATH --- .config/fish/fish_variables | 1 + .config/fish/functions/n.fish | 37 +++++++++++++++++++++++++++++++++++ .config/kitty/kitty.conf | 4 ++-- .emacs.bankruptcy/init.org | 24 +++++++++++++++++++++-- .ideavimrc | 1 - 5 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 .config/fish/functions/n.fish diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index eb8b590..2739229 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -1,6 +1,7 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 SETUVAR EDITOR:hx +SETUVAR --export --path GOPATH:/home/joe/\x2elocal/share/go/ SETUVAR --export LC_COLLATE:C SETUVAR --export NNN_FIFO:/tmp/nnn\x2efifo SETUVAR --export VISUAL:hx diff --git a/.config/fish/functions/n.fish b/.config/fish/functions/n.fish new file mode 100644 index 0000000..204d800 --- /dev/null +++ b/.config/fish/functions/n.fish @@ -0,0 +1,37 @@ +# Rename this file to match the name of the function +# e.g. ~/.config/fish/functions/n.fish +# or, add the lines to the 'config.fish' file. + +function n --wraps nnn --description 'support nnn quit and change directory' + # Block nesting of nnn in subshells + if test -n "$NNNLVL" -a "$NNNLVL" -ge 1 + echo "nnn is already running" + return + end + + # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set) + # If NNN_TMPFILE is set to a custom path, it must be exported for nnn to + # see. To cd on quit only on ^G, remove the "-x" from both lines below, + # without changing the paths. + if test -n "$XDG_CONFIG_HOME" + set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + else + set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" + end + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + # The command function allows one to alias this function to `nnn` without + # making an infinitely recursive alias + set -x NNN_PLUG 'p:preview-tui' + command nnn -ed -P p $argv + + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end +end diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index c9e28c9..67f17a8 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -2,8 +2,8 @@ include /home/joe/.config/kitty/theme.conf font_size 13.0 -adjust_line_height 5 -adjust_column_width 1 +adjust_line_height 4 +adjust_column_width 0 window_resize_step_cells 3 window_resize_step_lines 3 diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index c795c6b..1e09662 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -707,7 +707,10 @@ targets." (add-hook 'shell-mode (lambda () (setq-local global-hl-line-mode nil))) (setq shell-kill-buffer-on-exit t) -(add-hook 'vterm-mode-hook (lambda () (setq-local global-hl-line-mode nil))) +(add-hook 'vterm-mode-hook (lambda () + (define-key vterm-mode-map (kbd "C-c C-x") #'vterm-send-C-x) + (setq-local global-hl-line-mode nil))) + #+end_src We need this require so we can call `vterm--internal in the joe/vterm-here function, but that slows @@ -864,7 +867,7 @@ Emacs is an great operating system, if only it had a good text editor... (meow-global-mode t) #+end_src *** Boon -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (straight-use-package 'boon) (require 'boon-qwerty) (boon-mode) @@ -877,10 +880,20 @@ Emacs is an great operating system, if only it had a good text editor... (define-key boon-moves-map ";" '("hop" . avy-goto-word-1)) (define-key boon-command-map (kbd "C-k") 'scroll-down-line) (define-key boon-command-map (kbd "C-j") 'scroll-up-line) +(define-key boon-command-map (kbd "C-d") 'joe/smooth-scroll-half-page-down) +(define-key boon-command-map (kbd "C-u") 'joe/smooth-scroll-half-page-up) (define-key boon-moves-map "H" 'backward-paragraph) (define-key boon-moves-map "L" 'forward-paragraph) (define-key boon-moves-map "K" 'boon-smarter-upward) (define-key boon-moves-map "J" 'boon-smarter-downward) + +#+end_src + +Because boon provides the x mode map, emacs bindings that keep tempo no longer do, so reverse them + +#+begin_src emacs-lisp +(global-set-key (kbd "C-x s") 'save-buffer) +(global-set-key (kbd "C-x C-s") 'save-some-buffers) #+end_src *** Kakoune.el @@ -929,6 +942,7 @@ Emacs is an great operating system, if only it had a good text editor... (straight-use-package 'lsp-mode) (setq lsp-keymap-prefix "C-c c") +(lsp-enable-which-key-integration t) ;; (require 'lsp) ;; (straight-use-package 'eglot) @@ -1046,6 +1060,12 @@ it doesn't close it. (global-set-key (kbd "C-c e n") #'flymake-goto-next-error) (global-set-key (kbd "C-c e p") #'flymake-goto-prev-error) +#+end_src +*** Go + +#+begin_src emacs-lisp +(straight-use-package 'go-mode) +;; (straight-use-package 'go-imports) #+end_src ** Magit diff --git a/.ideavimrc b/.ideavimrc index 81b61e8..0f2b28c 100755 --- a/.ideavimrc +++ b/.ideavimrc @@ -32,7 +32,6 @@ set highlightedyank " vnoremap N :action FindPrevious " nnoremap * :action FindWordAtCaret " nnoremap # :action FindWordAtCaret -nnoremap nnoremap f :action FindInPath