Thursday, January 31, 2008

gVim revisited

In previous post (here) I gave some hints about gVim and some scripts. The first serious update is on the spell-checking area. The new Vim 7.0 already includes a spell-checker. To activate it include the following in your ~/.vimrc file: set spell spl=<lang>, where <lang> is of [en,en_gb,en_us,de,de_20], see the complete documentation for more (here) and a nice quick reference chart here, from where I got inspired to add my own contribution for spell-checking.

First you need to install the dictd package:

#---
yum -y install dictd
#---


Then you can add the following to your ~/.vimrc file:

nmap <silent> <F2> :!dict -s exact -d gcide -m <C-R><C-W><CR>
nmap <silent> <F3> :!dict -s exact -d gcide <C-R><C-W><CR>



This line makes a dict query for word where your cursor is (if you press <F2>. It is just a match against on of the available dictionaries (see: dict --help for more details). This is useful for dictionaries that are not that updated and when the Vim spell-checker says that a word does not exist you can double-check it with <F2>.

The second variant, pressing <F3>, gives you the word definition.

I hope you enjoy it!

Related posts: Some scripts.

Wednesday, January 23, 2008

Fedora Control Center: I'm impressed

I just bumped into the Gnome Control Center today and I must say I'm impressed. It is just the thing that MS Windows had had since the beginning and I sort of regretted that Linux doesn't, actually didn't. It is pretty much a polished clone from the earlier versions of MS Windows Control Panel (resembles the MS Windows 2000).

The first thing I tried was the regular stuff: sound and so on. But what really impresses me was the IPTables configuring tool (Firewall). It is really not that bad. I'm still a shell guy but that control center worths the try.

Main Menu -> System -> Preferences -> Control Center

Tuesday, January 15, 2008

[UPDATE] C Cedilla with Gnome

This problem could be perfectly overcame with a language switch to Portuguese, but I like to have my Linux in English or German and still be able to write in Portuguese, this includes the ç characters. But the default for English and German is to produce a ć instead of our beloved cedilla.

Anyway the answer I found in here and it says the following:

1. Edit the file /etc/gtk-2.0/i386-redhat-linux-gnu/gtk.immodules /etc/gtk-2.0/x86_64-redhat-linux-gnu/gtk.immodules

2. Add at the line beginning with: "cedilla" the language that you want to produce, as default, the c cedilla.

The original is:
"/usr/lib64/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

And I changed it to:
"/usr/lib64/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en:de"