update vim readme with new mappings and options

This commit is contained in:
Clément DOUIN
2021-05-08 22:26:15 +02:00
parent fada081115
commit ccfc3b0d6e
7 changed files with 80 additions and 24 deletions
+5 -1
View File
@@ -70,7 +70,11 @@ function! himalaya#mbox#pick(cb)
endtry
endfunction
function! himalaya#mbox#set(mbox)
function! himalaya#mbox#change()
call himalaya#mbox#pick("himalaya#mbox#_change")
endfunction
function! himalaya#mbox#_change(mbox)
let s:curr_mbox = a:mbox
let s:curr_page = 0
call himalaya#msg#list()
+10 -2
View File
@@ -147,7 +147,11 @@ function! himalaya#msg#forward()
endtry
endfunction
function! himalaya#msg#copy(target_mbox)
function! himalaya#msg#copy()
call himalaya#mbox#pick("himalaya#msg#_copy")
endfunction
function! himalaya#msg#_copy(target_mbox)
try
let pos = getpos(".")
let msg_id = stridx(bufname("%"), "Himalaya messages") == 0 ? s:get_focused_msg_id() : s:msg_id
@@ -162,7 +166,11 @@ function! himalaya#msg#copy(target_mbox)
endtry
endfunction
function! himalaya#msg#move(target_mbox)
function! himalaya#msg#move()
call himalaya#mbox#pick("himalaya#msg#_move")
endfunction
function! himalaya#msg#_move(target_mbox)
try
let msg_id = stridx(bufname("%"), "Himalaya messages") == 0 ? s:get_focused_msg_id() : s:msg_id
let choice = input(printf("Are you sure you want to move the message %d? (y/N) ", msg_id))
+1 -1
View File
@@ -2,7 +2,7 @@ function! himalaya#shared#bindings#define(bindings)
for [mode, key, name] in a:bindings
let plug = substitute(name, "[#_]", "-", "g")
let plug = printf("<plug>(himalaya-%s)", plug)
execute printf("%snoremap <silent>%s :call himalaya#%s<cr>", mode, plug, name)
execute printf("%snoremap <silent>%s :call himalaya#%s()<cr>", mode, plug, name)
if !hasmapto(plug, mode)
execute printf("%smap <nowait><buffer>%s %s", mode, key, plug)