Updated nvim for godot.

This commit is contained in:
Jason Hilder 2026-02-09 20:50:56 +02:00
parent 23ffa739bc
commit 39519e4e7c
2 changed files with 36 additions and 4 deletions

View File

@ -38,7 +38,8 @@ vim.pack.add({
{ src = "https://github.com/stevearc/oil.nvim" }, { src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/akinsho/toggleterm.nvim" }, { src = "https://github.com/akinsho/toggleterm.nvim" },
{ src = "https://github.com/folke/trouble.nvim" }, { src = "https://github.com/folke/trouble.nvim" },
{ src = "https://github.com/tribela/transparent.nvim" } { src = "https://github.com/tribela/transparent.nvim" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" }
}) })
vim.cmd.colorscheme("kanagawa") vim.cmd.colorscheme("kanagawa")
@ -51,6 +52,31 @@ require("mini.statusline").setup()
require("oil").setup({ view_options = { show_hidden = true, } }) require("oil").setup({ view_options = { show_hidden = true, } })
require("toggleterm").setup({ open_mapping = [[<c-\>]], direction = "float" }) require("toggleterm").setup({ open_mapping = [[<c-\>]], direction = "float" })
--------------------------------------------------------------------------------
-- [[ Godot ]]
---------------------------------------------------------------------------------
-- paths to check for project.godot file
local paths_to_check = {'/', '/../'}
local is_godot_project = false
local godot_project_path = ''
local cwd = vim.fn.getcwd()
-- iterate over paths and check
for key, value in pairs(paths_to_check) do
if vim.uv.fs_stat(cwd .. value .. 'project.godot') then
is_godot_project = true
godot_project_path = cwd .. value
break
end
end
-- check if server is already running in godot project path
local is_server_running = vim.uv.fs_stat(godot_project_path .. '/server.pipe')
-- start server, if not already running
if is_godot_project and not is_server_running then
vim.fn.serverstart(godot_project_path .. '/server.pipe')
end
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
-- [[ KEYMAPS ]] -- [[ KEYMAPS ]]
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
@ -76,10 +102,11 @@ vim.keymap.set("n", "<leader>e", ":Oil<CR>")
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- [[ LSP ]] -- [[ LSP ]]
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
local servers = { "gopls" } local servers = { "gopls", "gdscript" }
for _, server in ipairs(servers) do for _, server in ipairs(servers) do
vim.lsp.enable(server) vim.lsp.enable(server)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- [[ AUTOCMDS ]] -- [[ AUTOCMDS ]]
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------

View File

@ -5,13 +5,18 @@
"src": "https://github.com/rebelot/kanagawa.nvim" "src": "https://github.com/rebelot/kanagawa.nvim"
}, },
"mini.nvim": { "mini.nvim": {
"rev": "f28cd08c8be826355d64080400fab1764c9693dd", "rev": "8c40d95931cbe6138391af9180e59439ed2e69df",
"src": "https://github.com/nvim-mini/mini.nvim" "src": "https://github.com/nvim-mini/mini.nvim"
}, },
"nvim-lspconfig": { "nvim-lspconfig": {
"rev": "0480b120318ec8bab27b530ffab6ee76a8c4d806", "rev": "66fd02ad1c7ea31616d3ca678fa04e6d0b360824",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
}, },
"nvim-treesitter": {
"rev": "42fc28ba918343ebfd5565147a42a26580579482",
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
"version": "'master'"
},
"oil.nvim": { "oil.nvim": {
"rev": "f55b25e493a7df76371cfadd0ded5004cb9cd48a", "rev": "f55b25e493a7df76371cfadd0ded5004cb9cd48a",
"src": "https://github.com/stevearc/oil.nvim" "src": "https://github.com/stevearc/oil.nvim"