Doc: Edit docs about navigating in Edit mode

List code editing services in the Edit Mode topic.
Will remove the Writing Code topic when the reorg for
this part is ready.

Move info about locating files to the "Move between files"
topic.

Change-Id: I6c97d2778b74bba106a9d8e8b89376d5961e0a27
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Leena Miettinen
2024-02-01 15:47:30 +01:00
parent 72bcc0f260
commit d35e567c92
3 changed files with 124 additions and 97 deletions

View File

@@ -23,14 +23,6 @@
in-line error indicators while you are typing.
\list
\if defined(qtcreator)
\li \l{Edit Mode}
You can use the editor toolbar to navigate between open files
and symbols in use. You can also split the view to work on
several files simultaneously, add bookmarks, and move between
symbol definitions and declarations.
\endif
\li \l{Semantic Highlighting}
\QC enables you to write well formatted code by highlighting
@@ -79,18 +71,10 @@
keyboard sequence as a macro. You can then play the macro to
repeat the sequence. You can save the latest macro and assign a
keyboard shortcut for running it or run it from the locator.
\endlist
\section1 Related Topics
\list
\li \l{Comparing Files}
You can use a diff editor to compare two versions of a file and
view the differences side-by-side in the \uicontrol Edit mode.
\endif
\endlist
\if defined(qtcreator)
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files}
\endif
*/

View File

