Updated nvim for godot.
This commit is contained in:
@@ -38,7 +38,8 @@ vim.pack.add({
|
||||
{ src = "https://github.com/stevearc/oil.nvim" },
|
||||
{ src = "https://github.com/akinsho/toggleterm.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")
|
||||
@@ -51,6 +52,31 @@ require("mini.statusline").setup()
|
||||
require("oil").setup({ view_options = { show_hidden = true, } })
|
||||
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 ]]
|
||||
---------------------------------------------------------------------------------
|
||||
@@ -76,10 +102,11 @@ vim.keymap.set("n", "<leader>e", ":Oil<CR>")
|
||||
--------------------------------------------------------------------------------
|
||||
-- [[ LSP ]]
|
||||
---------------------------------------------------------------------------------
|
||||
local servers = { "gopls" }
|
||||
local servers = { "gopls", "gdscript" }
|
||||
for _, server in ipairs(servers) do
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- [[ AUTOCMDS ]]
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user