-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup godot external editor #29
Comments
Might be worth updating the docs again to include |
vim --servername godot is not working |
@Arrow-x |
Thank! |
this will take you to the end of the file if you just click on the script icon. it is kinda annoying how godot sends how many lines the document have everytime |
this command works better though |
I'm using a manually recompiled vim with the Explanation: |
When using godot, the easiest way to open scripts is the little script icon on nodes. However, setting this up with vim is a pain. This is a request to have this added to the documentation, as I found it very helpful.
When you first open vim, add this as a command line flag:
vim --servername godot
. This will allow other vim commands to attach to that vim session. Next, in godot, set your external editor to vim (for example,/usr/bin/vim
). Now, set your exec flags to--servername godot --remote {file}
. This tells godot to execute vim with those flags. If you pass those flags to vim, it will simply open the file in the other vim session, and then exit.EDIT: After more messing about with exec flags, this appears to be the best solution:
vim --servername godot --remote-send "<C-\><C-N>:n {file}<CR>{line}G{col}|"
. The previous solution had a few problems: If there was no server open, it would open it "locally", which meant creating a background vim editor that did nothing, and was only closed when you closed godot. This new command will leave edit mode, open the file, and then go to the line and column number specified by godot. This means that double clicking on functions attached to signals works properly. Also, if there is no vim session open, then opening a script will do nothing (as it should).The text was updated successfully, but these errors were encountered: