Code editor

From this point forward, all options are dedicated to improving the code IDE. Therefore, all options will be in Tools->Options.

MINIMIZE WHILE RUNNING (expendable):

 In Delphi – in some versions – when running (F9) the program, the common behavior is for the IDE to be minimized and this helps when dealing with many programs simultaneously, but this does not help if your intention is to debug and follow the execution with breakpoints. If you want this option turned on then go to ->Environment->Window and then check the option Hide IDE windows on run. This option can be inconvenient in situations where you run the application and still want to have access to the code editor and change it while watching the execution.

SHOW PROJECT DETAILS IN THE TITLE(highly recommended): 

It seems unimportant, but I need to see the name of the project in the title of the IDE, if you also need it then go to ->Environment->Window and check the options that you would like to show in the project window when it is opened, they are: 

  • IDE title starts with project name: Display project name
  • IDE title show project directory: Display project folder location
  • IDE title show selected build mode: Display the project build mode to indicate if the project compiles Win32, Win64, etc…
  • Window menu shows designed form’s name instead of caption: Os formulários, ao invés de topo da janela mostrar o Caption, mostrará o nome do formulário. Isso é muito util quando sua forma de programar sempre muda o caption das janelas ao invés de sempre usar o que foi definido em tempo de design.
  • Automatically adjust IDE main window height: Ajustar automaticamente a altura da janela principal da IDE. Isso é util especialmente quando estamos docando ou para evitar janelas perdidas. Janelas perdidas é quando salvamos um projetos e quando abrimos o projeto numa outra configuração de resolução a janela parece que some quando na realidade sua posição esta fora das coordenadas visiveis.
  • Show complete componente pallet: Exibir paleta de componentes completa.
  • Show properties pane in Project Inspector: Exibir painel de propriedades no inspetor de projeto. Se este painel aqui será mostrado ou não(eu prefiro “não”):

It's not a good idea to turn on the 3 options because hardly the 3 options will fit in the IDE's title window, so turn on only the option you need most when you look at the IDE's title window.

END OF GENERIC COMPONENT NAMES: 

Something that I find very useful: when dragging a component to the form then being forced to choose a name for it instead of the generic names that the IDE chooses. It will be the end of label1, label2, label3…. it can be a bit of work to get used to, but it makes maintaining the source code a lot easier later on. Go in ->Enviroment->Form Editor and then activate the option Ask name on create.

REDUCE THE FORM XY GRID

Aproveitando que ainda está em ->Enviroment->Form Editor, ajuste o grid size X e Y de 8 para 4px, assim os alinhamentos de componentes no formulário usando o mouse serão mais precisos:

Content of the “Object Inspector” is changed when clicking on the form title

Optionally, you can also mark Change Object Inspector contents on clicking form title bar, it will help you when you need to get the properties and events of the form by just touching the title of the form, but this is an option that you should test it before leaving it on, you may not like this behavior. This option still remains in ->Enviroment->Form Editor:

Highlight spaces between edges::

Optionally, you can also turn on the option show border spacing, it will help you to recognize the space between the borders and the container component when the borderwidth is zero, very useful for those who make use of padding or anchoring of visual components. This option still remains in ->Enviroment->Form Editor:

Here's what your form looks like when the borders are highlighted:

show border spacing

The red lines are indicating the spaces between the main component and the container component

DO NOT OPEN THE LAST PROJECT (optional): 

Something that can get in the way for some is every time you load Lazarus it always reopens the last project. If you work and spend a lot of time on the same project for days, weeks or even months this option is very useful, but if you open different projects daily, it is the case of code managers who observe the code and/or document projects so maybe this behavior must be modified. If you want to modify it, go to Tools|Options|Environment|IDE Startup and check the option Open last project and packages at startup as per your need:

TAB SIZE (highly recommended): 

Tvery spaced ablation can bother you, the default is 8, if you want to change this default go to ->Editor->General->Tab and Ident is at tab widths change from 8 to 2 or 4. I personally prefer “2”:

STANDARD SOURCE (highly recommended):

Go in ->Editor->Display is at “Default font editor” change from Courier New 10 for consoles in the size you prefer. Another font option is Note Mono (Linux), both – in my opinion – are much better than Lazarus' default Courier and Delphi:

COLORS (expendable):

I tend to stick with the FreePascal colors which seem to me to be quite adequate, there is no real gain in swapping them unless the Delphi colors are well ingrained in you. To change go to ->Editor->Display->Colors and at the top where is the color style “Default” you can choose "Delphi":

CORES
Delphi colors only if you are very used to it

CURSOR LINE COLORS WHERE THE CURSOR IS (highly recommended):

Something that happens with some frequency is the jumps from one line to another with Ctrl+Arrow, Alta+Arrow, but we don't always quickly find where the edit cursor has positioned itself, so let's enable a Hightlight on the line where the cursor is positioned. Go in ->Editor->Display->Colors and in the elements in the middle column look for “Current line highlight” and then at the bottom make the color adjustments that suit you best, for me the GREEN BACKGROUND WITH WHITE AND BOLD FONT it's ideal. The display on the right shows an example of how it will look:

CORRESPONDENCE INDICATORS (highly recommended):

Something very useful is colorizing begin..end, if..then..else blocks, etc… and highlighting dangerous terms like the “not” clause, see this example:

INDICADORES DE CORRESPONDÊNCIA

How is this done? Just go to option ->Editor->Display->Markup and Matches->Outline and turn it on:

Then your blocks will be colorized, particularly it's faster than following vertical lines in some block types with your eyes and easier to see blocks with the "not" negation clause

HIDE THE MOUSE IN THE EDITOR WHILE TYPING (expendable):

A good part of us use notebooks and the touchpad creates some inconveniences, in Linux it is possible to turn off the pointer when typing and this works for the entire environment, in Windows there is not always this option, so in this case go to ->Editor->Mouse and check the option “Hide mouse pointer when typing”:

REMOVE EMPTY METHODS (highly recommended):

Those OnCreate, OnClick,… methods where they were created UNWANTED and they are left with an empty block, because by default Lazarus will keep them. If you want to change this behavior, go to ->Editor->Completion and hints and turn on the option Auto remove empty methods:

SKIP DIRECT TO CODE (highly recommended):

Lazarus has a behavior of Ctrl+Click over a method that is in another unit and then jump to the declaration instead of the code block, then use Ctrl+Down Arrow to jump to the method code. I'm used to giving Ctrl+Click and go straight to the code of the method and if you also prefer that way then go to ->CodeTools (Code Tools) is at Jump directly to method body switch to on:

Save the IDE Options window by clicking "OK".