tadhg.com
tadhg.com
 

Posts concerning Jython

Some Vim Script Implementation, Testing, and Hackery

23:50 16 Feb 2010. Updated: 00:57 17 Feb 2010

As a result of my porting over jEdit (Jython) macros to Vim, I now have a fair amount of (Python) Vim scripts, and have learned some things about how to set up those scripts. I’ll go through some of that below, and hopefully other people writing Python scripts for Vim will find it useful.
[more...]

Permalink     1 Comment     [, , , , , , ]    

First Post With Vim

20:05 14 Feb 2010

Over the last couple of weeks I’ve been hacking away on scripts to customize Vim, replicating the scripts I made for jEdit. I’m more or less done, and this blog post is being written in MacVim. This hopefully means that when I’m done with it I’ll be able to publish it from within Vim, the same as with jEdit.
[more...]

Permalink     1 Comment     [, , , , , , , ]    

Better Word Count in Vim

23:40 17 Jan 2010

I’m currently trying out Vim (again), and have made more progress this time, mainly due to Seth’s help. The key things that have made it better:

  • :set hidden. Absolutely critical, this. Stops Vim from complaining when you try to switch buffers and your current buffer has unsaved changes.
  • bufexplorer. Makes switching buffers a lot easier.
  • A better Python syntax file. I didn’t like the defaults.
  • My own indentation and syntax files for reStructuredText.

Really, though, the key first one was :set hidden. Before that I felt that I had completely misunderstood Vim’s file management model.
[more...]

Permalink     1 Comment     [, , , , , , , ]    

Better Word Count in jEdit

22:33 19 Jul 2009

I tend to care about word count in my writing. I’ve never been paid by the word, but nevertheless, it matters to me. From time to time I write fiction where I set the word count in advance, and then I try to hit it precisely. Even when that’s not the case, I just like to know how many words there are in a piece I’m writing. For this reason, a "word count" function is completely critical to me for whatever word processor or text editor I’m using to write.

jEdit has such a feature. It’s more or less the same as the one that I’ve been using in AbiWord, and in various word processors before that. But for quite some time I’ve wanted a better word counter. Since jEdit is now my application for all writing and I can script for it in Python, it was time to make the word counter I wanted.
[more...]

Permalink     Comment     [, , , , , ]    

jEdit Macros in Python

16:57 17 Jul 2009. Updated: 17:52 18 Jul 2009

jEdit has long been my text editor of choice, and I’m using it more than ever now that I’m writing more or less everything in it. I’ve been waiting a while for 4.3 to come out, but overall I remain quite happy with it. I do occasionally wonder about switching to vim or Emacs, but jEdit’s generally been able to do whatever I wanted it to.

I haven’t done much scripting with it, though. I recently came up with some use cases for scripts—involving reStructuredText, naturally—but I was a little reluctant to do the scripting because it involves Java and I really want to keep my current focus on Python and JavaScript.

I was therefore rather happy to discover the existence of the JythonInterpreter plugin, which makes it possible to write macros for jEdit in Python.
[more...]

Permalink     2 Comments     [, , , , ]