Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

Wednesday, March 5, 2014

[Tutorial] Personalizar las herramientas básicas en Linux

Personalizar las herramientas básicas en Linux

Si como a mí, les gusta cambiar el aspecto de las herramientas que usan todos los días: como el Terminal, su editor de texto y cosas de ese estilo... pueden ver algunas opciones que dejaré en este post.

Personalizar su Shell


Antes que nada, yo prefiero utilizar zsh en vez de bash porque tiene algunas mejoras y funcionalidades más interesantes. Es un shell un poco más evolucionado, pero uno necesita escribir su propio archivo de configuración o conseguir uno en línea.

Yo no escribí mi propio archivo de configuración para zsh. Lo sé, qué decepción.. Pero si alguien ya lo hizo y lo hizo mejor que yo, pues voy a usar lo que hizo. :)

Hay un montón de opciones que se pueden encontrar en internet. El que yo uso y me gusta mucho se llama grml zsh rc.
Este es el archivo de configuración es el que se usa cuando uno instala Arch en una máquina, y tiene muchas funcionalidades interesantes. Por ejemplo la compleción para las páginas del manual, archivos o carpetas... básicamente para todo lo que puedan usar la Tabulación. Les mostrará todas las opciones que haya y creará un menú dinámicamente en la pantalla de su terminal.
Un ejemplo de la compleción cuando busco una página del manual. La tabulación me permite navegar entre las selecciones.
Inclusive hay una página de manual para el archivo de configuración. Pueden agregar muchas cosas interesantes en su prompt como el estado de su batería, o pueden cambiar el look de su prompt muy fácilmente con algunas opciones predeterminadas.

Si quieren instalar esto (asegúrense de hacer una copia de respaldo de su archivo de configuración si desean conservarlo):

$ wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc

Si estan usando Arch pueden instalarlo directamente desde los paquetes extra:

# pacman -S grml-zsh-config

Otra opción que probé no hace mucho se llama oh-my-zsh.
Tienen un montón de archivos de configuración creados por la comunidad y pueden pasar de uno a otro muy fácilmente, cambiando una sola línea de su archivo .zshrc .

Asegúrense de ver las opciones en la página Github del proyecto.

Si prefieren usar bash pueden chequear el Arch wiki sobre Color Bash Prompt.

¿Cansados de la apariencia de ls


Recientemente vi un screenshot en una comunidad de Linux en G+ que mostraba colores diferentes para el comando ls. Luego comencé a buscar sobre cómo cambiar los colores para los diferentes tipos de archivos y me encontré con el tema Solarized que al parecer es bastante popular.
Todos los tipos de archivos con los diferentes colores.
Si quieren cambiar los colores para el comando ls, pueden ir a este proyecto Github y descargar el tema que quieran utilizar. Yo uso el tema 256.

Cambien el nombre del archivo que descargaron y pónganlo donde quieran (en mi caso lo puse en el home):

$ mv dircolors.256dark ~/.dircolors

Luego necesitan ejecutar el comando siguiente cada vez en su terminal:

$ eval `dircolors ~/.dircolors`

Entonces la mejor manera de hacerlo es editando su archivo de configuración, dependiendo de su shell va a ser.bashrc para bash, .zshrc para zsh.

PERO si usan grml config para la configuración de su zsh no pueden editar el archivo.zshrc directamente porque es muy arriesgado.
La manera correcta de hacer esto es editando/creando el archivo .zshrc.local en el cual van a añadir la línea siguiente:

eval `dircolors ~/.dircolors`

Si quieren hacer unos cambios extras pueden intentar el comando llamado ls++ (ls on steroids).

Pueden instalarlo directamente desde AUR si están en Arch o compilarlo con las fuentes. Aquí está la la página Github.

Terminator, usando zsh con GRML config, Solarized como dircolors y ls en esteroides.


Instalar el tema Solarized en VIM


En esta última parte les voy a mostrar como instalar el tema Solarized en VIM.

