diff --git a/dot_config/nvim/lua/custom/chadrc.lua b/dot_config/nvim/lua/custom/chadrc.lua deleted file mode 100644 index eb756d1..0000000 --- a/dot_config/nvim/lua/custom/chadrc.lua +++ /dev/null @@ -1,24 +0,0 @@ ----@type ChadrcConfig -local M = {} - -M.plugins = "custom.plugins" -M.mappings = require "custom.mappings" - -M.ui = { - theme = "onedark", - statusline = { - theme = "default", - separator_style = "arrow", - }, - tabufline = { - lazyload = false, - show_numbers = true, - }, - hl_override = { - CursorLine = { - bg = "one_bg", - }, - }, -} - -return M diff --git a/dot_config/nvim/lua/custom/configs/lspconfig.lua b/dot_config/nvim/lua/custom/configs/lspconfig.lua deleted file mode 100644 index 0fd21a0..0000000 --- a/dot_config/nvim/lua/custom/configs/lspconfig.lua +++ /dev/null @@ -1,23 +0,0 @@ -local on_attach = require("plugins.configs.lspconfig").on_attach -local capabilities = require("plugins.configs.lspconfig").capabilities - -local lspconfig = require("lspconfig") -local util = require "lspconfig/util" - -lspconfig.gopls.setup { - on_attach = on_attach, - capabilities = capabilities, - cmd = {"gopls"}, - filetypes = {"go", "gomod", "gowork", "gotmpl"}, - root_dir = util.root_pattern("go.work", "go.mod", ".git"), - settings = { - gopls = { - completeUnimported = true, - usePlaceholders = true, - analyses = { - unusedparams = true, - } - } - } -} - diff --git a/dot_config/nvim/lua/custom/configs/null-ls.lua b/dot_config/nvim/lua/custom/configs/null-ls.lua deleted file mode 100644 index a26a5c7..0000000 --- a/dot_config/nvim/lua/custom/configs/null-ls.lua +++ /dev/null @@ -1,27 +0,0 @@ -local null_ls = require("null-ls") -local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) - -local opts = { - sources = { -- run these on save - null_ls.builtins.formatting.gofumpt, - null_ls.builtins.formatting.goimports, - null_ls.builtins.diagnostics.golangci_lint, - }, - on_attach = function (client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ - group = augroup, - buffer = bufnr, - }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - vim.lsp.buf.format({ async = false }) - end, - }) - end - end, -} - -return opts diff --git a/dot_config/nvim/lua/custom/configs/nvim-dap-ui.lua b/dot_config/nvim/lua/custom/configs/nvim-dap-ui.lua deleted file mode 100644 index 0b66ee8..0000000 --- a/dot_config/nvim/lua/custom/configs/nvim-dap-ui.lua +++ /dev/null @@ -1,14 +0,0 @@ -local dap, dapui = require("dap"), require("dapui") -dap.listeners.before.attach.dapui_config = function() - dapui.open() -end -dap.listeners.before.launch.dapui_config = function() - dapui.open() -end -dap.listeners.before.event_terminated.dapui_config = function() - dapui.close() -end -dap.listeners.before.event_exited.dapui_config = function() - dapui.close() -end - diff --git a/dot_config/nvim/lua/custom/mappings.lua b/dot_config/nvim/lua/custom/mappings.lua deleted file mode 100644 index 6d35a02..0000000 --- a/dot_config/nvim/lua/custom/mappings.lua +++ /dev/null @@ -1,107 +0,0 @@ -local M = {} - -M.dap = { - plugin = true, - n = { - ["db"] = { - " DapToggleBreakpoint ", - "Add breakpoint at line" - }, - ["dc"] = { - " DapContinue ", - "Debug - continue" - }, - ["dsi"] = { - " DapStepInto ", - "Debug - step into" - }, - ["dn"] = { - " DapStepOver ", - "Debug - step over (next)" - }, - ["dso"] = { - " DapStepOut ", - "Debug - step out" - }, - ["dt"] = { - " DapTerminate ", - "Debug - terminate" - }, - ["dus"] = { - function () - require("dapui").toggle(); - -- local widgets = require('dap.ui.widgets'); - -- local sidebar = widgets.sidebar(widgets.scopes); - -- sidebar.open(); - end, - "Toggle debugging interface" - } - } -} - -M.dap_go = { - plugin = true, - n = { - ["dgt"] = { - function() - require("dap-go").debug_test() - end, - "Debug go test" - }, - ["dgl"] = { - function() - require("dap-go").debug_last_test() - end, - "Debug last go test" - }, - } -} - -M.dap_ui = { - plugin = true, - n = { - ["È"] = { -- alt+k - function() - require("dapui").eval() - end, - "Debug - eval expression (Alt+K)" - } - } -} - -M.terminal = { - t = { - [""] = {""} - } -} - -M.general = { - i = { - [""] = { "^i", "Beginning of line" }, - } -} - -M.nvterm = { - n = { - ["ti"] = { - function() - require("nvterm.terminal").toggle "float" - end, - "Toggle floating term" - }, - ["tv"] = { - function() - require("nvterm.terminal").toggle "vertical" - end, - "Toggle vertical term" - }, - ["th"] = { - function() - require("nvterm.terminal").toggle "horizontal" - end, - "Toggle horizontal term" - }, - } -} - -return M diff --git a/dot_config/nvim/lua/custom/plugins.lua b/dot_config/nvim/lua/custom/plugins.lua deleted file mode 100644 index f72aa52..0000000 --- a/dot_config/nvim/lua/custom/plugins.lua +++ /dev/null @@ -1,100 +0,0 @@ -local plugins = { - { - "nvim-tree/nvim-tree.lua", - opts = { - git = { - enable = true, - }, - renderer = { - highlight_git = true, - icons = { - show = { - git = true, - }, - }, - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", -- grammars - opts = { - ensure_installed = { - "go", - "lua", - "python", - }, - auto_install = true, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }, - }, - { - "williamboman/mason.nvim", -- auto install tools - opts = { - ensure_installed = { - "lua-language-server", - "gopls", - "gofumpt", - "golangci-lint", - "goimports", - }, - }, - }, - { - "mfussenegger/nvim-dap", -- generic debugger integration - init = function() - require("core.utils").load_mappings("dap") - end, - }, - { - "leoluz/nvim-dap-go", -- specific go debugger integration - ft = "go", - dependencies = "mfussenegger/nvim-dap", - config = function(_, opts) - require("dap-go").setup(opts) - require("core.utils").load_mappings("dap_go") - end, - }, - { - "rcarriga/nvim-dap-ui", -- UI for the DAP debugger - ft = "go", - dependencies = "mfussenegger/nvim-dap", - config = function() - require("dapui").setup() - require "custom.configs.nvim-dap-ui" - require("core.utils").load_mappings("dap_ui") - end, - }, - { - "neovim/nvim-lspconfig", -- load custom lsp config - config = function() - require "plugins.configs.lspconfig" - require "custom.configs.lspconfig" - end, - }, - { - "nvimtools/none-ls.nvim", -- custom format on save - ft = "go", - opts = function() - return require "custom.configs.null-ls" - end, - }, - { - "olexsmir/gopher.nvim", - ft = "go", - config = function(_, opts) - require("gopher").setup(opts) - end, - build = function() - vim.cmd [[silent! GoInstallDeps]] - end, - }, -} -return plugins