On 04/01/10 11:22, Horacio Sanson wrote:
> Is it possible to create Vim fold like keybindings to expand/collapse threads in
> mutt?
>
> Example:
>    zo  -   expand thread under the cursor
>    zO  -   expand thread under the cursor and all subthreads recursively
>    zc  -   close thread under the cursor
>    zC  -   close thread under the cursor and all subthreads recursively
>    za  -   toggle thread under the cursor
>    zA  -   toggle thread under the cursor and all subthreads recursively
>
> Being used to vim keybindings using ESC-v is rather uncomfortable for me.
>

Here is a list of bindings and macros I use to simulate vim. Any suggestion to enhance it is welcome ;)

#------------------------------------------------------------------------
#  Moving
#------------------------------------------------------------------------

bind generic <home>  first-entry
bind pager   <home>   top

bind generic <end>   last-entry
bind pager   <end>    bottom

bind index   <up>     previous-entry
bind index   <down>   next-entry

bind pager   <up>     previous-line
bind pager   <down>   next-line

bind index j            next-undeleted
bind pager j            next-undeleted

bind index k            previous-undeleted
bind pager k            previous-undeleted

bind index J            next-new-then-unread
bind pager J            next-new-then-unread

bind index K            previous-new-then-unread
bind pager K            previous-new-then-unread

bind index   '('      previous-subthread
bind pager   '('      previous-subthread

bind index   ')'      next-subthread
bind pager   ')'      next-subthread

bind index   '{'      previous-thread
bind pager   '{'      previous-thread

bind index   '}'      next-thread
bind pager   '}'      next-thread

bind index   '['      half-up
bind pager   '['      half-up

bind index   ']'      half-down
bind pager   ']'      half-down

bind pager   <left>   previous-entry
bind pager   <right>  next-entry

#------------------------------------------------------------------------
#  Sidebar (mutt patched)
#------------------------------------------------------------------------

# ctrl - n, p, o, u, d

bind pager '' sidebar-next
bind index '' sidebar-next

bind pager '' sidebar-prev
bind index '' sidebar-prev

bind pager '' sidebar-open
bind index '' sidebar-open

bind pager '' sidebar-scroll-up
bind index '' sidebar-scroll-up

bind pager '' sidebar-scroll-down
bind index '' sidebar-scroll-down

#------------------------------------------------------------------------
#  Move, Copy, Delete mails
#------------------------------------------------------------------------

bind pager 's' save-message
bind index 's' save-message

bind pager 'S' copy-message
bind index 'S' copy-message

bind index 'd' delete-message
bind pager 'd' delete-message

bind index 'u' undelete-message
bind pager 'u' undelete-message

bind index 'D' delete-thread
bind pager 'D' delete-thread

bind index 'U' undelete-thread
bind pager 'U' undelete-thread

#------------------------------------------------------------------------
#  Display
#------------------------------------------------------------------------

# Headers
# ------------------------------------

bind pager   'h'      display-toggle-weed

#------------------------------------------------------------------------
#  Selections
#------------------------------------------------------------------------

bind index v            tag-thread
bind index V            tag-pattern
bind index             untag-pattern

#------------------------------------------------------------------------
#  Lists
#------------------------------------------------------------------------

macro index za '<esc>v'
macro pager za '<esc>v'

macro index zr '<esc>V'
macro pager zr '<esc>V'

macro index zm '<esc>V'
macro pager zm '<esc>V'

#------------------------------------------------------------------------
#  Attachments
#------------------------------------------------------------------------

macro attach V '|view -<enter>'

Reply via email to