diff options
author | Bart Trojanowski <bart@jukie.net> | 2009-11-22 00:10:27 -0500 |
---|---|---|
committer | Bart Trojanowski <bart@jukie.net> | 2009-11-25 00:48:54 -0500 |
commit | dda6b7eb1c5a75dc31595376212d0e30c5fd61ed (patch) | |
tree | 285aa5aa76df429225e9ae91ecc11918c5c2ebc7 /vim/plugin | |
parent | e67ad108c80424a1138e9d2eea37844977fc1eff (diff) |
vim: added searching for word under cursor with ^]
Diffstat (limited to 'vim/plugin')
-rw-r--r-- | vim/plugin/notmuch.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 7ba7f9c1..3bb9d363 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -91,6 +91,7 @@ let g:notmuch_folders_maps = { " --- --- bindings for search screen {{{2 let g:notmuch_search_maps = { \ '<Enter>': ':call <SID>NM_search_show_thread()<CR>', + \ '<C-]>': ':call <SID>NM_search_expand(''<cword>'')<CR>', \ 'a': ':call <SID>NM_search_archive_thread()<CR>', \ 'f': ':call <SID>NM_search_filter()<CR>', \ 'm': ':call <SID>NM_new_mail()<CR>', @@ -109,6 +110,7 @@ let g:notmuch_search_maps = { let g:notmuch_show_maps = { \ '<C-P>': ':call <SID>NM_show_previous(1)<CR>', \ '<C-N>': ':call <SID>NM_show_next(1)<CR>', + \ '<C-]>': ':call <SID>NM_search_expand(''<cword>'')<CR>', \ 'q': ':call <SID>NM_kill_this_buffer()<CR>', \ \ 'b': ':call <SID>NM_show_fold_toggle(''b'', ''bdy'', !g:notmuch_show_fold_bodies)<CR>', @@ -758,6 +760,15 @@ function! s:NM_kill_this_buffer() endif endfunction +function! s:NM_search_expand(arg) + let word = expand(a:arg) + let prev_bufnr = bufnr('%') + setlocal bufhidden=hide + call <SID>NM_cmd_search([word]) + setlocal bufhidden=delete + let b:nm_prev_bufnr = prev_bufnr +endfunction + function! s:NM_add_remove_tags(prefix, tags) let id = <SID>NM_search_find_thread_id() if id == '' |