godot setup
This commit is contained in:
parent
0a6c51ad4f
commit
82ef6e8679
58
init.lua
58
init.lua
|
|
@ -17,11 +17,10 @@ require("lazy").setup({
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
{"sheerun/vim-polyglot", enabled=false},
|
{"sheerun/vim-polyglot", enabled=false},
|
||||||
{"habamax/vim-godot", enabled=false },
|
{"habamax/vim-godot", enabled=false },
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
})
|
})
|
||||||
require('statusline')
|
require('statusline')
|
||||||
--require('packer_init')
|
|
||||||
require('keybindings')
|
require('keybindings')
|
||||||
--vim.opt.guicursor = " "
|
|
||||||
|
|
||||||
vim.opt.nu = true
|
vim.opt.nu = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
@ -52,17 +51,7 @@ require('nvim-treesitter.configs').setup {
|
||||||
persist_queries = false,
|
persist_queries = false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--require('treesitter-context').setup {
|
|
||||||
-- enable = true,
|
|
||||||
-- max_lines = 0,
|
|
||||||
-- min_window_height = 0,
|
|
||||||
-- patterns = {
|
|
||||||
-- zig = {
|
|
||||||
-- 'fn',
|
|
||||||
-- 'struct',
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
--}
|
|
||||||
require('nvim-autopairs').setup{}
|
require('nvim-autopairs').setup{}
|
||||||
require('telescope').setup{
|
require('telescope').setup{
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
@ -81,37 +70,28 @@ require('telescope').setup{
|
||||||
extensions = {
|
extensions = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
--local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
|
||||||
--parser_config.zimbu = {
|
|
||||||
-- install_info = {
|
|
||||||
-- url = "D:/Code/zig/treesitter",
|
|
||||||
-- files = {"src/parser.c"},
|
|
||||||
-- generate_requires_npm = true,
|
|
||||||
-- requires_generate_from_grammer = true,
|
|
||||||
-- },
|
|
||||||
-- filetype = "zu",
|
|
||||||
--}
|
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
extension = {
|
extension = {
|
||||||
odin = "odin"
|
odin = "odin"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
--if (vim.loop.os_uname().sysname == "Windows_NT") then
|
-- Server mode for godot
|
||||||
-- url = "D:\\Code\\odin\\tree-sitter-odin"
|
local paths_to_check = {'/', '/../'}
|
||||||
--else
|
local is_godot_project = false
|
||||||
-- url = "~/code/odin/tree-sitter-odin"
|
local godot_project_path = ''
|
||||||
--end
|
local cwd = vim.fn.getcwd()
|
||||||
--parser_config.odin = {
|
|
||||||
-- install_info = {
|
|
||||||
-- url = url,
|
|
||||||
-- files = {"src/parser.c"}
|
|
||||||
-- },
|
|
||||||
-- filetype = "odin",
|
|
||||||
--}
|
|
||||||
|
|
||||||
--local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
for key, value in pairs(paths_to_check) do
|
||||||
--if not vim.loop.fs_stat(pipepath) then
|
if vim.uv.fs_stat(cwd .. value .. 'project.godot') then
|
||||||
-- vim.fn.serverstart(pipepath)
|
is_godot_project = true
|
||||||
--end
|
godot_project_path = cwd .. value
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local is_server_running = vim.uv.fs_stat(godot_project_path .. '/server.pipe')
|
||||||
|
if is_godot_project and not is_server_running then
|
||||||
|
vim.fn.serverstart(godot_project_path .. '/server.pipe')
|
||||||
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ end
|
||||||
-- flags = lsp_flags,
|
-- flags = lsp_flags,
|
||||||
--}
|
--}
|
||||||
|
|
||||||
|
local godot_port = os.getenv 'GDScript_Port' or '6005'
|
||||||
|
|
||||||
local lsps = {
|
local lsps = {
|
||||||
{
|
{
|
||||||
"clangd",
|
"clangd",
|
||||||
|
|
@ -103,7 +105,18 @@ local lsps = {
|
||||||
'pylsp'
|
'pylsp'
|
||||||
},
|
},
|
||||||
root_markers = { '.git' },
|
root_markers = { '.git' },
|
||||||
filetype = { 'py' },
|
filetypes = { 'py' },
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"godot-lsp",
|
||||||
|
{
|
||||||
|
cmd = {
|
||||||
|
vim.lsp.rpc.connect('127.0.0.1', tonumber(port))
|
||||||
|
},
|
||||||
|
filetypes = { 'gd', 'gdscript', 'gdscript3' },
|
||||||
|
root_markerts = {'project.godot', '.git' },
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue