mirror of https://github.com/garabik/grc.git
Merge pull request #56 from MatthiasWinkelmann/readme
Improved shell integration and instructions
This commit is contained in:
commit
b39abc0948
|
@ -1,7 +1,6 @@
|
||||||
# Generic Colouriser
|
# Generic Colouriser
|
||||||
|
|
||||||
Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
|
Radovan Garabík <http://kassiopeia.juls.savba.sk/~garabik/software/grc.html> (garabik @ kassiopeia.juls.savba.sk)
|
||||||
garabik @ kassiopeia.juls.savba.sk
|
|
||||||
|
|
||||||
For the impatient - try following commands:
|
For the impatient - try following commands:
|
||||||
|
|
||||||
|
@ -130,7 +129,7 @@ in your `/etc/grc.conf`, then typing `grc cat /var/log/syslog` will use `conf.lo
|
||||||
## Miscellaneous remarks:
|
## Miscellaneous remarks:
|
||||||
|
|
||||||
You should get yourself familiar with regular expressions. Good reading is
|
You should get yourself familiar with regular expressions. Good reading is
|
||||||
at http://docs.python.org/dev/howto/regex.html
|
at <http://docs.python.org/dev/howto/regex.html>
|
||||||
|
|
||||||
The program is not yet optimized for speed. There are places that can
|
The program is not yet optimized for speed. There are places that can
|
||||||
give a big boost if optimized.
|
give a big boost if optimized.
|
||||||
|
@ -178,16 +177,24 @@ or, if you have recent BSD tail:
|
||||||
|
|
||||||
tail -F /var/log/syslog | grcat conf.log >/dev/tty12
|
tail -F /var/log/syslog | grcat conf.log >/dev/tty12
|
||||||
|
|
||||||
If you want to start using grc automatically with supported commands, add
|
## Automatic aliases
|
||||||
|
|
||||||
source /etc/grc.bashrc
|
You can start using grc automatically with supported commands. The following assumes that `grc.<bashrc|zsh|fish>` is in `/etc`. The location may differ (i. e. `/usr/local/etc` when installed with homebrew).
|
||||||
|
|
||||||
|
### Bash
|
||||||
|
|
||||||
To set aliases for supported commands, append to your `~/.bashrc`:
|
To set aliases for supported commands, append to your `~/.bashrc`:
|
||||||
|
|
||||||
[[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc
|
[[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc
|
||||||
|
|
||||||
|
### ZSH
|
||||||
|
|
||||||
Or for zsh users, append to `~/.zshrc`:
|
Or for zsh users, append to `~/.zshrc`:
|
||||||
|
|
||||||
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh
|
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh
|
||||||
|
|
||||||
(assuming you copied `grc.bashrc` and `grc.zsh` to `/etc`)
|
### Fish
|
||||||
|
|
||||||
|
Add to `~/.config/fish/config.fish` or in a new file in `~/.config/fish/conf.d/`:
|
||||||
|
|
||||||
|
source /usr/local/etc/grc.fish
|
||||||
|
|
17
grc.fish
17
grc.fish
|
@ -1,11 +1,20 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
# Main File: ~/.local/share/omf/pkg/grc/init.fish
|
#
|
||||||
# echo $grc_plugin_execs
|
# To load in ~/.config/fish/fish.conf or a new file in
|
||||||
|
# ~/.config/fish/conf.d add:
|
||||||
|
# source /etc/grc.fish (path may depend on install method)
|
||||||
|
#
|
||||||
|
# See also the plugin at https://github.com/oh-my-fish/plugin-grc
|
||||||
|
|
||||||
set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \
|
set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \
|
||||||
make mount mtr netstat ping ps tail traceroute \
|
make mount mtr netstat ping ps tail traceroute \
|
||||||
wdiff \
|
wdiff blkid du docker docker-machine env ip iostat \
|
||||||
blkid du docker docker-machine env ip iostat \
|
|
||||||
last lsattr lsblk lspci lsmod getfacl getsebool ulimit uptime nmap \
|
last lsattr lsblk lspci lsmod getfacl getsebool ulimit uptime nmap \
|
||||||
free semanage sar ss sysctl systemctl stat showmount tune2fs \
|
free semanage sar ss sysctl systemctl stat showmount tune2fs \
|
||||||
vmstat w who
|
vmstat w who
|
||||||
|
|
||||||
|
for executable in $grc_plugin_execs
|
||||||
|
if type -q $executable
|
||||||
|
alias $executable "grc $executable"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue