Archive for the 'Find' Category

Handy Firefox/Icewasel keyword searches for (packages|bugs|*).debian.org

Saturday, December 22nd, 2007

Just wanted to drop a tip on you about the Firefox keyword search feature. I use it to quickly access packages.debian.org on package information or to retrieve the BTS page for a bug number. With it you can use “bts 123456″ instead of “http://bugs.debian.org/123456″. May not appear much shorter but I like it anyway. Here an example on how to add a search keyword for packages.debian.org:

  1. Locate a search form (like on packages.debian.org), set all the select options like you want (e.g. only package in “unstable” and from “main”) and then right-click on the actual text field where you enter the search query and select “add a keyword for this search”:
    Iceweasel context menu to add a keyword search bookmark
  2. Give the bookmark a name (does not matter) and the keyword (should be short):
    name the bookmark
  3. Now you can use that keyword in the location bar (where you normally type the URL you want to surf to) and add the word that you search for:
    Using the bookmark in the location field
  4. You will be redirected to http://packages.debian.org/search?searchon=contents&keywords=cream&mode=path&suite=stable&arch=any

So basically getting the package page for this “cream” package means pressing Ctrl-L to highlight the location bar and just enter “pdo cream” and pressing Enter.

For me that was the second most valuable tip when using Firefox. The best tip would probably be how to make that monster take less than 10 seconds to react to mouse clicks on the menus when you have 20 tabs open simultaneously and to consume less than ridiculous 500 MB RAM or freeze up every minute when you use flashy sites like youtube. I really wish 3.x will finally fix that.

P.S. I wonder why wordpress shrinks all my images. I hope you can still guess what I meant.

kate isn’t just a NOTEPAD.EXE for KDE

Sunday, December 2nd, 2007

I’ve been a VIM lover for at least a decade. Nothing beats it at doing complex text editing. Surely it’s not intuitive (although I frequently claim that VI stands for “very intuitive”) but no other text editor can so quickly repeat the last action or reformat a paragraph or insert text at a certain column in every line etc. I am very fast with it and happily ranted at IDEs like SPE, Eric or WingIDE for having such a bad text editor. They were more like a NOTEPAD.EXE that allowed you to navigate with the cursor keys and insert text where you are. But I have to admit that IDEs have a lot of advantages like code completion (vim doesn’t understand Python - not even with omni-completion), templates or dealing with your repository software.

I love cryptic hardcore tools because once I understand them I’m very fast in accomplishing tasks. But even after a decade of using VIM I don’t really understand its configuration or some more advanced features properly. Recently I tried to tell a Python file that I simply like the textwidth to be 100 by adding

:vim:set tw=100:

at the end of the file. No idea why that didn’t work. The command worked well when typed manually.

In addition many basic features like editing multiple files at the same time became a chaos quickly. Multiple buffers? Nah. Tabs are nice but after a certain amount of open files you have to use the arrows to find your file again. Syntax coloring is nice but customizing it is a pain. VIM is great for editing single files and I will always use it to work on DNS zone files for example. But since I develop Pylons (a Python web framework) applications I have to deal with many open files and complex Python code. I tried “pida” which is very promising but is still lacking. For example it doesn’t remember the window panes as I want to have them arranged and find myself moving around things every time I start it up.

I wouldn’t have expected to hear myself saying that vim is not good for all tasks. I had always condemned editors for not being vim and wasn’t open for all the features that I was missing out. Currently I’m trying out “kate”. I had expected it to be a stupid text editor like NOTEPAD.EXE or joe but although it looks similar it is very powerful. Some things I like about it:

  • Handles multiple open files in sessions gracefully (even shows which files have changed)
  • Shows indentation levels in source code (no more guessing where a Python function ends)
  • Text completion (no worse than what vim can do)
  • Closing brackets automatically
  • Split views
  • Syntax highlighting for all types of text files I care about
  • Proper Python indentation handling (vim doesn’t even add an indentation level after a line ending with “:” unless you use dirty tricks)
  • Code folding
  • Snippets (finally I don’t have to copy/paste templates from my knotes any more)
  • Commenting/Uncommenting of lines without :s/^/#/ magic

Kate doesn’t do all things that vim can. But the common tasks are made simpler and more comfortable. No idea if it will be my new editor. But it appears like other text editors besides vim are also worth being tried.