
# Use powerline
USE_POWERLINE="true"
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
fi

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd beep extendedglob nomatch
unsetopt notify

bindkey -v
export KEYTIMEOUT=1





# vi mode
# Change cursor shape for different vi modes.
function zle-keymap-select {
  if [[ ${KEYMAP} == vicmd ]] ||
     [[ $1 = 'block' ]]; then
    echo -ne '\e[1 q'
  elif [[ ${KEYMAP} == main ]] ||
       [[ ${KEYMAP} == viins ]] ||
       [[ ${KEYMAP} = '' ]] ||
       [[ $1 = 'beam' ]]; then
    echo -ne '\e[5 q'
  fi
}
zle -N zle-keymap-select
zle-line-init() {
    zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
    echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.










# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall


#normal mode
##################
# Basic Movement #
##################
#	backward-char (^B ESC-[D) (unbound) (unbound)
#		Move backward one character.
#bindkey	-M	vicmd	''	
#	vi-backward-char (unbound) (^H h ^?) (ESC-[D)
#		Move backward one character, without changing lines.
bindkey	-M	vicmd	'n'	vi-backward-char
bindkey	-M	vicmd	'^[n'	vi-backward-char
bindkey	-M	visual	'n'	vi-backward-char
bindkey	-M	viins	'^[[D'	vi-backward-char
bindkey	-M	viins	'^[[D'	vi-cmd-mode


#	forward-char (^F ESC-[C) (unbound) (unbound)
#		Move forward one character.
#bindkey	-M	vicmd	''	
#	vi-forward-char (unbound) (space l) (ESC-[C)
#		Move forward one character.
bindkey	-M	vicmd	'i'	vi-forward-char
bindkey	-M	vicmd	'^[i'	vi-forward-char
bindkey	-M	visual	'i'	vi-forward-char #fixme -- slow
bindkey	-M	viins	'^[[C'	vi-forward-char
bindkey	-M	viins	'^[[C'	vi-cmd-mode

#	up-line (unbound) (unbound) (unbound)
#		Move up a line in the buffer.
#bindkey	-M	vicmd	'u'	up-line
bindkey	-M	vicmd	'u'	up-line-or-history
bindkey	-M	vicmd	'^[u'	up-line-or-history
bindkey	-M	visual	'u'	up-line-or-history #feature -- join lines

#	down-line (unbound) (unbound) (unbound)
#		Move down a line in the buffer.
#bindkey	-M	vicmd	'e'	down-line
bindkey	-M	vicmd	'e'	down-line-or-history
bindkey	-M	vicmd	'^[e'	down-line-or-history
bindkey	-M	visual	'e'	down-line-or-history #feature -- join lines


#################
# Word Movement #
#################
#	backward-word (ESC-B ESC-b) (unbound) (unbound)
#		Move to the beginning of the previous word.
#bindkey	-M	vicmd	''	
#	emacs-backward-word
#		Move to the beginning of the previous word.
#bindkey	-M	vicmd	''	
#	vi-backward-word (unbound) (b) (unbound)
#		Move to the beginning of the previous word, vi-style.
#bindkey	-M	vicmd	''	
#       vi-backward-blank-word (unbound) (B) (unbound)
#              Move backward one word, where a word is defined as a series of non-blank characters.
bindkey	-M	vicmd	'l'	vi-backward-blank-word
bindkey	-M	vicmd	'^[l'	vi-backward-blank-word
bindkey	-M	visual	'l'	vi-backward-blank-word

#	forward-word (ESC-F ESC-f) (unbound) (unbound)
#		Move to the beginning of the next word.  The editor's idea of a word is specified with the WORDCHARS parameter.
#bindkey	-M	vicmd	''	
#	emacs-forward-word
#		Move to the end of the next word.
#bindkey	-M	vicmd	''	
#	vi-forward-word (unbound) (w) (unbound)
#		Move forward one word, vi-style.
#bindkey	-M	vicmd	'y'	vi-forward-word
#bindkey	-M	vicmd	'^[y'	vi-forward-word
#bindkey	-M	visual	'y'	vi-forward-word
#	vi-forward-blank-word (unbound) (W) (unbound)
#		Move forward one word, where a word is defined as a series of non-blank characters.
bindkey	-M	vicmd	'y'	vi-forward-blank-word
bindkey	-M	vicmd	'^[y'	vi-forward-blank-word
bindkey	-M	visual	'y'	vi-forward-blank-word

#	vi-backward-word-end (unbound) (ge) (unbound)
#		Move to the end of the previous word, vi-style.
#bindkey	-M	vicmd	''	
#       vi-backward-blank-word-end (unbound) (gE) (unbound)
#              Move to the end of the previous word, where a word is defined as a series of non-blank characters.
bindkey	-M	vicmd	'L'	vi-backward-blank-word-end 
bindkey	-M	vicmd	'^[L'	vi-backward-blank-word-end 
bindkey	-M	visual	'L'	vi-backward-blank-word-end 

#	vi-forward-word-end (unbound) (e) (unbound)
#		Move to the end of the next word.
#bindkey	-M	vicmd	''	
#bindkey	-M	vicmd	'Y'	vi-forward-word-end 
#bindkey	-M	vicmd	'^[Y'	vi-forward-word-end 
#bindkey	-M	visual	'Y'	vi-forward-word-end 
#	vi-forward-blank-word-end (unbound) (E) (unbound)
#		Move to the end of the current word, or, if at the end of the current word, to the end of the next word, where a word is defined as a
#		series of non-blank characters.
bindkey	-M	vicmd	'Y'	vi-forward-blank-word-end 
bindkey	-M	vicmd	'^[Y'	vi-forward-blank-word-end 
bindkey	-M	visual	'Y'	vi-forward-blank-word-end 


#################
# Line Movement #
#################
#	beginning-of-line (^A) (unbound) (unbound)
#		Move to the beginning of the line.  If already at the beginning of the line, move to the beginning of the previous line, if any.
#bindkey	-M	vicmd	''	
#	vi-beginning-of-line
#		Move to the beginning of the line, without changing lines.
bindkey	-M	vicmd	'N'	vi-beginning-of-line
bindkey	-M	vicmd	'^[N'	vi-beginning-of-line
bindkey	-M	visual	'N'	vi-beginning-of-line
bindkey	-M	vicmd	'0'	vi-beginning-of-line
bindkey	-M	vicmd	'^[0'	vi-beginning-of-line
bindkey	-M	visual	'0'	vi-beginning-of-line
bindkey	-M	vicmd	'^[[H'	vi-beginning-of-line
bindkey	-M	viins	'^[[H'	vi-beginning-of-line

#	end-of-line (^E) (unbound) (unbound)
#		Move to the end of the line.  If already at the end of the line, move to the end of the next line, if any.
#bindkey	-M	vicmd	''	
#	vi-end-of-line (unbound) ($) (unbound)
#		Move to the end of the line.  If an argument is given to this command, the cursor will be moved to the end of the line (argument - 1)
#		lines down.
bindkey	-M	vicmd	'I'	vi-end-of-line
bindkey	-M	vicmd	'^[I'	vi-end-of-line
bindkey	-M	visual	'I'	vi-end-of-line
bindkey	-M	vicmd	'$'	vi-end-of-line
bindkey	-M	vicmd	'^[$'	vi-end-of-line
bindkey	-M	visual	'$'	vi-end-of-line
bindkey	-M	vicmd	'^[[F'	vi-end-of-line
bindkey	-M	viins	'^[[F'	vi-end-of-line

#	vi-first-non-blank (unbound) (^) (unbound)
#		Move to the first non-blank character in the line.
bindkey	-M	vicmd	'^'	vi-first-non-blank
bindkey	-M	vicmd	'^[^'	vi-first-non-blank
bindkey	-M	visual	'^'	vi-first-non-blank

#	vi-goto-column (ESC-|) (|) (unbound)
#		Move to the column specified by the numeric argument.
bindkey	-M	vicmd	'|'	vi-goto-column
bindkey	-M	vicmd	'^[|'	vi-goto-column
bindkey	-M	visual	'|'	vi-goto-column

#	vi-match-bracket (^X^B) (%) (unbound)
#		Move to the bracket character (one of {}, () or []) that matches the one under the cursor.  If the cursor is not on a bracket charac‐
#		ter, move forward without going past the end of the line to find one, and then go to the matching bracket.
bindkey	-M	vicmd	'%'	vi-match-bracket
bindkey	-M	vicmd	'^[%'	vi-match-bracket
bindkey	-M	visual	'%'	vi-match-bracket


########
# Find #
########
#	vi-find-next-char (^X^F) (f) (unbound)
#		Read a character from the keyboard, and move to the next occurrence of it in the line.
bindkey	-M	vicmd	'f'	vi-find-next-char
bindkey	-M	vicmd	'^[f'	vi-find-next-char
bindkey	-M	visual	'f'	vi-find-next-char

#	vi-find-next-char-skip (unbound) (t) (unbound)
#		Read a character from the keyboard, and move to the position just before the next occurrence of it in the line.
bindkey	-M	vicmd	'p'	vi-find-next-char-skip
bindkey	-M	vicmd	'^[p'	vi-find-next-char-skip
bindkey	-M	visual	'p'	vi-find-next-char-skip

#	vi-find-prev-char (unbound) (F) (unbound)
#		Read a character from the keyboard, and move to the previous occurrence of it in the line.
bindkey	-M	vicmd	'F'	vi-find-prev-char
bindkey	-M	vicmd	'^[F'	vi-find-prev-char
bindkey	-M	visual	'F'	vi-find-prev-char

#	vi-find-prev-char-skip (unbound) (T) (unbound)
#		Read a character from the keyboard, and move to the position just after the previous occurrence of it in the line.
bindkey	-M	vicmd	'P'	vi-find-prev-char-skip
bindkey	-M	vicmd	'^[P'	vi-find-prev-char-skip
bindkey	-M	visual	'P'	vi-find-prev-char-skip

#	vi-repeat-find (unbound) (;) (unbound)
#		Repeat the last vi-find command.
bindkey	-M	vicmd	';'	vi-repeat-find	
bindkey	-M	vicmd	'^[;'	vi-repeat-find	
bindkey	-M	visual	';'	vi-repeat-find	

#	vi-rev-repeat-find (unbound) (,) (unbound)
#		Repeat the last vi-find command in the opposite direction.
bindkey	-M	vicmd	','	vi-rev-repeat-find
bindkey	-M	vicmd	'^[,'	vi-rev-repeat-find
bindkey	-M	visual	','	vi-rev-repeat-find



####################
# History Movement #
####################
#	up-history (unbound) (^P) (unbound)
#		Move to the previous event in the history list.
#bindkey	-M	vicmd	''	
#	up-line-or-history (^P ESC-[A) (k) (ESC-[A)
#		Move up a line in the buffer, or if already at the top line, move to the previous event in the history list.
#bindkey	-M	vicmd	''	
#	up-line-or-search
#		Move up a line in the buffer, or if already at the top line, search backward in the history for a line beginning with the first  word
#		in the buffer.
#		If  called  from  a function by the zle command with arguments, the first argument is taken as the string for which to search, rather
#		than the first word in the buffer.
bindkey	-M	vicmd	'+'	up-history
bindkey	-M	vicmd	'^[+'	up-history
bindkey	-M	visual	'+'	up-history

#	down-history (unbound) (^N) (unbound)
#		Move to the next event in the history list.
#bindkey	-M	vicmd	''	
#	down-line-or-history (^N ESC-[B) (j) (ESC-[B)
#		Move down a line in the buffer, or if already at the bottom line, move to the next event in the history list.
#bindkey	-M	vicmd	''	
#	vi-down-line-or-history (unbound) (+) (unbound)
#		Move down a line in the buffer, or if already at the bottom line, move to the next event in the history list.  Then move to the first
#		non-blank character on the line.
#bindkey	-M	vicmd	''	
#	down-line-or-search
#		Move  down  a line in the buffer, or if already at the bottom line, search forward in the history for a line beginning with the first
#		word in the buffer.
#		If called from a function by the zle command with arguments, the first argument is taken as the string for which  to  search,  rather
#		than the first word in the buffer.
bindkey	-M	vicmd	'\-'	vi-down-line-or-history #fixme -- check to see if I did this right. it does seem to work.
bindkey	-M	vicmd	'^[\-'	vi-down-line-or-history
bindkey	-M	visual	'\-'	vi-down-line-or-history

#	beginning-of-history
#		Move to the first event in the history list.
bindkey	-M	vicmd	'gg'	beginning-of-history
bindkey	-M	vicmd	'^[g^[g'	beginning-of-history
bindkey	-M	visual	'gg'	beginning-of-history
#	beginning-of-line-hist
#		Move to the beginning of the line.  If already at the beginning of the buffer, move to the previous history line.
#bindkey	-M	vicmd	''	
#	beginning-of-buffer-or-history (ESC-<) (gg) (unbound)
#		Move to the beginning of the buffer, or if already there, move to the first event in the history list.
#bindkey	-M	vicmd	''	

#	end-of-history
#		Move to the last event in the history list.
bindkey	-M	vicmd	'G'	end-of-history
bindkey	-M	vicmd	'^[G'	end-of-history
bindkey	-M	visual	'G'	end-of-history
#	end-of-buffer-or-history (ESC->) (unbound) (unbound)
#		Move to the end of the buffer, or if already there, move to the last event in the history list.
#bindkey	-M	vicmd	''	

#	history-search-forward (ESC-N ESC-n) (unbound) (unbound)
#		Search forward in the history for a line beginning with the first word in the buffer.
#		If called from a function by the zle command with arguments, the first argument is taken as the string for which  to  search,  rather
#		than the first word in the buffer.
#bindkey	-M	vicmd	''	
#	history-beginning-search-forward
#		Search forward in the history for a line beginning with the current line up to the cursor.  This leaves the cursor  in  its  original
#		position.
#bindkey	-M	vicmd	''	
#	vi-history-search-forward (unbound) (?) (unbound)
#		Search  forward  in  the  history for a specified string.  The string may begin with `^' to anchor the search to the beginning of the
#		line. The functions available in the mini-buffer are the same as for vi-history-search-backward.  Argument handling is also the  same
#		as for that command.
#bindkey	-M	vicmd	''	
#	history-incremental-search-forward (^S ^Xs) (unbound) (unbound)
#		Search  forward  incrementally  for  a specified string.  The search is case-insensitive if the search string does not have uppercase
#		letters and no numeric argument was given.  The string may begin with `^' to anchor the search to the beginning  of  the  line.   The
#		functions available in the mini-buffer are the same as for history-incremental-search-backward.
#bindkey	-M	vicmd	'?'	history-incremental-search-forward
#	history-incremental-pattern-search-forward
#		These widgets behave similarly to the corresponding widgets with no -pattern, but the search string typed by the user is treated as a
#		pattern, respecting the current settings of the various options affecting pattern matching.  See FILENAME  GENERATION  in  zshexpn(1)
#		for  a  description of patterns.  If no numeric argument was given lowercase letters in the search string may match uppercase letters
#		in the history.  The string may begin with `^' to anchor the search to the beginning of the line.
#		The prompt changes to indicate an invalid pattern; this may simply indicate the pattern is not yet complete.
#		Note that only non-overlapping matches are reported, so an expression with wildcards may return fewer matches on a line than are vis‐
#		ible by inspection.
bindkey	-M	vicmd	'/'	history-incremental-pattern-search-forward # Note: hold alt+k or alt+K to cycle
bindkey	-M	vicmd	'^[/'	history-incremental-pattern-search-forward
bindkey	-M	visual	'/'	history-incremental-pattern-search-forward

#	history-search-backward (ESC-P ESC-p) (unbound) (unbound)
#		Search backward in the history for a line beginning with the first word in the buffer.
#		If  called  from  a function by the zle command with arguments, the first argument is taken as the string for which to search, rather
#		than the first word in the buffer.
#bindkey	-M	vicmd	''	
#	history-beginning-search-backward
#		Search  backward  in the history for a line beginning with the current line up to the cursor.  This leaves the cursor in its original
#		position.
#bindkey	-M	vicmd	''	
#	history-incremental-search-backward (^R ^Xr) (unbound) (unbound)
#		Search  backward  incrementally  for a specified string.  The search is case-insensitive if the search string does not have uppercase
#		letters and no numeric argument was given.  The string may begin with `^' to anchor the search to the beginning of  the  line.   
#bindkey	-M	vicmd	'/'	history-incremental-search-backward	
#	history-incremental-pattern-search-backward
#		These widgets behave similarly to the corresponding widgets with no -pattern, but the search string typed by the user is treated as a
#		pattern, respecting the current settings of the various options affecting pattern matching.  See FILENAME  GENERATION  in  zshexpn(1)
#		for  a  description of patterns.  If no numeric argument was given lowercase letters in the search string may match uppercase letters
#		in the history.  The string may begin with `^' to anchor the search to the beginning of the line.
#		The prompt changes to indicate an invalid pattern; this may simply indicate the pattern is not yet complete.
#		Note that only non-overlapping matches are reported, so an expression with wildcards may return fewer matches on a line than are vis‐
#		ible by inspection.
bindkey	-M	vicmd	'?'	history-incremental-pattern-search-backward # Note: hold alt+k or alt+K to cycle
bindkey	-M	vicmd	'^[?'	history-incremental-pattern-search-backward	
bindkey	-M	visual	'?'	history-incremental-pattern-search-backward	
#	vi-history-search-backward (unbound) (/) (unbound)
#		Search backward in the history for a specified string.  The string may begin with `^' to anchor the search to the  beginning  of  the
#		line.
#		A  restricted  set  of editing functions is available in the mini-buffer.  An interrupt signal, as defined by the stty setting,  will
#		stop the search.  The functions available in the mini-buffer are: accept-line, backward-delete-char,  vi-backward-delete-char,  back‐
#		ward-kill-word, vi-backward-kill-word, clear-screen, redisplay, quoted-insert and vi-quoted-insert.
#		vi-cmd-mode  is  treated  the  same  as accept-line, and magic-space is treated as a space.  Any other character that is not bound to
#		self-insert or self-insert-unmeta will beep and be ignored. If the function is called from vi command mode, the bindings of the  cur‐
#		rent insert mode will be used.
#		If  called  from  a function by the zle command with arguments, the first argument is taken as the string for which to search, rather
#		than the first word in the buffer.
#bindkey	-M	vicmd	''	

#	vi-repeat-search (unbound) (n) (unbound)
#		Repeat the last vi history search.
bindkey	-M	vicmd	'k'	vi-repeat-search
bindkey	-M	vicmd	'^[k'	vi-repeat-search
bindkey	-M	isearch	'^[k'	vi-repeat-search
bindkey	-M	isearch	'^[u'	vi-repeat-search

#	vi-rev-repeat-search (unbound) (N) (unbound)
#		Repeat the last vi history search, but in reverse.
bindkey	-M	vicmd	'K'	vi-rev-repeat-search
bindkey	-M	vicmd	'^[K'	vi-rev-repeat-search
bindkey	-M	isearch	'^[K'	vi-rev-repeat-search
bindkey	-M	isearch	'^[e'	vi-rev-repeat-search

#	vi-fetch-history (unbound) (G) (unbound)
#		Fetch the history line specified by the numeric argument.  This defaults to the current history line (i.e. the one that isn't history
#		yet).
#bindkey	-M	vicmd	'g'	vi-fetch-history #fixme

#	end-of-line-hist
#		Move to the end of the line.  If already at the end of the buffer, move to the next history line.
#bindkey	-M	vicmd	'I'	end-of-line-hist

#	infer-next-history (^X^N) (unbound) (unbound)
#		Search in the history list for a line matching the current one and fetch the event following it.
#bindkey	-M	vicmd	''	

#	set-local-history
#		By  default,  history  movement commands visit the imported lines as well as the local lines. This widget lets you toggle this on and
#		off, or set it with the numeric argument. Zero for both local and imported lines and nonzero for only local lines.
#bindkey	-M	vicmd	''	

#	accept-line-and-down-history (^O) (unbound) (unbound)
#bindkey	-M	vicmd	''	

#	accept-and-infer-next-history
#		Execute the contents of the buffer.  Then search the history list for a line matching the current one and push  the  event  following
#		onto the buffer stack.
#bindkey	-M	vicmd	''	

########
# Mark #
########
#	exchange-point-and-mark (^X^X) (unbound) (unbound)
#		Exchange the cursor position (point) with the position of the mark.  Unless a negative numeric argument is given, the region  between
#		point  and  mark  is activated so that it can be highlighted.  If a zero numeric argument is given, the region is activated but point
#		and mark are not swapped.
bindkey	-M	vicmd	'`'	exchange-point-and-mark
bindkey	-M	vicmd	'^[`'	exchange-point-and-mark
bindkey	-M	vicmd	"'"	exchange-point-and-mark # fixme -- Should I change it to  vi-goto-mark-line?
bindkey	-M	vicmd	"^['"	exchange-point-and-mark

#	vi-goto-mark (unbound) (`) (unbound)
#		Move to the specified mark.
#bindkey	-M	vicmd	'`'	vi-goto-mark
#bindkey	-M	vicmd	'^[`'	vi-goto-mark
#bindkey	-M	visual	'`'	vi-goto-mark

#	vi-goto-mark-line (unbound) (') (unbound)
#		Move to beginning of the line containing the specified mark.
#bindkey	-M	vicmd	"'"	
#bindkey	-M	vicmd	"^['"

#	vi-set-mark (unbound) (m) (unbound)
#		Set the specified mark at the cursor position.
#bindkey	-M	vicmd	'm'	vi-set-mark
#bindkey	-M	vicmd	'^[m'	vi-set-mark
#bindkey	-M	visual	'm'	vi-set-mark

#	set-mark-command (^@) (unbound) (unbound)
#		Set the mark at the cursor position.  If called with a negative numeric argument, do not set the mark but deactivate  the  region  so
#		that it is no longer highlighted (it is still usable for other purposes).  Otherwise the region is marked as active.
bindkey	-M	vicmd	'm'	set-mark-command
bindkey	-M	vicmd	'^[m'	set-mark-command
bindkey	-M	visual	'm'	set-mark-command


################
# Text Objects #
################
#	Text objects are commands that can be used to select a block of text according to some criteria. They are a feature of the vim  text  editor
#	and  so  are  primarily  intended  for use with vi operators or from visual selection mode. However, they can also be used from vi-insert or
#	emacs mode. Key bindings listed below apply to the viopp and visual keymaps.

#	select-a-blank-word (aW)
#		Select a word including adjacent blanks, where a word is defined as a series of non-blank characters. With a numeric argument, multi‐
#		ple words will be selected.
#bindkey	-M	vicmd	''	

#	select-a-shell-word (aa)
#		Select the current command argument applying the normal rules for quoting.
#bindkey	-M	vicmd	''	

#	select-a-word (aw)
#		Select  a  word including adjacent blanks, using the normal vi-style word definition. With a numeric argument, multiple words will be
#		selected.
#bindkey	-M	vicmd	''	

#	select-in-blank-word (iW)
#		Select a word, where a word is defined as a series of non-blank characters. With a numeric argument, multiple words will be selected.
#bindkey	-M	vicmd	''	

#	select-in-shell-word (ia)
#		Select the current command argument applying the normal rules for quoting. If the argument begins and ends with matching quote  char‐
#		acters, these are not included in the selection.
#bindkey	-M	vicmd	''	

#	select-in-word (iw)
#		Select a word, using the normal vi-style word definition. With a numeric argument, multiple words will be selected.


##########
# Insert #
##########
#	pound-insert (unbound) (#) (unbound)
#		If  there  is no # character at the beginning of the buffer, add one to the beginning of each line.  If there is one, remove a # from
#		each line that has one.  In either case, accept the current line.  The INTERACTIVE_COMMENTS option must be set for this to  have  any
#		usefulness.
#bindkey	-M	vicmd	''	
#	vi-pound-insert
#		If  there  is  no  character at the beginning of the current line, add one.  If there is one, remove it.  The INTERACTIVE_COMMENTS
#		option must be set for this to have any usefulness.
bindkey	-M	vicmd	'#'	vi-pound-insert
bindkey	-M	vicmd	'^[#'	vi-pound-insert
bindkey	-M	visual	'#'	vi-pound-insert

#	self-insert (printable characters) (unbound) (printable characters and some control characters)
#		Insert a character into the buffer at the cursor position.
#bindkey	-M	vicmd	''	
#	self-insert-unmeta (ESC-^I ESC-^J ESC-^M) (unbound) (unbound)
#		Insert a character into the buffer after stripping the meta bit and converting ^M to ^J.
#bindkey	-M	vicmd	''	

#	vi-add-next (unbound) (a) (unbound)
#		Enter insert mode after the current cursor position, without changing lines.
bindkey	-M	vicmd	't'	vi-add-next
bindkey	-M	vicmd	'^[t'	vi-add-next
bindkey	-M	visual	't'	vi-add-next

#	vi-add-eol (unbound) (A) (unbound)
#		Move to the end of the line and enter insert mode.
bindkey	-M	vicmd	'T'	vi-add-eol
bindkey	-M	vicmd	'^[T'	vi-add-eol
bindkey	-M	visual	'T'	vi-add-eol

#	vi-change (unbound) (c) (unbound)
#		Read  a  movement  command  from  the keyboard, and kill from the cursor position to the endpoint of the movement.  Then enter insert
#		mode.  If the command is vi-change, change the current line.
#		For compatibility with vi, if the command is vi-forward-word or vi-forward-blank-word, the whitespace after the word is not included.
#		If you prefer the more consistent behaviour with the whitespace included use the following key binding:
#			bindkey -a -s cw dwi
bindkey	-M	vicmd	'w'	vi-change
bindkey	-M	vicmd	'^[w'	vi-change
bindkey	-M	visual	'w'	vi-change

#	vi-change-eol (unbound) (C) (unbound)
#		Kill to the end of the line and enter insert mode.
bindkey	-M	vicmd	'W'	vi-change-eol
bindkey	-M	vicmd	'^[W'	vi-change-eol
bindkey	-M	visual	'W'	vi-change-eol

#	vi-change-whole-line (unbound) (S) (unbound)
#		Kill the current line and enter insert mode.
bindkey	-M	vicmd	'ww'	vi-change-whole-line
bindkey	-M	vicmd	'^[w^[w'	vi-change-whole-line
bindkey	-M	visual	'ww'	vi-change-whole-line

#	vi-insert (unbound) (i) (unbound)
#		Enter insert mode.
bindkey	-M	vicmd	's'	vi-insert
bindkey	-M	vicmd	'^[s'	vi-insert
bindkey	-M	visual	's'	vi-insert

#	vi-insert-bol (unbound) (I) (unbound)
#		Move to the first non-blank character on the line and enter insert mode.
bindkey	-M	vicmd	'S'	vi-insert-bol
bindkey	-M	vicmd	'^[S'	vi-insert-bol
bindkey	-M	visual	'S'	vi-insert-bol

#	vi-open-line-above (unbound) (O) (unbound)
#		Open a line above the cursor and enter insert mode.
bindkey	-M	vicmd	'O'	vi-open-line-above
bindkey	-M	vicmd	'^[O'	vi-open-line-above
bindkey	-M	visual	'O'	vi-open-line-above

#	vi-open-line-below (unbound) (o) (unbound)
#		Open a line below the cursor and enter insert mode.
bindkey	-M	vicmd	'o'	vi-open-line-below
bindkey	-M	vicmd	'^[o'	vi-open-line-below
bindkey	-M	visual	'o'	vi-open-line-below

#	quoted-insert (^V) (unbound) (unbound)
#		Insert the next character typed into the buffer literally.  An interrupt character will not be inserted.
#bindkey	-M	vicmd	''	
#	vi-quoted-insert (unbound) (unbound) (^Q ^V)
#		Display a `^' at the cursor position, and insert the next character typed into the buffer literally.  An interrupt character will not
#		be inserted.
#bindkey	-M	vicmd	''	

#	insert-last-word (ESC-_ ESC-.) (unbound) (unbound)
#		Insert  the  last  word from the previous history event at the cursor position.  If a positive numeric argument is given, insert that
#		word from the end of the previous history event.  If the argument is zero or negative insert that word from the  left  (zero  inserts
#		the  previous  command word).  Repeating this command replaces the word just inserted with the last word from the history event prior
#		to the one just used; numeric arguments can be used in the same way to pick a word from that event.
#		When called from a shell function invoked from a user-defined widget, the command can take one to three arguments.  The  first  argu‐
#		ment  specifies  a history offset which applies to successive calls to this widget: if it is -1, the default behaviour is used, while
#		if it is 1, successive calls will move forwards through the history.  The value 0 can be used to indicate that the history line exam‐
#		ined  by  the previous execution of the command will be reexamined.  Note that negative numbers should be preceded by a `--' argument
#		to avoid confusing them with options.
#		If two arguments are given, the second specifies the word on the command line in normal array  index  notation  (as  a  more  natural
#		alternative to the numeric argument).  Hence 1 is the first word, and -1 (the default) is the last word.
#		If a third argument is given, its value is ignored, but it is used to signify that the history offset is relative to the current his‐
#		tory line, rather than the one remembered after the previous invocations of insert-last-word.
#		For example, the default behaviour of the command corresponds to
#			zle insert-last-word -- -1 -1
#		while the command
#			zle insert-last-word -- -1 1 -
#		always copies the first word of the line in the history immediately before the line being edited.  This  has  the  side  effect  that
#		later invocations of the widget will be relative to that line.
#bindkey	-M	vicmd	''	


###########
# Replace #
###########
#	vi-replace-chars (unbound) (r) (unbound)
#		Replace the character under the cursor with a character read from the keyboard.
bindkey	-M	vicmd	'r'	vi-replace-chars
bindkey	-M	vicmd	'^[r'	vi-replace-chars
bindkey	-M	visual	'r'	vi-replace-chars

#	vi-replace (unbound) (R) (unbound)
#		Enter overwrite mode.
bindkey	-M	vicmd	'R'	vi-replace
bindkey	-M	vicmd	'^[R'	vi-replace
bindkey	-M	visual	'R'	vi-replace
#	overwrite-mode (^X^O) (unbound) (unbound)
#		Toggle between overwrite mode and insert mode.
#bindkey	-M	vicmd	''	

#	vi-substitute (unbound) (s) (unbound)
#		Substitute the next character(s).
#bindkey	-M	vicmd	''	

#	put-replace-selection (unbound) (unbound) (unbound) # fixme -- needs to be added probably
#		Replace the contents of the current region or selection with the contents of the kill buffer. If the kill buffer contains a  sequence
#		of lines (as opposed to characters), the current line will be split by the pasted lines.
#bindkey	-M	vicmd	''	


############
# Editting #
############
#	auto-suffix-remove
#		If the previous action added a suffix (space, slash, etc.) to the word on the command line, remove it.  Otherwise do nothing.  Remov‐
#		ing the suffix ends any active menu completion or menu selection.
#		This widget is intended to be called from user-defined widgets to enforce a desired suffix-removal behavior.
#bindkey	-M	vicmd	''	

#	auto-suffix-retain
#		If the previous action added a suffix (space, slash, etc.) to the word on the command line, force it to be preserved.   Otherwise  do
#		nothing.  Retaining the suffix ends any active menu completion or menu selection.
#		This widget is intended to be called from user-defined widgets to enforce a desired suffix-preservation behavior.
#bindkey	-M	vicmd	''	

#	transpose-chars (^T) (unbound) (unbound)
#		Exchange the two characters to the left of the cursor if at end of line, else exchange the character under the cursor with the  char‐
#		acter to the left.
#bindkey	-M	vicmd	''	

#	transpose-words (ESC-T ESC-t) (unbound) (unbound)
#		Exchange the current word with the one before it.
#bindkey	-M	vicmd	''	

#	quote-line (ESC-') (unbound) (unbound)
#		Quote the current line; that is, put a `'' character at the beginning and the end, and convert all `'' characters to `'\'''.
#bindkey	-M	vicmd	''	

#	quote-region (ESC-") (unbound) (unbound)
#		Quote the region from the cursor to the mark.
bindkey	-M	visual	'"'	quote-region

#	gosmacs-transpose-chars
#		Exchange the two characters behind the cursor.
#bindkey	-M	vicmd	''	

#	vi-indent (unbound) (>) (unbound)
#		Indent a number of lines.
bindkey	-M	vicmd	'>'	vi-indent
bindkey	-M	vicmd	'^[>'	vi-indent
bindkey	-M	visual	'>'	vi-indent

#	vi-unindent (unbound) (<) (unbound)
#		Unindent a number of lines.
bindkey	-M	vicmd	'<'	vi-unindent
bindkey	-M	vicmd	'^[<'	vi-unindent
bindkey	-M	visual	'<'	vi-unindent

#	vi-join (^X^J) (J) (unbound)
#		Join the current line with the next one.
bindkey	-M	vicmd	'J'	vi-join
bindkey	-M	vicmd	'^[J'	vi-join
bindkey	-M	visual	'J'	vi-join

# Swap Chars
#bindkey -M vicmd ''	transpose-chars
# Swap words
#transpose-words

# Insert Tab  // fixme, and add to colemak.vim
#insert-completions
#insert-last-argument
#self-insert
#quoted-insert


########
# Undo #
########
#	undo (^_ ^Xu ^X^U) (u) (unbound)
#		Incrementally undo the last text modification.  When called from a user-defined widget, takes an optional argument indicating a  pre‐
#		vious state of the undo history as returned by the UNDO_CHANGE_NO variable; modifications are undone until that state is reached.
#		Note  that  when  invoked from vi command mode, the full prior change made in insert mode is reverted, the changes having been merged
#		when command mode was selected.
bindkey	-M	vicmd	'z'	undo

#	redo (unbound) (^R) (unbound)
#		Incrementally redo undone text modifications.
bindkey	-M	vicmd	'Z'	redo

#	vi-undo-change (unbound) (unbound) (unbound)
#		Undo the last text modification.  If repeated, redo the modification.
#bindkey	-M	vicmd	''	


########
# Case #
########
#	vi-caps-lock-panic
#		Hang until any lowercase key is pressed.  This is for vi users without the mental capacity to keep track of their caps lock key (like
#		the author).
#bindkey	-M	vicmd	''	

#	capitalize-word (ESC-C ESC-c) (unbound) (unbound)
#		Capitalize the current word and move past it.
#bindkey	-M	vicmd	''	

#	vi-oper-swap-case (unbound) (g~) (unbound)
#		Read  a movement command from the keyboard, and swap the case of all characters from the cursor position to the endpoint of the move‐
#		ment.  If the movement command is vi-oper-swap-case, swap the case of all characters on the current line.
bindkey	-M	vicmd	'g~'	vi-oper-swap-case

#	vi-swap-case (unbound) (~) (unbound)
#		Swap the case of the character under the cursor and move past it.
bindkey	-M	vicmd	'~'	vi-swap-case

#	up-case-word (ESC-U ESC-u) (unbound) (unbound)
#		Convert the current word to all caps and move past it.
#bindkey	-M	vicmd	'~y'	up-case-word
#bindkey	-M	vicmd	'^[~^[y'	up-case-word
#bindkey	-M	visual	'~y'	up-case-word

#	down-case-word (ESC-L ESC-l) (unbound) (unbound)
#		Convert the current word to all lowercase and move past it.
#bindkey	-M	vicmd	'~Y'	down-case-word
#bindkey	-M	vicmd	'^[~^[Y'	down-case-word
#bindkey	-M	visual	'~Y'	down-case-word



##########
# delete #
##########
#	delete-char
#		Delete the character under the cursor.
#bindkey	-M	vicmd	''	
#	vi-delete-char (unbound) (x) (unbound)
#		Delete the character under the cursor, without going past the end of the line.
bindkey	-M	vicmd	'x'	vi-delete-char
bindkey	-M	vicmd	'^[x'	vi-delete-char
bindkey	-M	visual	'x'	vi-delete-char
bindkey	-M	visual	'^[[3~'	vi-delete-char
bindkey	-M	vicmd	'^[[3~'	vi-delete-char
bindkey	-M	viins	'^[[3~'	vi-delete-char

#	backward-delete-char (^H ^?) (unbound) (unbound)
#		Delete the character behind the cursor.
#bindkey	-M	vicmd	''	
#	vi-backward-delete-char (unbound) (X) (^H)
#		Delete the character behind the cursor, without changing lines.  If in insert mode, this won't delete past  the  point  where  insert
#		mode was last entered.
bindkey	-M	vicmd	'X'	vi-backward-delete-char
bindkey	-M	vicmd	'^[X'	vi-backward-delete-char
bindkey	-M	visual	'X'	vi-backward-delete-char

#	vi-delete (unbound) (d) (unbound)
#		Read  a  movement  command  from  the keyboard, and kill from the cursor position to the endpoint of the movement.  If the command is
#		vi-delete, kill the current line.
bindkey	-M	vicmd	'd'	vi-delete
bindkey	-M	vicmd	'^[d'	vi-delete
bindkey	-M	visual	'd'	vi-delete

#	vi-kill-eol (unbound) (D) (unbound)
#		Kill from the cursor to the end of the line.
bindkey	-M	vicmd	'D'	vi-kill-eol
bindkey	-M	vicmd	'^[D'	vi-kill-eol
bindkey	-M	visual	'D'	vi-kill-eol

#	backward-kill-line
#		Kill from the beginning of the line to the cursor position.
bindkey	-M	vicmd	'dN'	backward-kill-line

#	backward-kill-word (^W ESC-^H ESC-^?) (unbound) (unbound)
#		Kill the word behind the cursor.
#bindkey	-M	vicmd	''	
#	vi-backward-kill-word (unbound) (unbound) (^W)
#		Kill the word behind the cursor, without going past the point where insert mode was last entered.
#bindkey	-M	vicmd	'dl'	
#	backward-delete-word
#		Delete the word behind the cursor.
#bindkey	-M	vicmd	''	

#	delete-word
#		Delete the current word.
#bindkey	-M	vicmd	''	
#	kill-word (ESC-D ESC-d) (unbound) (unbound)
#		Kill the current word.
#bindkey	-M	vicmd	''	

#	kill-line (^K) (unbound) (unbound)
#		Kill from the cursor to the end of the line.  If already on the end of the line, kill the newline character.
#bindkey	-M	vicmd	''	
#	vi-kill-line (unbound) (unbound) (^U)
#		Kill from the cursor back to wherever insert mode was last entered.
#bindkey	-M	vicmd	''	
#	kill-whole-line (^U) (unbound) (unbound)
#		Kill the current line.
#bindkey	-M	vicmd	''	

#	kill-region
#		Kill from the cursor to the mark.
#bindkey	-M	vicmd	''	

#	kill-buffer (^X^K) (unbound) (unbound)
#		Kill the entire buffer.
#bindkey	-M	vicmd	''	


########
# Copy #
########
#	vi-yank (unbound) (y) (unbound)
#		Read a movement command from the keyboard, and copy the region from the cursor position to the endpoint of the movement into the kill
#		buffer.  If the command is vi-yank, copy the current line.
bindkey	-M	vicmd	'c'	vi-yank
bindkey	-M	vicmd	'^[c'	vi-yank
bindkey	-M	visual	'c'	vi-yank

#	vi-yank-whole-line (unbound) (Y) (unbound)
#		Copy the current line into the kill buffer.
bindkey	-M	vicmd	'C'	vi-yank-whole-line
bindkey	-M	vicmd	'^[C'	vi-yank-whole-line
bindkey	-M	visual	'C'	vi-yank-whole-line

#	copy-region-as-kill (ESC-W ESC-w) (unbound) (unbound)
#		Copy the area from the cursor to the mark to the kill buffer.
#		If  called  from  a ZLE widget function in the form `zle copy-region-as-kill string' then string will be taken as the text to copy to
#		the kill buffer.  The cursor, the mark and the text on the command line are not used in this case.
#bindkey	-M	vicmd	''	

#	copy-prev-word (ESC-^_) (unbound) (unbound)
#		Duplicate the word to the left of the cursor.
#bindkey	-M	vicmd	''	

#	copy-prev-shell-word
#		Like copy-prev-word, but the word is found by using shell parsing, whereas copy-prev-word looks for blanks. This makes  a  difference
#		when the word is quoted and contains spaces.
#bindkey	-M	vicmd	''	

#	yank (^Y) (unbound) (unbound)
#		Insert the contents of the kill buffer at the cursor position.
#bindkey	-M	vicmd	''	

#	yank-pop (ESC-y) (unbound) (unbound)
#		Remove the text just yanked, rotate the kill-ring (the history of previously killed text) and yank the new top.  Only works following
#		yank, vi-put-before, vi-put-after or yank-pop.
#bindkey	-M	vicmd	''	

#	vi-yank-eol
#		Copy  the region from the cursor position to the end of the line into the kill buffer.  Arguably, this is what Y should do in vi, but
#		it isn't what it actually does.
#bindkey	-M	vicmd	''	


#########
# Paste #
#########
#	get-line (ESC-G ESC-g) (unbound) (unbound)
#		Pop the top line off the buffer stack and insert it at the cursor position.
#bindkey	-M	vicmd	''	

#	vi-put-before (unbound) (P) (unbound)
#		Insert the contents of the kill buffer before the cursor.  If the kill buffer contains a sequence of lines  (as  opposed  to  charac‐
#		ters), paste it above the current line.
bindkey	-M	vicmd	'V'	vi-put-before

#	vi-put-after (unbound) (p) (unbound)
#		Insert the contents of the kill buffer after the cursor.  If the kill buffer contains a sequence of lines (as opposed to characters),
#		paste it below the current line.
bindkey	-M	vicmd	'v'	vi-put-after


############
# Complete #
############
# TAB for complete
#bindkey -M vicmd '	'	vi-complete
#	accept-and-menu-complete
#		In a menu completion, insert the current completion into the buffer, and advance to the next possible completion.
#bindkey	-M	vicmd	''	

#	complete-word
#		Attempt completion on the current word.
#bindkey	-M	vicmd	''	

#	delete-char-or-list (^D) (unbound) (unbound)
#		Delete the character under the cursor.  If the cursor is at the end of the line, list possible completions for the current word.
#bindkey	-M	vicmd	''	

#	expand-cmd-path
#		Expand the current command to its full pathname.
#bindkey	-M	vicmd	''	

#	expand-or-complete (TAB) (unbound) (TAB)
#		Attempt shell expansion on the current word.  If that fails, attempt completion.
#bindkey	-M	vicmd	''	

#	expand-or-complete-prefix
#		Attempt shell expansion on the current word up to cursor.
#bindkey	-M	vicmd	''	

#	expand-history (ESC-space ESC-!) (unbound) (unbound)
#		Perform history expansion on the edit buffer.
#bindkey	-M	vicmd	''	

#	expand-word (^X*) (unbound) (unbound)
#		Attempt shell expansion on the current word.
#bindkey	-M	vicmd	''	

#	list-choices (ESC-^D) (^D =) (^D)
#		List possible completions for the current word.
#bindkey	-M	vicmd	''	

#	list-expand (^Xg ^XG) (^G) (^G)
#		List the expansion of the current word.
#bindkey	-M	vicmd	''	

#	magic-space
#		Perform history expansion and insert a space into the buffer.  This is intended to be bound to space.
bindkey	-M	vicmd	' '	magic-space

#	menu-complete
#		Like complete-word, except that menu completion is used.  See the MENU_COMPLETE option.
#bindkey	-M	vicmd	''	

#	menu-expand-or-complete
#		Like expand-or-complete, except that menu completion is used.
#bindkey	-M	vicmd	''	

#	reverse-menu-complete
#		Perform menu completion, like menu-complete, except that if a menu completion is already in progress, move to the previous completion
#		rather than the next.
#bindkey	-M	vicmd	''	

#	end-of-list
#		When a previous completion displayed a list below the prompt, this widget can be used to move the prompt below the list.
#bindkey	-M	vicmd	''	


###################
# Keyboard Macros #
###################
#	vi-repeat-change (unbound) (.) (unbound)
#		Repeat the last vi mode text modification.  If a count was used with the modification, it is remembered.  If a count is given to this
#		command, it overrides the remembered count, and is remembered for future uses of this command.  The cut buffer specification is simi‐
#		larly remembered.
bindkey	-M	vicmd	'.'	vi-repeat-change

#	execute-named-cmd (ESC-x) (:) (unbound)
#		Read the name of an editor command and execute it.  A restricted set of editing functions is available in the mini-buffer.  Keys  are
#		looked up in the special command keymap, and if not found there in the main keymap.  An interrupt signal, as defined by the stty set‐
#		ting, will abort the function.  Note that the following always perform the same task within the  executed-named-cmd  environment  and
#		cannot  be  replaced  by  user  defined  widgets,  nor  can  the  set  of  functions  be  extended.  The allowed functions are: back‐
#		ward-delete-char, vi-backward-delete-char, clear-screen, redisplay,  quoted-insert,  vi-quoted-insert,  backward-kill-word,  vi-back‐
#		ward-kill-word,  kill-whole-line,  vi-kill-line,  backward-kill-line,  list-choices, delete-char-or-list, complete-word, accept-line,
#		expand-or-complete and expand-or-complete-prefix.
#		kill-region kills the last word, and vi-cmd-mode is treated the same as accept-line.  The space and tab characters, if not  bound  to
#		one  of  these functions, will complete the name and then list the possibilities if the AUTO_LIST option is set.  Any other character
#		that is not bound to self-insert or self-insert-unmeta will beep and be ignored.  The bindings of the current  insert  mode  will  be
#		used.
#		Currently this command may not be redefined or called by name.
bindkey	-M	vicmd	':'	execute-named-cmd

#	execute-last-named-cmd (ESC-z) (unbound) (unbound)
#		Redo the last function executed with execute-named-cmd.
#		Currently this command may not be redefined or called by name.
#bindkey	-M	vicmd	''	

###############
# Visual Mode #
###############
#	visual-mode (unbound) (v) (unbound)
#		Toggle vim-style visual selection mode. If line-wise visual mode is currently enabled then it is changed to being character-wise.  If
#		used following an operator, it forces the subsequent movement command to be treated as a character-wise movement.
bindkey	-M	vicmd	'a'	visual-mode

#	visual-line-mode (unbound) (V) (unbound)
#		Toggle  vim-style  line-wise  visual  selection  mode. If character-wise visual mode is currently enabled then it is changed to being
#		line-wise. If used following an operator, it forces the subsequent movement command to be treated as a line-wise movement.
bindkey	-M	vicmd	'A'	visual-line-mode


#############
# Arguments #
#############
#	digit-argument (ESC-0..ESC-9) (1-9) (unbound)
#		Start a new numeric argument, or add to the current one.  See also vi-digit-or-beginning-of-line.  This only works if bound to a  key
#		sequence ending in a decimal digit.
#		Inside a widget function, a call to this function treats the last key of the key sequence which called the widget as the digit.
bindkey	-M	vicmd	'1-9'	digit-argument

#	neg-argument (ESC--) (unbound) (unbound)
#		Changes the sign of the following argument.
#bindkey	-M	vicmd	''	

#	universal-argument
#		Multiply the argument of the next command by 4.  Alternatively, if this command is followed by an integer (positive or negative), use
#		that as the argument for the next command.  Thus digits cannot be repeated using this command.  For example, if this  command  occurs
#		twice,  followed  immediately  by forward-char, move forward sixteen spaces; if instead it is followed by -2, then forward-char, move
#		backward two spaces.
#		Inside a widget function, if passed an argument, i.e. `zle universal-argument num', the numeric argument will be set to num; this  is
#		equivalent to `NUMERIC=num'.
#bindkey	-M	vicmd	''	

#	argument-base
#		Use  the existing numeric argument as a numeric base, which must be in the range 2 to 36 inclusive.  Subsequent use of digit-argument
#		and universal-argument will input a new numeric argument in the given base.  The usual hexadecimal convention is used: the  letter  a
#		or  A  corresponds  to  10,  and so on.  Arguments in bases requiring digits from 10 upwards are more conveniently input with univer‐
#		sal-argument, since ESC-a etc. are not usually bound to digit-argument.
#		The function can be used with a command argument inside a user-defined widget.  The following code sets the base to 16 and  lets  the
#		user input a hexadecimal argument until a key out of the digit range is typed:
#			zle argument-base 16
#			zle universal-argument
#bindkey	-M	vicmd	''	

#	accept-and-hold (ESC-A ESC-a) (unbound) (unbound)
#		Push the contents of the buffer on the buffer stack and execute it.
#bindkey	-M	vicmd	''	

#	accept-line (^J ^M) (^J ^M) (^J ^M)
#		Finish editing the buffer.  Normally this causes the buffer to be executed as a shell command.
#bindkey	-M	vicmd	''	

#	beep   Beep, unless the BEEP option is unset.
#bindkey	-M	vicmd	''	

#	vi-cmd-mode (^X^V) (unbound) (^[)
#		Enter command mode; that is, select the `vicmd' keymap.  Yes, this is bound by default in emacs mode.
#bindkey	-M	vicmd	''	

#	clear-screen (^L ESC-^L) (^L) (^L)
#		Clear the screen and redraw the prompt.
#bindkey	-M	vicmd	''	

#	describe-key-briefly
#		Reads a key sequence, then prints the function bound to that sequence.
#bindkey	-M	vicmd	''	

#	push-input
#		Push the entire current multiline construct onto the buffer stack and return to the top-level (PS1) prompt.  If  the  current  parser
#		construct is only a single line, this is exactly like push-line.  Next time the editor starts up or is popped with get-line, the con‐
#		struct will be popped off the top of the buffer stack and loaded into the editing buffer.
#bindkey	-M	vicmd	''	

#	push-line (^Q ESC-Q ESC-q) (unbound) (unbound)
#		Push the current buffer onto the buffer stack and clear the buffer.  Next time the editor starts up, the buffer will  be  popped  off
#		the top of the buffer stack and loaded into the editing buffer.
#bindkey	-M	vicmd	''	

#	push-line-or-edit
#		At  the  top-level  (PS1)  prompt, equivalent to push-line.  At a secondary (PS2) prompt, move the entire current multiline construct
#		into the editor buffer.  The latter is equivalent to push-input followed by get-line.
#bindkey	-M	vicmd	''	

#	read-command
#		Only useful from a user-defined widget.  A keystroke is read just as in normal operation, but instead of the command  being  executed
#		the  name of the command that would be executed is stored in the shell parameter REPLY.  This can be used as the argument of a future
#		zle command.  If the key sequence is not bound, status 1 is returned; typically, however, REPLY is set to undefined-key to indicate a
#		useless key sequence.
#bindkey	-M	vicmd	''	

#	recursive-edit
#		Only  useful from a user-defined widget.  At this point in the function, the editor regains control until one of the standard widgets
#		which would normally cause zle to exit (typically an accept-line caused by hitting the return key)  is  executed.   Instead,  control
#		returns  to  the  user-defined  widget.  The status returned is non-zero if the return was caused by an error, but the function still
#		continues executing and hence may tidy up.  This makes it safe for the user-defined widget to alter the command line or key  bindings
#		temporarily.
#		The following widget, caps-lock, serves as an example.
#			self-insert-ucase() {
#			  LBUFFER+=${(U)KEYS[-1]}
#			}
#			integer stat
#			zle -N self-insert self-insert-ucase
#			zle -A caps-lock save-caps-lock
#			zle -A accept-line caps-lock
#			zle recursive-edit
#			stat=$?
#			zle -A .self-insert self-insert
#			zle -A save-caps-lock caps-lock
#			zle -D save-caps-lock
#			(( stat )) && zle send-break
#			return $stat
#		This  causes  typed  letters  to  be  inserted  capitalised  until either accept-line (i.e. typically the return key) is typed or the
#		caps-lock widget is invoked again; the later is handled by saving the old definition of caps-lock as save-caps-lock and then  rebind‐
#		ing  it  to invoke accept-line.  Note that an error from the recursive edit is detected as a non-zero return status and propagated by
#		using the send-break widget.
#bindkey	-M	vicmd	''	

#	redisplay (unbound) (^R) (^R)
#		Redisplays the edit buffer.
#bindkey	-M	vicmd	''	

#	reset-prompt (unbound) (unbound) (unbound)
#		Force the prompts on both the left and right of the screen to be re-expanded, then redisplay the edit buffer.  This reflects  changes
#		both  to  the  prompt  variables themselves and changes in the expansion of the values (for example, changes in time or directory, or
#		changes to the value of variables referred to by the prompt).
#		Otherwise, the prompt is only expanded each time zle starts, and when the display as been interrupted by output from another part  of
#		the shell (such as a job notification) which causes the command line to be reprinted.
#bindkey	-M	vicmd	''	

#	send-break (^G ESC-^G) (unbound) (unbound)
#		Abort  the  current  editor function, e.g. execute-named-command, or the editor itself, e.g. if you are in vared. Otherwise abort the
#		parsing of the current line; in this case the aborted line is available in the shell variable ZLE_LINE_ABORTED.   If  the  editor  is
#		aborted from within vared, the variable ZLE_VARED_ABORTED is set.
#bindkey	-M	vicmd	''	

#	run-help (ESC-H ESC-h) (unbound) (unbound)
#		Push  the  buffer  onto the buffer stack, and execute the command `run-help cmd', where cmd is the current command.  run-help is nor‐
#		mally aliased to man.
#bindkey	-M	vicmd	''	

#	vi-set-buffer (unbound) (") (unbound)
#		Specify a buffer to be used in the following command.  There are 37 buffers that can be specified: the 26 `named' buffers "a  to  "z,
#		the  `yank' buffer "0, the nine `queued' buffers "1 to "9 and the `black hole' buffer "_.  The named buffers can also be specified as
#		"A to "Z.
#		When a buffer is specified for a cut, change or yank command, the text concerned replaces the previous contents of the specified buf‐
#		fer.  If  a  named  buffer is specified using a capital, the newly cut text is appended to the buffer instead of overwriting it. When
#		using the "_ buffer, nothing happens. This can be useful for deleting text without affecting the normal registers.
#		If no buffer is specified for a cut or change command, "1 is used, and the contents of "1 to "8 are each shifted  along  one  buffer;
#		the  contents  of  "9 is lost. If no buffer is specified for a yank command, "0 is used. Finally, a paste command without a specified
#		buffer will paste the text from the most recent command regardless of any buffer that might have been used with that command.
#		When called from a widget function by the zle command, the buffer can optionally be specified with an argument. For example,
#			zle vi-set-buffer A
#bindkey	-M	vicmd	''	

#	spell-word (ESC-$ ESC-S ESC-s) (unbound) (unbound)
#		Attempt spelling correction on the current word.
#bindkey	-M	vicmd	''	

#	split-undo
#		Breaks  the  undo sequence at the current change.  This is useful in vi mode as changes made in insert mode are coalesced on entering
#		command mode.  Similarly, undo will normally revert as one all the changes made by a user-defined widget.
#bindkey	-M	vicmd	''	

#	undefined-key
#		This command is executed when a key sequence that is not bound to any command is typed.  By default it beeps.
#bindkey	-M	vicmd	''	


#	what-cursor-position (^X=) (ga) (unbound)
#		Print the character under the cursor, its code as an octal, decimal and hexadecimal number, the current cursor  position  within  the
#		buffer and the column of the cursor in the current line.
#bindkey	-M	vicmd	''	

#	where-is
#		Read  the  name  of  an editor command and print the listing of key sequences that invoke the specified command.  A restricted set of
#		editing functions is available in the mini-buffer.  Keys are looked up in the special command keymap, and if not found there  in  the
#		main keymap.
#bindkey	-M	vicmd	''	

#	which-command (ESC-?) (unbound) (unbound)
#		Push  the buffer onto the buffer stack, and execute the command `which-command cmd'. where cmd is the current command.  which-command
#		is normally aliased to whence.
#bindkey	-M	vicmd	''	

#	vi-digit-or-beginning-of-line (unbound) (0) (unbound)
#		If the last command executed was a digit as part of an argument, continue the argument.  Otherwise, execute vi-beginning-of-line.


########
# ???? #
########


############
# Unmapped #
############
#pgup pgdown
#bindkey	-M	vicmd	'j'	
#bindkey	-M	vicmd	'h'	

#5up 5down
#bindkey	-M	vicmd	'U'	
#bindkey	-M	vicmd	'E'	

#Jump in history
#bindkey	-M	vicmd	'['	
#bindkey	-M	vicmd	']'	

# top of screen
#bindkey	-M	vicmd	'H'	

# ??? maybe quote
#bindkey	-M	vicmd	'"'	
#bindkey	-M	vicmd	'\\'	

# folds
#bindkey	-M	vicmd	'b'	
#bindkey	-M	vicmd	'be'	
#bindkey	-M	vicmd	'bu'	

# pull previous history down.
#bindkey	-M	vicmd	'bb'	

# ????
#bindkey	-M	vicmd	'B'	

# Pull history, but only to middle of screen?
#bindkey	-M	vicmd	'M'	

# Execute Command
#bindkey	-M	vicmd	'!'	


#bindkey -M vicmd ']'	
#bindkey -M vicmd '{'	
#bindkey -M vicmd '}'	
#bindkey -M vicmd '('	
#bindkey -M vicmd ')'	
#bindkey -M vicmd '&'	
#bindkey -M vicmd '\\'	
#bindkey -M vicmd '\''	







###########
# Control #
###########


###########
# Useless #
###########

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
