KDevelop4/Manual/Customizing KDevelop: Difference between revisions
(Created page with "== Customizing KDevelop == There are times when you want to change the default appearance or behavior of KDevelop, for example because you are used to different keyboard shortcu...") |
m (add formatting and category) |
||
Line 1: | Line 1: | ||
== Customizing KDevelop == | == Customizing KDevelop == | ||
There are times when you want to change the default appearance or behavior of KDevelop, for example because you are used to different keyboard shortcuts or because your project requires a different indenting style for source code. In the following sections, we briefly discuss the various ways how KDevelop can be customized for these needs. | There are times when you want to change the default appearance or behavior of '''KDevelop''', for example because you are used to different keyboard shortcuts or because your project requires a different indenting style for source code. In the following sections, we briefly discuss the various ways how '''KDevelop''' can be customized for these needs. | ||
=== Customizing the editor === | === Customizing the editor === | ||
There are a number of useful things one can configure in and around KDevelop's builtin editor. Of more universal use is to switch on line numbering using the menu entry <menuchoice>Editor > View > Show line numbers</menuchoice>, making it easier to match compiler error messages or debug messages with locations in the code. In the same submenu you may also want to switch on the "Icon border" — a column to the left of your code in which KDevelop will show icons such as whether there is a breakpoint on the current line. | There are a number of useful things one can configure in and around KDevelop's builtin editor. Of more universal use is to switch on line numbering using the menu entry <menuchoice>Editor -> View -> Show line numbers</menuchoice>, making it easier to match compiler error messages or debug messages with locations in the code. In the same submenu you may also want to switch on the "Icon border" — a column to the left of your code in which '''KDevelop''' will show icons such as whether there is a breakpoint on the current line. | ||
=== Customizing code indentation === | === Customizing code indentation === | ||
Many of us like code formatted in a particular way. Many projects also enforce a particular indentation style. Neither may match KDevelop's default indentation style. However, this can be customized: Go to the <menuchoice>Settings > Customize KDevelop</menuchoice> menu item, then click on "Source Formatter" on the left. You can choose one of the predefined indentation styles that are widely in use, or define your own one by adding a new style and then editing it. There may not be a way to exactly re-create the style in which your project's sources have been indented in the past, but you can come close by using the settings for a new style; an example is shown in the two pictures below. | Many of us like code formatted in a particular way. Many projects also enforce a particular indentation style. Neither may match '''KDevelop's''' default indentation style. However, this can be customized: Go to the <menuchoice>Settings -> Customize KDevelop</menuchoice> menu item, then click on "Source Formatter" on the left. You can choose one of the predefined indentation styles that are widely in use, or define your own one by adding a new style and then editing it. There may not be a way to exactly re-create the style in which your project's sources have been indented in the past, but you can come close by using the settings for a new style; an example is shown in the two pictures below. | ||
{| | {| | ||
Line 16: | Line 16: | ||
|} | |} | ||
{{Note|1= With KDevelop 4.2.2, you can create a new style for a particular mimetype (e.g. for C++ header files) but this style does not show up among the list of possible styles for other mimetypes (e.g. for C++ source files) although it would of course be useful to use the same style for both kinds of files. You will therefore have to define the style twice, once for header and once for source files. This has been reported as [https://bugs.kde.org/show_bug.cgi?id=272335 KDevelop bug 272335].}} | {{Note|1= With '''KDevelop 4.2.2''', you can create a new style for a particular mimetype (e.g. for C++ header files) but this style does not show up among the list of possible styles for other mimetypes (e.g. for C++ source files) although it would of course be useful to use the same style for both kinds of files. You will therefore have to define the style twice, once for header and once for source files. This has been reported as [https://bugs.kde.org/show_bug.cgi?id=272335 KDevelop bug 272335].}} | ||
=== Customizing keyboard shortcuts === | === Customizing keyboard shortcuts === | ||
KDevelop has an almost boundless list of keyboard shortcuts (some of them are listed in the "Useful keyboard shortcuts sections" of several chapters in this manual) that can be changed to your taste through the menu <menuchoice>Settings > Shortcuts</menuchoice>. At the top of the dialog you can enter a searchword and it only shows those commands that match; you can then edit which key combination is bound to this command. | '''KDevelop''' has an almost boundless list of keyboard shortcuts (some of them are listed in the "Useful keyboard shortcuts sections" of several chapters in this manual) that can be changed to your taste through the menu <menuchoice>Settings -> Shortcuts</menuchoice>. At the top of the dialog you can enter a searchword and it only shows those commands that match; you can then edit which key combination is bound to this command. | ||
Two that have been found to be very useful to change are to set "Align" to the | Two that have been found to be very useful to change are to set "Align" to the <keycap>Tab</keycap> key (many people don't usually enter tabs by hand and rather prefer if me editor chooses the layout of code for me; with the changed shortcut, hitting <keycap>Tab</keycap> makes '''KDevelop''' indent/outdent/align the code for me). The second one is putting <menuchoice>Toggle Breakpoint</menuchoice> on <keycap>Ctrl+B</keycap> since this is quite a frequent operation. | ||
[[Category:Development]] |
Revision as of 19:07, 17 May 2011
Customizing KDevelop
There are times when you want to change the default appearance or behavior of KDevelop, for example because you are used to different keyboard shortcuts or because your project requires a different indenting style for source code. In the following sections, we briefly discuss the various ways how KDevelop can be customized for these needs.
Customizing the editor
There are a number of useful things one can configure in and around KDevelop's builtin editor. Of more universal use is to switch on line numbering using the menu entry
, making it easier to match compiler error messages or debug messages with locations in the code. In the same submenu you may also want to switch on the "Icon border" — a column to the left of your code in which KDevelop will show icons such as whether there is a breakpoint on the current line.Customizing code indentation
Many of us like code formatted in a particular way. Many projects also enforce a particular indentation style. Neither may match KDevelop's default indentation style. However, this can be customized: Go to the
menu item, then click on "Source Formatter" on the left. You can choose one of the predefined indentation styles that are widely in use, or define your own one by adding a new style and then editing it. There may not be a way to exactly re-create the style in which your project's sources have been indented in the past, but you can come close by using the settings for a new style; an example is shown in the two pictures below.
Customizing keyboard shortcuts
KDevelop has an almost boundless list of keyboard shortcuts (some of them are listed in the "Useful keyboard shortcuts sections" of several chapters in this manual) that can be changed to your taste through the menu
. At the top of the dialog you can enter a searchword and it only shows those commands that match; you can then edit which key combination is bound to this command.Two that have been found to be very useful to change are to set "Align" to the Tab key (many people don't usually enter tabs by hand and rather prefer if me editor chooses the layout of code for me; with the changed shortcut, hitting Tab makes KDevelop indent/outdent/align the code for me). The second one is putting on Ctrl+B since this is quite a frequent operation.