I would like to do capturing within the window I currently have active.
For example I often have a resource on one window and org-note on the other. Now when I do a new capture, org-roam-capture buffer will be opened on the window where the resource was. How I can change this behavior?
If you are not using Doom, try the code below. If you are using Doom, it uses its own (I think it’s a module called “popup” or something; I can’t remember).
For normal Emacs, with the change below, two things will happen:
The selection screen of the template (if you have more than one) will open below the currently selected one
The CAPTURE window will appear in the window you selected when you started the capture.
This way, I think your resource file won’t be covered over the CAPTURE window.
Window management in Emacs can be a rabbit hole. I suggest you first read the docstring of user option display-buffer-alist (the one you are adding custom values to in the code above).
There are many different functions you can use instead of display-buffer-below-selected and display-buffer-same-window. The image below is from customizing screen for display-buffer-alist. Note the drop-down menu I am showing where you see many functions to choose from.