Showing posts with label kate. Show all posts
Showing posts with label kate. Show all posts

Saturday, December 1, 2007

Directory Project plugin for Kate

This is a plugin for Kate that mimics TextMate's directory tree view and find files features. In other words, it's a simple project managing plugin where a directory defines a project. See the "Features" section below for screenshots and the "Settings" sections for an explanation of each option.

Prerequisites


This plugin requires that Kate (obviously) and Pate be installed. If you are having trouble installing Pate on an Ubuntu system, please see this post.

Installation


git clone git://github.com/cjbottaro/kate_directory_project.git
cd directory_project
./install

If that doesn't work, all you need to do mkdir -p ~/.kde/share/apps/kate/pyplugins/directory_project and copy directory_project.py into it.

Features


Tree view of whatever directory is currently opened.

Search-as-you-type find files dialog.

Useful configuration options.


Tree browser and find files dialog stay in sync with filesystem via KDirWatch. (no picture)

Settings


There are two types of settings: project specific and global. Global options are applied to all directory projects while project specific settings are different for each one. Directory Project remembers the project specific settings between projects via an ini file in ~/.kde/share/apps/kate/pyplugins/directory_project/directory_project.conf

Probably the most important setting is the search type setting. It dictates how the find files dialog generates matches.

Search type exact only hits exact matches. For instance, searching for doc_test will yield the following matches (matching text highlighted):
doc_test.rb
email_doc_test.rb

Search type character matches by character, preserving the order of the characters. Spaces are ignored in the query string for this search type. This search type is the default behavior in TextMate. Searching for doc test yields:
document_test
dashboard_controller_test.rb

Search type word matchs by word, preserving the order of the words. Words are space separated in the query string. This is the default search type for Directory Project. Searching for doc test yields:
document_test.rb
document_controller_test.rb

The name filters settings is a space separated list of file name pattern matches. Any file that does not match one of these patterns will not show up in Directory Project's tree browser or find files dialog. The default setting is * which matches all files. If you only want to match Ruby and HTML files, you can change the name filters to *.rb *.html

The Ignore Files/Directories is a list of files and directories names that will be ignored by Directory Project. Adding a directory here will stop Directory Project from including anything below that directory.

TODO


Make an option to have the find files dialog search on the relative path instead of just the file name, so you can distinguish between app/views/emails/index.html and app/views/documents/index.html by searching for email index.

Wednesday, November 14, 2007

Installing Pate for Kate

You need to do some hacking to get Pate installed on a (K)ubuntu 7.10 system.

Background


Pate is a really cool plugin for Kate (which is a text editor for my favorite desktop environment). It is a Kate plugin that allows you to write other Kate plugins in Python (instead of C++). It also comes with a few Python-written plugins, mainly to demonstrate what you can do with it.

I had a very hard time installing Pate. The reason being that the author is a Suse user and his configure script only works? is tailored for Suse. I'm an Ubuntu user; specifically Kubuntu 7.10 Gutsy Gibbon.

Installation Process


You need to install development headers/libraries for Kate, Sip, KDE Python bindings, QT Python bindings, etc.

sudo aptitude install cmake sip4 python-sip4-dev python-kde3-dev \
python-qt-dev kate-plugins kdelibs-dev kdebase-dev
If I'm missing anything, please let me know and I'll update this.

Pate-0.5
cd PATE_SRC
wget http://www.stochasticbytes.com/pate/pate-0.5-ubuntu-patches.tar.gz
tar xzf pate-0.5-ubuntu-patches.tar.gz

Now configure && cd build && make && sudo make install should work as expected.

Here is a link to my Pate-0.5 patches.

Pate-0.5.1

This version isn't available (yet) via the main Pate webpage, but here's a link for you.

cd PATE_SRC
wget www.stochasticbytes.com/pate/pate-0.5.1-ubuntu-patches.tar.gz
tar xzf pate-0.5.1-ubuntu-patches.tar.gz

Now configure && cd build && make && sudo make install should work as expected.

Here is a link to my Pate-0.5.1 patches.

Why?


Why did I go through the trouble of making a blog post about this rather than submit my changes back to the author? Two reasons:

  1. It's an excuse to make a blog post!
  2. The author and the kwrite-devel mailing list didn't seem too interested in my plight.