Foro de elhacker.net

Sistemas Operativos => GNU/Linux => Mensaje iniciado por: leogtz en 26 Junio 2011, 11:26 am



Título: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 26 Junio 2011, 11:26 am
Bueno, empiezo por poner mi .bashrc

Código
  1. export HISTCONTROL=erasedups
  2. HISTIGNORE="fg*:bg*:history*:exit*"
  3. shopt -s cdspell
  4. shopt -s histappend
  5. shopt -s cmdhist                                # save multi-line commands in history as single line
  6. shopt -s mailwarn
  7.  
  8. # Cargar variables personales
  9.  
  10. if [ -f ~/.bash_variables ];
  11. then
  12. . ~/.bash_variables
  13. fi
  14.  
  15. # Cargar alias
  16. if [ -f ~/.bash_aliases ];
  17. then
  18. . ~/.bash_aliases
  19. fi
  20.  
  21. # Cargar funciones
  22. if [ -f ~/.bash_functions ];
  23. then
  24. . ~/.bash_functions
  25. fi
  26.  
  27. # Check for an interactive session
  28. [ -z "$PS1" ] && return
  29.  
  30. export HISTSIZE=30000
  31. export HISTCONTROL=ignoredups    # no duplicate lines in the history.
  32.  
  33. PS1='┌─[$? \u@\h \w]\$\n└─> '
  34. PS2="New line [`date +"%H:%M:%S"`] : "
  35.  
  36. setxkbmap -layout latam
  37. complete -cf sudo
  38. complete -cf man
  39.  
  40. export escritorio=/home/leo/Desktop
  41. export PATH=$PATH:/usr/local/bin
  42. export EDITOR="vim"
  43.  
  44. myname="Leonardo Gutiérrez Ramírez";
  45.  

.bash_aliases
Código
  1. # Mis alias personales.
  2. alias ls='ls --color=auto'
  3. alias cls='clear'
  4. alias cd..='cd ..'
  5. alias cd.='pwd'
  6. alias ocultos='ls -a1 | grep -i "^[.]"'
  7. alias cdesk='cd $HOME/Escritorio'
  8. alias folds='ls -d1 */'
  9. alias myip='curl icanhazip.com'
  10. alias cd-='cd -'
  11. alias dwn='cd ~/Descargas'
  12. alias files='ls -1F | grep -v ".*/$"'
  13. alias pdf='evince'
  14. alias _total='du -hsx'
  15. alias rm='rm -i'
  16. alias l1='ls -1'
  17. alias xterm='xterm -font -*-fixed-medium-r-*-*-15-*-*-*-*-*-iso8859-* -geometry 120x88'
  18. alias img='eog .'
  19. alias ungz='tar zxvf'
  20. alias s='ls -1 | grep -i'
  21. alias lf='leafpad'
  22. alias up='source ~/.bashrc;'
  23. #alias pas='sudo pacman-color -S'
  24. #alias pacman='pacman'
  25. alias grep='grep --color=auto'
  26. alias ls='ls --color=auto'
  27. alias cdwin='cd /media/windows/'
  28. alias rmsecure='bash /usr/local/bin/rmsecure.sh'
  29. alias unins='bash /usr/local/bin/unins.sh'
  30. alias modins='bash /usr/local/bin/modins.sh'
  31. alias _c='bash /usr/local/bin/_c.sh'
  32. alias sc='bash /usr/local/bin/sc.sh'
  33. alias dn='. /usr/local/bin/dn.sh $1'
  34. #alias comando='bash /usr/local/bin/comando.sh; source ~/.bashrc'
  35. alias abs='evince /media/descargas/bash/abs-guide.pdf&'
  36. alias ttouch='bash /usr/local/bin/ttouch'
  37. #alias cdprompt='. /usr/local/bin/cdprompt.sh'
  38. alias usb='. /usr/local/bin/usb'
  39. alias wiki='perl /usr/local/bin/wiki'
  40. #alias t='thunar .'
  41. alias pc='pcmanfm .'
  42. alias mq='/etc/rc.d/mysqld start'
  43. alias v='vim'
  44. alias nocomment='egrep -v "^\s*(#|$)"'
  45. alias findcontent='grep -HURi'
  46. alias cdp='cd "$(ls -d */ | dmenu -l $(ls -d */ | wc -l) -nb "#100" -nf "#b9c0af" -sb "#000" -sf "#afff2f" -i)"'
  47. alias ~='cd ~'
  48. #alias remove='pacman -R'
  49. alias vi='vim'
  50. alias :q='exit'
  51. alias txtmsn='find ./.purple/logs/msn/leorocko13\@hotmail.com/ -type f -exec cat {} \; | grep -i "$1"'
  52. alias emp='cd ~/escuela/administracion/empresa_miercoles/'
  53. alias galias='cat ~/.bash_aliases'
  54. alias mathematica='mathematica -noSplashscreen'
  55. alias cdn='cd ~/NetBeansProjects/'
  56. alias logmysql='mysql -u root -plein23 agencia'
  57. alias tablas='mysql -u root -plein23 agencia -e "show tables \G" | grep -v "^\*" | sed "s/.*:\s\(.*\)/\1/"'
  58. alias soft='cd /media/descargas/Software/'
  59. alias mkx='sudo chmod +x $1'
  60. alias t='todo'
  61. # Apagado y reiniciado:
  62. alias reboot='sudo reboot'
  63. alias poweroff='sudo poweroff'
  64.  
  65. # Ping a google, útil para checar conexión
  66. alias pingg='ping -c 4 google.com'
  67. # alias windows linux
  68. alias move='mv'
  69. alias copy='cp'
  70. # Facebook
  71. alias muro='fbcmd mywall'
  72. alias estado='fbcmd status $1'
  73. alias restado='fbcmd restatus $1'
  74. alias notices='fbcmd notices'
  75. alias mutuo='fbcmd mutual $1'
  76. alias amiwhix='cat ~/.amigos'
  77. alias fbon='fbcmd finfo online_presence =all | grep -v "offline" | grep -v "^NAME.*ONLINE_PRESENCE$"'
  78. # instalar programa
  79. alias sagi='sudo apt-get install'
  80. alias th='thunar'
  81.  

.bash_functions

