Tornando o bash mais amigável

O recurso 'Tab completion' do bash é apenas um aperitivo do que ele é capaz, criando um arquivo ~/.inputrc no seu diretório pessoal as coisas melhoram ainda mais. Se o bash não estiver lendo a variável $INPUTRC coloque-a no seu ~/.bashrc para que ele leia o inputrc e copie o código abaixo para ele:


# ------------------------------------------------------
# FILE: ~/.inputrc
# CREATED: Qui 13/Out/2011 hs 09:39
# LAST CHANGE: Qui 13/Out/2011 hs 09:39
# SITE: http://vivaotux.blogspot.com
# TWITTER: http://www.twitter.com/voyeg3r
# EMAIL: <voyeg3r  gmail.com>
# DOWNLOAD: https://gist.github.com/1284081
#
# key bindings for bash
#
# ( O O )
# --------------oOO--(_)--OOo---------------------------
#-------------------------------------------------------
# Use `bind -v` to see current settings
#-------------------------------------------------------
# definir no ~/ .bashrc o local do inputrc
# INPUTRC=~/.inputrc
# para baixar:
# wget -c https://raw.github.com/gist/1284081 -O ~/.inputrc
# alternative download
# wget -c http://pastie.org/pastes/2689512/text -C ~/.inpurtc
# Referências
# https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/103986
# http://superuser.com/questions/222390/making-bash-tab-completion-more-like-cmd-exe
# pesquisar sobre as opções 'shopt' do bash
# pesquisar as opções 'cmdhist' 'nocaseglob' 'nocasematch'
# By default, C-x C-r is bound to re-read-init-file.
# Adding this to your /etc/inputrc or ~/.inputrc will result in a character
# # being appended to any file-names returned by completion, in much the same
# # way as ls -F works.
set visible-stats on
set blink-matching-paren on
set bell-style visible
set convert-meta off
set input-meta on
set output-meta on
$if Bash
# Search history back and forward using page-up and page-down
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# Cycle through ambiguous completions instead of list (option bellow)
"\C-i": menu-complete
# Completion
set match-hidden-files off
set completion-query-items 350
set completion-ignore-case on
set show-all-if-ambiguous on
set show-all-if-unmodified on
# do history expansion when space entered
Space: magic-space
$endif
$include /etc/inputrc
# put in your ~/.bashrc
# complete -d cd mkdir rmdir
# exec bash (to reload bash)
view raw inputrc hosted with ❤ by GitHub

linux-cookbook

Grupos do Google
Participe do grupo linux-cookbook
E-mail:
Visitar este grupo