From 2c749ac32940909d444682a0199b05b1c80357c2 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Thu, 15 May 2025 13:40:48 -0400 Subject: [PATCH] Updated things, following TJ Devries advent of Neovim. --- {ftplugin => after/ftplugin}/gdscript.lua | 6 ++--- after/ftplugin/lua.lua | 3 +++ init.lua | 29 ++++++++++++----------- lua/config/lazy.lua | 14 +++++++++++ lua/plugins/nvim-treesitter.lua | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) rename {ftplugin => after/ftplugin}/gdscript.lua (83%) create mode 100644 after/ftplugin/lua.lua create mode 100644 lua/config/lazy.lua diff --git a/ftplugin/gdscript.lua b/after/ftplugin/gdscript.lua similarity index 83% rename from ftplugin/gdscript.lua rename to after/ftplugin/gdscript.lua index c573a38..3c7cff7 100644 --- a/ftplugin/gdscript.lua +++ b/after/ftplugin/gdscript.lua @@ -2,13 +2,13 @@ local port = os.getenv('GDScript_Port') or '6005' local cmd = vim.lsp.rpc.connect('127.0.0.1', port) local pipe = '/tmp/godot.pipe' -vim.print("Hello, World from gdscript") - vim.lsp.start({ name = 'Godot', cmd = cmd, - root_dir = vim.fs.dirname(vim.fs.find({ 'project.godot', '.git' }, { upaward = true })[1]), + root_dir = vim.fs.dirname(vim.fs.find({ 'project.godot', '.git' }, { upward = true })[1]), on_attach = function(client, bufnr) vim.api.nvim_command('echo serverstart("' .. pipe .. '")') end }) + + diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/after/ftplugin/lua.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/init.lua b/init.lua index a02db06..c5b67cb 100644 --- a/init.lua +++ b/init.lua @@ -1,19 +1,15 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) +require("config.lazy") -require("lazy").setup("plugins") require("mason").setup() -require("mason-lspconfig").setup() +require("mason-lspconfig").setup({ + ensure_installed = { + "pylsp", + "clangd", + "gopls", + -- "dcm", + "ols", + }, +}) -- My user settings: vim.opt.number = true @@ -27,9 +23,14 @@ vim.opt.foldenable = false vim.cmd([[colorscheme everforest]]) -- My custom keybinds +-- vim.keymap.set("n", "x", "source %") -- Can't do this with lazy.nvim apparently +vim.keymap.set("n", "x", ":.lua") +vim.keymap.set("v", "x", ":lua") vim.api.nvim_set_keymap('t', '', [[]], {noremap = true}) local lspconfig = require('lspconfig') lspconfig.pylsp.setup{} lspconfig.clangd.setup{} lspconfig.gopls.setup{} +--lspconfig.dcm.setup{} +lspconfig.ols.setup{} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..bb44a52 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,14 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("plugins") diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index eaa683b..d021788 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -5,7 +5,7 @@ return {{ local configs = require("nvim-treesitter.configs") configs.setup({ - ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "python", "html", "gdscript", "odin" }, + ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "python", "html", "gdscript", "odin" , "dart"}, sync_install = false, highlight = { enable = true }, indent = { enable = true, }, --disable = { "gdscript"} },