Skip to content

Commit

Permalink
refactor: change k#toggle to cmd-call
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 22, 2023
1 parent 9a495f8 commit 2d75312
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions k.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endfunction

function! k#enable() abort
if s:is_enable
return ''
return
endif

let s:keys_to_remaps = []
Expand All @@ -49,16 +49,14 @@ function! k#enable() abort
endif
endfor


call s:set_inner_mode('hira')
let s:is_enable = v:true
return ''
endfunction

function! k#disable() abort
call inline_mark#clear()
if !s:is_enable
return ''
return
endif

for m in s:keys_to_remaps
Expand All @@ -72,7 +70,6 @@ function! k#disable() abort
let s:keys_to_unmaps = []

let s:is_enable = v:false
return ''
endfunction

function! k#toggle() abort
Expand Down Expand Up @@ -400,5 +397,5 @@ function! k#cmd_buf() abort
endfunction

cnoremap <c-j> <cmd>call k#cmd_buf()<cr>
inoremap <expr> <c-j> k#toggle()
inoremap <c-j> <cmd>call k#toggle()<cr>
call k#initialize()

0 comments on commit 2d75312

Please sign in to comment.