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",
|
||||
{"sheerun/vim-polyglot", enabled=false},
|
||||
{"habamax/vim-godot", enabled=false },
|
||||
"mfussenegger/nvim-dap",
|
||||
})
|
||||
require('statusline')
|
||||
--require('packer_init')
|
||||
require('keybindings')
|
||||
--vim.opt.guicursor = " "
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
|
@ -52,17 +51,7 @@ require('nvim-treesitter.configs').setup {
|
|||
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('telescope').setup{
|
||||
defaults = {
|
||||
|
|
@ -81,37 +70,28 @@ require('telescope').setup{
|
|||
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({
|
||||
extension = {
|
||||
odin = "odin"
|
||||
}
|
||||
})
|
||||
|
||||
--if (vim.loop.os_uname().sysname == "Windows_NT") then
|
||||
-- url = "D:\\Code\\odin\\tree-sitter-odin"
|
||||
--else
|
||||
-- url = "~/code/odin/tree-sitter-odin"
|
||||
--end
|
||||
--parser_config.odin = {
|
||||
-- install_info = {
|
||||
-- url = url,
|
||||
-- files = {"src/parser.c"}
|
||||
-- },
|
||||
-- filetype = "odin",
|
||||
--}
|
||||
-- Server mode for godot
|
||||
local paths_to_check = {'/', '/../'}
|
||||
local is_godot_project = false
|
||||
local godot_project_path = ''
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
--local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
||||
--if not vim.loop.fs_stat(pipepath) then
|
||||
-- vim.fn.serverstart(pipepath)
|
||||
--end
|
||||
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
|
||||
|
||||
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,
|
||||
--}
|
||||
|
||||
local godot_port = os.getenv 'GDScript_Port' or '6005'
|
||||
|
||||
local lsps = {
|
||||
{
|
||||
"clangd",
|
||||
|
|
@ -103,7 +105,18 @@ local lsps = {
|
|||
'pylsp'
|
||||
},
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue