forked from qt-creator/qt-creator
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:
@@ -23,14 +23,6 @@
|
|||||||
in-line error indicators while you are typing.
|
in-line error indicators while you are typing.
|
||||||
|
|
||||||
\list
|
\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}
|
\li \l{Semantic Highlighting}
|
||||||
|
|
||||||
\QC enables you to write well formatted code by 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
|
keyboard sequence as a macro. You can then play the macro to
|
||||||
repeat the sequence. You can save the latest macro and assign a
|
repeat the sequence. You can save the latest macro and assign a
|
||||||
keyboard shortcut for running it or run it from the locator.
|
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
|
\endif
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\if defined(qtcreator)
|
||||||
|
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files}
|
||||||
|
\endif
|
||||||
*/
|
*/
|
||||||
|
@@ -72,55 +72,6 @@
|
|||||||
|
|
||||||
\endlist
|
\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
|
\section2 Locating Lines and Columns
|
||||||
|
|
||||||
To move directly to a particular line and column in the document when you
|
To move directly to a particular line and column in the document when you
|
||||||
|
@@ -9,14 +9,61 @@
|
|||||||
|
|
||||||
\title Edit Mode
|
\title Edit Mode
|
||||||
|
|
||||||
\brief Use the editor toolbar to navigate between open files and symbols in
|
\brief Edit and navigate code and other resources in your projects.
|
||||||
use, split the view to work on several files simultaneously, add bookmarks,
|
|
||||||
and move between symbol definitions and declarations.
|
|
||||||
|
|
||||||
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
|
\image qtcreator-spliteditorview.png {Code editor}
|
||||||
shows items relevant to the file currently open in the 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}
|
\image qtcreator-editor-toolbar.webp {Edit mode toolbar}
|
||||||
|
|
||||||
@@ -32,11 +79,11 @@
|
|||||||
\li
|
\li
|
||||||
\row
|
\row
|
||||||
\li \inlineimage numbers/01.png
|
\li \inlineimage numbers/01.png
|
||||||
\li Go to any open file.
|
\li Shows the currently open file.
|
||||||
\li \l{Move between open files}
|
\li \l{Move between files}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage numbers/02.png
|
\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}
|
\li \l{Move to symbols}
|
||||||
\row
|
\row
|
||||||
\li \uicontrol #
|
\li \uicontrol #
|
||||||
@@ -89,7 +136,7 @@
|
|||||||
|
|
||||||
\section1 Editing Selected Lines
|
\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:
|
to edit lines of text that you select in the editor:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
@@ -108,8 +155,8 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\sa {Edit Code}{How To: Edit Code},
|
\sa {Edit Code}{How To: Edit Code},
|
||||||
{Manage Language Servers}{How To: Manage Language Servers}, {File System},
|
{Manage Language Servers}{How To: Manage Language Servers},
|
||||||
{Projects}
|
{Searching with the Locator}, {Keyboard Shortcuts}, {Sidebar Views}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -118,16 +165,59 @@
|
|||||||
|
|
||||||
\ingroup creator-how-to-edit
|
\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
|
The editor toolbar shows the file that is currently open (1) in the editor.
|
||||||
\l{General Keyboard Shortcuts}{keyboard shortcuts} to move between open
|
|
||||||
files.
|
|
||||||
|
|
||||||
To go to any open file, select it in the list of open files (1) on the editor
|
\image qtcreator-editor-open-files.webp {Current file shown on Edit mode toolbar}
|
||||||
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
|
To browse backward or forward through your location history, click
|
||||||
\inlineimage icons/prev.png (\uicontrol {Go Back}) and
|
\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
|
To return to the last location where you made a change, go to
|
||||||
\uicontrol Window > \uicontrol {Go to Last Edit}.
|
\uicontrol Window > \uicontrol {Go to Last Edit}.
|
||||||
|
|
||||||
|
\section1 Navigate with the keyboard
|
||||||
|
|
||||||
Use keyboard shortcuts:
|
Use keyboard shortcuts:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
@@ -148,7 +240,8 @@
|
|||||||
back to your original location in that file.
|
back to your original location in that file.
|
||||||
\endlist
|
\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
|
\title Move to symbols
|
||||||
|
|
||||||
Use the \l{Edit Mode}{editor toolbar}, locator, \uicontrol Window menu items,
|
The editor toolbar shows the symbol currently under the cursor (1).
|
||||||
or \l{General Keyboard Shortcuts}{keyboard shortcuts} to navigate between
|
|
||||||
symbols in open files.
|
|
||||||
|
|
||||||
To jump to a symbol used in a project, select the symbol on the
|
\image qtcreator-editor-symbols.webp {Symbol under the cursor shown on Edit mode toolbar}
|
||||||
editor toolbar (1).
|
|
||||||
|
|
||||||
\image qtcreator-editor-symbols.webp {List of symbols on Edit mode toolbar}
|
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}
|
||||||
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}
|
|
||||||
to arrange the symbols in alphabetic order.
|
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
|
\section1 Locate symbols
|
||||||
|
|
||||||
To jump to a symbol in the current file, activate the locator,
|
To jump to a symbol in the current file, activate the locator,
|
||||||
|
Reference in New Issue
Block a user