go stuff & a mess more
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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" },
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user