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

Vim Mode

The Vim editor is exceptional in many, many ways, and it has been a staple of many programmers and writers primarily due to its keyboard focused approach to editing and its extensibility and flexibility. Vim is a fantastic editor to use within a terminal because it does not necessitate a graphical user interface and works fairly well when you are spending most of your time within that terminal.

Vim was designed and written at a time when graphical user interfaces were not as mainstream as they are today. I’ll never forget the first few times I attempted to use Vi to edit a file in college. A blank screen with just a cursor staring at me with no instructions for use and, try as I may, typing on the keyboard did practically nothing. I needed to track down someone with knowledge of the editor just to do basic things, and then I needed to commit those first few keystrokes to memory. It’s no wonder that I initially sought out the few graphical editors that were available to me at the time instead of sticking with it. Though Vim’s keyboard-centric editing features, once committed to memory, are incredibly efficient, there are elements of having a graphical user interface that improves on Vim. Ease of learning, discoverability of features, better view modes, and interactions with those features are just some of those improvements.

The marriage of the Vim editing experience and a graphical user interface has been attempted by many editors in the past but many of those editors fall short, relegating Vim mode to a second-class citizen — a plugin of sorts — instead of integrating it into the core experience. There was also many things about gvim (a graphical implementation of a Vim editor) that didn’t seem to work quite right to me.

This is one of the primary reasons TKE was created, to attempt to create a modern editor which integrates deeply with Vim editing functionality. Most editing features added to TKE are implemented for Vim mode first or designed with Vim editing in mind, making sure that Vim editing remains frictionless and central to the TKE editing experience.

If you consider yourself in the Vim camp and are looking for a great graphical Vim editor, give the TKE editor a try. It is hoped that you will find a terrific editing experience with additional superpowers.

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

Vim Mode

Default Open/Save Dialog Directory

Whenever you need to open or save a file/directory, the open/save dialog window will display the contents of a directory. Sometimes that directory is the one that you want, but other times you may find yourself constantly using the file system browser features in the dialog window to change the directory. This can get tiresome if you are doing this often, but TKE can offer some help by making the default directory smarter and more customizable.

To change the way TKE chooses the default directory in the open/save dialog windows, head on over to Preferences (Edit / Preferences / Edit User – Global menu option) and go to the General tab within the General panel.

 

The last option in the tab specifies “Set default open/save browsing directory to:” with a dropdown list containing four options:

  • Last accessed:  TKE will remember the last directory that was in use in an open/save dialog window and use that directory as the default directory the next time the open/save dialog window is used.
  • Current editing buffer directory:  The directory containing the file which is the current editing buffer will be used as the default directory.
  • Current working directory:  The current working directory will be used as the default directory. The current working directory is always displayed in the title bar of the main window and can be changed at any of the methods discussed in our Current Working Directory post.
  • Use directory:  When this option is selected, a directory selection window will be displayed. Use it to navigate to the directory that you want to use as the default directory for subsequent open/save dialogs. The selected directory name will be displayed in the preferences window.

You can change this preference option at any time and, like most TKE preference changes, its selected value will be immediately applied within TKE.

If you using TKE in Vim mode, you can also change this option without needing to open Preferences. Just use the :browsedir value (or :bsdir value) command option and in place of value, use the values of:

  • last: Same as “Last accessed”.
  • buffer: Same as “Current editing buffer directory”.
  • current: Same as “Current working directory”.
  • Or specify the absolute or relative pathname of the directory to use.

Note that changing the default directory using the Vim command will not be remembered when you quit TKE (the preferences value will be the one used upon application startup), so using this method is a terrific way to temporary override the current behavior.

Sweet.

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

Default Open/Save Dialog Directory

Managing Themes

Themes in TKE control the look of the editor. Themes can alter the look of the window elements such as color, size, thickness, etc. They can set the colors used in syntax highlighting. They can also set the various icons used throughout the application.

TKE has several different themes that you can choose from via the View / Set Theme submenu. Just select a theme from the available list to cause the UI to immediately update. However, using the menu will only cause the theme to be changed while the application is running. If you close TKE and restart it, TKE will use the theme that was set in the preferences area.

To change the theme via the preferences window, launch the preferences (via Edit / Preferences / Edit User – Global menu option) and select the Appearance panel in the sidebar. The first option in the panel will allow you to set the default theme to use when launching TKE.

image-12
Setting Default Theme in Preferences

But what if you want to try out more themes can come built into TKE? Well, TKE has a way to import new themes using the Manage Themes tab in the Appearances Panel. Selecting that tab will display the list of all themes that are currently available within the application.

image-86
Theme Manager

The theme table displays all of the available themes within TKE. You can change the visibility of themes by clicking on the checkbox in the Visible column of the table. If a theme’s visibility is turned off, the associated theme will not be displayed in any of the theme selection menus. This can be useful for hiding built-in themes that you are not interested in using.

To get new themes, click on the Get More Themes… button in the lower right corner of the panel. This will launch your web browser to the new TKE themes page where you can browse, filter and download other available pre-built free themes. When you download a theme from the website, to install the theme you can click on the Add button which will launch a file selection dialog window. Find the downloaded theme and click on the Open button to install the theme.

In addition to installing new themes, you can also delete previously imported themes by selecting the theme and clicking on the Delete button. You can also edit any theme by selecting the theme and clicking on the Edit button. This will launch the theme editor (which will be a topic of future conversation).

Themes are not just eye candy within TKE. Each saved session can set its own theme, making themes useful for session identification.

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

Managing Themes

Pane Alignment and Synchronized Scrolling

Every once in a while, I find myself needing to visually compare two files side-by-side. Unfortunately, there are few tools available (apart from difference tools which typically only allow a read-only view) that allow you to quickly align textual lines and keep them in sync when scrolling one of the files.

Now in TKE (as of version 2.8) there is a great solution. Simply open the two files in separate panes. You can do this by opening the two files, selecting one of the files, right click on the tab and choose the “Move to Other Pane” option.

Once both files are in view, place the insertion cursor on the line in each file that you want to synchronize (you will only the insertion cursor in the active editing buffer but TKE remembers the last insertion point in an editing buffer). The lines do not need to be aligned, just in view. Then select the “View / Panes / Align Panes” menu option. This will cause both of the lines in each buffer to align themselves to each other.

Once the panes have been aligned, you can keep those lines aligned by choosing the “View / Panes / Enable Synchronized Scrolling”. When either buffer is scrolled, the other pane will match itself. Nice.

You can visually know that synchronized scrolling is enabled for the two buffers because the scrollbars in each buffer will be colored differently (usually in a red color but this can be changed within the theme editor). What’s even better is that pane synchronization is remembered for pairs of editing buffers. Change one of the pane’s buffers and synchronized scrolling is disabled for that pair. Re-select the original editing buffers and they will remain synchronized. Very nice.

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

Pane Alignment and Synchronized Scrolling