Posts Tagged ‘ctags’

2011w29

Sunday, July 24th, 2011

vim and ctags

I’ve been meaning to look into ctags for a while, mostly because I’ve wanted some better way of being able to locate the definition or calls of a function, than popping up a new terminal and running grep. I know of :[l]grep and :[l]vimgrep and should really spend a day or two learning those as well, but ctags looks like it could be more useful to know immediately so for now I’ll focus on getting acquainted with these keybindings.

ctags itself is “exuberant ctags” and is found on sourceforge, if not available from your package manager. If you’re using vim you’ll also want to grab the ctags.vim script and just drop it into your ${HOME}/.vim/plugin/ directory.

In your source directory simply run $ ctags -R and you will have yourself a tags file for this directory and all subdirectories. Opening a file and calling :TlistOpen will give you a list of all the found definitions in the project. Unfortunately for me, I want all the newly created windows from a split to appear to the right or below, the original window, EXCEPT for this tag list window ;)

The solution to that came in a StackOverflow thread and is called Ctrl-W R

There are several good posts which helped me come to terms with ctags.

firefox and sorting downloads

For a while now *cough*since around 2006*cough* I have been using the absolutely asskicking add-on Download Sort for Firefox. You set up your rules for where files with a certain extension should go, and then you just start downloading files, and they all end up where they should.

Or so the theory goes. But let’s say that you get tired of having to move all your wallpapers downloaded from deviantart.com or wherever, to your wallpapers folder, from the generic images folder?

Then Download Sort is looking less good. There just isn’t a way to differentiate between an “image” jpg and a “wallpaper” jpg.
Sadly, the only add-on I’ve found which advertises the features I want, Automatic Save Folder, didn’t work for me at all. It might be my overly paranoid security settings screwing things up, but for some reason it just won’t remember any of the rules I set into place…

urxvt-tabbedex

I started playing with tabbed urxvt. I ultimately ended up installing urxvt-tabbedex and using that instead. The differences are small, but tabbedex doesn’t provide a “new” button (a new shell is spawned using Shift-Down, and tabbedex provides (the perhaps less useful) feature of renaming a tab (Shift-Up).

wmii

I have lived under the impression that I was using a really old wmii (even though the package I used was wmii-hg which should pull the latest version from the repository). The reason I was under the impression that this was old was that it never came any updates when I executed a $ yaourt -Sayu.

When I finally looked into it yesterday I finally realized that I was running on bleeding edge. The trick to wmii-hg, apparently, is that you need to manually re-install it to have it fetch the latest updates… What I took as project inactivity (and must thus be an old branch) was in fact not so.

As tagrules are severely broken in wmii-hg it hasn’t been fun using it (and colrules behaved very strange, but strange in a way I have now come to appreciate… go figure) but there were always issues with the wmii package in the repository, most having to do with an insane amount of flickering when creating a new terminal, or moving one about etc.

The flickering parts seems to have been solved, it might have had something to do with my transparent terminals and not a problem with wmii, I don’t know, but now it works.

Thanks goes out to pesa for single-handedly seeking out and vanquishing my final annoyance of wmii 3.9.2: that every now and then it would start spawning more than one terminal when I issued a command to get one.

When I was reloading the configuration, the old process remained, and with it, the listeners for keyboard commands… like starting a new terminal…

mercurial-server

I’ve been running the mercurial-server package on my server to provide me with easy access to (mercurial) repositories. This week, for some reason, it started failing.

I had updated mercurial from 1.3 to 1.9 and my first thought was that this had broken mercurial-server somehow, but after reverting the package, the problem came back.

Not immediately, mind you, which makes this whole thing even stranger.

But this has just provided me with the right amount of kick in the ass to get on my way and convert from mercurial to git, so all in all perhaps not a bad thing?

Links

Why I’m not going near spotify: It sums up pretty well my own feelings about Spotify…

In certain (rather specific) contexts, I even despise Spotify users, and here’s why: Imagine that you are sitting on a train, and you will be doing so for the next seven hours or so. The train has “internet”, via one 3G modem.

Now picture ten other passengers ALSO going online, their objective being to listen to Spotify. Can haz moar bandwifs plz? kthxbai

:wq

Vim + snipMate

Sunday, March 14th, 2010

As I sat down in front of the computer today and started reading the identi.ca backlog I came across this gem, which lead here, about how to turn Vim into a Python IDE. The blogpost itself contained many useful tips/tricks (the code folding script being on the top of that list), but as is often the case, the really cool stuff gets unearthed in the comments, like this one about snipMate. Also, excellent video presentation is excellent!

That post also lead me to another post on that blog which inspired me to finally start looking into ctags, which is a two step installation, one being installing the package exuberant-ctags from the repository, and the other fetching this script.

All I need to do now is try to learn the key mappings M^e, f, M^f, and TT/F4 ;D oh, and to tab a lot ;D