Linux Commands Examples

A great documentation place for Linux commands

kate

Advanced text editor for KDE

Synopsis

kate [-s, --start name] [--startanon] [-n, --new] [-b, --block] [-p, --pid pid] [-e, --encoding name] [-l, --line line] [-c, --column column] [-i, --stdin] [-u, --use] [KDE Generic Options] [Qt Generic Options]


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

0

To open a file named source.cpp at column 15, line 25, in an existing Kate window, you could use:

kate -c 15 -l
25 -u source.cpp

If you have an active internet connection, you can take advantage of KDE's network transparency to open a file from an ftp site. If you do not have write permission on the remote server, the file will be opened read only and you will be prompted for a local filename to save to if you make changes. If you do have write permission, changes will be saved transparently over the network.

kate ftp://ftp.kde.org/pub/kde/README


0
source
            
alias kate='kate -n'
0
source
            
function kate {
apt-get install -y kate
}
0
source

How can I tell kate to use CSS highlighting for .less files by default?

The syntax highlighting definition files are located at:

~/.kde/share/apps/katepart/syntax/
/usr/share/kde4/apps/katepart/syntax/

Editing files in the first directory requires root permissions, and the syntax highlighting file will be available to every kate user in your environment. When the directory does not exist, create it in order to place the file.
Find the <language> tag, and modify the extensions attribute, as follows:

<language name="CSS" ... extensions="*.css" ... >
<language name="CSS" ... extensions="*.css;*.less" ... >

Instead of modifying css.xml, I recommend to get the definition file for less css, so that less-syntax is also highlighted correctly. See mtorromeo / kate-syntax-files / less.xml on GitHub.

Copy-paste the following commands, then restart Kate.

mkdir -p ~/.kde/share/apps/katepart/syntax
wget https://raw.github.com/mtorromeo/kate-syntax-files/master/less.xml
0
source

Kate gives out debug messages on the console from which it is started

Debug messages are usually written to the standard error, which is the filehandle denoted by 2 in the console. You can redirect that without affecting output to the standard out (file handle 1), by starting your application like this

kate 2>/dev/null

You can append the & if you'd like as well.

The number 2 here represents file handle 2, the > is a redirection operator in the shell, /dev/null is a "blackhole" device -- it eats up everything that is written to it, so it "disappears" (does not appear in console).

You can capture the standard error output by replacing /dev/null with a filename. In that case the output goes to the file, not to the console.

In case the application is writing debug messages to the standard output, you can replace the number 2 with number 1 (see above) -- note that in this case normal messages are going to be redirected as well.

You can redirect both standard out and error at the same time, the easiest way to do so is

kate 2>&1 1>/dev/null

Here the &1 denotes the file handle 1 where standard error should be redirected. The use of & is to differentiate it from the file named 1.

For further info on redirection, read the manual of your shell (e.g. bash)

0
source

Kate changes inode

Looks like a known bug in Kate, and one that won't be fixed. (Bug status is RESOLVED WONTFIX)

description

Kate is the KDE Advanced Text Editor.

Kate also provides the editor part for various applications, under the name KWrite.

Some of Kate's many features include configurable syntax highlighting for languages ranging from C and C++ to HTML to bash scripts, the ability to create and maintain projects, a multiple document interface (MDI), and a self-contained terminal emulator.

But Kate is more than a programmer's editor. Its ability to open several files at once makes it ideal for editing UNIX®'s many configuration files. This document was written in Kate.

options

-s, --start name

Start Kate with a given session.

--startanon

Start Kate with a new anonymous session, implies -n.

-n, --new

Force start of a new Kate instance (is ignored if start is used and another Kate instance already has the given session opened), forced if no parameters and no URLs are given at all.

-b, --block

If using an already running Kate instance, block until it exits, if URLs given to open.

-p, --pid pid

Only try to reuse kate instance with this pid (is ignored if start is used and another Kate instance already has the given session opened).

-e, --encoding name

Set encoding for the file to open

You can use this to force a file opened in utf-8 format, for instance. (The command iconv -l provides a list of encodings, which may be helpful to you.)

-l, --line line

Navigate to this line

-c, --column column

Navigate to this column

-i, --stdin

Read the contents of stdin

-u, --use

Use an already running Kate instance; default, only for compatibility

notes

1.

the Kate website

http://kate-editor.org/


see also

More detailed user documentation is available from help:/kate (either enter this URL into Konqueror, or run khelpcenter help:/kate).

There is also further information available at the Kate website [1] .


authors

Lauri Watts <lauri[:at:]kde[:dot:]org>

Author.

The maintainer of Kate is Christoph Cullmann cullmann[:at:]kde[:dot:]org. A comprehensive list of authors and contributors is available in the complete user manual mentioned above.

How can this site be more helpful to YOU ?


give  feedback