Quick look at declaration-section while coding... lazarus / 9-Editor ---------------------------------------------------------------------- Valter Fukuoka · 2016-08-03 03:29 Hi, just want to ask about some features in the code editor or any help that may be useful for my question... I am an old Turbo P. user and now returning to Lazarus Pascal (and happy with it) and feeling a need to deal with the following question (or stuff)... [Quest / Question] While reading or writing some code, be able to *go* to the declaration section of the code (let's say, to declare a new var) AND (this is the important part in my quest), be able to come back with EXACTLY the same point I was and with the EXACTLY visual disposition that I had... So, that, I can continue to do things with the same *thinking of flow* that I had in mind... In other words, it can be a tool/key-shortcut/trick to *jump* somewhere and *come back* where the *jump* was invoked... Is there anything on the editor that I can use for that purpose? Does anybody have any *trick* that can help? Thanks all, Valter ---------------------------------------------------------------------- Handoko · 2016-08-03 04:03 English is not my native language, I don't fully understand your meaning. But in Lazarus, there are many useful shortcut keys and you can customize them to suit your needs. For example, I often use Jump Back (Ctrl+H) and Jump Forward (Shift+Ctrl+H) for go back and forward the recent mouse position. Here I attached the screenshot of keymapping customization screen. To configure to keymapping: goto Lazarus main menu > Tools > Options > Editor section > Keymappings. Also, there are 2 very useful tools to help you navigate your source code which you should not miss: - Lazarus main menu > View > Code Explorer - Lazarus main menu > Project > Project Inspector ---------------------------------------------------------------------- Edson · 2016-08-03 04:08 Maybe Shift+Ctrl+C when doing an assignation of the variable, can help. It add automatically the variable declaration in the section VAR, without moving the cursor. It works in most of the cases. ---------------------------------------------------------------------- Valter Fukuoka · 2016-08-03 04:34 Hi, Handoko, Edson, thanks for the tips (fast time)... Ctrl+H solve part of my quest and Ctrl+Shift+C can solve another part... Perhaps there are also combination to *peak* the declaration, but for now these 2 tips will help me a LOT... Thanks, Valter ---------------------------------------------------------------------- Handoko · 2016-08-03 04:51 There are many other useful shortcuts, for example: - Find Procedure Definition: Ctrl+Shift+Up - Find Procedure Method: Ctrl+Shift+Down - Find Declaration: Alt+Up Note: I changed several shortcut combinations on my IDE to suit my needs, the shortcuts showing here may have been altered. ---------------------------------------------------------------------- Valter Fukuoka · 2016-08-03 10:48 Quote from: Handoko on August 03, 2016, 06:51:48 amNote: I changed several shortcut combinations on my IDE to suit my needs, Yes, there is a point in the cumulative time of use that we need to go for customization to make things productive... hopefully I will be entering this stage soon... ---------------------------------------------------------------------- Martin_fr · 2016-08-03 12:41 For a list of useful shortcuts (and it really is worth having a look) http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools For customization: http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript It doesn't expose the editors top line, so no way to restore the exact view that you did have. Another option is to open a 2nd source editor window. And have the unit open in both. One for the declaration, the other for implementation. If you want to prevent the IDE from repositioning the window with the declaration, check the context menu of the *TAB*. Use "lock page". That prevent automatic scroll in many cases. See http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options_Mult iWindow ---------------------------------------------------------------------- Valter Fukuoka · 2016-08-03 16:55 Quote from: Martin_fr on August 03, 2016, 02:41:09 pmFor a list of useful shortcuts (and it really is worth having a look) http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools For customization: http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript See http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options_Mult iWindow Martin, thanks for the links. Looks like there are lots of options to make things easier... I will take a special look at macros, seems to be a good tool not only for this specific issue... Valter