Tag snippets

Recent Posts

Third Google CodeIn Screencast - Snippets (December 12, 2010)

Hey everyone,

the third screencast for KDevelop is in:

It shows the advanced snippets support in KDevelop, see also: Snippets in KDevelop & Kate.

In an unrelated note: I’ll do a talk at the Computer Science faculty of the FU Berlin tomorrow, see:

13.12.2010, 18 Uhr, Hörsaal der Informatik

“Wie und warum man sich als Open Source Entwickler/in engagieren sollte”

Viele Studenten könnten gute Programmierer sein, aber lassen Ihr Talent ungenutzt oder stecken es in private (kleinst) Projekte und One-Man-Vaporware. Würden sie sich hingegen in bestehenden Open Source Projekten engagieren, würde ihr Lieblingsprojekt nicht nur ein Stück besser werden, sondern sie selbst gewännen dabei eine Menge. Was ein paar dieser Vorteile sind, und wie man überhaupt damit anfängt sich in einem großen Projekt zu beteiligen, möchte ich am Beispiel von KDE zeigen und hoffe, dass dadurch ein paar mehr von euch aktiv in einem FOSS Projekt mitarbeiten werden.

continue reading...

Kate/KDevelop HackSprint - Up To Day 4 (February 18, 2010)

Woha, quite a few days flew by without me blogging about anything. Thankfully the others started to write so I don’t have to repeat it all ;-) Instead I’ll concentrate on stuff I did or learned.

GHNS for Snippets

Well, first I think an excuse is in oder: There is a GHNS button for Kate Snippets in 4.4.0 but it’s broken, neither me nor Joseph had time to acutally use and fix it… But anyways, I fixed it now for 4.4.1. For 4.5 we’ll also have an Upload Dialog.

I also added both now to KDevelop, you can now upload and download snippets from it. I added a few dump examples but will probably improve it steadily.

Kate Performance

On Saturday and Sunday I started to profile Kate highlighting for a large MySQL dump and managed to greatly improve the speed. Actually the funny thing is that I could improve RegExp based highlighting (you still should try to prevent using it, it will always be slower than simple char/string based highlighting). And the knowledge for this optimization I had from my time as an active contributor for GeSHi. I feel like it was ages ago, he funny :)

continue reading...

Snippets In KDevelop / Kate (February 03, 2010)

Hey all!

Just wanted to give you a little rundown on Snippets in Kate 4.4 (via the snippets_tng plugin) and KDevelop Beta 8 (soon to be released).

Note: The Kate plugin was written by Jowenn and introduced me to all these nice features. For KDevelop I wrote a somewhat simpler yet imo better implementation. We will try to get the best of both worlds into KDE 4.5. Stay tuned!

General Usage & Features

  • create a snippet repository (or download via GHNS [see below])
  • create snippets in that repository
  • insert snippets via the snippets view (i.e. double click), or (imo better/faster) insert them via code-completion (remember: CTRL + Space requests code completion at the current cursor position!).
  • snippet gets inserted (properly indented) and potential placeholders/variables get expanded. A variable is something like %{date} or ${email}. Also take a look at the API documentation.
  • variables that get inserted via “${…}” will be “selectable”, meaning you can jump from one var to the other by hitting TAB / Shift TAB
  • the %{...} vars will only get expanded and inserted, without getting selectable.
  • multiple occurrences of the same variable will be updated once one of them gets edited, something that is called “mirroring” in other editors.
  • once one edits ESC the cursor is placed at the end of the snippet or to the first occurrence of ${cursor} or %{cursor} and the user types something, the snippet-handler quits and you are left with your normal editor until you insert the next snippet
  • nested snippets (i.e. insert snippet than insert another one) should “just work”.

continue reading...