Sidebar Sorting

A new trick that TKE version 3.3 learned was how to move files/directories within the sidebar via drag and drop and how to allow manually sorting of files/directories within the sidebar using the same technique. In the past, you could always move a file or directory to a new location by selecting the item in the sidebar, right-clicking to display the contextual menu, select the rename option, and proceed to change the name or even the entire pathname of the file. This method of renaming still exists; however, there is now a simpler way to do this using the mouse.

Moving Files And Folders

 

To move a file or folder from one location in the sidebar to another, simply left-click on the item or items to move and then drag them to the new location in the sidebar. The TKE sidebar has support for spring loading folders while items are being dragged. Just move the cursor over a closed folder for a second while the left button is still pressed and the folder will automatically open, allowing you to continue delving down into the file system to find the destination folder to drop the items into. Additionally, if the destination folder is not currently in view in the sidebar, dragging files to the top or bottom of the sidebar will cause the sidebar to autoscroll. Nifty.

Manually Sorting Contents In A Folder

Pretty intuitive so far, right? Well, what can I do if I want to place the dragged items into a specific order within a folder? Perhaps I want a dragged item to be placed at the top of the destination folder’s contents instead of sorted alphabetically. Well, TKE has your back there, too.

First, you need to enable manually sort for the folder. To do this, select the folder, right-click to bring up the folder’s contextual menu, and select the Sort / Manually option. Nothing will immediately happen in the user interface; however, TKE will create a file within directory called “.tkesort”, storing the current order of the items in the directory. After that selection has occurred, you will be able to drag and drop items within the folder and TKE will remember the manually sorted order of those items, even between TKE sessions. Super simple.

Other Sorting Odds And Ends

 

In addition to the Manual sorting option, you can revert back to sorting by name at any time by selecting the “Sort / By Name” option in the directory’s contextual menu. TKE will not destroy the .tkesort file that exists in the directory, so switching back to manual sorting will revert the sorted state of the folder back to its original view if manual sorting is reselected in the future.

When a folder is sorted by name, you can sort it alphabetically or in reverse alphabetical order by selecting the “Sort / Increasing” or “Sort / Decreasing” options.

And that’s how the sidebar in TKE became your new best friend 🙂

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Advertisements
Sidebar Sorting

Bird’s Eye View

Most of the time you want to keep your head down and stay focused on coding up the task at hand. However, every once in a while it’s nice to see where you have been and get a 10,000 foot view of your code. To that end, the TKE text editor comes with a built-in “Bird’s Eye View” panel that you can hide or show via the View / Bird’s Eye View menu option. This displays a high-level representation of the current editing buffer by displaying your file’s code (syntax highlighting included) on the right-hand side of the editing buffer.

Bird’s Eye Viewer (on right)

 

In addition to displaying a bird’s eye representation of the file, this pane can also be used for navigating to different points within the file. The following are few tips on using the Bird’s Eye View panel for navigating.

  1. Use the mouse scrollbar, while the cursor is within the panel, to scroll the view panel up and down. This won’t change the editing buffer view.
  2. Holding down the Control key while left/right-clicking in the panel will cause the bird’s eye view to scroll up/down by a screen at a time.
  3. When the cursor is within panel, a translucent background will be displayed to show you what the editing buffer is currently displaying.
  4. Left-click in the panel to jump the editing buffer view to that location within the file.
  5. Left-click and drag in the panel to cause the editing buffer view to change.

As you scroll the editing buffer, the bird’s eye view will automatically adjust itself to make sure that the current editing buffer content is displayed in the bird’s eye view panel.

You can control the font size and width of the Bird’s Eye View panel within Preferences by selecting the View pane. From here you can control whether the panel is always displayed when a file is opened by selecting the Show Bird’s Eye View checkbox. At the bottom of the View panel, you can change the font size of the text used in the panel with the Bird’s Eye View Font Size value selector, and you can change the pixel width of the panel using the Bird’s Eye View Width value selector.

Preference Window View Panel


Important note:
It is recommended that you not enable this feature by default within preferences as it can have a negative impact on the application’s performance. By using the menu option to enable the view, you only display the panel for the current editing buffer, which should keep things moving along nicely while you are using it.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Bird’s Eye View

The Sidebar Information Panel

Files and directories on your file system contain a lot of meta data associated with them. Sometimes, we need to get at that information for various reasons. This typically requires the use of your operating system’s file system viewer, the terminal and/or other 3rd party software. Jumping around to other pieces of software on your desktop can be disruptive to a good workflow and that’s where the new sidebar information panel in TKE (version 3.3) comes in handy.

This panel is displayed at the bottom of the sidebar and allows you to view information for any file that is displayed within the sidebar. To view file/directory information, either right-click on a file or directory within the sidebar and select the “Show Info” menu item or hold down the Control key while right-clicking on a file/directory. A representation of this panel is shown below.

Sidebar Information Panel

In this representation, we see that an image file’s information is being viewed, including a 64×64 thumbnail preview of the image, file name, image dimensions, syntax type, file size, modification date, file permissions, file owner, file group, current version control number, and the TKE favorited status of the file. The information displayed within this file will be customized depending on the item type selected (i.e., image file, text file, directory).

But wait, there’s more… In addition to this information, several other file/directory attributes can be optionally displayed by heading over to the Preferences window (Edit / Preferences / Edit User – Global), selecting the Sidebar panel and clicking on the Info Panel tab.

Sidebar Information Panel Preferences

Simply check/uncheck the file/directory attributes within this panel to control what information is displayed. By default, the panel will only be displayed when the sidebar has the current input focus. However, if you would prefer to keep it visible when the sidebar does not have keyboard focus, simply check the “Keep file information panel visible when sidebar doesn’t have focus” option.

Back in the information panel itself, there are a few other useful functions you can perform when the mouse cursor is within the panel.

  1. Clicking on the ‘x’ button will remove the panel from the sidebar.
  2. Clicking on the “refresh” button will refresh the information within the panel (by default, the information is refreshed if the user is editing the associated file and saves it).
  3. Clicking on the “eye” button will cause the associated file/directory to be displayed and selected within the sidebar.
  4. Clicking on the value of any attribute that is clickable will copy that information to the clipboard.

Finally, it is possible for future plugins to display additional information within this panel, making it extensible and infinitely more useful.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

The Sidebar Information Panel

Clipboard Snippet Workflow for Markdown

Instead of talking about a TKE feature this week, let’s look at creating a simple but potentially useful workflow that allows us to copy a URL to the clipboard and essentially paste the text as a well-formatted Markdown link, using a snippet.

To create the snippet, open the TKE Preference window (Command-, on Mac or Control-, on other platforms). Select the Snippets panel and make sure that the Language option menu within the Snippets panel is set to “Markdown”. To add a new snippet, click on the Add button and fill in the resulting snippet editor pane as follows:

After giving the snippet an expansion keyword “clipurl” and entering the snippet code, click the Save button at the bottom of the editing panel to save the snippet. The Preference window will change the snippet panel view to show the list of all saved snippets that are specific to the Markdown syntax. You should see your new “clipurl” snippet in the table which will look like:

So what is going on in this snippet text? Well, when we enter the snippet keyword in a Markdown editing buffer, the snippet will grab the contents stored in the clipboard (a URL in this case), it will remove the URL scheme including the “://“ characters and place the remaining contents between a square bracket pair (this is the displayed link name within a Markdown link). It will then output the full URL between a pair of parenthesis (the link URL within a Markdown link).

So now let’s close the preference window and test out the new clipboard snippet. To do that, navigate to a website within your web browser (we’ll use tke.sourceforge.net for this example) and copy the URL from the address bar. Then back in TKE, create a new editing buffer (Command-n or Control-n), set the syntax of the new editing buffer to Markdown, input our new snippet text “clipurl” in the editing buffer and enter the TAB key to expand our snippet which should look as follows:

Cool! It’s a valid Markdown link with the displayed link name being the copied URL name minus the “http://“ syntax, while the full URL exists in the URL portion of the Markdown link. To test the link out, right click on the underlined link name and the link should be displayed within your web browser.

Now whenever you are working on that next great Markdown document, you can quickly create a Markdown link by simply copying a URL to the clipboard and entering “clipurl”. Try thinking about other ways that you can manipulate the clipboard (or even contents in clipboard history) using snippets to increase your editing productivity.

Consider yourself are a certified TKE power user now. Feel free to impress your friends.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Clipboard Snippet Workflow for Markdown

Choosers Plugin

If you use different tools for selecting and getting the programming values for things such as fonts, colors or pathnames to directories/files somewhere in your file system, then the Choosers plugin will come in handy. After installing it (select the Plugins / Install… menu item and select the “Choosers” plugin from the resulting list), the Plugins menu will be populated with the new Choosers submenu which contains four menu options:

  • Color
  • Font
  • Directory
  • File

The Color item will display the standard color picker widget available on your particular platform. On MacOS and Windows, the color picker even contains an eye-dropper that will allow you to select any pixel color on your screen which can be super handy. After selecting the color, click the Choose button to copy the RGB color value to the clipboard.

The Font item will display the font picker widget which will allow you to select a font family, weight and size, including the ability to add underline and strikeout features to the font. The resulting font string value will be copied to the clipboard when the Choose button is clicked.

Font Chooser Window

The Directory and File items allow you to browse your file system for a given directory/file using open file browser available on your particular platform. Selecting the Open button will copy the pathname to the clipboard.

Just some handy plugin functionality to help make your programming workflows better.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Choosers Plugin

Vim Macro Recording

A quick tip for Vim mode users…

TKE has support for Vim’s macro recording feature when Vim mode is enabled. Vim macros are basically just a recording of some number of keystrokes that the user used while recording is enabled. These recorded macros can then be “played” at any time which will essentially replay the keystrokes within Vim, allowing you to do a lot of repetitive tasks quite quickly within the editor.

There is support for automatic recording (that is, you can repeat the last Vim command at any time just by pressing the ‘.’ key). You can also repeat the last Vim command-line (started by entering ‘:’ when in COMMAND mode), by entering the ‘@’ key followed by the ‘:’ key.

There is also support for recording to multiple macro “registers”. Each register is named by a single letter of the alphabet (i.e., a-z, A-Z as well as the doublequote (“) character). To begin recording keystrokes to a named register, simply enter ‘q’ (when in COMMAND mode) followed by the name of the register to use and then begin entering the keystrokes that you would like to store in the macro register. When you are done entering keystrokes, enter ‘q’ when in COMMAND mode. While you are recording, the information bar at the bottom of the main window will display the recording status and the name of the macro register being recorded into.

Main Window Status Bar Indicating Recording Status

 

To playback the recorded keystrokes of a register, enter ‘@’ when in COMMAND mode, followed by the name of the register to playback. The keystrokes will be played back immediately.

So if you are Vim user, you probably already know this, but here is the TKE tip for this week….

Vim macros are recordable and usable in any editing buffer within TKE. That means that you could record a macro in one editing buffer and replay that macro in another editing buffer. So if you find yourself performing the same types of tasks in multiple files, do the task once in one buffer and replay the macro in all of the other files. (Insert mind blowing explosion sounds here).

Sweet.

To see more information and download your copy of the TKE code editor, visit http://tke.sourceforge.net.

Vim Macro Recording