@@ -72,55 +72,6 @@
\endlist
\section2 Locating Files
You can locate files in the local file system or on connected devices. By
default, the file system filter shows the files in the same folder as the
currently open file and lets you navigate the file system. Also, it shows
items that let you switch to another device root.
For example, to open a QML file called \e HelloWorld.qml in the currently
open project using the locator:
\list 1
\li Press \key {Ctrl+K} to activate the locator.
\li Start typing the filename.
\image qtcreator-locator-open.webp "List of files found in the locator"
\li Use the arrow keys to move to the filename in the list and press
\key Enter.
The file opens in the editor.
\li To move to a line in the file, enter the line number in the locator.
\endlist
Filters locating files also accept paths, such as \c {tools/*main.cpp}.
If the path to a file is very long, it might not fit into the locator
window. To view the full path, press \key Alt when the filename is selected
or use the handle next to the locator window to increase the window width.
\if defined(qtcreator)
If the locator does not find some files, see \l{Specify project contents}
for how to make them known to the locator.
\endif
\section2 Locating Files from Global File System Index
You can install tools such as Spotlight, Locate, or Everything and use them
to locate files from a global file system index. Use the \c md locator
filter to locate the files.
To use the sorting from the selected tool instead of from \QC,
deselect the \uicontrol {Sort results} check box in the \c md
locator filter configuration.
\image qtcreator-locator-filter-edit-md.webp {Filter Configuration dialog}
\section2 Locating Lines and Columns
To move directly to a particular line and column in the document when you

View File

@@ -9,14 +9,61 @@
\title Edit Mode
\brief Use the editor toolbar to navigate between open files and symbols in
use, split the view to work on several files simultaneously, add bookmarks,
and move between symbol definitions and declarations.
\brief Edit and navigate code and other resources in your projects.
Write code in the \uicontrol Edit mode.
Write and navigate code in the \uicontrol Edit mode.
The editor toolbar at the top of the editor view is context sensitive and
shows items relevant to the file currently open in the editor.
\image qtcreator-spliteditorview.png {Code editor}
\section1 Editing Code
The \QC code editor offers code editing services, such as:
\list
\li \l {Semantic Highlighting}{Semantic highlighting}
\QC helps you to write well formatted code by highlighting
code elements and blocks. You can use syntax highlighting
also for other types of files than C++ or QML.
\li \l {Checking Code Syntax}{Checking code syntax}
\QC checks for errors when you write code and displays inline
error and warning messages. Similarly, it checks the data
structure of an instance of a JavaScript object notation (JSON)
entity. Run static checks on the QML and JavaScript code in your
project to find common problems.
\li \l {Complete code}{Code completion}
\QC anticipates what you are going to write and completes code
and code snippets for elements, properties, and IDs.
\li \l {Indent text or code}{Indenting text or code}
\QC indents text and code according to rules that you
specify separately for files that have C++, QML, or
Nim (experimental) code and for other text files.
\endlist
\section1 Navigating Code
Split the editor view to work on several files simultaneously and move
between files and symbols in the following ways:
\list
\li Locate them with the locator.
\li Use the \l{Sidebar Views}{views} in the sidebar.
\li Go to the \uicontrol Edit and \uicontrol Window menu.
\li Use keyboard shortcuts.
\li Bookmark code.
\li Select buttons on the editor toolbar.
\endlist
\section1 Editor Toolbar
The editor toolbar is context sensitive and shows items relevant to the file
currently open in the editor.
\image qtcreator-editor-toolbar.webp {Edit mode toolbar}
@@ -32,11 +79,11 @@
\li
\row
\li \inlineimage numbers/01.png
\li Go to any open file.
\li \l{Move between open files}
\li Shows the currently open file.
\li \l{Move between files}
\row
\li \inlineimage numbers/02.png
\li Jump to any symbol used in the current file.
\li Shows the current symbol.
\li \l{Move to symbols}
\row
\li \uicontrol #
@@ -89,7 +136,7 @@
\section1 Editing Selected Lines
In the \uicontrol Edit mode go to \uicontrol Edit > \uicontrol Advanced
In the \uicontrol Edit mode, go to \uicontrol Edit > \uicontrol Advanced
to edit lines of text that you select in the editor:
\list
@@ -108,8 +155,8 @@
\endlist
\sa {Edit Code}{How To: Edit Code},
{Manage Language Servers}{How To: Manage Language Servers}, {File System},
{Projects}
{Manage Language Servers}{How To: Manage Language Servers},
{Searching with the Locator}, {Keyboard Shortcuts}, {Sidebar Views}
*/
/*!
@@ -118,16 +165,59 @@
\ingroup creator-how-to-edit
\title Move between open files
\title Move between files
Use the \l{Edit Mode}{editor toolbar}, \uicontrol Window menu items, or
\l{General Keyboard Shortcuts}{keyboard shortcuts} to move between open
files.
The editor toolbar shows the file that is currently open (1) in the editor.
To go to any open file, select it in the list of open files (1) on the editor
toolbar.
\image qtcreator-editor-open-files.webp {Current file shown on Edit mode toolbar}
\image qtcreator-editor-open-files.webp {List of open files on Edit mode toolbar}
Use the locator, \l{Sidebar Views}{sidebar views}, \uicontrol Window menu
items, \l{General Keyboard Shortcuts}{keyboard shortcuts}, or
\l{Editor Toolbar}{editor toolbar} to move between files.
\section1 Locate files
Activate the locator to find files in the local file system or on connected
devices. By default, the locator shows open documents and all files from all
projects. The file system filter (\c f) shows all files in the same folder
as the currently open file, and you can navigate the file system from there.
Also, you can switch to another device root.
For example, to open a QML file called \e HelloWorld.qml in the currently
open project using the locator:
\list 1
\li Press \key {Ctrl+K} to activate the locator.
\li Start typing the filename.
\image qtcreator-locator-open.webp {List of files in the locator}
\li Use the arrow keys to move to the filename in the list and press
\key Enter.
The file opens in the editor.
\li To move to a line in the file, enter the line number in the locator.
\endlist
Filters locating files also accept paths, such as \c {tools/*main.cpp}.
If the path to a file is very long, it might not fit into the locator
window. To view the full path, press \key Alt when the filename is selected
or use the handle next to the locator window to increase the window width.
If the locator does not find some files, see \l{Specify project contents}
for how to make them known to the locator.
\section1 Locate files from global file system index
You can install tools such as Spotlight, Locate, or Everything and use them
to locate files from a global file system index. Use the \c md locator
filter to locate the files.
To use the sorting from the selected tool instead of from \QC,
deselect the \uicontrol {Sort results} check box in the \c md
locator filter configuration.
\image qtcreator-locator-filter-edit-md.webp {Filter Configuration dialog}
\section1 Browse location history
To browse backward or forward through your location history, click
\inlineimage icons/prev.png (\uicontrol {Go Back}) and
@@ -136,6 +226,8 @@
To return to the last location where you made a change, go to
\uicontrol Window > \uicontrol {Go to Last Edit}.
\section1 Navigate with the keyboard
Use keyboard shortcuts:
\list
@@ -148,7 +240,8 @@
back to your original location in that file.
\endlist
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {File System}, {Projects}
\sa {Edit Code}{How To: Edit Code}, {Edit Mode},
{Searching with the Locator}, {File System}, {Projects}
*/
/*!
@@ -159,19 +252,18 @@
\title Move to symbols
Use the \l{Edit Mode}{editor toolbar}, locator, \uicontrol Window menu items,
or \l{General Keyboard Shortcuts}{keyboard shortcuts} to navigate between
symbols in open files.
The editor toolbar shows the symbol currently under the cursor (1).
To jump to a symbol used in a project, select the symbol on the
editor toolbar (1).
\image qtcreator-editor-symbols.webp {Symbol under the cursor shown on Edit mode toolbar}
\image qtcreator-editor-symbols.webp {List of symbols on Edit mode toolbar}
By default, the symbols are displayed in the order in which they appear in
the file. Right-click the field and go to \uicontrol {Sort Alphabetically}
By default, the list of symbols shows them in the order in which they appear
in the file. Right-click the field and go to \uicontrol {Sort Alphabetically}
to arrange the symbols in alphabetic order.
Use the locator, \l{Sidebar Views}{views}, \uicontrol Window menu items,
\l{General Keyboard Shortcuts} {keyboard shortcuts}, or \l{Editor Toolbar}
{editor toolbar}, to navigate between symbols in open files.
\section1 Locate symbols
To jump to a symbol in the current file, activate the locator,