mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2024-11-21 05:58:06 +01:00
Compare commits
3 commits
23872d465d
...
b1efeb328f
Author | SHA1 | Date | |
---|---|---|---|
b1efeb328f | |||
50d0e88606 | |||
9af3b97d36 |
10 changed files with 13 additions and 302 deletions
4
dot_config/fish/private_functions/dark.fish
Normal file
4
dot_config/fish/private_functions/dark.fish
Normal 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
|
4
dot_config/fish/private_functions/light.fish
Normal file
4
dot_config/fish/private_functions/light.fish
Normal 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
|
5
dot_config/fish/private_functions/update_nvim_theme.fish
Normal file
5
dot_config/fish/private_functions/update_nvim_theme.fish
Normal 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
|
|
@ -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
|
|
@ -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
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue