Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZSH users (lovers?) thread
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 8, 9, 10, 11, 12, 13  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
champ
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2006
Posts: 96
Location: Thailand

PostPosted: Thu Apr 17, 2008 7:04 am    Post subject: Reply with quote

Quote:
Why do you have alias aliased to : ?
I don't know :(
Quote:
Try 'unalias alias' and it should work fine.
That worked. Thanks kwalo.
_________________
"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety." - Benjamin Franklin

blog: johnsearth.blogspot.com
Back to top
View user's profile Send private message
champ
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2006
Posts: 96
Location: Thailand

PostPosted: Fri Apr 18, 2008 9:14 am    Post subject: Reply with quote

I found the culprit. The default zshenv file has the line
Code:
alias alias=' :'
I didn't read the fine print :oops:
_________________
"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety." - Benjamin Franklin

blog: johnsearth.blogspot.com
Back to top
View user's profile Send private message
punloh
n00b
n00b


Joined: 29 Mar 2008
Posts: 23

PostPosted: Tue Mar 03, 2009 9:53 am    Post subject: Reply with quote

I've got a problem with making zsh use the completions cache. Whenever I type paludis -i <partial_package_name> <TAB> or emerge -i <partial_package_name> <TAB> no cache is created. The exactly same config works ok on debian and caches the completions for apt just fine.
My /etc/zshrc
Code:
# /etc/zsh/zshrc: system-wide .zshrc file for zsh(1).
#
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Global Order: zshenv, zprofile, zshrc, zlogin

READNULLCMD=${PAGER:-/usr/bin/pager}

