Friday, June 12, 2009

SVN Introduction

A very common thing while doing any kind of project is using repository. I tend to forget these commands every now and then. That's why this

svn checkout http://fileextensiontype.unfuddle.com/svn/fileextensiontype_fi/ local_directory_name

svn status

svn add *

svn commit


You may also have to do this
export EDITOR=vim

Monday, June 8, 2009

Wordweb Equivalent on Linux

One feature I really miss in Linux is Word-Web. We can have word-web in Linux using wine but pressing the hot-key when word is selected does not activate it. Thus, we can use "gnome-dictionary" with "xbindkeys" and "xclip" to get same kind of functionality.

yum install xbindkeys
yum install xclip
xbindkeys --defaults > ~/.xbindkeysrc
xbindkeys -k

Now a small window will appear and you can get code for the key-combination pressed. Use this combination in configuration file ~/.xbindkeysrc. (I got m:0x1c + c:52 for alt+ctrl+e)

cat <<- END
"gnome-dictionary $(xclip -o)"
m:0x1c + c:52
END
echo "xbindkeys &" >> ~/.bashrc
killall -HUP xbindkeys


Equivalent to "delimiter cat" is "echo -e".

That's it. Just select any word you don't know and press your key combination. We will get its meaning.

Friday, June 5, 2009

Using cscope and ctags

Many people complain that though Linux is in C they don't have good IDE for C development. Though there the things mentioned here are not great but they are good enough to help you in C development.

1. Cscope

find . -name '*.c' > cscope.files
cscope -i cscope.files


cscope.files is default file name, thus just cscope command would work. To exit, you can type Ctrl+D and to see help, you can type "?".

2.Ctags

cd /path/to/your/project
ctags -R *
vim -t

Once inside a file, hitting ctrl-] while the cursor is over a function/class name, Vim will attempt to open the file with that tag. Pressing ctrl-t will take you back a step. To exit, , regular ":q" should work.