summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-04 15:39:18 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-04 15:39:18 +0100
commit4872151a219b66aa2ff67bf2eacddfaae7379ddc (patch)
tree68a2a03cd2215d29c1ca87421c71e27ab075fc0f /fnl
parent158e488e9cbfb166c89321dda4f0fc962f0ab205 (diff)
Move window picker keymap
Diffstat (limited to 'fnl')
-rw-r--r--fnl/config/which-key.fnl11
-rw-r--r--fnl/config/window-picker.fnl11
-rw-r--r--fnl/settings/keymaps.fnl1
3 files changed, 11 insertions, 12 deletions
diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 310f7c4..8a8c72d 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -1,5 +1,5 @@
;; Which-key provides a pop-up meny for some key mappings.
-(module config.which-key {autoload {util config.util nvim aniseed.nvim}})
+(module config.which-key {autoload {util config.util}})
(def- setup {:plugins {:marks true
:registers true
@@ -135,12 +135,6 @@
(def- treesitter
{:name :Treesitter :p [:<cmd>TSPlaygroundToggle<cr> :Playground]})
-(defn- switch-window []
- (let [window-picker (require :window-picker)]
- (let [win (window-picker.pick_window)]
- (if (not= win nil)
- (nvim.set_current_win win)))))
-
(def- nmappings {:a ["<cmd>Telescope lsp_document_symbols theme=dropdown<cr>"
"Document Symbols"]
:T treesitter
@@ -152,9 +146,6 @@
:l lsp
:n [:<cmd>CommentNormal<CR> :Comment]
:r replace
- :s [(fn []
- (switch-window))
- "Switch window"]
:t [:<cmd>ToggleTerm<cr> :Terminal]
:u [:<cmd>UndotreeToggle<cr> :Undotree]
:y lazy
diff --git a/fnl/config/window-picker.fnl b/fnl/config/window-picker.fnl
index 76a11f5..c055fb9 100644
--- a/fnl/config/window-picker.fnl
+++ b/fnl/config/window-picker.fnl
@@ -1,8 +1,17 @@
;; Trim whitespaces on save.
-(module config.window-picker {autoload {util config.util}})
+(module config.window-picker {autoload {util config.util nvim aniseed.nvim}})
(def- opts {:other_win_hl_color "#171717"
:fg_color "#E1E1E1"
:selection_chars :MNEIOARSTG})
(util.setup :window-picker opts)
+
+(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)) {})
diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl
index f7c06e4..064084c 100644
--- a/fnl/settings/keymaps.fnl
+++ b/fnl/settings/keymaps.fnl
@@ -40,7 +40,6 @@
;; Splits
(map :n :<m-s> :<cmd>split<CR> opts)
(map :n :<m-t> :<cmd>vsplit<CR> opts)
-(map :n :<C-s> :<cmd>split<CR> opts)
;; Nav
(map :n :<m-m> :<cmd>bprev<CR> opts)