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

Changing Fonts

Starting with version 2.6, TKE now allows the user to change the font used in the editing buffer, the command launcher entry field, and the command launcher preview display. To make these changes, launch the general user preferences using the Edit / Preferences / Edit User – Global menu option and select the Appearances category in the preferences sidebar.

 

The middle section shows the application fonts that can be permanently set in the application preferences. You’ll notice that next to each font description is a sample of the current font used. To change a font, simply click on the Choose button next to the font. This will display a font chooser dialog window.

The editing buffer fonts will be limited to available monospace fonts installed on your system. The fonts that can be used for the other two font types can be any installed font on your system. To change a font, choose a font name, font style and/or font size and click on the Choose button which will update the associated font immediately within the application. Click on the Cancel button to leave the font alone.

Super simple to change the fonts to your liking with the newer versions of TKE so feel free to make your editing environment your own.

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

Changing Fonts