Tuesday, May 12, 2015

Meu .bashrc

#!/bin/sh

# .bashrc


# Source global definitions

if [ -f /etc/bashrc ]; then

    . /etc/bashrc

fi


# User specific aliases and functions


export EDITOR=emacs

export GREP_OPTIONS='--color=auto'

#export GREP_COLOR='1;37;41'

#export GREP_COLORS="mc=00;36:ms=31:mt=01;38:ln=31"

export GREP_COLORS="fn=34:mc=01;30:ms=33:sl=21:cx=31:ln=31"


alias lcfiles="git diff-tree --no-commit-id --name-only -r HEAD"


icor="\[\e[1;32m\]"
ecor="\[\e[0m\]"
export PS1="$icor<user:$ecor\u$icor, njobs:$ecor\j$icor, relogio:$ecor \D{%d.%m.%y}$icor,$ecor \A$icor>\n[$ecor\w$icor]\\$ $ecor "

alias pshierarch="/bin/ps -o 'uid:5,pid:5,ppid:5,user:4,args' axf"

alias vim_doc="w3m http://vimdoc.sourceforge.net/htmldoc/help.html"
alias rpm_doc="w3m http://www.rpm.org/max-rpm/index.html"
alias xterm='xterm -fa monaco -fs 12 -bg black -fg white'

google() {
    #eval $(echo firefox --new-tab http://www.google.com/search?hl=en#q="\"${@}\"" &amp;);
 eval $(echo firefox --new-tab http://www.google.com/search?hl=en#q="\"${@}\"" &);
}
gtext() {
 eval $(echo w3m "http://www.google.com/search?hl=en\&q="\"${@}\");
}
gtextout() {
 eval $(echo xterm -e "w3m http://www.google.com/search?hl=en\&q="\"${@}\" &);
}

# The emacs or emacsclient command to use
function _emacsfun
{
    # Replace with `emacs` to not run as server/client
    #emacsclient -c -n $@
    emacs $@
}

# An emacs 'alias' with the ability to read from stdin
function e
{
    # If the argument is - then write stdin to a tempfile and open the
    # tempfile.
    if [[ $# -ge 1 ]] && [[ "$1" == - ]]; then
         tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)"
         cat - > "$tempfile"
     echo $tempfile
         emacs --eval="(find-file \"$tempfile\")" --eval="(set-visited-file-name nil)"  --eval="(rename-buffer \"*stdin*\")"
#    _emacsfun --insert <(cat -)
    else
        _emacsfun "$@"
    fi
}

function gdiff
{
    git config --global diff.tool $1;
}

No comments:

Blog Archive