summaryrefslogtreecommitdiff
path: root/fnl/config/window-picker.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-08 02:49:49 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-08 02:49:49 +0100
commit86fc163e549d78136855ac2b45e91ffb2f43affc (patch)
tree20fab78a2ff2635af5ac95f2b2a11d9d07ace0e1 /fnl/config/window-picker.fnl
parent0d7f782cb4e68cff000beb00e8ab64308a66f3f0 (diff)
Refactor config loading
Diffstat (limited to 'fnl/config/window-picker.fnl')
-rw-r--r--fnl/config/window-picker.fnl29
1 files changed, 16 insertions, 13 deletions
diff --git a/fnl/config/window-picker.fnl b/fnl/config/window-picker.fnl
index c055fb9..d03d9e9 100644
--- a/fnl/config/window-picker.fnl
+++ b/fnl/config/window-picker.fnl
@@ -1,17 +1,20 @@
;; Trim whitespaces on save.
-(module config.window-picker {autoload {util config.util nvim aniseed.nvim}})
-(def- opts {:other_win_hl_color "#171717"
- :fg_color "#E1E1E1"
- :selection_chars :MNEIOARSTG})
+(local opts {:other_win_hl_color "#171717"
+ :fg_color "#E1E1E1"
+ :selection_chars :MNEIOARSTG})
-(util.setup :window-picker opts)
+(fn pick-window []
+ (let [window-picker (require :window-picker)]
+ (let [win (window-picker.pick_window)]
+ (if (not= win nil)
+ (nvim.set_current_win win)))))
-(defn- pick-window []
- (let [window-picker (require :window-picker)]
- (let [win (window-picker.pick_window)]
- (if (not= win nil)
- (nvim.set_current_win win)))))
-
-(vim.keymap.set :n :<C-s> (fn []
- (pick-window)) {})
+{1 :s1n7ax/nvim-window-picker
+ :event :BufReadPost
+ :config (fn []
+ (let [window-picker (require :window-picker)]
+ (window-picker.setup opts)
+ (vim.keymap.set :n :<C-s>
+ (fn []
+ (pick-window)) {})))}