Accepting request 423967 from shells
1 OBS-URL: https://build.opensuse.org/request/show/423967 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zsh?expand=0&rev=75
This commit is contained in:
commit
d6c98f07c6
7
zprofile
7
zprofile
@ -1,8 +1,3 @@
|
|||||||
# we source the general profile here so we dont have to
|
# we source the general profile here so we dont have to
|
||||||
# reimplement it
|
# reimplement it
|
||||||
setopt nonomatch
|
emulate sh -c 'source /etc/profile'
|
||||||
source /etc/profile
|
|
||||||
unsetopt nonomatch
|
|
||||||
# put your own login shell specific configuration below
|
|
||||||
# this line
|
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 30 14:13:40 UTC 2016 - mmanno@suse.com
|
||||||
|
|
||||||
|
- Remove custom zshrc and zshenv as they might interfere with the users config
|
||||||
|
- Remove unused zshprompt.pl
|
||||||
|
- Move install outside loop in spec file, was executed too often
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed May 25 12:30:17 UTC 2016 - llua@gmx.com
|
Wed May 25 12:30:17 UTC 2016 - llua@gmx.com
|
||||||
|
|
||||||
|
15
zsh.spec
15
zsh.spec
@ -26,9 +26,7 @@ Url: http://www.zsh.org
|
|||||||
Source0: http://www.zsh.org/pub/zsh-%{version}.tar.xz
|
Source0: http://www.zsh.org/pub/zsh-%{version}.tar.xz
|
||||||
Source1: http://www.zsh.org/pub/zsh-%{version}.tar.xz.asc
|
Source1: http://www.zsh.org/pub/zsh-%{version}.tar.xz.asc
|
||||||
Source2: %{name}.keyring
|
Source2: %{name}.keyring
|
||||||
Source3: zshrc
|
Source3: zprofile
|
||||||
Source4: zshenv
|
|
||||||
Source5: zprofile
|
|
||||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||||
Source11: zlogin.rhs
|
Source11: zlogin.rhs
|
||||||
Source12: zlogout.rhs
|
Source12: zlogout.rhs
|
||||||
@ -36,7 +34,6 @@ Source13: zprofile.rhs
|
|||||||
Source14: zshrc.rhs
|
Source14: zshrc.rhs
|
||||||
Source15: zshenv.rhs
|
Source15: zshenv.rhs
|
||||||
Source16: dotzshrc.rh
|
Source16: dotzshrc.rh
|
||||||
Source17: zshprompt.pl
|
|
||||||
%endif
|
%endif
|
||||||
Patch1: trim-unneeded-completions.patch
|
Patch1: trim-unneeded-completions.patch
|
||||||
# PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion
|
# PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion
|
||||||
@ -106,10 +103,6 @@ This package contains the Zsh manual in html format.
|
|||||||
# Remove executable bit
|
# Remove executable bit
|
||||||
chmod 0644 Etc/changelog2html.pl
|
chmod 0644 Etc/changelog2html.pl
|
||||||
|
|
||||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
|
||||||
cp -p %{SOURCE17} .
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# Fix bindir path in some files
|
# Fix bindir path in some files
|
||||||
perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \
|
perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \
|
||||||
Doc/intro.ms Misc/globtests.ksh Misc/globtests \
|
Doc/intro.ms Misc/globtests.ksh Misc/globtests \
|
||||||
@ -165,7 +158,7 @@ install -m 0755 -Dd %{buildroot}/{etc,bin}
|
|||||||
|
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
# install SUSE configuration
|
# install SUSE configuration
|
||||||
install -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_sysconfdir}
|
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}
|
||||||
|
|
||||||
# Create custom completion directory
|
# Create custom completion directory
|
||||||
mkdir %{buildroot}%{_sysconfdir}/zsh_completion.d
|
mkdir %{buildroot}%{_sysconfdir}/zsh_completion.d
|
||||||
@ -175,8 +168,8 @@ mkdir %{buildroot}%{_sysconfdir}/zsh_completion.d
|
|||||||
# install RHEL || CentOS || Fedora configuration
|
# install RHEL || CentOS || Fedora configuration
|
||||||
for i in zlogin zlogout zprofile zshrc zshenv; do
|
for i in zlogin zlogout zprofile zshrc zshenv; do
|
||||||
install -m 0644 $RPM_SOURCE_DIR/${i}.rhs %{buildroot}%{_sysconfdir}/$i
|
install -m 0644 $RPM_SOURCE_DIR/${i}.rhs %{buildroot}%{_sysconfdir}/$i
|
||||||
install -D -m 0644 %{SOURCE16} %{buildroot}%{_sysconfdir}/skel/.zshrc
|
|
||||||
done
|
done
|
||||||
|
install -D -m 0644 %{SOURCE16} %{buildroot}%{_sysconfdir}/skel/.zshrc
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# install help files
|
# install help files
|
||||||
@ -259,8 +252,6 @@ fi
|
|||||||
%doc ChangeLog FEATURES LICENCE MACHINES META-FAQ NEWS README
|
%doc ChangeLog FEATURES LICENCE MACHINES META-FAQ NEWS README
|
||||||
%doc Etc/* intro.ps Misc/compctl-examples
|
%doc Etc/* intro.ps Misc/compctl-examples
|
||||||
|
|
||||||
%config(noreplace) %{_sysconfdir}/zshrc
|
|
||||||
%config(noreplace) %{_sysconfdir}/zshenv
|
|
||||||
%config(noreplace) %{_sysconfdir}/zprofile
|
%config(noreplace) %{_sysconfdir}/zprofile
|
||||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||||
%config(noreplace) %{_sysconfdir}/zlogin
|
%config(noreplace) %{_sysconfdir}/zlogin
|
||||||
|
235
zshprompt.pl
235
zshprompt.pl
@ -1,235 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
|
|
||||||
#requires Gtk-Perl
|
|
||||||
|
|
||||||
use Gtk;
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
set_locale Gtk;
|
|
||||||
init Gtk;
|
|
||||||
|
|
||||||
my $window = new Gtk::Window("toplevel");
|
|
||||||
$window->signal_connect( "delete_event", \&CloseAppWindow );
|
|
||||||
my $table = new Gtk::Table( 20, 6, 0 );
|
|
||||||
$window->border_width( 5 );
|
|
||||||
#$window->add( $button );
|
|
||||||
|
|
||||||
|
|
||||||
my $prompt = new Gtk::Entry( 128);
|
|
||||||
my $log = new Gtk::Text();
|
|
||||||
$log->set_usize(40,60);
|
|
||||||
$log->show();
|
|
||||||
$prompt->show();
|
|
||||||
#$prompt->set_editable (1);
|
|
||||||
$prompt->set_text("");
|
|
||||||
$table->attach( $prompt,0,4,0,4,[ 'expand', 'shrink', 'fill' ],
|
|
||||||
'shrink',
|
|
||||||
0, 0 );
|
|
||||||
|
|
||||||
$table->set_row_spacings( 5 );
|
|
||||||
$table->set_col_spacings( 5 );
|
|
||||||
|
|
||||||
my $currDir = new Gtk::Button( "Current Directory" );
|
|
||||||
$currDir->show();
|
|
||||||
$table->attach_defaults( $currDir,0,1,4,6 );
|
|
||||||
|
|
||||||
my $errorCode = new Gtk::Button( "Last Return Code" );
|
|
||||||
$errorCode->show();
|
|
||||||
$table->attach_defaults( $errorCode,1,2,4,6 );
|
|
||||||
|
|
||||||
my $currTime = new Gtk::Button( "Time" );
|
|
||||||
$currTime->show();
|
|
||||||
$table->attach_defaults( $currTime,2,3,4,6 );
|
|
||||||
|
|
||||||
my $hist = new Gtk::Button( "History Number" );
|
|
||||||
$hist->show();
|
|
||||||
$table->attach_defaults( $hist,3,4,4,6 );
|
|
||||||
|
|
||||||
my $host = new Gtk::Button( "Hostname" );
|
|
||||||
$host->show();
|
|
||||||
$table->attach_defaults( $host,0,1,6,8 );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $backgroundBlue = new Gtk::Button( "Blue Background" );
|
|
||||||
$backgroundBlue->show();
|
|
||||||
$table->attach_defaults( $backgroundBlue,0,1,8,10 );
|
|
||||||
|
|
||||||
my $backgroundRed = new Gtk::Button( "Red Background" );
|
|
||||||
$backgroundRed->show();
|
|
||||||
$table->attach_defaults( $backgroundRed,1,2,8,10 );
|
|
||||||
|
|
||||||
my $backgroundGreen = new Gtk::Button( "Green Background" );
|
|
||||||
$backgroundGreen->show();
|
|
||||||
$table->attach_defaults( $backgroundGreen,2,3,8,10 );
|
|
||||||
|
|
||||||
my $backgroundYellow = new Gtk::Button( "Yellow Background" );
|
|
||||||
$backgroundYellow->show();
|
|
||||||
$table->attach_defaults( $backgroundYellow,3,4,8,10 );
|
|
||||||
|
|
||||||
my $backgroundBlack = new Gtk::Button( "Black Background" );
|
|
||||||
$backgroundBlack->show();
|
|
||||||
$table->attach_defaults( $backgroundBlack,5,6,8,10 );
|
|
||||||
|
|
||||||
my $backgroundWhite = new Gtk::Button( "White Background" );
|
|
||||||
$backgroundWhite->show();
|
|
||||||
$table->attach_defaults( $backgroundWhite,6,7,8,10 );
|
|
||||||
|
|
||||||
my $backgroundPink = new Gtk::Button( "Pink Background" );
|
|
||||||
$backgroundPink->show();
|
|
||||||
$table->attach_defaults( $backgroundPink,7,8,8,10 );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $textBlue = new Gtk::Button( "Blue Text" );
|
|
||||||
$textBlue->show();
|
|
||||||
$table->attach_defaults( $textBlue,0,1,10,12 );
|
|
||||||
|
|
||||||
my $textRed = new Gtk::Button( "Red Text" );
|
|
||||||
$textRed->show();
|
|
||||||
$table->attach_defaults( $textRed,1,2,10,12 );
|
|
||||||
|
|
||||||
my $textGreen = new Gtk::Button( "Green Text" );
|
|
||||||
$textGreen->show();
|
|
||||||
$table->attach_defaults( $textGreen,2,3,10,12 );
|
|
||||||
|
|
||||||
my $textYellow = new Gtk::Button( "Yellow Text" );
|
|
||||||
$textYellow->show();
|
|
||||||
$table->attach_defaults( $textYellow,3,4,10,12 );
|
|
||||||
|
|
||||||
my $textBlack = new Gtk::Button( "Black Text" );
|
|
||||||
$textBlack->show();
|
|
||||||
$table->attach_defaults( $textBlack,5,6,10,12 );
|
|
||||||
|
|
||||||
my $textWhite = new Gtk::Button( "White Text" );
|
|
||||||
$textWhite->show();
|
|
||||||
$table->attach_defaults( $textWhite,6,7,10,12 );
|
|
||||||
|
|
||||||
my $textPink = new Gtk::Button( "Pink Text" );
|
|
||||||
$textPink->show();
|
|
||||||
$table->attach_defaults( $textPink,7,8,10,12 );
|
|
||||||
|
|
||||||
|
|
||||||
my $textDefault = new Gtk::Button( "Default Text" );
|
|
||||||
$textDefault->show();
|
|
||||||
$table->attach_defaults( $textDefault,0,1,12,14 );
|
|
||||||
|
|
||||||
my $backgroundDefault = new Gtk::Button( "Default Background" );
|
|
||||||
$backgroundDefault->show();
|
|
||||||
$table->attach_defaults( $backgroundDefault,1,2,12,14 );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $set = new Gtk::Button( "Save Settings" );
|
|
||||||
$set->show();
|
|
||||||
$table->attach_defaults( $set,0,1,16,18 );
|
|
||||||
|
|
||||||
my $xterm = new Gtk::Button( "Test saved settings" );
|
|
||||||
$xterm->show();
|
|
||||||
$table->attach_defaults( $xterm,1,2,16,18 );
|
|
||||||
|
|
||||||
$table->attach_defaults( $log,0,6,18,20 );
|
|
||||||
|
|
||||||
|
|
||||||
$currDir->signal_connect( "clicked", \&insertButtonText, "%1/" );
|
|
||||||
$errorCode->signal_connect( "clicked", \&insertButtonText, "%?" );
|
|
||||||
$currTime->signal_connect( "clicked", \&insertButtonText, "%T" );
|
|
||||||
$hist->signal_connect( "clicked", \&insertButtonText, "%!" );
|
|
||||||
$host->signal_connect( "clicked", \&insertButtonText, "%m" );
|
|
||||||
|
|
||||||
$backgroundBlue->signal_connect( "clicked", \&insertButtonText, "%{\$bg[blue]%}" );
|
|
||||||
$backgroundRed->signal_connect( "clicked", \&insertButtonText, "%{\$bg[red]%}" );
|
|
||||||
$backgroundGreen->signal_connect( "clicked", \&insertButtonText, "%{\$bg[green]%}" );
|
|
||||||
$backgroundYellow->signal_connect( "clicked", \&insertButtonText, "%{\$bg[yellow]%}" );
|
|
||||||
$backgroundBlack->signal_connect( "clicked", \&insertButtonText, "%{\$bg[black]%}" );
|
|
||||||
$backgroundWhite->signal_connect( "clicked", \&insertButtonText, "%{\$bg[white]%}" );
|
|
||||||
$backgroundPink->signal_connect( "clicked", \&insertButtonText, "%{\$bg[magenta]%}" );
|
|
||||||
$backgroundDefault->signal_connect( "clicked", \&insertButtonText, "%{\$bg[default]%}" );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$textBlue->signal_connect( "clicked", \&insertButtonText, "%{\$fg[blue]%}" );
|
|
||||||
$textRed->signal_connect( "clicked", \&insertButtonText, "%{\$fg[red]%}" );
|
|
||||||
$textGreen->signal_connect( "clicked", \&insertButtonText, "%{\$fg[green]%}" );
|
|
||||||
$textYellow->signal_connect( "clicked", \&insertButtonText, "%{\$fg[yellow]%}" );
|
|
||||||
$textBlack->signal_connect( "clicked", \&insertButtonText, "%{\$fg[black]%}" );
|
|
||||||
$textWhite->signal_connect( "clicked", \&insertButtonText, "%{\$fg[white]%}" );
|
|
||||||
$textPink->signal_connect( "clicked", \&insertButtonText, "%{\$fg[magenta]%}" );
|
|
||||||
$textDefault->signal_connect( "clicked", \&insertButtonText, "%{\$fg[default]%}" );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$set->signal_connect( "clicked", \&pushEnv );
|
|
||||||
$xterm->signal_connect( "clicked", \&xterm );
|
|
||||||
|
|
||||||
sub xterm
|
|
||||||
{
|
|
||||||
my $string="xterm -e zsh -li&";
|
|
||||||
#$string.=$prompt->get_text();
|
|
||||||
|
|
||||||
#$string.="' zsh -li\"& ";
|
|
||||||
|
|
||||||
system($string);
|
|
||||||
# $prompt->append_text( $string );
|
|
||||||
$log->insert( "", "white", "black", "executing:\n $string\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub pushEnv
|
|
||||||
{
|
|
||||||
chdir("~");
|
|
||||||
use Env qw(PS1);
|
|
||||||
my $pNotSet=0;
|
|
||||||
open(PROMPT, "+<", ".prompt") or $pNotSet=1;
|
|
||||||
|
|
||||||
|
|
||||||
if($pNotSet)
|
|
||||||
{
|
|
||||||
#$prompt->insert( "", "white", "black", "prompt is not set");
|
|
||||||
open(ZSHRC, '>>','.zshrc') or die "cannot open zshrc";
|
|
||||||
print ZSHRC ". ~/.prompt\n";
|
|
||||||
close (ZSHRC);
|
|
||||||
}
|
|
||||||
close (PROMPT);
|
|
||||||
open(PROMPT, ">", ".prompt");
|
|
||||||
print PROMPT "export PS1=\"",$prompt->get_text(),"\"\n";
|
|
||||||
|
|
||||||
#$prompt->insert( "", "white", "black", $PS1);
|
|
||||||
|
|
||||||
close(PROMPT);
|
|
||||||
close(ZSHRC);
|
|
||||||
$prompt->grab_focus();
|
|
||||||
|
|
||||||
}
|
|
||||||
$prompt->can_default(1);
|
|
||||||
$prompt->grab_default();
|
|
||||||
$table->show();
|
|
||||||
$window->add( $table );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$window->show();
|
|
||||||
$prompt->grab_focus();
|
|
||||||
main Gtk;
|
|
||||||
|
|
||||||
exit( 0 );
|
|
||||||
|
|
||||||
sub CloseAppWindow
|
|
||||||
{
|
|
||||||
Gtk->exit( 0 );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub insertButtonText
|
|
||||||
{
|
|
||||||
my ($widget, $txt) = @_;
|
|
||||||
$prompt->append_text( $txt );
|
|
||||||
$prompt->grab_focus();
|
|
||||||
}
|
|
252
zshrc
252
zshrc
@ -1,252 +0,0 @@
|
|||||||
# read bash.bashrc first for some features we dont want
|
|
||||||
# to re-implement here
|
|
||||||
source /etc/bash.bashrc
|
|
||||||
|
|
||||||
# Custom completion support via /etc/zsh_completion.d
|
|
||||||
fpath=( $fpath /etc/zsh_completion.d )
|
|
||||||
|
|
||||||
# zsh line editing
|
|
||||||
: ${ZSHEDIT:="emacs"}
|
|
||||||
: ${TERM:=linux}
|
|
||||||
|
|
||||||
if [[ "$ZSHEDIT" == "vi" ]] then
|
|
||||||
bindkey -v
|
|
||||||
else
|
|
||||||
bindkey -e
|
|
||||||
bindkey "^[ " magic-space
|
|
||||||
bindkey "^[!" expand-history
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Environment
|
|
||||||
HISTSIZE=1000
|
|
||||||
HISTFILE=${HOME}/.zsh_history
|
|
||||||
SAVEHIST=500
|
|
||||||
|
|
||||||
# Prompt on the right side. zsh feature
|
|
||||||
#RPROMPT="[%T]"
|
|
||||||
|
|
||||||
# Set/unset shell options
|
|
||||||
setopt nocorrect
|
|
||||||
setopt pushdtohome
|
|
||||||
setopt autolist
|
|
||||||
setopt nopromptcr
|
|
||||||
setopt nocorrectall
|
|
||||||
setopt autocd
|
|
||||||
setopt recexact
|
|
||||||
setopt longlistjobs
|
|
||||||
setopt histignoredups
|
|
||||||
setopt pushdsilent
|
|
||||||
setopt appendhistory
|
|
||||||
setopt histexpiredupsfirst
|
|
||||||
setopt autopushd
|
|
||||||
setopt pushdminus
|
|
||||||
setopt extendedglob
|
|
||||||
setopt rcquotes
|
|
||||||
unsetopt bgnice
|
|
||||||
unsetopt autoparamslash
|
|
||||||
unsetopt hup
|
|
||||||
|
|
||||||
# Setup some basic programmable completions. To see more examples
|
|
||||||
# of these, check out /usr/doc/packages/zsh/compctl-examples.
|
|
||||||
# You you have a slow machine, you might want to comment the lines below
|
|
||||||
# with compctl in, and comment the below two lines out.
|
|
||||||
#
|
|
||||||
# compctl -g '*(-/)' cd pushd
|
|
||||||
# compctl -g '*(/)' rmdir dircmp
|
|
||||||
# compctl -j -P % -x 's[-] p[1]' -k signals -- kill
|
|
||||||
# compctl -j -P % fg bg wait jobs disown
|
|
||||||
# compctl -A shift
|
|
||||||
# compctl -caF type whence which
|
|
||||||
# compctl -F unfunction
|
|
||||||
# compctl -a unalias
|
|
||||||
# compctl -v unset typeset declare vared readonly export integer
|
|
||||||
# compctl -e disable
|
|
||||||
# compctl -d enable
|
|
||||||
#
|
|
||||||
# The default way is the usage of the zsh built-in completer
|
|
||||||
# Comment the two below lines out, if you are on a slow machine, and
|
|
||||||
# comment the above compctl lines in.
|
|
||||||
|
|
||||||
autoload -U compinit
|
|
||||||
compinit
|
|
||||||
|
|
||||||
# Completion so "cd ..<TAB>" -> "cd ../"
|
|
||||||
# zstyle ':completion:*' special-dirs ..
|
|
||||||
|
|
||||||
# Online help
|
|
||||||
unalias run-help 2>/dev/null || true
|
|
||||||
autoload run-help
|
|
||||||
|
|
||||||
# Don't use zsh builtin which
|
|
||||||
alias which >/dev/null && unalias which
|
|
||||||
|
|
||||||
# Common standard keypad and cursor
|
|
||||||
bindkey "^[[2~" yank
|
|
||||||
bindkey "^[[3~" delete-char
|
|
||||||
|
|
||||||
# History completion on pgup and pgdown
|
|
||||||
autoload -U history-search-end
|
|
||||||
zle -N history-beginning-search-backward-end history-search-end
|
|
||||||
zle -N history-beginning-search-forward-end history-search-end
|
|
||||||
bindkey "^[[5~" history-beginning-search-backward-end
|
|
||||||
bindkey "^[[6~" history-beginning-search-forward-end
|
|
||||||
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
bindkey "^[2;5~" yank
|
|
||||||
bindkey "^[3;5~" delete-char
|
|
||||||
bindkey "^[5;5~" up-history
|
|
||||||
bindkey "^[6;5~" down-history
|
|
||||||
fi
|
|
||||||
bindkey "^[[C" forward-char
|
|
||||||
bindkey "^[[D" backward-char
|
|
||||||
bindkey "^[[A" up-history
|
|
||||||
bindkey "^[[B" down-history
|
|
||||||
|
|
||||||
# Avoid network problems
|
|
||||||
# ... \177 (ASCII-DEL) and \010 (ASCII-BS)
|
|
||||||
# do `backward-delete-char'
|
|
||||||
# Note: `delete-char' is maped to \033[3~
|
|
||||||
# Therefore xterm's responce on pressing
|
|
||||||
# key Delete or KP-Delete should be
|
|
||||||
# \033[3~ ... NOT \177
|
|
||||||
bindkey "^?" backward-delete-char
|
|
||||||
bindkey "^H" backward-delete-char
|
|
||||||
|
|
||||||
# Home and End
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
# Normal keypad and cursor of xterm
|
|
||||||
bindkey "^[[1~" history-search-backward
|
|
||||||
bindkey "^[[4~" set-mark-command
|
|
||||||
bindkey "^[[H" beginning-of-line
|
|
||||||
bindkey "^[[F" end-of-line
|
|
||||||
# Home and End of application keypad and cursor of xterm
|
|
||||||
bindkey "^[OH" beginning-of-line
|
|
||||||
bindkey "^[OF" end-of-line
|
|
||||||
bindkey "^[O5H" beginning-of-line
|
|
||||||
bindkey "^[O5F" end-of-line
|
|
||||||
else
|
|
||||||
if [[ "$TERM" == "kvt" ]] then
|
|
||||||
bindkey "^[[1~" history-search-backward
|
|
||||||
bindkey "^[[4~" set-mark-command
|
|
||||||
bindkey "^[OH" beginning-of-line
|
|
||||||
bindkey "^[OF" end-of-line
|
|
||||||
else
|
|
||||||
# TERM=linux or console
|
|
||||||
bindkey "^[[1~" beginning-of-line
|
|
||||||
bindkey "^[[4~" end-of-line
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Application keypad and cursor of xterm
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
bindkey "^[OD" backward-char
|
|
||||||
bindkey "^[OC" forward-char
|
|
||||||
bindkey "^[OA" up-history
|
|
||||||
bindkey "^[OB" down-history
|
|
||||||
# DEC keyboard KP_F1 - KP_F4
|
|
||||||
bindkey -s "^[OP" "^["
|
|
||||||
bindkey "^[OQ" undo
|
|
||||||
bindkey "^[OR" undefined-key
|
|
||||||
bindkey "^[OS" kill-line
|
|
||||||
fi
|
|
||||||
if [[ "$TERM" == "gnome" ]] then
|
|
||||||
# or gnome terminal F1 - F4
|
|
||||||
bindkey -s "^[OP" "^["
|
|
||||||
bindkey "^[OQ" undo
|
|
||||||
bindkey "^[OR" undefined-key
|
|
||||||
bindkey "^[OS" kill-line
|
|
||||||
fi
|
|
||||||
# Function keys F1 - F12
|
|
||||||
if [[ "$TERM" == "linux" ]] then
|
|
||||||
# On console the first five function keys
|
|
||||||
bindkey "^[[[A" undefined-key
|
|
||||||
bindkey "^[[[B" undefined-key
|
|
||||||
bindkey "^[[[C" undefined-key
|
|
||||||
bindkey "^[[[D" undefined-key
|
|
||||||
bindkey "^[[[E" undefined-key
|
|
||||||
else
|
|
||||||
# The first five standard function keys
|
|
||||||
bindkey "^[[11~" undefined-key
|
|
||||||
bindkey "^[[12~" undefined-key
|
|
||||||
bindkey "^[[13~" undefined-key
|
|
||||||
bindkey "^[[14~" undefined-key
|
|
||||||
bindkey "^[[15~" undefined-key
|
|
||||||
fi
|
|
||||||
bindkey "^[[17~" undefined-key
|
|
||||||
bindkey "^[[18~" undefined-key
|
|
||||||
bindkey "^[[19~" undefined-key
|
|
||||||
bindkey "^[[20~" undefined-key
|
|
||||||
bindkey "^[[21~" undefined-key
|
|
||||||
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
|
|
||||||
bindkey "^[[23~" undefined-key
|
|
||||||
bindkey "^[[24~" undefined-key
|
|
||||||
|
|
||||||
# Shift Function keys F1 - F12
|
|
||||||
# identical with F11 - F22
|
|
||||||
#
|
|
||||||
# bindkey "^[[23~" undefined-key
|
|
||||||
# bindkey "^[[24~" undefined-key
|
|
||||||
bindkey "^[[25~" undefined-key
|
|
||||||
bindkey "^[[26~" undefined-key
|
|
||||||
# DEC keyboard: F15=^[[28~ is Help
|
|
||||||
bindkey "^[[28~" undefined-key
|
|
||||||
# DEC keyboard: F16=^[[29~ is Menu
|
|
||||||
bindkey "^[[29~" undefined-key
|
|
||||||
bindkey "^[[31~" undefined-key
|
|
||||||
bindkey "^[[32~" undefined-key
|
|
||||||
bindkey "^[[33~" undefined-key
|
|
||||||
bindkey "^[[34~" undefined-key
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
# Not common
|
|
||||||
bindkey "^[[35~" undefined-key
|
|
||||||
bindkey "^[[36~" undefined-key
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
# Application keypad and cursor of xterm
|
|
||||||
# with NumLock ON
|
|
||||||
#
|
|
||||||
# Operators
|
|
||||||
bindkey -s "^[Oo" "/"
|
|
||||||
bindkey -s "^[Oj" "*"
|
|
||||||
bindkey -s "^[Om" "-"
|
|
||||||
bindkey -s "^[Ok" "+"
|
|
||||||
bindkey -s "^[Ol" ","
|
|
||||||
bindkey -s "^[OM" "\n"
|
|
||||||
bindkey -s "^[On" "."
|
|
||||||
# Numbers
|
|
||||||
bindkey -s "^[Op" "0"
|
|
||||||
bindkey -s "^[Oq" "1"
|
|
||||||
bindkey -s "^[Or" "2"
|
|
||||||
bindkey -s "^[Os" "3"
|
|
||||||
bindkey -s "^[Ot" "4"
|
|
||||||
bindkey -s "^[Ou" "5"
|
|
||||||
bindkey -s "^[Ov" "6"
|
|
||||||
bindkey -s "^[Ow" "7"
|
|
||||||
bindkey -s "^[Ox" "8"
|
|
||||||
bindkey -s "^[Oy" "9"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# EMACS line editing
|
|
||||||
if [[ "$ZSHEDIT" == "emacs" ]] then
|
|
||||||
# ... xterm application cursor
|
|
||||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
|
||||||
bindkey "^[^[OD" backward-word
|
|
||||||
bindkey "^[^[OC" forward-word
|
|
||||||
bindkey "^[^[OA" up-history
|
|
||||||
bindkey "^[^[OB" down-history
|
|
||||||
bindkey "^^[OD" backward-char
|
|
||||||
bindkey "^^[OC" forward-char
|
|
||||||
bindkey "^^[OA" up-history
|
|
||||||
bindkey "^^[OB" down-history
|
|
||||||
fi
|
|
||||||
# Standard cursor
|
|
||||||
bindkey "^[^[[D" backward-word
|
|
||||||
bindkey "^[^[[C" forward-word
|
|
||||||
bindkey "^[^[[A" up-history
|
|
||||||
bindkey "^[^[[B" down-history
|
|
||||||
bindkey "^^[[D" backward-char
|
|
||||||
bindkey "^^[[C" forward-char
|
|
||||||
bindkey "^^[[A" up-history
|
|
||||||
bindkey "^^[[B" down-history
|
|
||||||
fi
|
|
Loading…
Reference in New Issue
Block a user