October 31, 2014
 
 
RSSRSS feed

Kate Text Editor-- Advanced Configuration and Command-Line Tips - page 2

Configuration Tips and Tricks

  • March 3, 2009
  • By Juliet Kemp

The command-line interface is accessed via the F7 key. It allows you to set many of the editor options: for example, set-replace-tabs on will set indentation to use spaces rather than a tab character. There's an autocomplete function available for the settings, as seen in Figure 1 (below).

If you input a setting without the appropriate argument you get a brief help message. For most of these settings, the argument is a boolean, so off/on/true/false/1/0 will all work. To return to the main window from the command-line, hit ESC (you will also be automatically returned after each command); to return to the command-line again, hit F7 again.

You can access the search and replace functions via the command line. s///[ig] and %s///[ig] provide a sed-like search and replace option, either in the current line, or the whole file (if the % is included). As with sed, you can create back-references, and the i and g options offer case-insensitivity and global matching (the default is to match only the first occurrence of the pattern in each line) respectively.

replace:options pattern replacement offers slightly more configurability, with options including replace:b (search backwards from cursor) and replace:e (search only in the current selection). replace:p will prompt for permission to replace, and replace:v will match whole words only. The r option interprets the pattern as a regular expression, in which case you can use parentheses and \N to do captures.

Using the terminal emulator

The terminal emulator can be opened from the Window->Tool Views menu. It enabling you to navigate around in the terminal, change file permissions, and run scripts, without exiting Kate. It's especially useful if you set the "sync terminal emulator with active document" option (in the General Config menu): this means that the terminal emulator will cd into the relevant directory when you open a file.

Bookmarks

Bookmarks allow you to mark your place in a file and then go back to it. Set a bookmark with Ctrl-B, from the Bookmarks menu, or by clicking on the icon border. then move down the bookmarks with Alt+PageDown/PageUp. The icon border can be turned off/on with F6, as well as from the config menu – it's off by default.


In the final part of this series, I'll look at some of the features that Kate has for coders, including syntax highlighting, code folding, indenting, and commenting.


Sitemap | Contact Us