diff --git a/fnl/bepo.fnl b/fnl/bepo.fnl index 0a41e96..997c681 100644 --- a/fnl/bepo.fnl +++ b/fnl/bepo.fnl @@ -15,6 +15,11 @@ ;; ;; Credit: Inspired by https://github.com/michamos/vim-bepo by Micha Moskovic +(fn map-cmd-insert [key target] + "For insert and command mode" + (vim.api.nvim_set_keymap "" key target {:noremap true}) + nil) + (fn map-text-object [key target] "For text-objects mappings" (vim.api.nvim_set_keymap :o key target {:noremap true}) @@ -44,6 +49,7 @@ (fn fun-to-mods [fun] "Converts a function to the modes it sets mappings for" (match (tostring fun) + :map-cmd-insert :ic :map-text-object :ox :map-visual :x :map-normal :n @@ -107,6 +113,8 @@ (map-text-object "aÉ" :aW) ;; idem pour [iw] et [ié] (map-text-object "ié" :iw) ;; idem pour [iW] et [iÉ] (map-text-object "iÉ" :iW)) + ;; Pareil pour en mode insertion et commande + (map-cmd-insert "" "") (𝛅 mapping-window [] "[w] est libre pour faire , grâce à easy_access" (map-normal :w :) ;; et [w] pour faire diff --git a/lua/bepo.lua b/lua/bepo.lua index 021f77b..b3891bb 100644 --- a/lua/bepo.lua +++ b/lua/bepo.lua @@ -1,3 +1,7 @@ +local function map_cmd_insert(key, target) + vim.api.nvim_set_keymap("", key, target, {noremap = true}) + return nil +end local function map_text_object(key, target) vim.api.nvim_set_keymap("o", key, target, {noremap = true}) vim.api.nvim_set_keymap("x", key, target, {noremap = true}) @@ -60,6 +64,7 @@ local function mapping_easy_access() map_text_object("i\195\169", "iw") return map_text_object("i\195\137", "iW") end +map_cmd_insert("", "") local function mapping_window() map_normal("w", "") map_normal("W", "")