fix: gé and gB mappings
This commit is contained in:
parent
5aff414d44
commit
b81af2dace
12
fnl/bepo.fnl
12
fnl/bepo.fnl
@ -13,6 +13,7 @@
|
||||
;; See the License for the specific language governing permissions and
|
||||
;; limitations under the License.
|
||||
;;
|
||||
;; Credit: Inspired by https://github.com/michamos/vim-bepo by Micha Moskovic
|
||||
|
||||
(fn map-text-object [key target]
|
||||
"For text-objects mappings"
|
||||
@ -28,7 +29,7 @@
|
||||
(vim.api.nvim_set_keymap :n key target {:noremap true})
|
||||
(map-text-object key target)))
|
||||
|
||||
(fn setup []
|
||||
(fn mapping-setup []
|
||||
;; Keys still free
|
||||
;; , and ; as they may be used as leaders
|
||||
;; à and À
|
||||
@ -73,9 +74,9 @@
|
||||
;; le couple [gb]/[gé] agit sur les tabs
|
||||
(map-all "gé" :gt)
|
||||
;; le couple [gb]/[gé] agit sur les tabs
|
||||
(map-all :gB ":execute " silent! tabfirst :<CR>)
|
||||
(map-all :gB ":execute \"silent! tabfirst\"<CR>")
|
||||
;; [gB] va au premier tab
|
||||
(map-all "gÉ" ":execute " silent! tablast "<CR> ")
|
||||
(map-all "gÉ" ":execute \"silent! tablast\"<CR>")
|
||||
;; [gÉ] au dernier
|
||||
(map-all :gT "<C-]>")
|
||||
;; [gT] est libéré et peut agir sur les tags
|
||||
@ -131,5 +132,10 @@
|
||||
;; déplace sur un nouveau tab
|
||||
)
|
||||
|
||||
(fn setup []
|
||||
(when (= vim.g.loaded_bepo_nvim nil)
|
||||
(mapping-setup)
|
||||
(set vim.g.loaded_bepo_nvim 1)))
|
||||
|
||||
{: setup}
|
||||
|
||||
|
15
lua/bepo.lua
15
lua/bepo.lua
@ -14,7 +14,7 @@ local function map_all(key, target)
|
||||
return map_text_object(key, target)
|
||||
end
|
||||
end
|
||||
local function setup()
|
||||
local function mapping_setup()
|
||||
map_all("c", "h")
|
||||
map_all("t", "j")
|
||||
map_all("s", "k")
|
||||
@ -35,8 +35,8 @@ local function setup()
|
||||
map_all("K", "S")
|
||||
map_all("gb", "gT")
|
||||
map_all("g\195\169", "gt")
|
||||
map_all("gB", ":execute ", __fnl_global__silent_21, tabfirst, "<CR>")
|
||||
map_all("g\195\137", ":execute ", __fnl_global__silent_21, tablast, "<CR> ")
|
||||
map_all("gB", ":execute \"silent! tabfirst\"<CR>")
|
||||
map_all("g\195\137", ":execute \"silent! tablast\"<CR>")
|
||||
map_all("gT", "<C-]>")
|
||||
map_all("\194\171", "<")
|
||||
map_all("\194\187", ">")
|
||||
@ -62,4 +62,13 @@ local function setup()
|
||||
map_all("w\195\169", "<C-w>t")
|
||||
return map_all("w\195\137", "<C-w>T")
|
||||
end
|
||||
local function setup()
|
||||
if (vim.g.loaded_bepo_nvim == nil) then
|
||||
mapping_setup()
|
||||
vim.g.loaded_bepo_nvim = 1
|
||||
return nil
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
return {setup = setup}
|
||||
|
Loading…
x
Reference in New Issue
Block a user