Thursday, July 9, 2009 - 20:32
So, I got taglist up an running. It was pretty straihgtforward. I had a little trouble with "set Tlist_Ctags_Cmd" because this requires the command
let Tlist_Ctags_Cmd='/usr/local/bin/ctags'
rather than
set .....
. This is one where the instructions assumed I knew a little more about vim than I actually did.
Taglist is a little cumbersome for me (although so far well worth it). I have a little trouble navigating using it, but considering how much (or little, to be more precise) I've used it so far I'm not worried. The biggest thing I don't like is how it spaces and arranges some things. If I decide to be crazy later, I may dig through taglist.vim to see if I can change it, but I probably won't bother. I certainly don't have the advantage of already knowing the vim scripting language.
In the meantime, I added an ant script to my project. It's very basic. It has two targets, "clean" and "ctags". Unsurprisingly, "clean" removes generated files. In my case this is all the *.pyc files and the tags file. "ctags", as you might guess, generates a new ctags file. When I first started learning ant I thought it was horrible. But I was trying to learn it while maintaining a bloated build file. Once I started working with it for smaller projects like this one, I found out why it's so nice. I suspect if the bloated one were cleaned up (a lot) it would be lovely too.
Labels: ctags, exuberant ctags, macVim, series4, taglist, vi plugin
Saturday, July 4, 2009 - 10:13
I have decided that I need a better editor / IDE. IDLE is honestly pretty pathetic on a mac. It doesn't allow me to use the command key, so I'm forced to switch back and forth between keystrokes for IDLE and the terminal (I don't mind swithcing between the two programs for different aspects of programming, like terminal to run code and change directory structures, but I REALLY mind that command-> only works in my terminal and not IDLE. There I have to use the 'end' key. It's really just too disorienting when you move around a lot). I have other problems with IDLE too - it doesn't read ANY other file type, so notes and supplimentary files require a different editor, and even worse - creating my *.py files in another program or change the file associations in Finder causes IDLE to not recognize them. Another grievance, which causes me great frustration is the fact that "idle" is a common word. That makes it incredibly difficult for me to search for help or information about why I'm having so many problems. Some people might not be bothered by a 'trivial' problem like that, but it really irks me and I'm not that good at finding what I need in searches to make up for it.
In short, it is causing me problems and I can't stand programming with it. That said, my attempts to find a reasonable editor / lite IDE have not gone well. Somehow, the editors I tried had some major flaws (for me, at least), and I couldn't stand using them. I won't use Eclipse either. It's bloated and buggy and I've had some bad experiences with it recently. Like I said, I'm fine with using editor + terminal for the most part, I just need an editor that's worth its weight. So I decided to use gVim. I use it at work for minor editing jobs, and even without code-completion it's a good editor that I know how to make due the (rather simple) things I absolutely require. Having decided that, all I had to do was grab gVim for my Mac.
A quick search led me to macVim, and tons of information about using vi plugins to gain the most useful IDE features without bloat. Sounds like just what I need. I decided that the most important thing was to install just one plugin at a time, and learn to use it before moving on to the next. I have a tendancy to try too much at once and overwhelm myself.
Installing macVim was trivial. That is a very good thing, because I'm pretty flaky at installing stuff. Unless it is truely trivial, I get confused and require help. This makes Shane rather frustrated, but somehow despite a little coding experience and general comfort with computers, intalling is still really difficult for me.
Anyway, so I decided to start by installing the Taglist plugin, which requires Exuberant Ctags. Finding the source wasn't hard, but it didn't come ready to install for macs. Bad news for me. I looked around and found some simple instructions. I will repeat them here for completion:
- get and unzip ctags-5.7.tar.gz (this was simplified for me because downloads are automatically unzipped with the Archive Utility)
- cd to the directory ctags-5.7
- ./configure
- make
- make install (I had do use sudo for this)
- put /usr/local/bin in the path by placing
export PATH="/usr/local/bin:$PATH"
in my ./bashrc (If you are following these instructions to install ctags, keep reading. This did not work for me.)
- source .bashrc; which ctags
Horray. So I have ctags installed. Everything seemed to be going smoothly (too smoothly) so far. Next step, simply run the command
ctags -R .
in the directory for my project. Should be simply, right? No, alas, something has gone horribly wrong. My ctags does not have a -R option, or any recursive option at all. That is very bad, as I definitely do not want to be running this in every directory of my project. Ick. Besides, even running
ctags .
inside one of the directories doesn't seem to do anything at all.
That is a pretty major issue. Something has gone wrong. I decide I don't like messing with my path. Instead, I use an alias
alias ctags='/usr/local/bin/ctags'
After resourcing my .bashrc, I seem to be using the correct one now (there is some default ctags that is not recommended and supposedly does not work with taglist). Now the
ctags -R .
does exactly what it should. It creates the file tags for my project.
Woot.
Labels: ctags, exuberant ctags, IDE, IDLE, macVim, series 4, taglist, vi plugin
Leave one.