Código
  1. function ebash
  2. {
  3. elegido=`ls -1 ~/.bash* | dmenu -l $(ls -1 ~/.bash* | wc -l)`
  4. [ -z "$elegido" ] && return
  5. vim "$elegido"
  6. }
  7. function sch
  8. {
  9. [ ! -d "$HOME/escuela" ] && {
  10. echo -e "No existe la carpeta escuela"
  11. return;
  12. }
  13. lines=`find ~/escuela -maxdepth 1 -type d | grep -v "^\.$" | wc -l`
  14. cd `find ~/escuela -maxdepth 1 -type d | grep -v "^\.$" | sort | dmenu -l $lines`
  15. }
  16.  
  17. # Function para ver los registros de determinada tabla.
  18. function verr()
  19. {
  20. :
  21. #BD=$(cat ~/.bash_variables | grep -i "^BD" | cut -f2 -d '=')
  22. #n_tablas=$(mysql -u root -plein23 $BD -e "show tables \G" | grep -v "^\*" |  wc -l);
  23. #mysql -u root -plein23 $BD -e "select * from `mysql -u root -plein23 $BD -e 'show tables' | dmenu -l ${n_tablas}`" | more
  24. }
  25.  
  26. # Funcion que cambia la BD definida en el archivo ~/.bashrc
  27. function changebd()
  28. {
  29. :
  30. #n_tablas=$(mysql -u root -plein23 agencia -e "show databases \G" | grep -vi "^\*" | sed "s/.*:\s\(.*\)$/\1/g" | wc -l)
  31. #BD=$(mysql -u root -plein23 agencia -e "show databases \G" | grep -vi "^\*" | sed "s/.*:\s\(.*\)$/\1/g" | dmenu -l ${n_tablas})
  32. #sed -i "s/^BD=\(.*\)/BD=$BD/" ~/.bash_variables
  33. #source ~/.bash_variables
  34.  
  35. }
  36. function hacerx()
  37. {
  38. read -p "Name : " name
  39. touch "$name";
  40. sudo chmod +xwr "$name";
  41. }
  42. function cddev()
  43. {
  44. elegido=`cat << EOF | dmenu -l 3
  45. cpps
  46. perl
  47. bash
  48. EOF
  49. `
  50. cd /media/descargas/$elegido
  51. }
  52. function extract() {
  53.    local c e i
  54.  
  55.    (($#)) || return
  56.  
  57.    for i; do
  58.        c=''
  59.        e=1
  60.  
  61.        if [[ ! -r $i ]]; then
  62.            echo "$0: file is unreadable: \`$i'" >&2
  63.            continue
  64.        fi
  65.  
  66.        case $i in
  67.        #*.t@(gz|lz|xz|b@(2|z?(2))|a@(z|r?(.@(Z|bz?(2)|gz|lzma|xz)))))
  68.               #c='bsdtar xvf';;
  69.        *.7z)  c='7z x';;
  70.        *.Z)   c='uncompress';;
  71.        *.bz2) c='bunzip2';;
  72.        *.exe) c='cabextract';;
  73. *.tar.gz) c='tar xzf';;
  74. *.tgz) c='tar zxvf';;
  75.        *.gz)  c='gunzip';;
  76.        *.rar) c='unrar x';;
  77.        *.xz)  c='unxz';;
  78.        *.zip) c='unzip';;
  79.        *)     echo "$0: unrecognized file extension: \`$i'" >&2
  80.               continue;;
  81.        esac
  82.  
  83.        command $c "$i"
  84.        e=$?
  85.    done
  86.  
  87.    return $e
  88. }
  89.  
  90. function on()
  91. {
  92. ping -c 1 www.google.com &> /dev/null || {
  93. echo -e "\E[31;47mOFFLINE";
  94. sudo dhcpcd
  95. tput sgr0;
  96. } && {
  97. echo -e "\E[31;47mONLINE";
  98. notify-send "ONLINE"
  99. tput sgr0;
  100. }
  101.  
  102. }
  103.  
  104. function my()
  105. {
  106. sudo chown -R ${USER} "$1"
  107. }
  108.  
  109. function cdl()
  110. {
  111. cd "$1"
  112. ls -1
  113. }
  114.  
  115.  
  116. function enc()
  117. {
  118. if [ $# -ne 1 ]
  119. then
  120. echo -e "`basename $0` file";
  121. exit 1;
  122. fi
  123. gpg -c "$1" && rm -rvf "$1"
  124. }
  125.  
  126. function dec()
  127. {
  128. if [ $# -ne 1 ]
  129. then
  130. echo -e "`basename $0` file";
  131. exit 1;
  132. fi
  133. gpg "$1" && rm -rvf "$1"
  134.  
  135. }
  136.  
  137. function exes()
  138. {
  139. echo -e "\e[1;31mNúmero de ejecutables : $(find . -maxdepth 1 -type f -iname "*.exe" -print | wc -l)"
  140. find . -maxdepth 1 -type f -iname "*.exe" -print
  141. tput sgr0
  142. }
  143.  
  144. function f()
  145. {
  146. cat<<EOF>/tmp/factorial.bc
  147. define factorial(n)
  148. {
  149. i = 1;
  150. p = 1;
  151. while(i <= n)
  152. {
  153. p *= i++
  154. }
  155. return (p);
  156. }
  157. n = read();
  158. print n, "! = ", factorial(n), "\n";
  159. quit;
  160. EOF
  161. echo -e "$1" | bc -ql /tmp/factorial.bc
  162. rm -f /tmp/factorial.bc
  163. }
  164.  
  165. function dictionary(){
  166. curl -s -A 'Mozilla/4.0'  'http://www.google.com/search?q=define%3A+'$1  | html2text -ascii -nobs -style compact -width 500 | grep "*" | head -n 5
  167. }
  168.  
  169. function mktar() { tar cvf  "${1%%/}.tar"     "${1%%/}/"; }
  170. function mktgz() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
  171. function mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
  172.  
  173. function hgg()
  174. {
  175. if [ $# -lt 1 ] || [ $# -gt 1 ]; then
  176. echo "search bash history"
  177.   echo "usage: mg [search pattern]"
  178. else
  179.   history | grep -i $1 | grep -v hg
  180. fi
  181. }
  182.  
  183. function ask()
  184. {
  185.    echo -n "$@" '[y/n] ' ; read ans
  186.    case "$ans" in
  187.        y*|Y*) return 0 ;;
  188.        *) return 1 ;;
  189.    esac
  190. }
  191.  
  192. function box() { t="$1xxxx";c=${2:-#}; echo ${t//?/$c}; echo "$c $1 $c"; echo ${t//?/$c}; }
  193.  
  194. function translate() { wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=%7C${2:-en}" | sed 's/.*{"translatedText":"\([^"]*\)".*/\1\n/'; }
  195.  
  196. function fp()
  197. {
  198. find . -type f -iname "$1" -print
  199. }
  200.  
  201. function c()
  202. {
  203. echo -e "$*" | bc -l
  204. }
  205.  
  206. # Creates an archive from given directory
  207. function mktar() { tar cvf  "${1%%/}.tar"     "${1%%/}/"; }
  208. function mktgz() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
  209. function mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
  210.  
  211. # recursively fix dir/file permissions on a given directory
  212. function fix()
  213. {
  214.  if [ -d $1 ]; then
  215.        find $1 -type d -exec chmod 755 {} \;
  216.      find $1 -type f -exec chmod 644 {} \;
  217.        else
  218.            echo "$1 is not a directory."
  219.              fi
  220. }
  221.  
  222. function safeedit() {
  223.  cp -vi $1 ${1}.backup && vim $1
  224. }
  225.  
  226. function kk()
  227. {
  228. read -p "Nombre de archivo > " name
  229. cp -vi ~/Escritorio/pl.pl /media/descargas/perl/$name
  230. }
  231.  
  232. # Ver foto de perfil de un amigo en facebook localmente, con eog
  233. function verfoto()
  234. {
  235. fbcmd allinfo "$1" | grep "pic_big" | grep "jpg$" | awk '{print $2}' | xargs wget -O "${1}.jpg"
  236. eog "${1}.jpg"
  237. rm -rvf "${1}.jpg"
  238. }
  239. function isprime () {
  240.    perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
  241. }
  242. function cd2iso {
  243.    dd if=/dev/cdrom of=$1 bs=2048 conv=sync,notrunc
  244. }
  245. function fbfriends()
  246. {
  247. fbcmd friends | sed "s/\([0-9]*\)\s\(.*\)/\2/g" | grep -v "^ID.*" 2>&1 | tee ~/.amigos
  248. }
  249.  
  250. # Función para imprimir un archivo en pantalla
  251. function csg()
  252. {
  253. cat `ls -1 | grep -i "$1" | dmenu -l $(ls -1 | grep -i "$1" | wc -l)` | more
  254. }
  255.  

Saludos.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Exe U. en 28 Junio 2011, 02:03 am
~/.bashrc

Código
  1. # If not running interactively, don't do anything
  2. [ -z "$PS1" ] && return
  3.  
  4. #Settings
  5. PS1="\033[1;36m\]&#9484;&#9472;[\[\e[37;1m\]\u@\[\e[37;1m\]\H\[\033[1;36m\]]\[\033[1;36m\]&#9472;[\[\033[36;1m\]\w\[\033[1;36m\]]\n\[\033[1;36m\]&#9492;&#9472;> \[\e[0m\]"
  6. export HISTCONTROL=ignoredups:ignorespace
  7. export HISTSIZE=1000
  8. export HISTFILESIZE=3000
  9. export EDITOR="vim"
  10. export BROWSER="/usr/bin/opera"
  11. shopt -s checkwinsize
  12. shopt -s histappend
  13.  
  14. #Alias
  15. alias color="~/Scripts/color.sh"
  16. alias ls="ls --color=auto"
  17. alias otf2tff="~/Scripts/otf2ttf.sh"
  18. alias limpiar="~/Scripts/limpiar.sh"
  19.  
  20. #TTYcolor
  21. if [ "$TERM" = "linux" ]; then
  22.    echo -en "\e]P0000000" #black
  23.    echo -en "\e]P85F5F5F" #grey
  24.    echo -en "\e]P1935D73" #darked
  25.    echo -en "\e]P9973D61" #red
  26.    echo -en "\e]P25D927D" #darkgreen
  27.    echo -en "\e]PA97B292" #green
  28.    echo -en "\e]P3048992" #brown
  29.    echo -en "\e]PB6EB4BF" #yellow
  30.    echo -en "\e]P46F8CB2" #darkblue
  31.    echo -en "\e]PC819ABF" #blue
  32.    echo -en "\e]P58350A9" #darkmagenta
  33.    echo -en "\e]PD7D5D92" #magenta
  34.    echo -en "\e]P64F6784" #darkcyan
  35.    echo -en "\e]PE6F7B8E" #cyan
  36.    echo -en "\e]P7ADC6C9" #lightgrey
  37.    echo -en "\e]PFD0CCCC" #white
  38.    clear
  39. fi

~/.vimrc

Código
  1. set mouse=a
  2. set autoindent
  3. set smartindent
  4. set nocompatible
  5. set number
  6. syntax on
  7. set ic
  8. set hls
  9. set incsearch
  10. set history=500
  11. set smarttab
  12. set shiftwidth=4
  13. set shortmess+=I
  14. set nobackup
  15. map ,n :tabnew
  16. map ,1 :tabprevious
  17. map ,2 :tabnext
  18. map ,m :tabmove
  19. map ,f :tabfind
  20. colorscheme ir_black
  21. set tabstop=4
  22. set nowrap
  23. set spelllang=es
  24. map <f5> :NERDTreeToggle<cr>

Salu2


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 28 Junio 2011, 06:57 am
Gracias.

Tal parece que a nadie le gusta sacarle partido al shell.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: j3d1 en 28 Junio 2011, 08:36 am
Perdona mi ignorancia pero que es eso y para que me sirve o que ventajas me trae hacerlo o editarlo ? :xD
Saludos


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 28 Junio 2011, 08:50 am
Si eres de usar el shell o la consola, puedes crear funciones para controlar tu entorno, borrar archivos, obtener información de X cosa, lo que sea, la única limitación es tu imaginación.

El archivo .bashrc es un archivo que contiene comandos o configuraciones que se ejecutan cuando haces abres la consola. Los alias como su nombre lo indica son alias u otros nombres para los comandos, es decir:

Código:
alias sagi='sudo apt-get install'
Tecleando sagi en la consola es como si pusieras "sudo apt-get install", puedes automatizar todo lo que quieras.

Puedes crear tus propias funciones, yo puse algunas interesantes, como descargar una imagen de perfil de X amigo en Facebook para luego visualizarla con el visualizador (valga la redundancia) eog de GNOME.

En fin, si estás en GNU/Linux es obligado que sepas como trabajan dichos archivos.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Akai en 28 Junio 2011, 10:04 am
Todavía no he tenido tiempo entre examenes y otras cosas como para ponerme más en serio a ello T_T mi bashrc "básico"

Código
  1. archey3
  2. # Check for an interactive session
  3. #[ -z "$PS1" ] && return
  4.  
  5. alias ls='ls --color=auto '
  6. alias todo='todo.sh '
  7. alias archey='archey3 '
  8. alias cdakai='cd /media/Akai-Data '
  9. alias cower='cower --color=always --target=/home/akai/build '
  10. alias pacmans='sudo pacman-color '
  11. alias pacman='pacman-color '
  12. alias actualitzar='sudo pacman-color -Syyu && cower -u -dd '
  13. alias axel='axel -n 4 -v -a '
  14. alias sudo='sudo '
  15.  
  16. export CHROOTDIR=/opt/archroot
  17. export PATH=$PATH:/home/akai/scripts
  18. export EDITOR=nano
  19. # Colour Codes
  20. export Cyan="\[\e[m\]\[\e[0;36m\]"
  21. export Red="\[\e[m\]\[\e[0;31m\]"
  22. export White="\[\e[m\]\[\e[1;37m\]"
  23. export LightCyan="\[\e[m\]\[\e[1;36m\]"
  24. export LightRed="\[\e[m\]\[\e[1;31m\]"
  25.  
  26. # Code for a cool Prompt
  27. function pre_prompt
  28. {
  29.    newPWD="${PWD}"
  30.    user="whoami"
  31.    host=$(echo -n $HOSTNAME | sed -e "s/[\.].*//")
  32.    datenow=$(date "+%a, %d %b %y")
  33.    let promptsize=$(echo -n "--($user@$host ddd, DD mmm YY)---(${PWD})---" \
  34.                 | wc -c | tr -d " ")
  35.  
  36.    width=$(tput cols)
  37.  
  38.    if [ `id -u` -eq 0 ]
  39.    then
  40.        let fillsize=${width}-${promptsize}+1
  41.    else
  42.        let fillsize=${width}-${promptsize}-1
  43.    fi
  44.  
  45.    fill=""
  46.  
  47.    while [ "$fillsize" -gt "0" ]
  48.    do
  49.        fill="${fill}&#9472;"
  50.        let fillsize=${fillsize}-1
  51.    done
  52.  
  53.    if [ "$fillsize" -lt "0" ]
  54.    then
  55.        let cutt=3-${fillsize}
  56.        newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
  57.    fi
  58. }
  59.  
  60. # Set prompt colour
  61. if [ `id -u` -eq 0 ]
  62. then
  63.    cText="${LightRed}"
  64.    cBorder="${Red}"
  65. else
  66.    cText="${LightCyan}"
  67.    cBorder="${Cyan}"
  68. fi
  69.  
  70. PROMPT_COMMAND=pre_prompt
  71.  
  72. # Display Prompt
  73. PS1="${cBorder}&#9484;&#9472;(${White}\u@\h \$(date \"+%a, %d %b %y\")${cBorder})&#9472;\${fill}&#9472;(${cText}\$newPWD\
  74. ${cBorder})&#9472;&#9472;&#9472;&#9472;&#9488;\n${cBorder}&#9492;&#9472;(${cText}\$(date \"+%H:%M\")${cBorder})&#9472;>${White}"
  75.  
  76.  

por si alguien tiene curiosidad de saber en qué resulta el archey3 o el prompt, dejo una imagen.

(http://ompldr.org/tOTlocQ) (http://ompldr.org/vOTlocQ)

PD: si, editor nano, todavía no he tenido tiempo para introducirme en el arte del vim-fu
PD2; LA versión extraña del kernel, es el resultado de estar bisectando para encontrar en qué punto ha petado el driver de las gráficas intel >,< de normal es 2.6.39-ARCH o 2.6.39-pf, dependiendo de qué kernel use.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 28 Junio 2011, 20:52 pm
Se ve bastante bien, yo tengo un prompt parecido, pero en vez de la fecha puse el valor de retorno del comando anterior.

Código:
┌─[0 leo@leo-945GCT-M ~]$
└─> jkasd
jkasd: orden no encontrada
┌─[127 leo@leo-945GCT-M ~]$
└─>


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: j3d1 en 29 Junio 2011, 00:20 am
Algun manual o tutorial que recomienden para aprender a crea mi propio bashrc y para personalizar mi prompt  :xD


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Akai en 29 Junio 2011, 00:58 am
@j3d1:
Busca en google sobre ello, seguro que encontrarás muchísima documentación ahí. Lo básico es que no deja de ser otro fichero en shell script


Se ve bastante bien, yo tengo un prompt parecido, pero en vez de la fecha puse el valor de retorno del comando anterior.

No lo había pensado. Tengo la impresión que lo voy a incorporar.



Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 29 Junio 2011, 01:02 am
Tan sencillo como poner "$?" y listo.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Exe U. en 29 Junio 2011, 17:52 pm
En mi caso el prompt es asi

Código:
┌─[exeu@archlinux]-[~]
└─> asdf

Dejo una captura para el que quiera ver los colores de la tty =D
Todavia le tengo que cambiar el color de las lineas a tmux u.u

(http://ompldr.org/tOWE4eQ) (http://ompldr.org/vOWE4eQ)

Salu2


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: XayOn en 1 Julio 2011, 03:01 am
https://github.com/XayOn/jabashit
Justo hoy he descubierto que había otro software (bash-it) (a raíz del cual he cambiado el nombre de estas librerias) en plan framework con plugins como el mio, tienen funcionalidades similares aunque este esta menos orientado a macosx y es dependiente de bash > 4

Tengo por ahi, en la sección configs, algo sobre lo del $?, basado en codigo e ideas de un colega.

Nos vemos.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 1 Julio 2011, 06:46 am
https://github.com/XayOn/jabashit
Justo hoy he descubierto que había otro software (bash-it) (a raíz del cual he cambiado el nombre de estas librerias) en plan framework con plugins como el mio, tienen funcionalidades similares aunque este esta menos orientado a macosx y es dependiente de bash > 4

Tengo por ahi, en la sección configs, algo sobre lo del $?, basado en codigo e ideas de un colega.

Nos vemos.

¿?


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: XayOn en 1 Julio 2011, 20:05 pm
¿?
He posteado mi bashrc y otras configuraciones / "plugins" para sourcear desde bash con cosas utiles =)
y en algun punto en mis configs, hay una opcion para meter en el prompt manejo de erores con $?

¿Alguna pregunta más?

Como era tanto código, he posteado mi github.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: leogtz en 1 Julio 2011, 20:15 pm
Ninguna, solo que no te había entendido bien. Gracias por postear.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Foxy Rider en 2 Julio 2011, 01:38 am
Ufff, bien, vim no uso desde el vamos ( para editar en modo consola uso ee(1) (http://www.freebsd.org/cgi/man.cgi?query=ee&sektion=1) & nano(1) (http://man.cx/nano(1)) ... KISS ) ....
Mi .bashrc (ignoren lo de wine, es una cosa específica de FreeBSD de 64 bits) :

Código
  1. fortune freebsd-tips | cowsay
  2.  
  3. alias winecfg="LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:$PATH /compat/i386/usr/local/bin/winecfg"
  4. alias wine32="LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:$PATH /compat/i386/usr/local/bin/wine"
  5.  
  6. # prompt
  7.  
  8. if [[ $UID -eq 0 ]];then
  9.  PS1_base='[$?]\[\e[1;37m\][\[\e[1;31m\]\u\[\e[1;37m\]\[\e[1;37m\]@\h \W]\[\e[1;31m\]\$\[\e[0;0m\] '
  10.  PS2='\[\e[1;31m\]>\[\e[0;0m\] '
  11. else
  12.  PS1_base='[$?]\[\e[1;37m\][\u@\h \W]\$\[\e[0;0m\] '
  13.  PS2='\[\e[1;37m\]>\[\e[0;0m\] '
  14. fi
  15. set_prompt(){
  16.        error_val=$?
  17.        if [[ $error_val -eq 0 ]] ;then
  18.                str_error='\[\e[0;32m\]'
  19.        else
  20.                str_error='\[\e[1;31m\]'
  21.        fi
  22.        PS1="$str_error$PS1_base"
  23. }
  24. PROMPT_COMMAND='set_prompt'
  25.  
  26.  

Mi .profile :

Código
  1. # $FreeBSD: src/share/skel/dot.profile,v 1.23.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $
  2. #
  3. # .profile - Bourne Shell startup script for login shells
  4. #
  5. # see also sh(1), environ(7).
  6. #
  7.  
  8. # remove /usr/games if you want
  9. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/Software/bin; export PATH
  10.  
  11. # Setting TERM is normally done through /etc/ttys.  Do only override
  12. # if you're sure that you'll never log in via telnet or xterm or a
  13. # serial line.
  14. # Use cons25l1 for iso-* fonts
  15. # TERM=cons25;  export TERM
  16.  
  17. BLOCKSIZE=K;    export BLOCKSIZE
  18. EDITOR=vi;      export EDITOR
  19. PAGER=more;     export PAGER
  20.  
  21. # set ENV to a file invoked each time sh is started for interactive use.
  22. ENV=$HOME/.shrc; export ENV
  23.  
  24. if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi
  25.  
  26.  
  27. ########################################################
  28. # set compilers to Clang
  29. CC=/usr/local/bin/clang ; export CC
  30. CXX=/usr/local/bin/clang++ ; export CXX
  31. CPATH=/usr/include:/usr/local/include ; export CPATH
  32.  
  33. ########################################################
  34. # Locale
  35. LC_ALL=en_US.UTF-8 ; export LC_ALL
  36.  

En términos generales no automatizo mucho ya que lo que suelo hacer siempre (tareas de mantenimiento de ports y demás), las hago siempre "a mano" cuando no automatizo con portmaster
Realmente no tengo una librería de *scripts* para hacer cosas, ya que si bien paso un buen tiempo en la consola, pocas cosas son tan complejas y frecuentes como para crearles alias y funciones. (aparte de que no soy bueno para scripting, es más, antes hacía las cosas que hoy hago por scripts en C#)
Normalmente escribo todo en el momento ~

Saludos.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: XayOn en 2 Julio 2011, 03:33 am
Ufff, bien, vim no uso desde el vamos ( para editar en modo consola uso ee(1) (http://www.freebsd.org/cgi/man.cgi?query=ee&sektion=1) & nano(1) (http://man.cx/nano(1)) ... KISS ) ....
Mi .bashrc (ignoren lo de wine, es una cosa específica de FreeBSD de 64 bits) :

Código
  1. fortune freebsd-tips | cowsay
  2.  
  3. alias winecfg="LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:$PATH /compat/i386/usr/local/bin/winecfg"
  4. alias wine32="LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:$PATH /compat/i386/usr/local/bin/wine"
  5.  
  6. # prompt
  7.  
  8. if [[ $UID -eq 0 ]];then
  9.  PS1_base='[$?]\[\e[1;37m\][\[\e[1;31m\]\u\[\e[1;37m\]\[\e[1;37m\]@\h \W]\[\e[1;31m\]\$\[\e[0;0m\] '
  10.  PS2='\[\e[1;31m\]>\[\e[0;0m\] '
  11. else
  12.  PS1_base='[$?]\[\e[1;37m\][\u@\h \W]\$\[\e[0;0m\] '
  13.  PS2='\[\e[1;37m\]>\[\e[0;0m\] '
  14. fi
  15. set_prompt(){
  16.        error_val=$?
  17.        if [[ $error_val -eq 0 ]] ;then
  18.                str_error='\[\e[0;32m\]'
  19.        else
  20.                str_error='\[\e[1;31m\]'
  21.        fi
  22.        PS1="$str_error$PS1_base"
  23. }
  24. PROMPT_COMMAND='set_prompt'
  25.  
  26.  

Mi .profile :

Código
  1. # $FreeBSD: src/share/skel/dot.profile,v 1.23.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $
  2. #
  3. # .profile - Bourne Shell startup script for login shells
  4. #
  5. # see also sh(1), environ(7).
  6. #
  7.  
  8. # remove /usr/games if you want
  9. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/Software/bin; export PATH
  10.  
  11. # Setting TERM is normally done through /etc/ttys.  Do only override
  12. # if you're sure that you'll never log in via telnet or xterm or a
  13. # serial line.
  14. # Use cons25l1 for iso-* fonts
  15. # TERM=cons25;  export TERM
  16.  
  17. BLOCKSIZE=K;    export BLOCKSIZE
  18. EDITOR=vi;      export EDITOR
  19. PAGER=more;     export PAGER
  20.  
  21. # set ENV to a file invoked each time sh is started for interactive use.
  22. ENV=$HOME/.shrc; export ENV
  23.  
  24. if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi
  25.  
  26.  
  27. ########################################################
  28. # set compilers to Clang
  29. CC=/usr/local/bin/clang ; export CC
  30. CXX=/usr/local/bin/clang++ ; export CXX
  31. CPATH=/usr/include:/usr/local/include ; export CPATH
  32.  
  33. ########################################################
  34. # Locale
  35. LC_ALL=en_US.UTF-8 ; export LC_ALL
  36.  

En términos generales no automatizo mucho ya que lo que suelo hacer siempre (tareas de mantenimiento de ports y demás), las hago siempre "a mano" cuando no automatizo con portmaster
Realmente no tengo una librería de *scripts* para hacer cosas, ya que si bien paso un buen tiempo en la consola, pocas cosas son tan complejas y frecuentes como para crearles alias y funciones. (aparte de que no soy bueno para scripting, es más, antes hacía las cosas que hoy hago por scripts en C#)
Normalmente escribo todo en el momento ~

Saludos.

Nice, la chorradita de las fortunes me gusta ^^ Creo que me apunto a ello! =D
Jaja, ya veo tu compilador seteado a CLANG por ahi =)


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: P-Joe en 31 Agosto 2011, 15:17 pm
jajajajajaj lo de fortune es una idea MUY buena, ¡Saludos! Cuando pueda cuelgo mis scripts.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: P-Joe en 31 Agosto 2011, 18:53 pm
function mktar() { tar cvf  "${1%%/}.tar"     "${1%%/}/"; }
function mktgz() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
function mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
Leo me has vuelto reloco por saber que narices significa "1%%/" y saber como funciona esta función, ¿me lo puedes explicar?
Gracias :)


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: XayOn en 9 Noviembre 2011, 16:03 pm
Leo me has vuelto reloco por saber que narices significa "1%%/" y saber como funciona esta función, ¿me lo puedes explicar?
Gracias :)
$1 es el primer parametro, esta haciendole string manipulation.
http://www.thegeekstuff.com/2010/07/bash-string-manipulation/


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: morenochico en 26 Noviembre 2011, 01:20 am
Citar
alias cls='clear'
Amor a windows dos?


Citar
alias cd..='cd ..'

Muchas ganas de hacer las cosas rapido que el espacio es un estorbo?


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Foxy Rider en 26 Noviembre 2011, 06:34 am
@morenochico → Para gustos, colores ... Leo es moderador de Scripting y siempre está con cosas en batch, es esperable que se acomode algunas cosas de bash a costumbres de Windows.

Para ser un groso en una área, tenés que saber deconstruirte y dejar las costumbres de lado ... por que el humano es un animal de costumbres, y seamos sinceros ... todos pasamos por un Windows.

Para ser groso en otros sistemas tenés que saber desarmar esas costumbres y poder adaptar fácilmente la cabeza a "otro paradigma"
En realidad, toda la computación es así, néh ..


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Foxy Rider en 26 Noviembre 2011, 06:45 am
Bueno, reinstalé y terminé con esto :

.cshrc
Código
  1. cat .cshrc
  2. # $FreeBSD: stable/9/share/skel/dot.cshrc 170119 2007-05-29 22:07:57Z dougb $
  3. #
  4. # .cshrc - csh resource script, read at beginning of execution by each shell
  5. #
  6. # see also csh(1), environ(7).
  7. #
  8.  
  9. alias h         history 25
  10. alias j         jobs -l
  11. alias la        ls -a
  12. alias lf        ls -FA
  13. alias ll        ls -lA
  14.  
  15. # A righteous umask
  16. umask 22
  17.  
  18. set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/Software/bin /usr/local/kde4/bin )
  19.  
  20. setenv  EDITOR  ee
  21. setenv  PAGER   more
  22. setenv  BLOCKSIZE       K
  23.  
  24. setenv  LANG    en_US.UTF-8
  25. setenv  __GL_SHADER_DISK_CACHE 1
  26.  
  27. setenv CC /usr/bin/clang
  28. setenv CXX /usr/bin/clang++
  29. setenv CPATH /usr/include:/usr/local/include
  30.  
  31. if ($?prompt) then
  32.        # An interactive shell -- set some stuff up
  33.        set filec
  34.        set history = 100
  35.        set savehist = 100
  36.        set mail = (/var/mail/$USER)
  37.        if ( $?tcsh ) then
  38.                bindkey "^W" backward-delete-word
  39.                bindkey -k up history-search-backward
  40.                bindkey -k down history-search-forward
  41.        endif
  42. endif
  43.  
  44.  
(el .cshrc tradicional de FreeBSD con dos cambios)

Lo de wine lo volé por que ando usando un FreeBSD de 32 bits (y no necesito armar el workaround de la "jaula" de 32 bits )
La verdad no soy gran fan de personalizar los .*rc ... normalmente me armo scripts para las cosas que hago seguido, más que armar funciones o alias, como por ejemplo :

Código
  1. #!/bin/csh
  2.  
  3. if ( "`qdbus org.kde.kwin /KWin org.kde.KWin.compositingActive`" == "true" ) then
  4.        qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing
  5. endif
  6.  
  7. $*
  8.  
  9. if ("`qdbus org.kde.kwin /KWin org.kde.KWin.compositingActive`" == "false") then
  10.       qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing
  11. endif
  12.  
  13. exit

Y todo va derechito a $HOME/Software/bin

Saludos.

P.S → El .profile es similar x'3


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: morenochico en 28 Noviembre 2011, 23:57 pm
[Alex] :

Pienso lo mismo que tu 99.99% hemos pasado por windows, yo tambien tengo costumbres de win en linux, uso office 2003 en mandriva, worpad en suse, asi como utilerias like linux en xp ... pero eso es otra historia.


En su momento procuraba las mismas constumbres tanto en linux com win pero me canse luego de al ir probando los diferentes sabores de linux, asi que intento adaptarme al mundo y no que el mundo se adapte a mi.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: P-Joe en 5 Diciembre 2011, 16:47 pm
$1 es el primer parametro, esta haciendole string manipulation.
http://www.thegeekstuff.com/2010/07/bash-string-manipulation/
Muchas gracias por el link! Saludos.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: farresito en 11 Enero 2012, 21:35 pm
En mi caso el prompt es asi

Código:
┌─[exeu@archlinux]-[~]
└─> asdf

Dejo una captura para el que quiera ver los colores de la tty =D
Todavia le tengo que cambiar el color de las lineas a tmux u.u

(http://ompldr.org/tOWE4eQ) (http://ompldr.org/vOWE4eQ)

Salu2
ArchLinux rulez!!!


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: 0x5d en 19 Febrero 2012, 11:06 am
Acabo de enchular mi prompt:
Código
  1. PS1="\[$(tput setaf 6)\]\w\[$(tput setaf 1)@$(tput setaf 3)Debian$(tput setaf 1) ~~> $(tput setaf 2)\]"
y pues mi aliases no tiene nada del otro mundo:
Código
  1. alias www="cd /var/www"                                                                                                                        
  2. alias casa="cd /home/jaavier"                                                                                                                  
  3. alias f5="sudo apt-get update &&sudo apt-get upgrade"                                                                                          
  4. alias c_alias="kate .bash_aliases"


Saludos, Javier.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: dac en 10 Julio 2012, 16:54 pm
.bashrc

Código:
export DISPLAY=:1

LOCKFILE="/tmp/.X1-lock"

PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\]'

setxkbmap es

alias pacman='pacman-color'

alias python='python2.7'

alias ls='ls --color'


if [ -f $LOCKFILE ]; then

echo -e ' \033[36m Bash inicializado... \033[0m '


else

X :1 &

openbox &
gnome-terminal --maximize &
google-chrome &
PYTHONPATH=/usr/lib/python2.7/site-packages/
setxkbmap es

fi


*aclaro: esta "idiotez" es por que solo uso las Xs para iniciar un explorador grafico y un emulador de terminal "gnome-terminal". [eso lo explica todo :) ]

############################################

.vimrc

Código:
syntax on
colorscheme eclipse

jeje bastate simploncito :P


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: J414NP3R en 2 Octubre 2012, 18:20 pm
Saludos,

alguien tiene idea de como puedo poner a titilar (aparecer y desaparecer) parte del String de prompt?

Por ejemplo:

Atencion! Solo personal autorizado. ~$

la idea es que el string "Atencion!" quede titilando/intermitente o como le quieran llamar. Yo lo había hecho alguna vez en ubuntu 6.* pero ya se me olvidó.

Agradezco sus comentarios.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Foxy Rider en 2 Octubre 2012, 22:00 pm
Con la variable PS1 ... en este hilo tenés muchos ejemplos de como cambiarla.
Jugá con eso y si te sale alguna duda, postee nomás.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Dark Side en 16 Febrero 2013, 00:22 am
Pues actualmente tengo configurado lo siguiente:

.bash_aliases
Código
  1.  alias cd..='cd ..'
  2.  alias la='ls -la'
  3.  alias ll='ls -l'
  4.  alias pingg='ping google.com'
  5.  alias update='sudo apt-get update'
  6.  alias upgrade='sudo apt-get upgrade'
  7.  alias aptinsall='sudo apt-get install'
  8.  alias aptsearch='sudo apt-cache search'
  9.  alias :q='exit'

.bashrc
Código
  1. # User settings
  2. screenfetch-dev
  3. #PS1='\[\e[0;34m\][\W]\[\e[m\] ' Prompt en formato [dirActual]
  4. #PS1='[\u@\h \W]\$ ' Prompt en formato [usr@host dirActual]
  5. PS1='\n\e[0;37m\]&#9484;&#9472;\e[1;34m\][\u@\h] - \e[0;37m\][\D{%d/%m/%y} - \t]\e[1;34m\] - [\w]\n\e[0;37m\]&#9492;&#9472;> \e[1;34m\]\$ \e[0;0m\]'

El prompt queda de la siguiente forma:

┌─[user@host] - [dd/mm/yy - HH:mm:ss] - [~]
└─> $

Y el .vimrc
Código:
  1 set number
  2 set wrap
  3 set incsearch
  4 set hlsearch
  5 set expandtab
  6 set autoindent
  7 set wildmenu
  8 set textwidth=80
  9 set tabstop=8
 10
 11 "Activar uso del mouse
 12         set mouse=a
 13
 14 "Tecla para mostrar/ocultar NERDTree
 15         map <F2> :NERDTreeToggle<cr>
 16
 17 "Tema
 18         colorscheme desert
 19
 20 "Movimiento entre ventanas
 21         map <C-J> <C-W>j<C-W>_
 22         map <C-K> <C-W>k<C-W>_
 23         map <C-L> <C-W>l<C-W>_
 24         map <C-H> <C-W>h<C-W>_
 25
 26 "Movimiento entre pestañas
 27         map <S-H> gT
 28         map <S-L> gt

SalU2!
Dark Side


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: v4clox en 28 Febrero 2013, 22:14 pm
Uso bastante la shell pero nunca me habia parado a configurarla, soy un mal linuxero...


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: Algabe en 9 Abril 2013, 18:02 pm
Código
  1. #
  2. # ~/.bashrc
  3. #
  4.  
  5. # If not running interactively, don't do anything
  6. [[ $- != *i* ]] && return
  7. export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  8. alias ls='ls --color=auto'
  9.  
  10. export LANG=en_US.UTF-8
  11. export EDITOR="nano"
  12. export synclient VertEdgeScroll=1
  13.  
  14. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  15. HISTSIZE=1500
  16. HISTFILESIZE=3000
  17.  
  18. # don't put duplicate lines in the history. See bash(1) for more options
  19. # ... or force ignoredups
  20. HISTCONTROL=ignoredups
  21. HISTIGNORE=":htop*:ls*:su*:history*:pacman*:exit*"
  22.  
  23. #PS1='[\u@\h \W]\$ '
  24. #PS1='\[\033[0;41m\] \u@\h\[\033[01;36m\]\W \$ \[\033[00m\] '
  25. #PS1='\[\e[1;32m\][\u\[\e[m\]@\[\e[1;33m\]\h\[\e[1;34m\] \w]\[\e[1;36m\] \$\[\e[1;37m\] '
  26. #PS1='&#38;#9484;&#38;#9472;&#38;#9472;[\u@\h][\w][\t]\n&#38;#9492;&#38;#9472;&#38;#9472;[\$] '
  27. #PS1='&#38;#9484;&#38;#9472;[\u][\A][\w]\n&#38;#9492;&#38;#9472;[\$] '
  28. PS1='\[\e[1;34m\]&#38;#9484;&#38;#9472; \e[1;32m\u\e[m@\e[1;33m\h\e[1;34m [\e[m\t\e[1;34m] [\e[m\w\e[1;34m] \n &#38;#9492;&#38;#9472; $ \[\e[m\]'
  29. #PS1='\[\033[1;32m\]\u@\h\[\033[1;36m\] \W \$\[\033[00m\] '
  30.  
  31. # Alias definitions.
  32. # You may want to put all your additions into a separate file like
  33. # ~/.bash_aliases, instead of adding them here directly.
  34. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  35. if [ -f ~/.bash_aliases ]; then
  36.    . ~/.bash_aliases
  37. fi
  38.  
  39. # enable color support of ls and also add handy aliases
  40. if [ -x /usr/bin/dircolors ]; then
  41.    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  42.    alias ls='ls -lh --color=auto'
  43.    alias ll='ls -lh --color=auto'
  44.    alias dir='ls -lh --color=auto'
  45.    alias grep='grep --color=auto'
  46.    alias fgrep='fgrep --color=auto'
  47.    alias egrep='egrep --color=auto'
  48. fi
  49.  
  50. setxkbmap -layout "latam" -option "grp:alt_shift_toggle"
  51. set completion-ignore-case on
  52. #siv -t -c4
  53. alsi -a -u c1=blue c2=blue


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: J414NP3R en 15 Abril 2013, 22:34 pm

Me gustaría aumentar el margen en la terminal de gnome, debido a que por defecto no tiene márgenes.

A lo que me refiero es a aumentar el espacio entre el borde de la ventana y el texto de entrada/salida de la consola.

Por ejemplo:

Código:
=[X][-][ ]=============Mi Terminal==================
|                                                  |
|  $> echo "Hay margen arriba, a la izquierda y a  |
|  la derecha."                                    |
|                                                  |
|                                                  |
|                                                  |
====================================================

Si alguien tiene idea de como hacer esto le agradezco su ayuda.

Un saludo.


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: lawish en 4 Diciembre 2013, 19:46 pm
# .bashrc

# User specific aliases and functions

Ose nada de nada


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: danny920825 en 8 Junio 2015, 22:30 pm
Hola a todos, aqui traigo un script que me gustaria que revisaran y obvio que acepto sugerencias en cuanto al codigo. El objetivo es que haga una salva de las trazas del squid (access.log) en una carpeta llamada salvas ubicada en la raiz. Si puede ser mejorado, no se lo callen por favor.

Código:
#!/bin/bash
#INFORMACION DEL SCRIPT:
#ESTE SCRIPT SIRVE PARA HACER UNA SALVA DEL ACCESS.LOG DEL SQUID.

#VARIABLES
DIA=`date +%d`
MES=`date +%m`
YEAR=`date +%y`
HORA=`date +%H%M`
ARCHIVO=trazas-$DIA$MES$YEAR$HORA.log




#DETENER SQUID
service squid stop
echo "Squid detenido esperando 2 segundos para continuar"

#ESPERAMOS POR SI ACASO
sleep 2s

#MOVER EL ARCVHIVO DE LOS LOG's
echo "Moviendo el archivo de las trazas para /salvas/"
mv /var/log/squid/access.log /salvas/$ARCHIVO
echo "listo"


#CREACION DEL ARCHIVO NUEVO
echo "Creando el nuevo archivo en blanco"
touch /var/log/squid/access.log
echo "Listo"

#PERMISO DE ESCRITURA AL NUEVO ARCHIVO
echo "Asigando permisos al nuevo archivo"
chmod 777 /var/log/squid/access.log
echo "listo"

#INICIAMOS EL SQUID
echo "Iniciando el squid"
service squid start
echo "Listo, copia realizada con exito"

#ESPERAMOS POR SI ACASO
sleep 5s

#SALIMOS
exit 0


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: estudianteaprendiendo en 1 Julio 2015, 21:30 pm
muy interesante realmente estoy empezando a usar kali linux bueno no soy programador ni nada estoy estudiando otra cosa nada relacionado con informática pero encuentro interesante todo esto tengo un problema con eso de que no se reconoce un comando eso de la modificacion .bashrc podria aydarme ?

#msfpayload -h
bash: msfpayload : no se encontro la orden

es lo que me aparece espero puedan orientar mese que esto ya lo e colocado en un tema pero al leer un poco de tu proyecto me resulta interesante saber si puede solucionar mi problema  y si no igualmente gracias


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: dac en 19 Agosto 2015, 21:40 pm
.zshrc
Código:
#{{{ ZSH Modules
    autoload -U compinit promptinit zcalc zsh-mime-setup
    autoload -U colors && colors
    autoload -Uz vcs_info
    compinit
    promptinit
    zsh-mime-setup
#}}}

#{{{ Options
    # See `man zshoptions`

    setopt CORRECT
    setopt GLOB_COMPLETE
    setopt RM_STAR_WAIT
    setopt ZLE
    setopt VI
    setopt NO_HUP
    setopt IGNORE_EOF
    setopt NO_BEEP
    setopt NUMERIC_GLOB_SORT
    setopt EXTENDED_GLOB
    setopt RC_EXPAND_PARAM
    setopt APPEND_HISTORY
    setopt  COMPLETE_IN_WORD
    setopt prompt_subst
    setopt nohashdirs
    setopt nohashcmds
    unsetopt FLOW_CONTROL
    unsetopt LIST_AMBIGUOUS

    # History options
    setopt EXTENDED_HISTORY
    setopt SHARE_HISTORY
    setopt HIST_IGNORE_DUPS
    setopt HIST_IGNORE_ALL_DUPS
    setopt HIST_REDUCE_BLANKS
    setopt HIST_IGNORE_SPACE
    setopt HIST_NO_STORE
    setopt HIST_VERIFY
    setopt HIST_SAVE_NO_DUPS
    setopt HIST_EXPIRE_DUPS_FIRST
    setopt HIST_FIND_NO_DUPS
#}}}

#{{{ Variables
    export EDITOR=vim
    export PAGER=less
    export JAVA_HOME="/usr"
    export _JAVA_AWT_WM_NONREPARENTING=1
    export KEYTIMEOUT=1  # Reduce vi-mode lag
    export ANDROID_HOME="/opt/android-sdk"
    export ANDROID_SWT="/usr/share/java"
    export ANDROID_TOOLS="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
    export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$ANDROID_TOOLS"
    declare -U path

    # History
    HISTFILE=~/.history
    SAVEHIST=1000
    HISTSIZE=1000
#}}}

#{{{ Aliases
    alias x='startx'
    alias p='ping 8.8.8.8'
    alias ls='ls --color'
    alias vi='/usr/bin/vim'
    alias vim='nvim'
    alias emacs='emacs -nw'
    alias am='alsamixer' alsamixer='alsamixer -g -c 0'
#}}}

#{{{ Completion
    # See `man zshcompsys

    zstyle ':completion::complete:*' use-cache 1
    zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
    zstyle ':completion:*' verbose yes
    zstyle ':completion:*:descriptions' format '%B%d%b'
    zstyle ':completion:*:messages' format '%d'
    zstyle ':completion:*' group-name ''
    zstyle ':completion:*' auto-description 'specify: %d'
    zstyle ':completion:*:default' list-prompt '%S%M matches%s'
    zstyle ':completion:*:default' menu 'select=0'
    zstyle ':completion:*' file-sort modification reverse
    zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
    zstyle ':completion:*:manuals' separate-sections true
    zstyle ':completion:*:corrections' format '%B%d (errors %e)%b'
    zstyle ':completion::*:(rm|vi):*' ignore-line true
    zstyle ':completion:*' ignore-parents parent pwd
    zstyle ':completion::approximate*:*' prefix-needed false
#}}}

#{{{ Key bindings
    # Special keys works properly

    bindkey '\e[1~' beginning-of-line
    bindkey '\e[4~' end-of-line
    bindkey '\e[A' up-line-or-history
    bindkey '\e[B' down-line-or-history
    bindkey '\eOA' up-line-or-history
    bindkey '\eOB' down-line-or-history
    bindkey '\e[C' forward-char
    bindkey '\e[D' backward-char
    bindkey '\eOC' forward-char
    bindkey '\eOD' backward-char
#}}}

#{{{ Prompt
    zstyle ':vcs_info:*' stagedstr '%F{28}^'
    zstyle ':vcs_info:*' unstagedstr '%F{11}^'
    zstyle ':vcs_info:*' check-for-changes true
    zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
    zstyle ':vcs_info:*' enable git svn

    precmd()
    {
        if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
            zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{normal}]'
        } else {
            zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{red}^%F{normal}]'
        }

        vcs_info
    }

    PROMPT='%{$fg[blue]%}%B%n%b%{$reset_color%}@%{$fg[magenta]%}%B%M%b%{$reset_color%} %1~ ${vcs_info_msg_0_}%{$reset_color%}%# '
#}}}

#{{{ Vi-mode
    # From `oh-my-zsh` vi-mode plugin

    # Ensures that $terminfo values are valid and updates editor information when
    # the keymap changes.
    function zle-keymap-select zle-line-init zle-line-finish {
      # The terminal must be in application mode when ZLE is active for $terminfo
      # values to be valid.
      if (( ${+terminfo[smkx]} )); then
        printf '%s' ${terminfo[smkx]}
      fi
      if (( ${+terminfo[rmkx]} )); then
        printf '%s' ${terminfo[rmkx]}
      fi

      zle reset-prompt
      zle -R
    }

    # Ensure that the prompt is redrawn when the terminal size changes.
    TRAPWINCH() {
      if [[ -o zle ]]; then
        zle reset-prompt
        zle -R
      fi
    }

    zle -N zle-line-init
    zle -N zle-line-finish
    zle -N zle-keymap-select
    zle -N edit-command-line


    bindkey -v

    # Avoid dropping keystrokes after ESC hit
    bindkey -as '\e' ''

    # allow v to edit the command line
    # autoload -Uz edit-command-line
    # bindkey -M vicmd 'v' edit-command-line

    # allow ctrl-p, ctrl-n, ctrl-r for navigate history (standard behaviour)
    bindkey '^P' up-history
    bindkey '^N' down-history
    bindkey '^r' history-incremental-search-backward

    # Incrementar search for / and ?
    bindkey -M vicmd "/" history-incremental-search-backward
    bindkey -M vicmd "?" history-incremental-search-forward

    # allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
    bindkey '^?' backward-delete-char
    bindkey '^h' backward-delete-char
    bindkey '^w' backward-kill-word

    # Some extra vim like bindings
    bindkey -a 'gg' beginning-of-buffer-or-history
    bindkey -a 'G' end-of-buffer-or-history
    bindkey -a 'u' undo
    bindkey -a '^R' redo

    # Mode indicator right prompt
    function zle-line-init zle-keymap-select
    {
        RPS1="${${KEYMAP/vicmd/}/(main|viins)/-- INSERT --}"
        RPS2=$RPS1
        zle reset-prompt
    }

    # Allow Copy/Paste with the system clipboard
    # behave as expected with vim commands ( y/p/d/c/s )
    [[ -n $DISPLAY ]] && (( $+commands[xclip] )) && {

      function cutbuffer() {
        zle .$WIDGET
        echo $CUTBUFFER | xclip -selection clipboard
      }

      zle_cut_widgets=(
        vi-backward-delete-char
        vi-change
        vi-change-eol
        vi-change-whole-line
        vi-delete
        vi-delete-char
        vi-kill-eol
        vi-substitute
        vi-yank
        vi-yank-eol
      )
      for widget in $zle_cut_widgets
      do
        zle -N $widget cutbuffer
      done

      function putbuffer() {
        zle copy-region-as-kill "$(xclip -selection clipboard -o)"
        zle .$WIDGET
      }

      zle_put_widgets=(
        vi-put-after
        vi-put-before
      )
      for widget in $zle_put_widgets
      do
        zle -N $widget putbuffer
      done
    }
#}}}

#{{{ Misc
    # Deactivate Software flow control
    stty -ixon

    # Set proper terminal for SCREEN and TMUX
    if [[ -z $TMUX ]]; then
        if [ -e /usr/share/terminfo/x/xterm+256color ]; then
            export TERM='xterm-256color'
        else
            export TERM='xterm'
        fi
    else
        if [ -e /usr/share/terminfo/s/screen-256color ]; then
            # export TERM='screen-256color'
            export TERM='xterm-256color'
        else
            export TERM='screen'
        fi
    fi

    # Autorun TMUX (Only when X11 is running)
    # if [[ (-e /tmp/.X0-lock) ]]; then
    #     if [[ -n $TMUX ]]; then
    #         # Tmux running, do nothing
    #     else
    #         tmux -2
    #     fi
    # fi
#}}}

#{{{ First Init
    # Auto start X11 and Wifi connection
    if [[ ! (-e /tmp/.X0-lock) ]]; then
        # ~/.wifi.sh
        ./.ether.sh
        startx
    fi
#}}}


# vim:fdm=marker



.nvimrc
Código:
"{{{ VIM-PLUG
    call plug#begin('~/.vim/plugged')
    Plug 'wellle/targets.vim'
    Plug 'tpope/vim-commentary'
    Plug 'tpope/vim-surround'
    Plug 'tpope/vim-fugitive'
    Plug 'tpope/vim-unimpaired'
    Plug 'tpope/vim-repeat'
    Plug 'michaeljsmith/vim-indent-object'
    Plug 'scrooloose/syntastic'
    Plug 'scrooloose/nerdtree'
    Plug 'vim-scripts/taglist.vim'
    Plug 'kien/ctrlp.vim'
    Plug 'thanthese/Tortoise-Typing'
    Plug 'mbbill/undotree'
    Plug 'alx741/vinfo'
    Plug 'godlygeek/tabular'
    Plug 'bruno-/vim-man'
    Plug 'altercation/vim-colors-solarized'
    Plug 'junegunn/goyo.vim'
    Plug 'jceb/vim-orgmode'
    Plug 'EinfachToll/DidYouMean'
    Plug 'tommcdo/vim-exchange'
    Plug 'vitalk/vim-simple-todo'
    Plug 'powerman/vim-plugin-viewdoc'

    " On-demand loading
    Plug 'scrooloose/syntastic', { 'on': 'SyntasticCheck' }
    Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
    Plug 'vim-scripts/taglist.vim', { 'on': 'TlistToggle' }
    Plug 'thanthese/Tortoise-Typing', { 'on': 'TortoiseTyping' }
    Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
    Plug 'alx741/vinfo', { 'on': 'Vinfo' }
    Plug 'godlygeek/tabular', { 'on': 'Tabularize' }
    Plug 'bruno-/vim-man', { 'on': 'Man' }
    Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
    call plug#end()
"}}}


"{{{ Auto Commands
    " Reset format options when filetypes are loaded
    autocmd FileType * set formatoptions=tcrql

    " Trigger StyleMarks
    autocmd VimEnter,BufWinEnter,BufWinLeave * call StyleMarks()
"}}}


"{{{ Maps
    " Get raid of vim 'exclusivity' madness
    " All movements are now inclusive
    " onoremap h vh
    " onoremap l vl
    " onoremap b vb
    " onoremap B vB
    " onoremap F vF
    " onoremap T vT
    " onoremap ^ v^
    " onoremap g^ vg^
    " onoremap + v+
    " onoremap g+ vg+
    " onoremap ( v(
    " onoremap ` v`

    " Move with visual lines
    nnoremap j gj
    nnoremap k gk
    nnoremap J gJ
    nnoremap 0 g0
    nnoremap ^ g^
    nnoremap $ g$

    " Search for visual selected area
    vnoremap // y/<C-R>"<CR>

    " Terminal mode leaving
    tnoremap <esc> <C-\><C-n>

    " Toggle folds
    nnoremap <space> za

    " Remove highlights using escape (this prevent using especial keys mappings!)
    nnoremap <silent><esc> :noh<CR><esc>

    """"  LEADER mappings
    " Remove trailing white spaces ( \w )
    map <silent><leader>f :call Format() <CR>
    " Toggle spelling ( \s )
    nnoremap <leader>s :call ToggleSpell() <cr>
    " Trigger TagList plugin ( \t )
    nnoremap <leader>t :TlistToggle <cr>
    " Trigger UndoTree plugin ( \u )
    nnoremap <leader>u :UndotreeToggle <cr>
    " Trigger NerdTree plugin ( \n )
    nnoremap <leader>n :NERDTreeToggle <cr>
    " Trigger Ctags program for the current directory
    nnoremap <silent><leader>c :!ctags -R . <cr>
"}}}


"{{{ Options and Configurations
    " Status line
    set statusline=[%n]\ %t\ [%{strlen(&fenc)?&fenc:'none'},\ %{&ff}]
    set statusline+=\ [ft=%Y]\ %r\ %m
    set statusline+=%=%c:%l/%L\ %P

    " Color scheme
    colors solarized

    " Set various options
    syntax on
    syntax spell toplevel
    set t_CO=16
    set lazyredraw
    set textwidth=80
    set linebreak
    set timeoutlen=1000 ttimeoutlen=0
    " set cursorline
    set tabstop=4
    set softtabstop=4
    set shiftwidth=4
    set expandtab
    set smarttab
    set showcmd
    set completeopt-=preview
    set completeopt+=longest
    set number
    set showmatch
    set hlsearch
    set incsearch
    set ignorecase
    set smartcase
    set backspace=2
    set autoindent
    set cindent
    set ruler
    set autoread
    set nojoinspaces
    set background=light
    set wrapscan
    set laststatus=2
    set wildmenu
    set wildmode=longest,list,full
    set wildignore=*.o,*.class
    set hidden
    set foldenable
    set foldmethod=syntax
    set foldnestmax=2
    set foldlevel=3
    let c_no_comment_fold=1

    " Formatting options:
    "  * Auto wrap text using textwidth
    "  * Auto wrap comments using textwidth
    "  * Auto insert comment leader while inserting
    "  * Auto formatting of paragraphs
    "  * Don't auto brake lines
    set formatoptions=tcrql

    " Config the backup system
    set backup
    set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set backupskip=/tmp/*,/private/tmp/*
    set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set writebackup
"}}}


"{{{ Plugins configuration
    " Syntastic
    let $PYTHONPATH='/usr/lib/python3.4/site-packages'
    let g:syntastic_mode_map = {
        \ 'mode' : 'passive',
        \ 'active_filetypes' : [],
        \ 'passive_filetypes' : [] }

    " Targets
    " let g:targets_aiAI = 'aIAi'
"}}}


"{{{ Misc
    " Set SDCC paths
    set path+=/usr/share/sdcc/include/pic14,/usr/share/sdcc/include/pic16
    set path+=/usr/share/sdcc/non-free/include/pic14,/usr/share/sdcc/non-free/include/pic16

    " Sudo Write
    command W w !sudo tee % >/dev/null
"}}}


"{{{ Personal functions

    " Help files tags jump
    " [g , ]g
    nmap [g <Plug>unimpairedHelpTagPrevious
    nmap ]g <Plug>unimpairedHelpTagNext

    nnoremap <silent> <Plug>unimpairedHelpTagPrevious :call <SID>HelpTag(1)<CR>
    nnoremap <silent> <Plug>unimpairedHelpTagNext     :call <SID>HelpTag(0)<CR>

    function! s:HelpTag(reverse)
      call search('|\S\+|', a:reverse ? 'bW' : 'W')
    endfunction


    " Format document
    "
    " * Removes trailing white spaces
    " * Removes blank lines at the end of the file
    " * Replaces tabs with spaces
    " * Re-Indent
    "
    " * If: C, CPP, PHP or JAVA code: format using 'astyle'
    "       * Style: allman
    "       * Braces in the first column
    "       * Spaces between operators
    "
    " * Leaves 'formatprg' option clean so `gq` can be used with the default
    "   behavior
    function! Format()
        silent! execute 'norm! mz'

        if &ft ==? 'c' || &ft ==? 'cpp' || &ft ==? 'php'
            set formatprg=astyle\ --mode=c\ --style=allman\ -j\ -p\ -f\ -xe\ -xC80\ -H
            silent! execute 'norm! gggqG'
        elseif &ft ==? 'java'
            set formatprg=astyle\ --mode=java\ --style=allman\ -j\ -p\ -f\ -xe\ -xC80\ -H
            silent! execute 'norm! gggqG'
        endif

        silent! execute '%s/\s\+$//ge'
        silent! execute 'g/\v^$\n*%$/norm! dd'
        silent! execute 'retab'
        silent! execute 'gg=G'
        silent! execute 'norm! `z'
        set formatprg=
    endfunction


    " Alternate between { NOSPELL, EN, ES } spelling
    function! ToggleSpell()
        if &spell ==? 0
            set spelllang=en
            set spell
            echom "Spell [EN]"

        elseif &spell ==? 1
            if &spelllang ==? 'en'
                set spelllang=es
                echom "Spell [ES]"

            elseif &spelllang ==? 'es'
                set spelllang=en
                set nospell
                echom "NO Spell"
            endif
        endif
    endfunction


    " Marks over length lines and trailing white spaces as errors
    function! StyleMarks()
        highlight OverLength ctermbg=blue ctermfg=white
        call matchadd('OverLength', '\%81v.\+', 100)

        highlight Trailing ctermbg=blue ctermfg=white
        call matchadd('Trailing', '\s\+$', 100)

        highlight Debugme ctermbg=red ctermfg=white
        call matchadd('Debugme', 'debugme', 100)
        call matchadd('Debugme', 'DEBUGME', 100)
    endfunction
"}}}

" vim:fdm=marker



.tmux.conf
Código:
# Set the current working directory based on the current pane's current
# working directory (if set; if not, use the pane's starting directory)
# when creating # new windows and splits.
bind-key c new-window -c '#{pane_current_path}'
bind-key '"' split-window -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'

# use UTF8
set -g utf8
set-window-option -g utf8 on

# Index start from 1 (insted of 0)
set -g base-index 1

set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g mode-mouse off

# make tmux display things in 256 colors
set -g default-terminal "screen-256color"

# set scrollback history to 10000 (10k)
set -g history-limit 10000

# set Ctrl-s as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-s
unbind C-b

# use send-prefix to pass C-a through to application
bind C-s send-prefix

# shorten command delay
set -sg escape-time 1


# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# map Vi selectio/copy keys
bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind-key -t vi-copy 'y' copy-selection # Yank selection in copy mode


# resize panes using PREFIX H, J, K, L
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5


#### COLOR (Solarized light)
#
## default statusbar colors
set-option -g status-bg white #base2
set-option -g status-fg yellow #yellow
set-option -g status-attr default
#
## default window title colors
set-window-option -g window-status-fg brightyellow #base00
set-window-option -g window-status-bg default
##set-window-option -g window-status-attr dim
#
## active window title colors
set-window-option -g window-status-current-fg brightred #orange
set-window-option -g window-status-current-bg default
##set-window-option -g window-status-current-attr bright
#
## pane border
set-option -g pane-border-fg white #base2
set-option -g pane-active-border-fg brightcyan #base1
#
## message text
set-option -g message-bg white #base2
set-option -g message-fg brightred #orange
#
## pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
#
## clock
set-window-option -g clock-mode-colour green #green


# ----------------------
# Status Bar
# -----------------------
set -g status-right '#(~/.tmuxbar.sh)'
set-option -g status on                # turn the status bar on
set -g status-utf8 on                  # set utf-8 for the status bar
set -g status-interval 15              # set update frequency (default 15 seconds)
set -g status-justify centre           # center window list for clarity
# set-option -g status off                      # Hide tmux bar by default
bind-key a set -g status               # Toggle tmux bar visibility
# set-option -g status-position top    # position the status bar at top of screen

# visual notification of activity in other windows
# setw -g monitor-activity on
# set -g visual-activity on



#######################
# Tmux Plugin manager
#######################

# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins '              \
  tmux-plugins/tpm                 \
  tmux-plugins/tmux-sensible       \
  tmux-plugins/tmux-resurrect       \
  tmux-plugins/tmux-yank       \
'
# Other examples:
# github_username/plugin_name    \
# git@github.com/user/plugin     \
# git@bitbucket.com/user/plugin  \

# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'



.ratpoisonrc
Código:
#{{{ Bindigs
    # Escape
    escape C-g

    # Abort with ESC
    bind Escape abort

    # Only window
    unbind q
    bind o only

    # Start graphical terminal emulator instance
    bind c exec gnome-terminal

    # Give temporally control to DWM
    bind W tmpwm dwm

    # Close current window
    bind Q delete
    unbind C-k

    # Vi keys
    bind j focusdown
    bind h focusleft
    bind k focusup
    bind l focusright
    bind J exchangedown
    bind H exchangeleft
    bind K exchangeup
    bind L exchangeright

    # Vi splits
    unbind S
    bind s vsplit
    bind v hsplit
#}}}

# Banish the mouse pointer in every window change
addhook key banish

# Put cursor where it was previously
warp on

# Don't convert cursor in a box while waiting commands
set waitcursor 0

# Messages config
msgwait 2
startup_message off
set fgcolor black
set bgcolor papaya whip

# More informative date and time
bind a exec ratpoison -c "echo $( acpi -b | awk '{ print $3, $4 }' | tr -d ',' ) ||  $( date "+%F %r" )"

# If there is more than 1 screen, give focus to the second one
nextscreen

# vim:fdm=marker


Me han fascinado muchos ficheros de configuracion, buen post. Saludos cordiales desde Ecuador!


Título: Re: Postea tu .bashrc/alias/scripts/.vimrc
Publicado por: qwartz 2.0 en 12 Julio 2017, 18:38 pm
Ya es algo viejo el post pero igual y alguien le sirve :D

Dotfiles: https://github.com/qwartz2/dotfiles (https://github.com/qwartz2/dotfiles)

VIM
Tengo la config. de vim dividida en varios archivos, solo por tener un poco mas organizado nada especial.
Código:
~/
.vimrc
.vim/
   |- vimrc/
      |- basic.vim
      |- plugins.vim
   |- colors/
       |- hybrid.vim
*hybrid.vim es el esquema de colores que utilizo para vim

~/.vimrc
Código
  1. source ~/.vim/vimrc/basic.vim
  2. source ~/.vim/vimrc/plugins.vim
  3.  

~/.vim/vimrc/basic.vim
Código
  1. "
  2. " Basic Config. of VIM
  3. " Author - @qwartz_
  4. "
  5.  
  6. " -----------------------
  7. " General
  8. " -----------------------
  9.  
  10. "/*
  11. set encoding=utf8
  12. set nocompatible
  13. set history=1000
  14. " set colorcolumn=80
  15. "*/
  16.  
  17. "/* Not Backup
  18. set noswapfile
  19. set nobackup
  20. "*/
  21.  
  22. "/* Indented
  23. set autoindent
  24. set expandtab        
  25. set shiftwidth=4
  26. set softtabstop=4
  27. "*/
  28.  
  29. "/* Folding
  30. set foldmethod=marker
  31. set foldmarker=/*,*/
  32. "*/
  33.  
  34. " -----------------------
  35. "  Interface
  36. " -----------------------
  37.  
  38. "/* Basic
  39. set background=dark
  40. colorscheme hybrid
  41. syntax on
  42. set number
  43. "*/
  44.  
  45. "/* More
  46. set relativenumber
  47. set cursorline
  48. set cursorcolumn
  49. set showmatch " opening and closing parentheses
  50. set mouse=a
  51. set ruler
  52. set laststatus=2 " status  bar
  53. set wildmenu " autocomplete bar
  54. set t_Co=256
  55. "*/
  56.  
  57. " -----------------------
  58. "  Basic Mapping
  59. " -----------------------
  60. let mapleader=","
  61.  
  62. "/* change column numbers
  63. nmap <F5> :set invrelativenumber<CR>
  64. imap <F5> <ESC>:set invrelativenumber<CR>a
  65. "*/
  66.  
  67. "/* resize panels
  68. nmap h :vertical res +2<CR>
  69. nmap l :vertical res -2<CR>  
  70. nmap j :res +2<CR>
  71. nmap k :res -2<CR>
  72. "*/
  73.  
  74. "/* split window
  75. nmap <Leader>h :split<CR>
  76. nmap <Leader>v :vsplit<CR>
  77. "*/
  78.  


~/.vim/vimrc/plugins.vim
Código
  1. " Plugins
  2. " Author - @qwartz_
  3. "
  4. " -----------------------
  5. "  Plugins
  6. " -----------------------
  7. call plug#begin('~/.vim/plugged')
  8.  
  9. "/* list plugins
  10. " Uncomment the plugins you want to install!
  11. " Basic;
  12. Plug 'jiangmiao/auto-pairs'
  13. Plug 'vim-scripts/AutoComplPop'
  14. Plug 'scrooloose/nerdtree'  
  15. "
  16. " More;
  17. "Plug 'ervandew/supertab'
  18. " ----> Snippets <----
  19. "Plug 'garbas/vim-snipmate'
  20. "Plug 'MarcWeber/vim-addon-mw-utils'
  21. "Plug 'tomtom/tlib_vim'
  22. "Plug 'garbas/vim-snipmate'
  23. "Plug 'honza/vim-snippets'
  24. "*/
  25. call plug#end()
  26.  
  27. " -----------------------
  28. "  Config. Plugins
  29. " -----------------------
  30.  
  31. "/* NERDTree
  32. nmap <Leader>nt :NERDTreeToggle<CR>
  33. let NERDTreeQuitOnOpen=1
  34. let NERDTreeWinSize=20
  35. "*/
  36.  

*Para instalar plugins utilizo: vim-plug (https://github.com/junegunn/vim-plug)