Difference between revisions of "IDE Window: Editor Options"

From Free Pascal wiki
Jump to navigationJump to search
(Scroll Hint)
m (Fix blurry image - size issue)
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{IDE Window: Editor Options}}
+
<noinclude>{{IDE Window: Editor Options}}<!--- This page may be used as template in other pages ---></noinclude>
 +
[[File:IDE-options-editor.JPG|thumb|600px|IDE Options - Editor]]
  
You can get this dialog via:
+
This is part of the online help for the IDE.
*Menu / Environment / Editor options ...
 
*Source editor / popup menu / Editor properties ...
 
  
= General =
+
It describes the section: "Editor Options". You can open the described dialog in your IDE via:
 +
*The menu: "Tools" => "Options" / Editor options ...
 +
*The source-editor pop-up menu: "Editor properties ...
  
== Undo / Redo ==
+
The available editor options are:
 
+
*[[IDE Window: Editor Options General|General]]
==== Undo after save ====
+
**Undo / Redo
Keep the Undo list on save.
+
**Scrolling
==== Group Undo ====
+
**Indent and Tabs<br />Please also see Codetools for automatic indent of Pascal sources
When undoing/redoing actions, handle all continuous changes of the same kind in one call instead of undoing/redoing each command separately.
+
**Cursor
==== Undo limit ====
+
**Selection
Maximum number of Undo steps.
+
**[[IDE_Window: Editor Options General Misc|Misc]]
 
+
***Showing Whitespace
== Scrolling ==
+
***Trimming spaces
 
+
***Copy/paste: unselected / fold
==== Scroll past end of file ====
+
***Search
Allows the cursor to go past the end of file marker.
+
*[[IDE Window: Editor Options Display|Display]]
==== Scroll by one less ====
+
**Gutter / Margin
Forces scrolling to be one less line.
+
**Font
==== Half page scroll ====
+
**Line-spacing
When scrolling with page-up and page-down commands, only scroll a half page at a time.
+
** [[IDE_Window:_Editor_Options_HighlightColors|Colors]]
 
+
*** Highlighting Pascal/Language specific elements
==== Scroll Hint ====
+
*** General Highlighting (Selection, Line Highlights, ...)
When activated and you scroll the editor page with the mouse of scrollbar thumb, a small hint window will appear in the top right indicating the line number at the top of the editor page. After scrolling, the hint window will automatically disappear after 1.5 seconds.
+
**[[IDE_Window:_Editor_Options_Markup|Markup and Matches]]
 
+
*** Highlight other occurrences of the current word
== Indent and Tabs ==
+
*** Matching brackets
 
+
*** Extended Pascal-Keyword settings
==== Auto indent ====
+
* [[IDE_Window:_Editor_User_Defined_Words|User defined markup]]
When inserting new lines (e.g. through pressing Return or Enter key), the editor will indent the caret on the new line with the same amount of leading white space as the preceding line.
+
* Highlight your own chosen words
 
+
**[[IDE_Window:_Editor_Options_Keymap|Key Mappings]]
This includes "auto un-intend":
+
*** Keyboard
If the caret is located after the last whitespace of a continuous block of whitespaces at the beginning of a line, then pressing backspace will un-intend. This is done by looking for a start of line (indent) in the line(s) above the current line.
+
*** See [[Lazarus IDE Shortcuts]].
For an line containing Whitespaces only (see trim-trailing-space modes) this happens if the caret is at the end of the line.
+
** [[IDE_Window:_Editor_Options_Mouse|Mouse settings]]
 
+
*** Mouse
==== Smart tabs ====
+
*[[IDE_Window:_Editor_Options_Completion_Hints|Completion and Hints]]
When tabbing, the cursor will go to the next non-white space character of the previous line. If the current line is longer than the previous, it will look for a longer line in front.
+
** Automatic removal of unused events
==== Tab indents blocks ====
+
** Automatic completion of Pascal blocks (begin/end)
When active <Tab> and <Shift><Tab> act as block indent, unindent when text is selected.
+
** Automatic completion of identifiers
==== Tabs to spaces ====
+
** Hints in the Editor
When editing lines the editor adds spaces instead of tabs. The rest of the lines will not be altered and the tabs are kept. To convert all tabs of a file select the whole file (Ctrl-A) and use Main menu / Edit/ tabs to spaces.
+
* [[IDE_Window:_Editor_Options_Code_Folding|Code Folding]]
==== Block indent ====
+
** Source/Text folding
Amount of spaces a block is indented. For example with Ctrl+I. See "Tab indent blocks"
+
* [[IDE_Window:_Divider_Drawing_Divider_Draw|Divider Drawing]]
==== Tab widths ====
+
** Drawing divider lines
Maximum spaces for Tab characters.
+
* [[IDE_Window:_Editor_Options_MultiWindow|Pages and Windows]]
==== Auto indent mode ====
+
** Notebook and its tabs
"Auto indent" can use several ways to indent the new line.
+
** Automatic selection of windows for code navigation
* Spaces: Fill the beginning of the new line with spaces to match the desired position
 
* Space/Tab: Copy the same mix of spaces and tabs as used in the previous line
 
* Position only: Do not insert anything, position the caret past the end of line (even if this option is disabled). Spaces will be filled in, if something is typed
 
 
 
== Cursor ==
 
 
 
==== Keep cursor X position ====
 
When moving through lines w/o Cursor Past EOL, keeps the X position of the cursor.
 
==== Cursor skips selection ====
 
When there is a selection and you press the left arrow, the cursor will go to the start of the selection.
 
==== Persistent cursor ====
 
Keep cursor blinking, even if losing focus. The is needed on some systems, where the focus messages do not work properly.
 
==== Right mouse moves caret ====
 
This entry no longer exists. Use the mouse configuration instead. [[IDE_Window:_Editor_Options_Mouse]]
 
 
 
==== Always visible cursor ====
 
Move cursor to be always visible when scrolling.
 
==== Home key jumps to nearest start ====
 
home key jumps to line start if nearer, similar to visual studio.
 
==== Caret past end of line ====
 
Allows the cursor to go past the last character into the white space at the end of a line.
 
==== End key jumps to nearest start ====
 
End key jumps to visual line end (last none whitespace) if caret is before this point, then to end of line
 
 
 
== Selection ==
 
 
 
= General / Misc =
 
 
 
== Alt-Key sets column mode ==
 
This entry no longer exists. Use the mouse configuration instead. [[IDE_Window:_Editor_Options_Mouse]]
 
 
 
== Show close buttons in notebook ==
 
Show a close button on each source editor tab. Not all widgetsets support this. At the moment only the gtk interface.
 
== Find text at cursor ==
 
When invoking the 'Find' dialog, fetch the word at the cursor and put it into the Find field.
 
== Show special characters ==
 
Spaces are shown as dots and invalid characters as question marks.
 
== Copy word on copy none ==
 
If nothing is selected and user presses Copy (Ctrl-C), the editor selects the word and copy that. Same for cutting.
 
== Trim trailing spaces ==
 
Spaces at the end of lines will be trimmed and not saved. This applies only to edited lines.
 
== Trim spaces style ==
 
Defines how aggressive spaces are trimmed. SynEdit allows to enter "uncommitted" spaces at the end of line, so you can continue typing as usual. If SynEdit deems those spaces no longer needed it will trim them.
 
* Leave Line: This is the default, SynEdit will keep all spaces on the line where the caret is. If the caret moves to another lines, spaces are trimmed.
 
* Line Edited: In Addition to leaving the line Synedit will also remove any space on the right of the caret, if the line is edited. If you type spaces on the end of line, they will be left of the caret and not affected.
 
* Caret or Edit: This is the most aggressive mode, in addition to "Line Edited" it will also trim Spaces right to the caret, if you move horizontal (Caret-left at the end of line acts similar to backspace)
 
* Position Only: No spaces or tabs are inserted past the end of line. Only the caret is moved (and forced past EOL). If text is typed, the gap is always filled with spaces.
 
** This means tabs are lost (converted to space). Hence auto-indent "copy tabs" does not work in this mode
 
** Because you are "past the EOL", smart unindent does neither work in this mode
 
 
 
In any of those cases spaces you typed at the end of line will not be saved to a file. [[AboutTrimTrailingSpaces|Read more about trailing spaces]]
 
 
 
You may want to look at "[[#End_key_jumps_to_nearest_start|End key jumps to nearest start]]". This allows you to keep spaces while editing, yet jump to the visible end of line.
 
 
 
= Display =
 
 
 
== Margin and gutter ==
 
 
 
* Visible right margin - show the right margin line
 
* Visible gutter - show the left bar
 
* Show line numbers - show line numbers in the gutter
 
* Every n-th line number - fine tune the above 'Show line numbers' option
 
* Right margin color - position in characters
 
* Gutter separator index - define where the vertical separator line is drawn. A value of 4 means right between gutter and text. -1 means do not draw it at all.
 
 
 
== Default editor font ==
 
 
 
* Font name - Can be as simple as 'courier' or as complicated as '-adobe-courier-medium-r-normal-*-*-140-*-*-*-*-iso10646-1' under gtk/X.
 
* Editor font height
 
* Extra line spacing - extra space between lines in pixels.
 
* Disable anti-aliasing
 
 
 
= Key Mappings =
 
 
 
See [[Lazarus IDE Shortcuts]].
 
 
 
== Filter ==
 
 
 
At the top there is an edit field to set a text filter. You can type some letters and the tree will be updated to show only those keys which description contains the word. Set empty to show all.
 
 
 
== Tree of IDE shortcuts ==
 
 
 
Here you can see all commands and shortcuts of the IDE.
 
Click on one of the keys to popup a dialog to edit the shortcut.
 
 
 
== Find key combination ==
 
 
 
Click on the button to show a dialog. Grab a key and press ok. The tree will then only show those keys that start with the shortcut. Select VK_UNKNOWN to show all.
 
 
 
== Choose scheme ==
 
 
 
Load one of the predefined key mappings. This will replace '''all''' your shortcuts.
 
 
 
== Check consistency ==
 
 
 
Search for double defined keys.
 
 
 
= Mouse =
 
 
 
== See [[IDE_Window:_Editor_Options_Mouse|Mouse settings]] ==
 
 
 
= Colors =
 
 
 
== See [[IDE_Window:_Editor_Options_HighlightColors|Color and Highlight settings]] ==
 
 
 
= Automatic Features =
 
 
 
== Auto remove empty methods ==
 
 
 
Published methods without code are automatically removed on save. For example: When you double click on a form the IDE creates the published method FormCreate. When this is option is enabled and the method is still empty the IDE will remove it when you save the form.
 
 
 
== Tooltip symbol Tools ==
 
 
 
When the mouse moves over an identifier in the source editor and waits a few seconds the IDE will present a hint with some informations.
 
 
 
== Complete blocks ==
 
 
 
Complete blocks. For example, when you type ''begin'' and press return the IDE will automatically add the ''end;''.
 
This feature exists since 0.9.27.
 
 
 
== Tooltip expression evaluation ==
 
 
 
During debugging the tooltip hint will try to evaluate the expression at the cursor.
 
 
 
=== Delay ===
 
 
 
Set here the waiting period before the hint pops up.
 
 
 
== Markup ==
 
 
 
There are a couple of options to control the current-word-markup
 
feature. They are on the "Automatic feature" page of the editor option
 
(plus color settings on the color page)
 
 
 
Note: If you have a block selected, the selected block will be used as
 
term to highlight, rather than the word under caret.
 
Some settings are only for block, others only for current-word
 
 
 
1) You can change the time after which highlighting kicks in. You can
 
also disable the Timer completely, in which case you can still toggle
 
Highlighting by Keyboard
 
 
 
2) Toggle by Keyboard (default Alt-M)
 
You can toggle the highlight to any chosen word, or selection by
 
pressing Alt-M while at the word, or while having selected the desired
 
block.
 
