From d56fb1ab6e76a23817c6836249edd44cf6252554 Mon Sep 17 00:00:00 2001 From: amelia squires Date: Tue, 4 Mar 2025 03:04:24 -0600 Subject: settings + bar --- fnl/plugins/which_key.fnl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'fnl/plugins/which_key.fnl') diff --git a/fnl/plugins/which_key.fnl b/fnl/plugins/which_key.fnl index 16b10a1..643dfa3 100644 --- a/fnl/plugins/which_key.fnl +++ b/fnl/plugins/which_key.fnl @@ -6,6 +6,12 @@ (macro gmap [k group] {1 (.. " " k) :group group}) +(fn swap-layout [new] + (_G.loaded.edgy.goto_main) + (when (not= _G.current_layout "") ((. (require (.. :layouts. _G.current_layout)) :disable))) + (when (not= new "") ((. (require (.. :layouts. new)) :enable))) + (tset _G :current_layout new)) + (local mappings [ ;;common (wmap :f "Neotree toggle" "fs") @@ -28,8 +34,11 @@ ;;layouts (gmap :l "layout") - (wmap :li (require :layouts.ide) "ide") - (wmap :lq (require :layouts.quiet) "quiet") + (wmap :li (fn [] (swap-layout :ide)) "ide") + (wmap :lq (fn [] (swap-layout :quiet)) "quiet") + (wmap :lw (fn [] (swap-layout :writing)) "writing") + (wmap :lx (fn [] (swap-layout "")) "none") + ;;visual (gmap :v "visual") @@ -40,9 +49,14 @@ (gmap :q "quick") (wmap :qs "\"+y" "system grab") (wmap :ql "0v$" "line") + (wmap :qw "^v$" "line w/out whitespace") + (wmap :qa "0ggvG$" "select all") (wmap :qr "SnipRun" "run highlighted") (wmap :qf "RunFile" "run file") (wmap :qe "RunCode" "run code") + (wmap :qt (fn [] + (if _G._trans_ (_G.opt.trans-disable) + (_G.opt.trans-enable)) ) "toggle trans") ]) (tset mappings :mode [:n :v]) -- cgit v1.2.3