go stuff & a mess more
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled

This commit is contained in:
2025-03-28 14:53:54 -04:00
parent bf3c2c8003
commit 3fc6fde51c
7 changed files with 156 additions and 32 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ coc-settings.json
lazy-lock.json
after
**/.DS_Store
.elixir-tools/

View File

@@ -5,8 +5,8 @@ local M = {}
local highlights = require "custom.highlights"
M.ui = {
theme = "pastelDark",
theme_toggle = { "pastelDark", "one_light" },
theme = "everblush",
theme_toggle = { "everblush", "one_light" },
hl_override = highlights.override,
hl_add = highlights.add,

View File

@@ -1,10 +1,10 @@
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"
local util = require "lspconfig/util"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd" }
local servers = { "html", "cssls", "ts_ls", "clangd" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
@@ -13,6 +13,30 @@ for _, lsp in ipairs(servers) do
}
end
lspconfig.gopls.setup {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedParameters = true,
},
},
},
}
lspconfig.ts_ls.setup {
filetypes = { "javascript", "typescript", "typescriptreact", "typescript.tsx" },
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
on_attach = function(client, bufnr)
local opts = { noremap = true, silent = true }
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.lsp.buf.format()<CR>", opts)
end,
}
-- lspconfig.rust_analyzer.setup({
-- on_attach = on_attach,
-- capabilities = capabilities,
@@ -26,5 +50,5 @@ end
-- }
-- })
--
--
-- lspconfig.pyright.setup { blabla}

View File

@@ -43,6 +43,9 @@ M.general = {
-- ["<A-Space>"] = cmp.mapping.complete(),
["gb"] = { "<cmd>Gitsigns blame<CR>", "Git blame" },
["gB"] = { "<cmd>Gitsigns blame_line<CR>", "Git blame line" },
["gu"] = { "<cmd>diffget //2<CR>", "Select left in conflict" },
["gh"] = { "<cmd>diffget //3<CR>", "Select right in conflict" },

View File

@@ -35,6 +35,7 @@ local plugins = {
opts = vim.tbl_deep_extend("force", overrides.mason, {
ensure_installed = {
"rust-analyzer",
"gopls",
},
}),
},
@@ -143,8 +144,17 @@ local plugins = {
{ "famiu/bufdelete.nvim", lazy = false },
{ "fladson/vim-kitty", ft = { "kitty" } },
-- { "tpope/vim-fugitive", lazy = false },
{
"lewis6991/gitsigns.nvim",
config = function(_, opts)
require("gitsigns").setup(opts)
end,
},
{
"lukas-reineke/indent-blankline.nvim",
enabled = false,
@@ -158,6 +168,7 @@ local plugins = {
"nvim-neotest/neotest",
lazy = false,
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
@@ -201,6 +212,39 @@ local plugins = {
end,
},
{
"ray-x/go.nvim",
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("go").setup()
end,
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
{
"stevearc/conform.nvim",
config = function()
require("conform").setup {
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- You can customize some of the format options for the filetype (:help conform.format)
rust = { "rustfmt", lsp_format = "fallback" },
-- Conform will run the first available formatter
javascript = { "prettierd", "prettier", stop_after_first = true },
go = { { "gofmt" } },
},
}
end,
},
-- {
-- "rouge8/neotest-rust",
-- config = function() end,

View File

@@ -49,18 +49,69 @@ M.luasnip = function(opts)
})
end
-- M.gitsigns = {
-- signs = {
-- add = { text = "│" },
-- change = { text = "│" },
-- delete = { text = "󰍵" },
-- topdelete = { text = "‾" },
-- changedelete = { text = "~" },
-- untracked = { text = "│" },
-- },
-- on_attach = function(bufnr)
-- utils.load_mappings("gitsigns", { buffer = bufnr })
-- end,
-- }
M.gitsigns = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "󰍵" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged_enable = true,
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
auto_attach = true,
attach_to_untracked = false,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
virt_text_priority = 100,
},
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
on_attach = function(bufnr)
utils.load_mappings("gitsigns", { buffer = bufnr })
end,
}
return M

View File

@@ -90,25 +90,26 @@ local default_plugins = {
-- git stuff
{
"lewis6991/gitsigns.nvim",
lazy = false,
ft = { "gitcommit", "diff" },
init = function()
-- load gitsigns only when a git file is opened
vim.api.nvim_create_autocmd({ "BufRead" }, {
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
callback = function()
vim.fn.jobstart({ "git", "-C", vim.loop.cwd(), "rev-parse" }, {
on_exit = function(_, return_code)
if return_code == 0 then
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
vim.schedule(function()
require("lazy").load { plugins = { "gitsigns.nvim" } }
end)
end
end,
})
end,
})
end,
-- init = function()
-- -- load gitsigns only when a git file is opened
-- vim.api.nvim_create_autocmd({ "BufRead" }, {
-- group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
-- callback = function()
-- vim.fn.jobstart({ "git", "-C", vim.loop.cwd(), "rev-parse" }, {
-- on_exit = function(_, return_code)
-- if return_code == 0 then
-- vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
-- vim.schedule(function()
-- require("lazy").load { plugins = { "gitsigns.nvim" } }
-- end)
-- end
-- end,
-- })
-- end,
-- })
-- end,
opts = function()
return require("plugins.configs.others").gitsigns
end,