Compare commits

..

3 commits

10 changed files with 13 additions and 302 deletions

View file

@ -0,0 +1,4 @@
function dark --description 'Set shell theme to dark mode, including neovim'
yes | fish_config theme save "Catppuccin Mocha"
update_nvim_theme dark
end

View file

@ -0,0 +1,4 @@
function light --description 'Set shell theme to light mode, including neovim'
yes | fish_config theme save "Catppuccin Latte"
update_nvim_theme light
end

View file

@ -0,0 +1,5 @@
function update_nvim_theme --description 'Update neovim theme with light/dark mode' --argument theme
for addr in /var/folders/7r/l55lwv013hl_g8gc971k7kgw0000gn/T/nvim.gaugendre/**/*
nvim --server $addr --remote-send ":set background=$theme <cr>"
end
end

View file

@ -1,7 +0,0 @@
function update_theme --on-variable macOS_Theme
if [ "$macOS_Theme" = "dark" ]
yes | fish_config theme save "Catppuccin Mocha"
else if [ "$macOS_Theme" = "light" ]
yes | fish_config theme save "Catppuccin Latte"
end
end

View file

@ -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

View file

@ -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,
}
}
}
}

View file

@ -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

View file

@ -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

View file

@ -1,107 +0,0 @@
local M = {}
M.dap = {
plugin = true,
n = {
["<leader>db"] = {
"<cmd> DapToggleBreakpoint <CR>",
"Add breakpoint at line"
},
["<leader>dc"] = {
"<cmd> DapContinue <CR>",
"Debug - continue"
},
["<leader>dsi"] = {
"<cmd> DapStepInto <CR>",
"Debug - step into"
},
["<leader>dn"] = {
"<cmd> DapStepOver <CR>",
"Debug - step over (next)"
},
["<leader>dso"] = {
"<cmd> DapStepOut <CR>",
"Debug - step out"
},
["<leader>dt"] = {
"<cmd> DapTerminate <CR>",
"Debug - terminate"
},
["<leader>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 = {
["<leader>dgt"] = {
function()
require("dap-go").debug_test()
end,
"Debug go test"
},
["<leader>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 = {
["<Esc>"] = {"<C-\\><C-n>"}
}
}
M.general = {
i = {
["<C-a>"] = { "<ESC>^i", "Beginning of line" },
}
}
M.nvterm = {
n = {
["<leader>ti"] = {
function()
require("nvterm.terminal").toggle "float"
end,
"Toggle floating term"
},
["<leader>tv"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"Toggle vertical term"
},
["<leader>th"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"Toggle horizontal term"
},
}
}
return M

View file

@ -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 = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
},
},
{
"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