if [[ "$TERM" != emacs ]]; then
[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
[[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode

# ncurses fogyatekos
[[ "$terminfo[khome]" == "∪ ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
[[ "$terminfo[kend]" == "∪ ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
fi

# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
bindkey -M emacs '^[[1;5C' forward-word
bindkey -M emacs '^[[1;5D' backward-word

bindkey '^r' history-incremental-search-backward
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[H" beginning-of-line
bindkey "^[[1~" beginning-of-line
bindkey "^[[F"  end-of-line
bindkey "^[[4~" end-of-line
bindkey ' ' magic-space    # also do history expansion on space
bindkey '^I' complete-word # complete on tab, leave expansion to _expand

zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
              /usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin

unalias run-help
autoload run-help

# next lets set some enviromental/shell pref stuff up
# setopt NOHUP
#setopt NOTIFY
#setopt NO_FLOW_CONTROL
setopt APPEND_HISTORY
# setopt AUTO_LIST                # these two should be turned off
# setopt AUTO_REMOVE_SLASH
# setopt AUTO_RESUME                # tries to resume command of same name
unsetopt BG_NICE                # do NOT nice bg commands
unsetopt BEEP
setopt CORRECT                        # command CORRECTION
setopt EXTENDED_HISTORY                # puts timestamps in the history
setopt HASH_CMDS                # turns on hashing
setopt HIST_ALLOW_CLOBBER
setopt HIST_REDUCE_BLANKS
setopt INC_APPEND_HISTORY SHARE_HISTORY
setopt ALL_EXPORT

setopt MENUCOMPLETE
# Set/unset  shell options
setopt   notify globdots correct pushdtohome cdablevars autolist
setopt   correctall autocd recexact longlistjobs
setopt   autoresume histignoredups pushdsilent noclobber
setopt   autopushd pushdignoredups pushdminus extendedglob rcquotes mailwarning
unsetopt bgnice autoparamslash

# Autoload zsh modules when they are referenced
zmodload -a zsh/stat stat
zmodload -a zsh/zpty zpty
zmodload -a zsh/zprof zprof
#zmodload -ap zsh/mapfile mapfile



unsetopt ALL_EXPORT
# # --------------------------------------------------------------------
# # aliases
# # --------------------------------------------------------------------
alias ll='ls -al'
alias ls='ls --color=auto '
alias eix='nocorrect eix'

autoload -U compinit
compinit

zstyle ':completion::complete:*' use-cache on
#zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
zstyle ':completion:*' squeeze-slashes true
bindkey '^i' expand-or-complete-prefix

_force_rehash() {
  (( CURRENT == 1 )) && rehash
  return 1   # Because we didn't really complete anything
}

zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' menu select=1 _complete _ignored _approximate
zstyle -e ':completion:*:approximate:*' max-errors \
    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*:processes' command 'ps -aU$USER'
# Completion Styles
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
# list of completers to use
zstyle ':completion:*::::' completer _oldlist _expand _complete _ignored _approximate _force_rehash

# allow one error for every three characters typed in approximate completer
zstyle -e ':completion:*:approximate:*' max-errors \
    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
   
# insert all expansions for expand completer
zstyle ':completion:*:expand:*' tag-order all-expansions
#
#NEW completion:
# 1. All /etc/hosts hostnames are in autocomplete
# 2. If you have a comment in /etc/hosts like #%foobar.domain,
#    then foobar.domain will show up in autocomplete!
zstyle ':completion:*' hosts $(awk '/^[^#]/ {print $2 $3" "$4" "$5}' /etc/hosts | grep -v ip6- && grep "^#%" /etc/hosts | awk -F% '{print $2}')
# formatting and messages
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*' group-name ''

# match uppercase from lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# offer indexes before parameters in subscripts
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters

# command for process lists, the local web server details and host completion
#zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args'
#zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html'
zstyle '*' hosts $hosts

# Filename suffixes to ignore during completion (except after rm command)
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \
    '*?.old' '*?.pro'
# the same for old style completion
#fignore=(.o .c~ .old .pro)

# ignore completion functions (until the _ignored completer)
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*:scp:*' tag-order \
   files users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'
zstyle ':completion:*:scp:*' group-order \
   files all-files users hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order \
   users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'
zstyle ':completion:*:ssh:*' group-order \
   hosts-domain hosts-host users hosts-ipaddr
zstyle '*' single-ignored show


export ZSHDIR=$HOME/.zsh

# for custom functions
fpath=($ZSHDIR/functions $fpath)

# needs to be done after precmd/preexec are defined!
autoload -Uz promptinit
#promptinit; prompt gentoo
PROMPT=$'%{\e[0;32m%}%B%n@%m%b %{\e[0;34m%}%B%~%b%% '

Thanks for reading something that long ;-)
Back to top
View user's profile Send private message
Bill Cosby
Guru
Guru


Joined: 22 Jan 2005
Posts: 430
Location: Aachen, Germany

PostPosted: Sat Aug 08, 2009 1:38 pm    Post subject: Reply with quote

Hi there, I was wondering, has bash4 caught up with zsh?

I mostly use the terminal, and thus would like to have a powerful shell, I am used to bash, since it is simply the default, and quite ok, would you guys recommend zsh over bash for extensive shell use?

I tried it already out, but I am still unsure .. :?
_________________
The Creature from Jekyll Island.
Back to top
View user's profile Send private message
janosh
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 80
Location: Oslo, Norway

PostPosted: Sun Aug 09, 2009 10:25 pm    Post subject: zsh and emerge best practice Reply with quote

I just changed my shell to zsh.
Now when I try to emerge new software the ebuild breaks with an error about C compiler not enable to make executables.

I have narrowed it down to the environment variable CC, if i add "CC=gcc" in my $HOME/.zshrc emerge works again.

Is there a better way to have emerge work again, this don't feel like the right way to do it.
It doesn't look like I need that variable if i change back to bash.

Anyone knows what's going on?
Back to top
View user's profile Send private message
Bill Cosby
Guru
Guru


Joined: 22 Jan 2005
Posts: 430
Location: Aachen, Germany

PostPosted: Mon Aug 10, 2009 9:14 am    Post subject: Reply with quote

check /etc/zshenv or /etc/zsh/zshenv (not sure) and see if it is set up properly to use your gentoo vars, etc..
_________________
The Creature from Jekyll Island.
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Aug 10, 2009 4:45 pm    Post subject: Reply with quote

merged some posts above
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4113

PostPosted: Mon Aug 10, 2009 8:38 pm    Post subject: Reply with quote

Bill Cosby wrote:
I mostly use the terminal, and thus would like to have a powerful shell, I am used to bash, since it is simply the default, and quite ok, would you guys recommend zsh over bash for extensive shell use?

Yes, definitely. Not necessarily for scripts, since they might cause you headache once you are restricted to a system without zsh, but for interactive usage nothing can beat zsh (if you spend some time to configure it; unfortunately, most of the goodies are not seen in the default settings).
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4113

PostPosted: Mon Aug 10, 2009 8:42 pm    Post subject: Re: zsh and emerge best practice Reply with quote

janosh wrote:
I just changed my shell to zsh.

I hope you have done this only for your login shell and not modified the /bin/sh symlink to point to zsh?
If yes, you "just" have to follow Bill Cosby's recommendation: Especially, you have to make sure that the variables defines in /etc/env.d/* will get set - not sure whether the ebuild contains default-zsh-initscripts which do this.
Back to top
View user's profile Send private message
janosh
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 80
Location: Oslo, Norway

PostPosted: Sat Aug 15, 2009 4:21 pm    Post subject: Reply with quote

I fixed my CC variable problem.
I was stupid, and used a .zshrc file i found on the web, that set the CC variable.
When i commented out that line from my .zshrc all is good again, thanks all replys.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Fri Jul 09, 2010 4:41 am    Post subject: Reply with quote

I just setup zsh on my desktop. Here is my /etc/zsh/zshrc file:

Code:
# Aliases
alias grep='grep --colour=auto'
alias ls='ls --color=auto'

# Advanced Tab-completion
autoload -U compinit
compinit
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'

# Command correction
setopt correctall

# Gentoo prompt
autoload -U promptinit
promptinit
prompt gentoo

# History
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt hist_ignore_all_dups
setopt hist_ignore_space

# Extended GLOB support
# Whatever that is
setopt extendedglob

# Key bindings
bindkey "^[[3~" delete-char
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line


What do people here think? Is there any room for improvement? I am thinking of making it my default shell, but I want to be sure that I will not miss anything from bash if I do that.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2454
Location: Silver City, NM

PostPosted: Fri Jul 09, 2010 7:04 am    Post subject: Reply with quote

There is plenty of room for improvement but that can be a long story. With Zsh properly configured, I missed nothing from Bash. IMO, the only serious problem with Zsh is that I'm addicted to it and it feels like I have handcuffs on when I have to go back to Bash (like when I try out different distros).
Back to top
View user's profile Send private message
livius
n00b
n00b


Joined: 21 Oct 2005
Posts: 1
Location: At the meeting of the rivers

PostPosted: Wed Aug 04, 2010 10:55 am    Post subject: Reply with quote

Hello everybody.

A couple of previous posts made me think it would be nice to tell about an experiment of mine.

Since the beginning of my involvement with ZSH I was curious if it would be possible to build a Gentoo OS using Z as the system shell. I knew Z could emulate Bourne Shell, but as the start-up scripts seemed to rely heavily on BASH features, I considered it hopeless to even try. Now with OpenRC using stictly POSIX shell, the crazy scientist fnally took over, and so after having reinstalled one of my systems (a KDE desktop, the reason for reinstallation was the long-due migration x86 -> amd64), I proceeded to link /bin/sh to zsh and see just what happens...

Well, basically, for me it works like charm.
* I booted the system without any problems, save one (see below); KDE started without a single complaint.
* No performance penalty over BASH, which is very pleasant, but also rather expected. What is more surprising is that there is no measurable penalty over the ocasionally praised DASH, used by Debian (if I remember right) for booting, which I tried too in the role of /bin/sh.
* Finally, I rebuilt the whole system thus, and the only problem so far was media-libs/libsdl, for which I had to temporarily revert to /bin/sh -> bash, but even that was due to a bug which I could perhaps solve otherwise if I had had time.

The only true victim so far has been the MySQL startup script. Poor bloke seems to use BASH heavily, but frankly, I don't intend to investigate it, as for me it happens to be just the final straw in a long line of issues with MySQL, going years back, so that it just prompts me to finally switch to Postgres, which I have already decided anyway.

I don't have yet the full set of my desktop packages installed, so I still dare not be categoric, but this is more-or-less fulfillment of my greatest hopes for ZSH.
:D
Back to top
View user's profile Send private message
kemchua
n00b
n00b


Joined: 07 Aug 2010
Posts: 6

PostPosted: Sat Aug 07, 2010 4:25 pm    Post subject: Reply with quote

Does anyone know a way to get portage to automatically "rehash" so that users don't have to type that manually for zsh to find a newly installed app?

spam removed -- Admin team
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2070

PostPosted: Sat Aug 07, 2010 9:20 pm    Post subject: Reply with quote

There's the possibility for self-written hooks into portage, don't know exactly where it's documented though.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2454
Location: Silver City, NM

PostPosted: Sat Aug 07, 2010 9:31 pm    Post subject: Reply with quote

For me, rehash happens instantly. So why not write a little zsh function (in .zshrc) to always rehash after an emerge?
Code:
emerge () {
    /usr/bin/emerge $@
    rehash
}
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2070

PostPosted: Sat Aug 07, 2010 10:02 pm    Post subject: Reply with quote

Quote:
So why not write a little zsh function (in .zshrc) to always rehash after an emerge?
Because this one's expensive, because it also runs after `emerge -{a,p} foo`. Ok, it's not much overhead, but it ain't perfect.

Edit, this fork(?) of portage supports hooks: http://gitorious.org/neuvoo/portage/trees/neuvoo/trunk - correspondig bug: http://bugs.gentoo.org/show_bug.cgi?id=272988
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2454
Location: Silver City, NM

PostPosted: Sat Aug 07, 2010 10:09 pm    Post subject: Reply with quote

As I said before, on my system rehash happens instantly while emerge -p $ANYTHING takes many seconds.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4113

PostPosted: Sun Aug 08, 2010 5:54 am    Post subject: Reply with quote

Unless zsh has added a very particular mechanism concerning rehash which I am missing, portage cannot do anything about it: This is like setting an environment variable; it happens only in the currently shell and can only happen if you run this commend in the shell directly (unless, as mentioned, zsh would have a mechanism added which would allow to start this for the shell directly, like some signal handling or access to an external file to check whether rehash is necessary).

Also a macro wrapping around emerge only solves the problem for that instance of zsh running the emerge command. For all other simultaneously running instances of zsh, a manual rehash is necessary nevertheless.
Back to top
View user's profile Send private message
Krog
Apprentice
Apprentice


Joined: 26 Jun 2007
Posts: 256
Location: Roma, Italy

PostPosted: Sat Oct 23, 2010 9:43 am    Post subject: Reply with quote

I just converted to zsh... awesome!
my config file:
Code:

#!/bin/zsh

# autocompletamento
autoload -U compinit
compinit

# autocorrezione
setopt correctall

# prompt
autoload -U promptinit
promptinit
prompt gentoo
prompt_gentoo_setup


zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
setopt correctall
HISTSIZE=2000
HISTFILE="$HOME/.history"
SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt APPEND_HISTORY           # append the new history to the old
setopt autocd
setopt extendedglob

setopt nonomatch

## copy/paste from X clipboard function ##
copy-to-clipboard ()
{
  if [ -n "$LBUFFER$RBUFFER" ]; then
    echo $LBUFFER$RBUFFER | xclip -i
  fi
}

paste-from-clipboard ()
{
  CLIPOUT=`xclip -o`
  BUFFER=$LBUFFER$CLIPOUT$RBUFFER
}


zle -N paste-from-clipboard paste-from-clipboard
zle -N copy-to-clipboard copy-to-clipboard
bindkey "^V" paste-from-clipboard
bindkey "^X" copy-to-clipboard


# Enable color support of ls
if [[ "$TERM" != "dumb" ]]; then
    if [[ -x `which dircolors` ]]; then
        eval `dircolors -b`
        alias 'ls=ls --color=auto'
    fi
fi

# Typing errors...
alias 'cd..=cd ..'

PAGER=most

# Usage: simple-extract <file>
# Description: extracts archived files (maybe)
  simple-extract () {
        if [[ -f $1 ]]
        then
                case $1 in
                        *.tar.bz2)  bzip2 -v -d $1      ;;
                        *.tar.gz)   tar -xvzf $1        ;;
                        *.rar)      unrar $1            ;;
                        *.deb)      ar -x $1            ;;
                        *.bz2)      bzip2 -d $1         ;;
                        *.lzh)      lha x $1            ;;
                        *.gz)       gunzip -d $1        ;;
                        *.tar)      tar -xvf $1         ;;
                        *.tgz)      gunzip -d $1        ;;
                        *.tbz2)     tar -jxvf $1        ;;
                        *.zip)      unzip $1            ;;
                        *.Z)        uncompress $1       ;;
                        *)          echo "'$1' Error. Please go away" ;;
                esac
        else
                echo "'$1' is not a valid file"
        fi
  }


