bind left left
bind right right
bind up up
bind down down
bind home bol
bind end eol
bind pgup pgup
bind pgdown pgdown
bind delete delete

bind C-left 'word-bwd -s'
bind C-right 'word-fwd -s'
bind C-up up
bind C-down down
bind M-left bol
bind M-right eol
bind M-up pgup
bind M-down pgdown
bind M-delete 'delete-word -s'
bind M-C-delete 'delete-line'

bind S-left 'left -c'
bind S-right 'right -c'
bind S-up 'up -c'
bind S-down 'down -c'
bind S-home 'bol -c'
bind S-end 'eol -c'
bind S-pgup 'pgup -c'
bind S-pgdown 'pgdown -c'

bind C-S-left 'word-bwd -cs'
bind C-S-right 'word-fwd -cs'
bind C-S-up 'up -l'
bind C-S-down 'down -l'
bind C-S-pgup 'pgup -l'
bind C-S-pgdown 'pgdown -l'
bind C-S-delete 'delete-eol'

bind M-S-left 'bol -c'
bind M-S-right 'eol -c'
bind M-S-up 'pgup -c'
bind M-S-down 'pgdown -c'
bind M-S-delete 'delete-eol'

bind C-M-S-left 'bol -c'
bind C-M-S-right 'eol -c'
bind C-M-S-up 'pgup -l'
bind C-M-S-down 'pgdown -l'
bind C-M-S-pgup 'pgup -l'
bind C-M-S-pgdown 'pgdown -l'
bind C-M-S-delete 'delete-eol'

# Either Ctrl+H or Ctrl+? may be equivalent to Backspace, depending
# on the terminal, so they're both bound to "erase" by default for
# portability. On some terminals one may be equivalent to Backspace
# and the other Ctrl+Backspace.
bind C-h erase
bind C-? erase
bind M-C-h 'erase-word -s'
bind M-C-? 'erase-word -s'

bind C-c 'copy -k'
bind C-f search
bind C-g 'search -n'
# C-i == Tab
bind C-l 'command line\ '
# C-m == Enter
bind C-n open
bind C-o 'command open\ '
bind C-q 'quit -p'
bind C-r 'command replace\ '
bind C-s 'save -p'
bind C-t open
bind C-v 'paste -a'
bind C-w 'close -pwq'
bind C-x cut
bind C-y redo
bind C-z undo
bind C-] tag
bind C-[ unselect

bind M-b bof
bind M-c 'toggle -v case-sensitive-search'
bind M-e eof
bind M-f 'search -w'
bind M-S-f 'search -wr'
bind M-j wrap-paragraph
bind M-n 'msg -n'
bind M-p 'msg -p'
bind M-t 'insert -m "\t"'
bind M-x command
bind M-z suspend

bind M-1 'view 1'
bind M-2 'view 2'
bind M-3 'view 3'
bind M-4 'view 4'
bind M-5 'view 5'
bind M-6 'view 6'
bind M-7 'view 7'
bind M-8 'view 8'
bind M-9 'view 9'
bind M-0 'view last'

bind M-, prev
bind M-. next
bind M-- 'shift -- -1'
bind M-= 'shift +1'
bind M-\; command
bind M-/ search

bind M-< wprev
bind M-> wnext
bind M-: command
bind M-? 'search -r'
bind M-! 'move-tab left'
bind M-@ 'move-tab right'

bind M-S-, wprev
bind M-S-. wnext
bind M-S-\; command
bind M-S-/ 'search -r'
bind M-S-1 'move-tab left'
bind M-S-2 'move-tab right'

bind F1 'run man dterc'
bind F3 'search -n'
bind F4 'search -p'
bind F5 refresh

# Most terminals don't support sending these modifier+key combinations
# as distinct sequences, so don't be surprised if they don't work.
bind C-tab next
bind C-S-tab prev

# Command/search mode bindings:
bind -cs left left
bind -cs right right
bind -cs up history-prev
bind -cs down history-next
bind -cs home bol
bind -cs end eol
bind -cs delete delete
bind -cs C-left word-bwd
bind -cs C-right word-fwd
bind -cs M-left bol
bind -cs M-right eol
bind -cs C-delete delete-word
bind -cs M-delete delete-word
bind -cs C-M-h erase-word
bind -cs C-M-? erase-word
bind -cs C-a bol
bind -cs C-b left
bind -cs C-c cancel
bind -cs C-d delete
bind -cs C-e eol
bind -cs C-f right
bind -cs C-g cancel
bind -cs C-h erase
bind -cs C-k delete-eol
bind -cs C-u erase-bol
bind -cs C-w erase-word
bind -cs C-? erase
bind -cs C-[ cancel
bind -cs M-b word-bwd
bind -cs M-d delete-word
bind -cs M-f word-fwd
bind -cs enter accept
bind -c tab complete-next
bind -c S-tab complete-prev
bind -s M-enter 'accept -e'
bind -s M-c 'toggle case-sensitive-search'
bind -s M-r direction
