Fast-context.kak

Infers code context by following dedent levels backwards (i.e. prints lines where indentation level decreases), and shows it in an info box (possibly automatically, on NormalIdle, if enabled).

Based on the idea in @JJK96 's post. Rewritten in pure sh. Features:

  • almost no calls to external commands — probably about as fast as achievable with a script
  • respects tabstop, so should handle space-only / mixed / tab-only sources

Commands:

  • fast-context-show
  • fast-context-lock / unlock
  • fast-context-global-enable / disable

Configurable options:

  • maximum infobox width
  • max source lines to follow backwards
  • maximum context to show

I’ve been using this a bit and it comes quite handy. Thanks go to @JJK96 for the original idea!

5 Likes

This looks really cool, and it’s great that you did this almost by request. I think this warrants a try-out, for sure!

1 Like