becoming a Go andy
This commit is contained in:
parent
b72dd36780
commit
934b3ed160
|
@ -21,5 +21,3 @@ starship init fish | source
|
|||
|
||||
set EDITOR "nvim" # Set nvim as the default editor
|
||||
set VISUAL "nvim"
|
||||
|
||||
fish_add_path ~/.cargo/bin
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
---@type ChadrcConfig
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
M.ui = {
|
||||
theme = 'catppuccin',
|
||||
|
||||
nvdash = {
|
||||
load_on_startup = true
|
||||
}
|
||||
}
|
||||
M.plugins = 'custom.plugins'
|
||||
M.plugins = "custom.plugins"
|
||||
M.mappings = require "custom.mappings"
|
||||
return M
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||
|
||||
local options = {
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
|
@ -1 +1,2 @@
|
|||
vim.opt.rnu = true
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
local M = {}
|
||||
|
||||
M.general = {
|
||||
n = {
|
||||
["<C-h>"] = { "<cmd> TmuxNavigateLeft<CR>", "window left"},
|
||||
["<C-l>"] = { "<cmd> TmuxNavigateRight<CR>", "window right"},
|
||||
["<C-j>"] = { "<cmd> TmuxNavigateDown<CR>", "window down"},
|
||||
["<C-k>"] = { "<cmd> TmuxNavigateUp<CR>", "window up"},
|
||||
}
|
||||
}
|
||||
|
||||
M.dap = {
|
||||
plugin = true,
|
||||
n = {
|
||||
["<leader>db"] = {
|
||||
"<cmd> DapToggleBreakpoint <CR>",
|
||||
"Toggle breakpoint"
|
||||
"Add breakpoint at line"
|
||||
},
|
||||
["<leader>dus"] = {
|
||||
function ()
|
||||
|
@ -22,17 +14,42 @@ M.dap = {
|
|||
sidebar.open();
|
||||
end,
|
||||
"Open debugging sidebar"
|
||||
},
|
||||
["<leader>dso"] = {
|
||||
"<cmd> DapStepOver <CR>",
|
||||
"Debug step over each line"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.crates = {
|
||||
n = {
|
||||
["<leader>rcu"] = {
|
||||
M.dap_go = {
|
||||
plugin = true,
|
||||
n = {
|
||||
["<leader>dgt"] = {
|
||||
function ()
|
||||
require('crates').upgrade_all_crates()
|
||||
require('dap-go').debug_test()
|
||||
end,
|
||||
"update crates"
|
||||
"Debug go test"
|
||||
},
|
||||
["<leader>dgl"] = {
|
||||
function ()
|
||||
require('dap-go').debug_last()
|
||||
end,
|
||||
"Debug go test"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.gopher = {
|
||||
plugin = true,
|
||||
n = {
|
||||
["<leader>gsj"] = {
|
||||
"<cmd> GoTagAdd json <CR>",
|
||||
"Add json struct tags"
|
||||
},
|
||||
["<leader>gsy"] = {
|
||||
"<cmd> GoTagAdd yaml <CR>",
|
||||
"Add yaml struct tags"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,62 @@
|
|||
local plugins = {
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"gopls",
|
||||
"gofumpt",
|
||||
"goimports-reviser",
|
||||
"golines",
|
||||
"delve"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"rust-lang/rust.vim",
|
||||
ft = "rust",
|
||||
"mfussenegger/nvim-dap",
|
||||
init = function ()
|
||||
vim.g.rustfmt_autosave = 1
|
||||
require("core.utils").load_mappings("dap")
|
||||
end
|
||||
},
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
ft = "rust",
|
||||
dependencies = "neovim/nvim-lspconfig",
|
||||
"leoluz/nvim-dap-go",
|
||||
ft = "go",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
config = function (_, opts)
|
||||
require("dap-go").setup(opts)
|
||||
require("core.utils").load_mappings("dap_go")
|
||||
end
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function ()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"go"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
ft = "go",
|
||||
opts = function ()
|
||||
return require "custom.configs.rust-tools"
|
||||
return require "custom.configs.null-ls"
|
||||
end
|
||||
},
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function (_, opts)
|
||||
require("gopher").setup(opts)
|
||||
require("core.utils").load_mappings("gopher")
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require('rust-tools').setup(opts)
|
||||
end
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap"
|
||||
},
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
ft = {"rust", "toml"},
|
||||
config = function (_,opts)
|
||||
local crates = require('crates')
|
||||
crates.setup(opts)
|
||||
crates.show()
|
||||
end
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function ()
|
||||
local M = require "plugins.configs.cmp"
|
||||
table.insert(M.sources, {name = "crates"})
|
||||
return M
|
||||
build = function ()
|
||||
vim.cmd [[silent! GoInstallDeps]]
|
||||
end
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue