diff options
| author | anand <anand.panchdhari@gmail.com> | 2026-01-08 11:20:15 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2026-01-08 11:20:15 +0530 |
| commit | b5adb5105d21b164e8e4e6ed90b3c8306f8a07b9 (patch) | |
| tree | 2c6bb0e154fa6d1cd338fd776f52522bed90e5a9 /nvim/init.lua | |
| parent | f358e02e8ab12c87c8acac057b163993969c5f5d (diff) | |
changed a few things
removed polybar, changed gpg pinentry to gnome3 moved thunar plugins to
the top level and some other things I suppose.
Diffstat (limited to 'nvim/init.lua')
| -rwxr-xr-x | nvim/init.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nvim/init.lua b/nvim/init.lua index f6d5082..3f6c3b5 100755 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -51,6 +51,43 @@ vim.api.nvim_create_autocmd("TextYankPost", { end, }) +-- Godot +-- Function to find Godot project root directory +local function find_godot_project_root() + local cwd = vim.fn.getcwd() + local search_paths = { '', '/..' } + + for _, relative_path in ipairs(search_paths) do + local project_file = cwd .. relative_path .. '/project.godot' + if vim.uv.fs_stat(project_file) then + return cwd .. relative_path + end + end + + return nil +end + +-- Function to check if server is already running +local function is_server_running(project_path) + local server_pipe = project_path .. '/server.pipe' + return vim.uv.fs_stat(server_pipe) ~= nil +end + +-- Function to start Godot server if needed +local function start_godot_server_if_needed() + local godot_project_path = find_godot_project_root() + + if godot_project_path and not is_server_running(godot_project_path) then + vim.fn.serverstart(godot_project_path .. '/server.pipe') + return true + end + + return false +end + +-- Main execution +start_godot_server_if_needed() + require('mini.deps').setup({ path = { package = path_package } }) local add = require('mini.deps').add |
