Calendar Plugin

This tip is a fairly quick one. If you have ever needed/wanted to generate a monthly mini calendar, TKE 3.3 now has the all new Calendar plugin which will accomplish just that.

Inserted Calendar Text

 

After the plugin in installed, place the insertion cursor in the editing buffer where you want the calendar to be inserted. Then select the Plugins / Calendar / Insert Mini Calendar menu option. This will display the date range selection window as shown below:

Date Selection Window

 

Use the window to select the starting and ending month to generate and select the OK button to instantly insert a calendar in your editing buffer. Each consecutive month will be inserted below the previous month. To insert a single month, just make sure that the starting and ending month are the same.

Sometimes it’s the little things that make the difference.

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

Advertisements
Calendar Plugin

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

Perforce Plugin

This plugin may only apply to a small subset of the TKE user base who use Perforce for their version control system, but it’s a really handy one that does one thing really well. When you are working with Perforce-controlled files, getting permissions to edit a file requires that you always execute the ‘p4 edit <filename>’ command before you save the file contents. This usually means that you need to open a terminal, enter the command, then go to your editor where you make and save the change.

The Perforce plugin, when installed, automatically performs a p4 edit on the file when the file is saved. This will greatly improve your workflow when editing Perforce-controlled files (so much so that it will bother you to use other editors that don’t have this feature).

To install the plugin, simply click on the Plugins / Install… menu item and select the Perforce plugin from the available list. Before using the plugin, select the Plugins / Perforce / Edit include directories menu option. This will open a settings file in a new editing buffer which will look like the following:

# Host Directory
# ——— ————

Below the line, enter the name of the server containing the Perforce view that you would like to edit (i.e., the result of executing the ‘hostname’ command on *nix filesystems), followed by one or more spaces, and the base directory containing the Perforce view to edit (i.e., the result of displaying $P4WORKAREA in a terminal). Save the file, close it, and you are ready to start editing without the tedium ad nauseum of ‘p4 edit’ madness. You can add as many Perforce host-directory combinations that you need, if you are someone who works with multiple views on several machines.

If at any time, you want to disable this feature, simply select the Plugins / Perforce / Disable edit on open menu option. The plugin even provides a feature which will revert the current file if you want to throw away changes made to the file since the last file submission via the Plugins / Perforce / Revert current file menu option.

Once you have this plugin enabled and firing on all cylinders, you’ll never want to go back.

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

Perforce Plugin

Text Formatting

When you are editing files with a syntax type that supports text formatting, you can quickly get tired of adding the syntax that is required for doing things like bolding, italicizing, underlining, etc. However, if you are using TKE to do the editing, then your editor has your back.

If you need to italicize some text that you have already typed, simply select the text and use the Edit / Format / Italics (or use the shortcut Command/Control-I). TKE will insert the correct syntax before or around the text. This functionality is super handy and will save a ton of keystrokes, but TKE’s text formatting capabilities don’t stop there.

If you need to bold some text that you are about to type, simply select the Edit / Format / Bold (or using the shortcut Command/Control-B). TKE will insert the proper emboldening syntax and place the cursor at the appropriate spot to start entering the text to be emboldened. Once you have finished entering the formatted text, if there is bold syntax following the text, simply enter the TAB key to move the cursor to the right of that syntax and continue entering text.

Bonus Tip: Any time that you are editing text and you are not filling in a snippet, hitting the TAB key will advance the cursor to the first whitespace character in the current line (unless the cursor is in the first column when the TAB key is entered).

If you need to remove syntax formatting, simply select the text (including the formatting syntax) and then select the Edit / Format / Remove Formatting (or use the Command/Control-minus keyboard shortcut). Any syntax that can be applied via the text formatting feature will be removed from the selected text.

Text formatting support is currently available for the following syntax descriptions:

  • Markdown
  • MultiMarkdown
  • Fountain
  • HTML
  • HelpSystem
  • ManPage
  • Latex

In addition to text formatting options, TKE also supports the following formatting (depending on the availability of the format support in the syntax):

Text Formatting Submenu

Simple, easy, powerful. TKE might just make text formatting fun again.

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

Text Formatting

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

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

Markdown Table Beautifier Plugin

In TKE 3.2 a new plugin called the “Markdown Table Beautifier” is included which, when run, cleans up any table syntax found inside of a Markdown document. This essentially involves, making all table columns be vertically aligned and all cell contents be justified according to their column justification indicators. It also will adjust all rows to include the maximum column specified within a table row. All of this cleanup helps make Markdown tables easier to read in Markdown format.

Essentially the Markdown Table Beautifier plugin can run on all tables found within a single Markdown file or it can run only on the table where the insertion cursor is within.

To install the plugin, select the Plugins / Install… menu option, find the Markdown Table Beautifier plugin in the resulting list, highlight it and hit the RETURN key. Once the plugin has been successfully installed, you can run it by simply selecting the Plugins / Markdown Table Beautifier submenu and choosing one of the two available options to beautify all tables or only the currently selected table. Note that these menu options will only be enabled if the file syntax is either Markdown or MultiMarkdown.

Clean and easy to read tables without the fuss? Check and check.

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

Markdown Table Beautifier Plugin