Skip to content

Commit

Permalink
refactor: use keytrans instead of substitute
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 30, 2023
1 parent 130d67b commit 6e6e2e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions k.vim
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ function! k#initialize(opts = {}) abort
let s:map_cmds = []
for key in s:keymap_dict->keys()
let k = keytrans(key)
let k_lt = substitute(k, '<', '<lt>', 'g')
call add(s:map_cmds, [k, $"inoremap {k} <cmd>call k#ins('{k_lt}')<cr>"])
call add(s:map_cmds, [k, $"inoremap {k} <cmd>call k#ins('{keytrans(k)}')<cr>"])
endfor
for k in shift_key_list
call add(s:map_cmds, [k, $"inoremap {k} <cmd>call k#ins('{tolower(k)}',1)<cr>"])
Expand Down

0 comments on commit 6e6e2e8

Please sign in to comment.