Sunday, March 12, 2006

Quickies

Here are some quick tips to help using Linux easier.

  • We tend to use 'grep' to search through our files but finding the occourence of the word can be tricky especially if there are alot of output. grep comes with color option to highlight the word using the --color=auto option. I add an alias in my .bash_profile so I don't have to keep typing it all the time.
    • alias grep='grep --color=auto'

  • vi can be your best friend as it's a very powerful editor and it's always available in every Linux distribution. However, it can get tedious looking at merely looking at black and white fonts. The newer distribution of vi is called vim (vi improved) which offers color options. To enable it (if it isn't) just fire up vi and press the ESC key, and type ':syntax on' exactly. NOTE: The following instruction is for Ubuntu. To make sure every file you open has syntax highlighting, copy '/etc/vim/vimrc' to '~/.vimrc'. Open '~/.vimrc' and look for the line that says 'syntax on' which is disabled by default. Quit and save and every file you open from now on will have syntax highlighting. The syntax highlighting information is stored in '/usr/share/vim/vim63/syntax'.
  • GTK fonts too small? When using Fluxbox, most of the GTK application fonts tend to be really tiny. This doesn't appear in GNOME because it will load 'gnome-settings-daemon' to make the apps streamlined. This however is not a good approach for minimalistic WMs (isn't that why we CHOSE the minimalistic WMs in the 1st place:P). Here is a trick that will make your fonts in the GTK apps, appear exactly as you want them. Edit (or create) a '~/.gtkrc-2.0' and add 'gtk-font-name="<font name> <font size>"', save the file, reload your GTK applications and voila all your fonts are now as you defined them.
Well that's all for now folks;) Gotta go configure my development tools now. Ciaoz.

No comments: