User Tools

Site Tools


sesystems:kate_kwrite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sesystems:kate_kwrite [Friday, 13 November 2009 : 12:31:39]
pthijs Added link to syntax highlighting files on trac for kwrite
sesystems:kate_kwrite [Friday, 19 February 2010 : 08:12:03] (current)
dhendriks Updated 'dev' to 'devel'
Line 1: Line 1:
 +====== Using Kate/KWrite to edit Chi/CIF files ======
 +
 +Both the Kate and KWrite editor can be used to edit Chi and CIF files. They can be used without any modifications. However, it is possible to configure them to be even more useful editors.
 +
 +
 +
 +
 +
 +
 +
 +===== Kate/KWrite syntax highlighting =====
 +
 +It is possible to get syntax highlighting of Chi and CIF models in the Kate editor. This is in no way necessary for editing or simulation, but can be very helpful non the less. To get syntax highlighting for Chi and CIF models in Kate/​KWrite,​ follow these steps:
 +
 +  * Close all open Kate and KWrite windows.
 +  * Open a Konqueror window.
 +  * Browse to this web page in Konqueror.
 +  * Download and save the syntax highlighting definition files:
 +    * To save a file to a certain directory, right click the link in the browser and choose 'Save link as' (Firefox) or 'Save Target as' (Internet Explorer). Other browsers should have similarly named items. A dialog window will appear where you can browse your file system.
 +    * Save the files to the "/​usr/​share/​apps/​katepart/​syntax"​ folder (without the quotes). If the folder does not yet exist, create it. If you don't have access to it, see below for '​possible solutions'​.
 +    * Files to download:
 +      * {{http://​devel.se.wtb.tue.nl/​trac/​chi-tooling/​browser/​trunk/​extras/​syntax-highlighting-defs/​chi.xml?​format=raw?​|Chi syntax highlighting for Kate/​KWrite}}
 +      * {{http://​devel.se.wtb.tue.nl/​trac/​chi-tooling/​browser/​trunk/​extras/​syntax-highlighting-defs/​cif.xml?​format=raw?​|CIF syntax highlighting for Kate/​KWrite}}
 +  * Close the Konqueror window.
 +
 +After following these steps, open a .chi or .cif file in Kate or KWrite to test the syntax highlighting. If you create a new file in Kate/​KWrite,​ you need to save it first to get syntax highlighting to be activated. You need to use the correct file extension when you save the file (.chi for Chi and .cif for CIF).
 +
 +If it doesn'​t work, you can do the following to found out why:
 +  * Open a .chi or .cif file in Kate (or KWrite).
 +  * Open the '​Settings'​ menu and click the '​Configure Kate...'​ (or '​Configure Editor...'​) menu item. The configuration window will appear.
 +  * On the left, open the '​Highlighting'​ section.
 +  * Besides the '​Highlight:'​ text, there is a drop-down box. See if '​Sources/​Chi'​ and '​Sources/​CIF'​ are present. If not, the .xml files can not be found by Kate/​KWrite. Fix this first (see below).
 +  * On the left, open the 'Fonts & Colors'​ section.
 +  * Open the '​Highlighting Text Styles'​ tab.
 +  * Besides the '​Highlight:'​ text, there should be '​Sources/​Chi'​ or '​Sources/​CIF'​ selected (depending on the file you opened). If not, Kate/KWrite does not recognize your file correctly.
 +
 +Possible solutions if syntax highlighting does not work (try them after closing all Kate/KWrite applications first):
 +  * Press the '​F5'​ key on your keyboard, while Kate/KWrite is running. This reloads the current file.
 +  * Restart Kate/​KWrite.
 +  * Restart the operating system.
 +  * Copy the syntax highlighting definition files to the "​~/​.kde/​share/​apps/​katepart/​syntax"​ folder (without the quotes).
 +  * Download syntax highlighting files using Kate/​KWrite.
 +    * Start Kate (or KWrite).
 +    * Open the '​Settings'​ menu and click the '​Configure Kate...'​ (or '​Configure Editor...'​) menu item. The configuration window will appear.
 +    * On the left, open the '​Highlighting'​ section.
 +    * On the right, click the '​Download...'​ button.
 +    * In the new window, click the '​Install'​ button.
 +    * Wait for the installation of new syntax highlighting definition files to complete. While they are being installed, the '​Install'​ and '​Close'​ buttons will not work (hovering over them will not make them 'light up').
 +    * Once the installation of the new syntax highlighting definition files is completed and the '​Close'​ button works again, click that button.
 +    * Close the configuration window by using the '​OK'​ button.
 +    * Restart Kate/KWrite and retry the normal installation instructions above.
 +  * Search your file system for an alternate location for Kate/KWrite syntax highlighting files (by searching for '​katepart'​).
 +
 +
 +
 +
 +===== Kate/KWrite settings =====
 +
 +The Kate editor has many configurable settings. Here are some suggestions for settings you can change:
 +
 +  * Close all open Kate and KWrite windows.
 +  * Open a single Kate window.
 +  * In Kate, open the '​Settings'​ menu and choose the '​Configure Kate...'​ option. The '​Configure - Kate' window will open.
 +  * Settings 1 and 2 (highly recommended):​
 +    * On the left, there is an '​Editor'​ item, with a '​Editing'​ sub-item. Click on the '​Editing'​ sub-item.
 +    * Enable the '​Replace tabs with spaces'​ setting.
 +    * Change the 'Tab width' to 4, instead of the default 8.
 +  * Setting 3 (highly recommended):​
 +    * On the left, select the '​Open/​Save'​ sub-item (also in the '​Editor'​ item).
 +    * Enable the '​Remove trailing spaces'​ setting.
 +  * Setting 4 (highly recommended):​
 +    * On the left, select the 'View defaults'​ sub-item (also in the '​Editor'​ item).
 +    * Enable the 'Show line numbers'​ setting.
 +  * Setting 5 (optional):
 +    * On the left, select the '​Plugins'​ sub-item (also in the '​Editor'​ item).
 +    * Enable the '​KTextEditor Word Completion Plugin'​.
 +  * Close Kate.
 +
 +The same applies to the KWrite editor, although some names etc will be different. For instance, the '​Configure Kate...'​ menu option is called '​Configure Editor...'​ and the left side doesn'​t contain the '​Editor'​ item, only the sub-items.
  
sesystems/kate_kwrite.txt · Last modified: Friday, 19 February 2010 : 08:12:03 by dhendriks