Pressing Alt-M again will set the "fixed" word to the word at your new
 
location. To untoggle, press Alt-M twice at the same location
 
(The exact behaviour is: If your current selected block, or (if no block
 
selected) the current word under cursor is the same term as the word you
 
toggled-fixed, this will clear the fixed word. Otherwise the fixed word
 
will be set)
 
 
 
3) You can ignore Keywords. This is a hardcoded list of Keywords, and
 
will ignore them even if they are used in a context where they would not
 
be seen as Keyword. The list comes from the highlighter, so this only
 
works together with the highlighter.
 
 
 
4) for current-word only:
 
You can choose to only highlight exact matches(match word boundaries)
 
instead of any occurrence including occurrences in other words. By
 
Default this applies to words shorter than 3 chars.
 
 
 
For example:
 
Set option to true and field to 3.
 
 
 
If the word at caret is the 3 letter word 'laz' then all 'laz' will be marked, but not 'lazarus' or 'blaz'.
 
 
 
If the word at caret is the 4 letter word 'laza' then all words including 'laza' will be marked, such as 'lazarus'.
 
 
 
 
 
5) blocks only:
 
by default leading/trailing spaces are ignored/stripped from the search term
 
 
 
To disable the feature completely:
 
Set all colors (FG,. BG and Frame) to default (check the tickbox); make
 
sure no Styles (bold, italic) are selected.
 
 
 
This will be recognized, and the Editor is clever enough and will not
 
even trigger the search for other words.
 
 
 
== Bracket Highlight ==
 
 
 
If the cursor is behind or in front of a bracket, highlight matching bracket
 
 
 
= Code folding =
 
 
 
Define which constructs in your source can be folded. See [[IDE_Window:_Editor_Options_Code_Folding|Code Folding]]
 
 
 
= Divider Draw Level =
 
* Lazarus 0.9.26
 
:This option will draw a horizontal line based on the code folding level you specified.
 
::'''Example:'''
 
:* If you set this option to 1, the editor will draw a horizontal divider line in the editor after the 'end' keyword of each method. This is very handy if you want a visual cue where methods start and end.
 
:* If you set this option to 2, it will draw another horizontal line after the 'end' keyword of any nested begin..end block inside methods.
 
:* The higher you set the value the more nested begin..end blocks will be included.
 
 
 
* Lazarus 0.9.28
 
 
 
Allows to draw a vertical line at the end of selected structures. E.g draw a line after each procedure. See [[IDE_Window:_Divider_Drawing|Divider drawing]]
 
 
 
= Multi Window =
 
please see [[IDE_Window:_Editor_Options_MultiWindow]]
 

Revision as of 12:14, 26 January 2021

Deutsch (de) English (en) español (es) suomi (fi)

IDE Options - Editor

This is part of the online help for the IDE.

It describes the section: "Editor Options". You can open the described dialog in your IDE via:

  • The menu: "Tools" => "Options" / Editor options ...
  • The source-editor pop-up menu: "Editor properties ...

The available editor options are:

  • General
    • Undo / Redo
    • Scrolling
    • Indent and Tabs
      Please also see Codetools for automatic indent of Pascal sources
    • Cursor
    • Selection
    • Misc
      • Showing Whitespace
      • Trimming spaces
      • Copy/paste: unselected / fold
      • Search
  • Display
    • Gutter / Margin
    • Font
    • Line-spacing
    • Colors
      • Highlighting Pascal/Language specific elements
      • General Highlighting (Selection, Line Highlights, ...)
    • Markup and Matches
      • Highlight other occurrences of the current word
      • Matching brackets
      • Extended Pascal-Keyword settings
  • User defined markup
  • Highlight your own chosen words
  • Completion and Hints
    • Automatic removal of unused events
    • Automatic completion of Pascal blocks (begin/end)
    • Automatic completion of identifiers
    • Hints in the Editor
  • Code Folding
    • Source/Text folding
  • Divider Drawing
    • Drawing divider lines
  • Pages and Windows
    • Notebook and its tabs
    • Automatic selection of windows for code navigation