Host Aliases in SSH
So you've probably got one or two hosts that you frequently ssh to that have long hostnames. You'd prefer to just alias this to something really short. There's a couple ways to do this:
- Hosts file alias. Problem: may overwrite something useful for other network connections.
- Shell alias. Problem: too many aliases.
- Good shell tab-completion. Problem: I can never get zsh to do intelligent ssh host completion.
- SSH configured alias.
So to create an alias for a system add to ~/.ssh/config the following:
Host <alias>
HostName <real system fqdn>
Some examples:
Host s
HostName scottr.org
Host b
HostName 192.168.1.1
After a Host entry can be host specific configuration, and Host can be a pattern (Host *.slashdot.org). So for a host you could disable host key checking, or use a specific key file. Comes in pretty handy.
Full Code Navigation: Cscope
Not long ago we discussed ctags here, and how it can quickly let you navigate your code, helping you find definitions of variables and functions. You'll have taken notice that sometimes you want to navigate in the reverse: where is this function called, who includes this file, etc. Cscope builds a database of such information (and more). We can include it with ctags and have very impressive code searching.
If you want a detailed introduction, there is a great cscope and vim tutorial available. I'll just give you a quick run down of using it.
At the base of your C or C++ source tree run
cscope -R -b -qAdd this to your
.vimrc:if has("cscope") set cst set csto=1 if filereadable("cscope.out") cs add cscope out endif endifStart Vim in the same directory as the generated
cscope.outfile. (If not, just ...

