# Some Fundamentals

&kwrite; and many other &katepart; users are very simple to use. Anyone that has used a text editor should have no problems.

## Drag and Drop

&katepart; uses the &kde; Drag and Drop protocol. Files may be dragged and dropped onto &katepart; from the Desktop, the filemanager &dolphin;, or some remote &FTP; site opened in one of &dolphin;'s windows.

## Command Line Options

Though &kwrite; may most often be started from the &kde; program menu, or a desktop icon, it can also be opened at the command line prompt of a terminal window. There are a few useful options that are available when doing this.

Many other applications that use &katepart; offer similar command line options.

### Specify a File

By specifying the path and name of a particular file the user can have &kwrite; open (or create) that file immediately upon startup. This option might look something like the following:

    % kwrite
    /home/myhome/docs/myfile.txt

### Specify a file on the Internet

The above-mentioned method could even be used to open files on the Internet (if the user has an active connection at the time.) An example of this might look like the following:

    % kwrite
    ftp://ftp.kde.org/pub/kde/README

### Other Command Line Options

The following command line help options are available

``kwrite` `--help``

- This lists the most basic options available at the command line.

``kwrite` `--author``

- Lists &kwrite;'s authors in the terminal window

``kwrite` `-v`, `--version``

- Lists version information for the application.

``&kwrite;` `--license``

- Shows license information.

``kwrite` `--desktopfile` `filename``

- The base file name of the desktop entry for this application.

``kwrite` `-e`, `--encoding` `encoding` `&URL;``

- Causes &kwrite; to use the specified encoding for the document.

``kwrite` `-l`, `--line` `line` `&URL;``

- Navigate to the specified line after opening the document.

``kwrite` `-c`, `--column` `column` `&URL;``

- Navigate to the specified column after opening the document.

``kwrite` `-i`, `--stdin``

- Causes &kwrite; to read the document content from STDIN. This is similar to the common option `-` used in many command line programs, and allows you to pipe command output into &kwrite;.

## Shortcuts

Many of the shortcuts are configurable by way of the Settings menu. By default &katepart; honors the following shortcuts:

Ins | Toggle between Insert and Overwrite mode. When in insert mode the editor will add any typed characters to the text while pushing along any data to the right of the text cursor. Overwrite mode causes the entry of each character to eliminate the character immediately to the right of the text cursor.
Left Arrow | Move the cursor one character to the left
Right Arrow | Move the cursor one character to the right
Up Arrow | Move the cursor up one line
Down Arrow | Move the cursor down one line
Page Up | Move the cursor up one page
&Alt;Page Up | Previous Bookmark
Page Down | Move the cursor down one page
&Alt;Page Down | Next Bookmark
&Backspace; | Delete the character to the left of the cursor
Home | Move the cursor to the beginning of the line
End | Move the cursor to the end of the line
Delete | Delete the character to the right of the cursor (or any selected text)
&Shift;&Enter; | Insert newline including leading characters of the current line which are not letters or numbers. It is useful ⪚ to write comments in the code: At the end of the line // some text press this shortcut and the next line starts already with // . So you do not have to enter the comment characters at the beginning of each new line with comments.
&Shift;Left Arrow | Mark text one character to the left
&Shift;Right Arrow | Mark text one character to the right
F1 | Help
&Shift;F1 | What's this?
F3 | Find Next
&Shift;F3 | Find Previous
&Ctrl;H | Find Selected
&Ctrl;&Shift;H | Find Selected Backwards
&Ctrl;A | Select All
&Ctrl;&Shift;A | Deselect
&Ctrl;&Shift;B | Block Selection Mode
&Ctrl;B | Set a Bookmark
&Ctrl;C | Copy the marked text to the clipboard.
&Ctrl;D | Comment
&Ctrl;&Shift;D | Uncomment
&Ctrl;F | Find
&Ctrl;G | Go to line...
&Ctrl;I | Indent selection
&Ctrl;&Shift;I | Unindent selection
&Ctrl;J | Join Lines
&Ctrl;N | New document
&Ctrl;O | Open a document
&Ctrl;P | Print
&Ctrl;Q | Quit - close active copy of editor
&Ctrl;R | Replace
&Ctrl;S | Invokes the Save command.
&Ctrl;U | Uppercase
&Ctrl;&Shift;U | Lowercase
&Ctrl;&Alt;U | Capitalize
&Ctrl;V | Paste the clipboard text into line edit.
&Ctrl;W | Close
&Ctrl;X | Delete the marked text and copy it to the clipboard.
&Ctrl;Z | Undo
&Ctrl;&Shift;Z | Redo
&Ctrl;- | Collapse One Local Level
&Ctrl;&Shift;- | Collapse Toplevel
&Ctrl;+ | Expand One Local Level
&Ctrl;&Shift;+ | Expand Toplevel
Meta&Ctrl;V | VI input mode
&Ctrl;Space | Invoke Code Completion
F5 | Reload
F6 | Show/Hide Icon Border
F7 | Switch to Command Line
F9 | Show/Hide Folding Markers
F10 | Dynamic Word Wrap
F11 | Show/Hide Line Numbers