Thursday, June 14, 2007

[updated] Some life changing (g)VI(M) scripts

Ok first I need to say that I use gvim for both text, using LaTeX, and code, mainlly C/C++, writting. So the focus is on both aspects.


. LaTeX-Suite: here and here

- ~/vimrc:
filetype plugin on
set grepprg=grep\ -nH\ $*

- Comments: it works only if you start vim with a ".tex" file.

. Instead of vimspell use the native VIM spell-checker (for VIM 7.0 or greater, Fedora 8 or greater).

- ~/vimrc:
nmap <F10> :setl spell spl=de_de<CR>
nmap <F11> :setl spell spl=en_gb<CR>
nmap <F12> :setl spell spl=<CR>

- Comments: the out-of-the-box VIM come just with the English US dictionary, so to add more dictionaries, with your special flavour, just execute manually (once per language) the fallowing command in VIM:

:setl spell spl=xx_xx

Where "xx_xx" is the language you want to use, for instance: pt_br, es_es, es_mx, en_gb, en_ca, de_de, de_ch, for Brazilian Portuguese, Spanish Spanish, Mexican Spanish, British English, Canadian English, German German, Switzer German.

The languages supported are all languages present in OpenOffice.

. vimspell: here

- ~/vimrc:
" VimSpell settings
highlight SpellErrors ctermfg=Red guifg=Red
\ cterm=underline gui=underline term=reverse
au VimEnter * SpellAutoEnable
let spell_update_time = 2000
" file types to allow correction on
let spell_auto_type = "all"
" on-the-fly type correction
let spell_insert_mode = 0
" which corrector to use
let spell_executable = "aspell"
" languages
let spell_language_list = "en_GB,de_DE,pt_BR"
let spell_auto_jump = 0

- Comments: It is a must for every one that writes something besides code without comments :-)


. csupport: here, but usually already on vim/gvim package.

- ~/vimrc:
let g:C_AuthorName = 'Your name'
let g:C_Email = ''

- Comments: It helps, A LOT!

. Tags menu: here

- ~/vimrc:
let Tmenu_ctags_cmd = '/usr/bin/ctags'
let Tmenu_max_submenu_items = 20
let Tmenu_max_tag_length = 10
let Tmenu_sort_type = "name"

- Comments: it creates, using gvim, a menu item called "Tags" with the current file tags.

. taglist: here

- ~/.vimrc:
nnoremap <silent> <F8> :TlistToggle<CR>

- Comments: This is THE killer tag browser and that map above makes it reachable by pressing <F8>. Check it out.

Related posts: gVim revisited.

Sunday, June 10, 2007

Almost a year

That's it: this blog was dead for almost a year and is time to do some catch up, if I still have any reader. But anyway this is more for me than for you and I can also practice my English (as you can see need a lot of improvements).

Nevertheless here comes some things that I'm very excited about:

- CDT 4.0 RC3 for Eclipse 3.3
- Fedora 7

First why is CDT to be excited about, because it has a refactoring tool that actually works. Ok it is just a renaming tool, so what? That means that they are really into keeping track of your code, including documentation. So I believe that they are bringing all those cool refactoring tools, like move, in no time. Then a C/C++ programmer can have all those nice things about Java IDE in a C/C++ free IDE.

And what about Fedora 7, there is nothing REALLY new on it. Well, first they are free from the RH packaging tools, which means that hopefully there will be some Fedora "the way I wanted" 7. But here some critics about Fedora: they should be more careful about the RPMs, which have broken dependencies, like VLC. We are talking about VLC, which is a major end-user application. The new version has also some stability issues, specially xorg. But the new xorg is kicking asses!!! If you don't saw it, please DO.

The new xorg is already with the 3D Desktop concept in it. They must polish some rough edges, like maximizing, but it looks good, very good. It is a mixture of OSX (with that very nice + behaviour) with 3D Desktop environment. But has I said, it needs some refinement, maybe on the next major upgrade.