Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What are the equivalent functions in tcsh for the following zsh functions?

up-line-or-history
history-beginning-search-backward
down-line-or-history
history-beginning-search-forward

I have the following code in my ,zsh that I am hoping to translate in full to my ".tcsh". The code below is supposed to bind Ctrl-P and Ctrl-N to such history search functions:

up-line-or-history-beginning-search () {
  if [[ -n $PREBUFFER ]]; then
    zle up-line-or-history
  else
    zle history-beginning-search-backward
  fi
}
down-line-or-history-beginning-search () {
  if [[ -n $PREBUFFER ]]; then
    zle down-line-or-history
  else
    zle history-beginning-search-forward
  fi
}


zle -N up-line-or-history-beginning-search
zle -N down-line-or-history-beginning-search

bindkey '^P' up-line-or-history-beginning-search
bindkey '^N' down-line-or-history-beginning-search

Any ideas about what the equivalent tcsh code would look like?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.