Devlog Day 12

Vim tab layouts
gamedev
godot
vim
Author

Evan Lesmez

Published

August 13, 2024

Vim

Tabs

:h tabpage

Tabs in Vim are similar to tabs in other programs however the key difference is that one tab in Vim does not map to one file.
Instead, a tab in vim can have several buffers within it as well a window panes that show those buffers.

Here are the commands:

:lcd # set the working dir for the current window
:tabe {filename} # like edit but open buffer in new tab
<C-w>T # break the window pane into a new tab
:tabc # close current tab
:tabo # close other tabs
:tabn or gt # next tab
:tabp or gT # prev tab
:tabmove {N} # move the Nth tab to beginning

Files

I also learned about how to open files to buffers quicker rather than typing out full paths.
I already had discovered the % in command mode which represents the current buffer’s filepath.
Combine it into : %:h and press and the full path to the current buffer is completed for you.
This is handy for when you opened Vim at the root project dir but are opening files nested a few folders down.
If you already have one open, instead of typing out path from root, you can type the path out relative to the current folder.

Godot

Added a healthbar UI element to the spaceship health pickup scene.
Use a Control node with ProgressBar node nested.
Go into the control section of the inspector tab to change colors via theme overrides (or theme if one is made).
Note though that since these nodes are nested under a parent node that rotates, the bar will also rotate with this ship.
To prevent this, use get_node("Sprite2D") or $Sprite2D to access the rotation property of the ship directly.
I think this might be a problem though if the root scene node for the ship was not an Area2D with collision shape circle.
If the shape was anything else, rotating the Sprite without the collision shape would cause a desync in hitboxes relative to the visual sprite.
Could use the same get_node idea to also rotate the collision shape but maybe there is a cleaner way.

Thanks for reading!