Thank you: jEdit plugin 'SwitchBuffer'
Once in a while when you start using some software development or systems administration tool (or just a feature of such tools), you find yourself thinking "why on earth did I not use this 5 years ago"?
Some tools change the way your work, more or less. They turn some task that earlier was awkward, time consuming and error prone into something you do fluently, just using your subconscious reflexes while focusing on the main task.
(You can also turn the discussion around 180 degrees and state that there are some obvious tools to use which it so much failure to not use)
The 'SwitchBuffer' plugin for the jEdit editor is such a tool. Especially for people like me who are good at collecting stuff but bad at discarding them. In the context of jEdit, that means I'm really good at opening up files, keep them 'ready for edit' in a buffer (can you tell I'm a former Gnu Emacs user?) but not that good at closing said buffers. Why? Because this enables me to keep track of certain generally relevant files, simply by knowing that they are loaded in jEdit. It is a very crude way of managing what's interesting and not, but it works surprisingly well for me. Worth noting is that jEdit remembers (and automatically reopens) all the files you work with whenever you shutdown and restart the editor.
But this means I end up with a buffer list which easily get's above 50 open files and selecting among those using the drop down menu is a bit inefficient, even when using the limited keyboard short-cutting ability of entering the first letter of the buffer name. No to mention the fact that you have to let a hand leave the keyboard in order to reach for the mouse.
But by using 'SwitchBuffer' managing all these files becomes easy and won't require any use of the mouse. This is how I did it:
(This post is inspired by Chromatic's series of posts at the 'onLamp' blog at O'Riley where he presented in each such post a tool that were significant for him as a software developer. The title of every such blog post were simply 'Thank you "screen"', where he then described why he found the "screen" utility useful (which it really, really is by the way...))
(Of course, one could always say: "Oh, editor X does that natively... this entire post rather seem to tell me that jEdit really is a bad editor...". If you want to read this blog post like the devil reads he bible, be my guest.)
Some tools change the way your work, more or less. They turn some task that earlier was awkward, time consuming and error prone into something you do fluently, just using your subconscious reflexes while focusing on the main task.
(You can also turn the discussion around 180 degrees and state that there are some obvious tools to use which it so much failure to not use)
The 'SwitchBuffer' plugin for the jEdit editor is such a tool. Especially for people like me who are good at collecting stuff but bad at discarding them. In the context of jEdit, that means I'm really good at opening up files, keep them 'ready for edit' in a buffer (can you tell I'm a former Gnu Emacs user?) but not that good at closing said buffers. Why? Because this enables me to keep track of certain generally relevant files, simply by knowing that they are loaded in jEdit. It is a very crude way of managing what's interesting and not, but it works surprisingly well for me. Worth noting is that jEdit remembers (and automatically reopens) all the files you work with whenever you shutdown and restart the editor.
But this means I end up with a buffer list which easily get's above 50 open files and selecting among those using the drop down menu is a bit inefficient, even when using the limited keyboard short-cutting ability of entering the first letter of the buffer name. No to mention the fact that you have to let a hand leave the keyboard in order to reach for the mouse.
But by using 'SwitchBuffer' managing all these files becomes easy and won't require any use of the mouse. This is how I did it:
- Use plugin manager to install the SwitchBuffer plugin. (In the case jEdit prompts you to restart the editor in order to finalize the install, then just do that.)
- Bind some keyboard shortcut to the action 'Show Switch Buffer' (I personally use Ctrl-Alt-PageUp). In jEdit 4.3 you do this by entering the global options, selecting the 'Shortcuts' item in the left hand tree in the dialog and then in there select "Plugin: SwitchBuffer" in the drop down 'Edit Shortcuts:'. Then in the row for 'Show Switch Buffer', click in the middle item (in the 'Primary Shortcut' column) and enter the shortcut sequence you want to use in the dialog that appears.
- Now start using your brand new shortcut whenever you need to switch to another buffer: a dialog appears (where the last visited buffer already is pre-entered, which is convenient if you need to switch back and forth between two buffers) and in there, you enter a string and the list of available buffers to choose in shrunk to only contain those whose names contains that string. With a well chosen string you can often very quickly narrow down the alternatives to a handful, making selection with the arrow keys and the enter key dead easy.
(This post is inspired by Chromatic's series of posts at the 'onLamp' blog at O'Riley where he presented in each such post a tool that were significant for him as a software developer. The title of every such blog post were simply 'Thank you "screen"', where he then described why he found the "screen" utility useful (which it really, really is by the way...))
(Of course, one could always say: "Oh, editor X does that natively... this entire post rather seem to tell me that jEdit really is a bad editor...". If you want to read this blog post like the devil reads he bible, be my guest.)