(G)VIM con Solarized como tema
La página Github del proyecto explica cómo hacerlo.

Yo instale el bundle en .vim/bundle y copié el archivo solarized.vim en .vim/colors. Si no tienen estas carpetas simplemente deben crearlas con mkdir.

Una vez que copiaron el archivo y el bundle lo único que les queda por hacer es cambiar el colorscheme:

:colorscheme solarized

Si quieren hacer esto de manera permanente necesitan crear/editar el archivo .vimrc añadiendo la línea

colorscheme solarized

Les gustó este post? No se olviden de agregarme a sus círculos en G+ o de seguirme en Twitter: @RobertoXMed

Si pueden y quieren no olviden hacer una Donación (por Paypal) para el blog chimbo así podré seguir haciendo gran contenido.

Tuesday, February 25, 2014

[How to] Customization of Linux basic tools

Customization of Linux basic tools

If like me, you like to change the look of the tools that you use every day: like the Terminal, your text editor and stuff like that... you can check some of the options that I will leave in this post.

Customizing you Shell


First of all, I personally prefer to use zsh over bash because of the many features that are included.

I didn't write my own zsh configuration, I know, how lame... But if somebody already did it and did it way better than me, I will use it :)

There are a lot of configuration files out in the wild. I really like the grml zsh rc. This config file is used when you install Arch in a machine and has a lot of interesting features. For example extended completion for man pages, files, folders... Basically anything that you can Tab on. It will show you the options that you have on the screen dynamically.
Here is an example of completion when I'm looking for a manual. The tabulation lets me navigate through selection
There is even a man page for the configuration file. You can add a lot of interesting stuff like the battery state, changing your prompt easily with installed examples...

If you want to install this you can do (please make sure that you have saved your config because this will replace it):

$ wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc

If you are using Arch you can install it from the extra packages

# pacman -S grml-zsh-config

There is another option that I was trying not so long ago called oh-my-zsh.
You get a lot of configuration files made by the community and you can easily switch the look by editing you .zshrc file.

Make sure you check the options in the Github page.

If you prefer to use bash you can check the Arch wiki about Color Bash Prompt, so you can edit your own.

Bored of the display for ls


I saw a screenshot in a Linux community on G+ showing different colors for the ls command. Then I started to do some research about how to change the colors for different extension and came across the Solarized theme that seems to be very popular.
All the extensions showing the different colors
If you want to change all the colors for the ls command you can go to the Github page and download the theme that you want. I use the 256 theme.

Rename the file that you downloaded and put it where you want (I put it in my home):

$ mv dircolors.256dark ~/.dircolors

Then you need to execute the following command every time you launch your terminal:

$ eval `dircolors ~/.dircolors`
So the best way to do this is to edit you configuration file for your shell, .bashrc for bash, .zshrc for zsh.

BUT if you are using the grml config file for zsh you don't edit the .zshrc directly because it is too risky.
The right way to do it is to create/edit the file .zshrc.local and add the line:

eval `dircolors ~/.dircolors`

If you want to add a little extra you can try the command called ls++ (ls on steroids).

You can install it using the AUR packages or build it from source, here is the Github page.

Terminator, using zsh with GRML config file, with Solarized dircolors and ls on steroids.

Installing Solarized theme in VIM


In this last part I will show you how to install the Solarized theme in your VIM editor.

(G)VIM with the Solarized theme
The Github page of the project explains how to do it.

I installed the bundle in .vim/bundle and copied the solarized.vim file in .vim/colors. If the directories are missing just create them using mkdir.

Once you copied the file and the bundle the only thing to do is to change the colorscheme

:colorscheme solarized

If you want to do this permanently you need to create/edit the .vimrc file and put the line

colorscheme solarized


Did you like this post? Don't forget to add me to your circles in G+ or to follow me on Twitter: @RobertoXMed

Please consider donating to the Blog it will be of great help! Thank you.