mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2024-11-24 15:38:06 +01:00
Compare commits
No commits in common. "b1efeb328f6b4ac7fb155b9f18e4e95c3f2b0d92" and "23872d465d764482dc07e1c457c75042f976263c" have entirely different histories.
b1efeb328f
...
23872d465d
10 changed files with 302 additions and 13 deletions
|
@ -1,4 +0,0 @@
|
|||
function dark --description 'Set shell theme to dark mode, including neovim'
|
||||
yes | fish_config theme save "Catppuccin Mocha"
|
||||
update_nvim_theme dark
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function light --description 'Set shell theme to light mode, including neovim'
|
||||
yes | fish_config theme save "Catppuccin Latte"
|
||||
update_nvim_theme light
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
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
|
7
dot_config/fish/private_functions/update_theme.fish
Normal file
7
dot_config/fish/private_functions/update_theme.fish
Normal file
|
@ -0,0 +1,7 @@
|
|||
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
|
24
dot_config/nvim/lua/custom/chadrc.lua
Normal file
24
dot_config/nvim/lua/custom/chadrc.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
---@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
|
23
dot_config/nvim/lua/custom/configs/lspconfig.lua
Normal file
23
dot_config/nvim/lua/custom/configs/lspconfig.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
27
dot_config/nvim/lua/custom/configs/null-ls.lua
Normal file
27
dot_config/nvim/lua/custom/configs/null-ls.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
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
|
14
dot_config/nvim/lua/custom/configs/nvim-dap-ui.lua
Normal file
14
dot_config/nvim/lua/custom/configs/nvim-dap-ui.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
|
107
dot_config/nvim/lua/custom/mappings.lua
Normal file
107
dot_config/nvim/lua/custom/mappings.lua
Normal file
|
@ -0,0 +1,107 @@
|
|||
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
|
100
dot_config/nvim/lua/custom/plugins.lua
Normal file
100
dot_config/nvim/lua/custom/plugins.lua
Normal file
|
@ -0,0 +1,100 @@
|
|||
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
|
Loading…
Reference in a new issue