Code completion in vim

This is for C/C++, but it can also be done in other languages (details will come as I go). The bulk of the instructions are here, but I add one remark: the map to generate tags for the current directory, the command is wrong. Use this one, instead (exclamation mark inserted, and required!):

map <S-F8> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>

Also changed the key combination to Shift-F8, you use whatever suits you.

On a (not so) related note, on the that blog there’s also an interesting post about getting the 10 more used commands using this command:

$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head

Using it  in home computer yielded this:

53 make
48 ls
48 cd
40 mplayer
39 exit
22 ./sdlm
19 convert
18 vim
16 rm
15 man

I also only have 500 lines in .bash_history. Will have to increase that to get a better picture…


Os comentários estão fechados.