mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 19:08:09 +01:00
define keymap for show screen as a dictionary
This commit is contained in:
parent
f8c4b93840
commit
b0a0016416
1 changed files with 16 additions and 7 deletions
|
@ -57,11 +57,20 @@ let s:notmuch_show_headers_defaults = [
|
||||||
|
|
||||||
" --- keyboard mapping definitions {{{1
|
" --- keyboard mapping definitions {{{1
|
||||||
|
|
||||||
|
" --- --- bindings for search screen {{{2
|
||||||
let g:notmuch_search_maps = {
|
let g:notmuch_search_maps = {
|
||||||
\ '<Enter>': ':call <SID>NM_search_display()<CR>',
|
\ '<Enter>': ':call <SID>NM_search_display()<CR>',
|
||||||
\ 's': ':call <SID>NM_cmd_search(split(input(''NotMuch Search:'')))<CR>',
|
\ 's': ':call <SID>NM_cmd_search(split(input(''NotMuch Search:'')))<CR>',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
" --- --- bindings for show screen {{{2
|
||||||
|
let g:notmuch_show_maps = {
|
||||||
|
\ 'q': ':call <SID>NM_cmd_show_quit()<CR>',
|
||||||
|
\ '<C-N>': ':call <SID>NM_cmd_show_next()<CR>',
|
||||||
|
\ 'c': ':call <SID>NM_cmd_show_fold_toggle(''c'', ''cit'', !g:notmuch_show_fold_citations)<CR>',
|
||||||
|
\ 's': ':call <SID>NM_cmd_show_fold_toggle(''s'', ''sig'', !g:notmuch_show_fold_signatures)<CR>',
|
||||||
|
\ }
|
||||||
|
|
||||||
" --- implement search screen {{{1
|
" --- implement search screen {{{1
|
||||||
|
|
||||||
function! s:NM_cmd_search(words)
|
function! s:NM_cmd_search(words)
|
||||||
|
@ -112,14 +121,15 @@ function! s:NM_cmd_show(words)
|
||||||
|
|
||||||
call s:NM_cmd_show_mkfolds()
|
call s:NM_cmd_show_mkfolds()
|
||||||
call s:NM_cmd_show_mksyntax()
|
call s:NM_cmd_show_mksyntax()
|
||||||
|
call <SID>NM_set_map(g:notmuch_show_maps)
|
||||||
setlocal foldtext=NM_cmd_show_foldtext()
|
setlocal foldtext=NM_cmd_show_foldtext()
|
||||||
setlocal fillchars=
|
setlocal fillchars=
|
||||||
setlocal foldcolumn=6
|
setlocal foldcolumn=6
|
||||||
|
|
||||||
exec printf("nnoremap <buffer> q :b %d<CR>", b:nm_prev_bufnr)
|
endfunction
|
||||||
nnoremap <buffer> <C-N> :call <SID>NM_cmd_show_next()<CR>
|
|
||||||
nnoremap <buffer> c :call <SID>NM_cmd_show_fold_toggle('c', 'cit', !g:notmuch_show_fold_citations)<CR>
|
function! s:NM_cmd_show_quit()
|
||||||
nnoremap <buffer> s :call <SID>NM_cmd_show_fold_toggle('s', 'sig', !g:notmuch_show_fold_signatures)<CR>
|
exec printf(":buffer %d", b:nm_prev_bufnr)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:NM_cmd_show_next()
|
function! s:NM_cmd_show_next()
|
||||||
|
@ -407,7 +417,6 @@ function! NM_set_defaults(force)
|
||||||
\ a:force, key, string(dflt))
|
\ a:force, key, string(dflt))
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
echoe cmd
|
|
||||||
exec cmd
|
exec cmd
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in a new issue