#per fare ls [freccia su]
bindkey "^[[A"  history-search-backward
bindkey "^[[B"  history-search-forward


emerge () {
    /usr/bin/emerge $@
    rehash
}
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3205

PostPosted: Sat Oct 23, 2010 12:42 pm    Post subject: Reply with quote

@Krog Some hints:
1. Use the following to automatically rehash. Then you don't need to alias emerge.
Code:
# Enable automatic rehash of commands
_force_rehash() {
  (( CURRENT == 1 )) && rehash
  return 1   # Because we didn't really complete anything
}
zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete


2. You can use "alias -s" to pre-define some commands
Code:
~/tmp/Downloadz/mp3> ls                                           
13 - Under Pressure.mp3
~/tmp/Downloadz/mp3> alias -s mp3="mplayer -ac mad, -quiet"
~/tmp/Downloadz/mp3> ./13\ -\ Under\ Pressure.mp3         
MPlayer SVN-r30554-4.4.4 (C) 2000-2010 MPlayer Team

Playing ./13 - Under Pressure.mp3.
Audio only file format detected.
Clip info:
 Title: Under Pressure
 Artist: Queen & David Bowie
 Album: Best Of Bowie
 Year: 2002
 Comment: Amazon.com Song ID: 20198336
 Track: 13
 Genre: Pop
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...

