feat: add <C-é> mapping for <C-w>
<C-é> is much more acessible.
This commit is contained in:
parent
efce15ecd4
commit
354a6b5ea5
@ -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 <C-w> en mode insertion et commande
|
||||
(map-cmd-insert "<C-é>" "<C-w>")
|
||||
|
||||
(𝛅 mapping-window [] "[w] est libre pour faire <C-w>, grâce à easy_access"
|
||||
(map-normal :w :<C-w>) ;; et [w] pour faire <C-w><C-w>
|
||||
|
5
lua/bepo.lua
generated
5
lua/bepo.lua
generated
@ -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("<C-\195\169>", "<C-w>")
|
||||
local function mapping_window()
|
||||
map_normal("w", "<C-w>")
|
||||
map_normal("W", "<C-w><C-w>")
|
||||
|
Loading…
x
Reference in New Issue
Block a user