Exiting... (Quit)
~/tmp/Downloadz/mp3>

_________________
emerge --quiet redefined | E17 vids: I, II
Back to top
View user's profile Send private message
Krog
Apprentice
Apprentice


Joined: 26 Jun 2007
Posts: 256
Location: Roma, Italy

PostPosted: Sat Oct 23, 2010 2:34 pm    Post subject: Reply with quote

thanks :-)

one thing: i've just noticed that "home" and "end" buttons of my keyboard are not working now
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3205

PostPosted: Sat Oct 23, 2010 4:08 pm    Post subject: Reply with quote

Krog wrote:
thanks :-)

one thing: i've just noticed that "home" and "end" buttons of my keyboard are not working now
Code:
typeset -A key

key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
bindkey "${key[Home]}"      beginning-of-line
bindkey "${key[End]}"       end-of-line
In fact, my complete key bindings:
Code:
typeset -A key

key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}

bindkey -v                  # vi-keybindings
bindkey "^R"                history-incremental-search-backward
bindkey "^S"                history-incremental-search-forward
bindkey "^A"                beginning-of-line
bindkey "^E"                end-of-line
bindkey "^F"                end-of-line
bindkey "${key[Home]}"      beginning-of-line
bindkey "${key[End]}"       end-of-line
bindkey "${key[Delete]}"    delete-char
bindkey "${key[Insert]}"    overwrite-mode
bindkey "${key[PageUp]}"    up-line-or-search
bindkey "${key[PageDown]}"  down-line-or-search
bindkey "^i"                expand-or-complete-prefix
if [[ $TERM = xterm* ]]; then
    bindkey "^[[H"          beginning-of-line
    bindkey "^[[F"          end-of-line
fi

_________________
emerge --quiet redefined | E17 vids: I, II
Back to top
View user's profile Send private message
Krog
Apprentice
Apprentice


Joined: 26 Jun 2007
Posts: 256
Location: Roma, Italy

PostPosted: Sat Oct 23, 2010 5:34 pm    Post subject: Reply with quote

thanks :-)


edit: it works only on tty
in konsole under kde, the keys still are not working
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4113

PostPosted: Sat Oct 23, 2010 7:41 pm    Post subject: Reply with quote

ppurka wrote:
1. Use the following to automatically rehash. Then you don't need to alias emerge.

This will not work if you do not use autocompletion for the new command (i.e. if you "just" type it). Moreover, if the autocompletion finds another (existing) command it will also not rehash and thus not show the new alternative. I guess these are most of the cases when you installed something new. Moreover, IMHO it is a bit too overdone to rehash that often. If you have really such a fast machine that you do not really care about rehashing time, you can also rehash in the precmd hook (i.e. every time before the prompt is displayed).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3 ... 8, 9, 10, 11, 12, 13  Next
Page 9 of 13

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum