Restructure Darwin configuration

So far, this is just based on mightymac. The other devices will be
updated soon.
This commit is contained in:
Gene Liverman 2024-12-07 23:12:52 -05:00
parent ce3a1b5e20
commit f95cc09e13
45 changed files with 14 additions and 18 deletions

View file

@ -0,0 +1,31 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- make sure vim know I always have a dark terminal
vim.opt.background = "dark"
-- use spaces for tabs and whatnot
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.shiftround = true
-- make sure all the mouse stuff is on.
-- pressing alt to hightlight + copy/paste works like it does outside of nvim
vim.opt.mouse = "a"
vim.keymap.set("n", "<leader>h", ":nohlsearch<CR>")
vim.wo.relativenumber = true
vim.o.termguicolors = true
-- Tips from https://github.com/folke/edgy.nvim
-- views can only be fully collapsed with the global statusline
vim.opt.laststatus = 3
-- Default splitting will cause your main splits to jump when opening an edgebar.
-- To prevent this, set `splitkeep` to either `screen` or `topline`.
vim.opt.splitkeep = "screen"

View file

@ -0,0 +1,14 @@
return {'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true,
-- insert_at_start = true,
-- …etc.
},
}

View file

@ -0,0 +1,9 @@
return {
"sudormrfbin/cheatsheet.nvim",
dependencies = {
'nvim-telescope/telescope.nvim',
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
},
config = true,
}

View file

@ -0,0 +1,11 @@
return{
"nvim-tree/nvim-tree.lua",
config = function ()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require('nvim-tree').setup()
vim.keymap.set('n', '<c-n>', ':NvimTreeFindFileToggle<CR>')
end
}

View file

@ -0,0 +1,8 @@
return {
"Mofiqul/dracula.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("dracula")
end,
}

View file

@ -0,0 +1,11 @@
return {
"ellisonleao/gruvbox.nvim",
priority = 1000 ,
config = function ()
require("gruvbox").setup()
vim.o.background = "dark"
vim.o.termguicolors = true
vim.cmd.colorscheme "gruvbox"
end
}

View file

@ -0,0 +1,8 @@
return {
"rebelot/kanagawa.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme "kanagawa"
end,
}

View file

@ -0,0 +1,8 @@
return {
"nyoom-engineering/oxocarbon.nvim",
config = function ()
vim.o.background = "dark"
vim.o.termguicolors = true
vim.cmd.colorscheme "oxocarbon"
end
}

View file

@ -0,0 +1,10 @@
return {
-- the colorscheme should be available when starting Neovim
"folke/tokyonight.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- load the colorscheme here
vim.cmd.colorscheme "tokyonight-storm"
end,
}

View file

@ -0,0 +1,33 @@
return {
"goolord/alpha-nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.startify")
dashboard.section.header.val = {
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[  ]],
[[ ████ ██████ █████ ██ ]],
[[ ███████████ █████  ]],
[[ █████████ ███████████████████ ███ ███████████ ]],
[[ █████████ ███ █████████████ █████ ██████████████ ]],
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
[[ ]],
[[ ]],
[[ ]],
}
alpha.setup(dashboard.opts)
vim.cmd('autocmd User AlphaReady Neotree show')
end,
}

View file

@ -0,0 +1,49 @@
return {
"akinsho/bufferline.nvim",
after = "catppuccin",
dependencies = { "nvim-tree/nvim-web-devicons" },
version = "*",
config = function()
-- Get the color pallet of the theme flavor I am using
local color_palette = require("catppuccin.palettes").get_palette("frappe")
-- Set variables to use the color they'd use if the background was not transparent
local bg_highlight = color_palette.crust
local separator_fg = color_palette.crust
require("bufferline").setup({
highlights = require("catppuccin.groups.integrations.bufferline").get({
-- Copy settings from Catppuccin bufferline integration and override just the
-- part that is needed to make it look like it would if the background was not
-- set to transparent in catppuccin.lua
-- https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/groups/integrations/bufferline.lua
custom = {
all = {
-- this makes the background behind the tabs contrast with the tabs themselves
fill = { bg = bg_highlight },
-- separators
-- I am only overriding the foreground as that is what makes the tabs look correct
separator = { fg = separator_fg },
separator_visible = { fg = separator_fg },
separator_selected = { fg = separator_fg },
offset_separator = { fg = separator_fg },
},
},
}),
options = {
mode = "buffers",
separator_style = "slant",
offsets = {
{
filetype = "neo-tree",
text = "File Explorer",
highlight = "Directory",
separator = true,
},
},
diagnostics = "nvim_lsp",
},
})
end,
}

View file

@ -0,0 +1,57 @@
return {
"catppuccin/nvim",
name = "catppuccin",
flavour = "frappe", -- latte, frappe, macchiato, mocha
lazy = false,
priority = 1000,
config = function()
require("catppuccin").setup({
transparent_background = true,
color_overrides = {
frappe = {
base = "#07042B",
mantle = "#0c0746",
crust = "#10095d",
rosewater = "#FF7F7F", -- used for cursor
},
},
custom_highlights = function(colors)
return {
Comment = { fg = colors.subtext0 },
LineNr = { fg = colors.subtext0 },
}
end,
})
vim.cmd.colorscheme("catppuccin")
end,
--[[
-- original palette from frappe:
rosewater = "#f2d5cf",
flamingo = "#eebebe",
pink = "#f4b8e4",
mauve = "#ca9ee6",
red = "#e78284",
maroon = "#ea999c",
peach = "#ef9f76",
yellow = "#e5c890",
green = "#a6d189",
teal = "#81c8be",
sky = "#99d1db",
sapphire = "#85c1dc",
blue = "#8caaee",
lavender = "#babbf1",
text = "#c6d0f5",
subtext1 = "#b5bfe2",
subtext0 = "#a5adce",
overlay2 = "#949cbb",
overlay1 = "#838ba7",
overlay0 = "#737994",
surface2 = "#626880",
surface1 = "#51576d",
surface0 = "#414559",
base = "#303446",
mantle = "#292c3c",
crust = "#232634",
--]]
}

View file

@ -0,0 +1,49 @@
return {
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{
name = "nvim_lsp",
entry_filter = function(entry)
return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= "Text"
end,
},
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
})
end,
},
{
"hrsh7th/cmp-nvim-lsp",
},
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
},
},
}

View file

@ -0,0 +1,65 @@
return {
"folke/edgy.nvim",
event = "VeryLazy",
opts = {
exit_when_last = false,
bottom = {
-- toggleterm / lazyterm at the bottom with a height of 40% of the screen
{
ft = "toggleterm",
size = { height = 0.2 },
-- exclude floating windows
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
"Trouble",
{ ft = "qf", title = "QuickFix" },
{
ft = "help",
size = { height = 20 },
-- only show help buffers
filter = function(buf)
return vim.bo[buf].buftype == "help"
end,
},
{ ft = "spectre_panel", size = { height = 0.4 } },
},
left = {
-- Neo-tree filesystem always takes half the screen height
{
title = "Neo-Tree",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "filesystem"
end,
size = { height = 0.5 },
},
{
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
},
{
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
},
{
ft = "Outline",
pinned = true,
open = "SymbolsOutlineOpen",
},
-- any other neo-tree windows
"neo-tree",
},
},
}

View file

@ -0,0 +1,38 @@
return {
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
current_line_blame = true,
})
vim.keymap.set("n", "<leader gp", ":Gitsigns preview_hunk<CR>", {})
end,
},
{
"tpope/vim-fugitive",
},
{
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
config = function()
require("telescope").load_extension("lazygit")
end,
},
}

View file

@ -0,0 +1,65 @@
return {
{
"williamboman/mason.nvim",
config = true,
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lemminx", -- xml
"lua_ls", -- lua
"nil_ls", -- nix
"puppet", -- puppet
"ruff", -- python
},
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local on_attach = function(_, _)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {})
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {})
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, {})
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
end
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.lemminx.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = { Lua = { diagnostics = { globals = { "vim" } } } },
})
lspconfig.nil_ls.setup({
capabilities = capabilities,
on_attach = on_attach,
})
local puppet_languageserver = vim.fn.expand(
"$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver"
)
lspconfig.puppet.setup({
capabilities = capabilities,
on_attach = on_attach,
cmd = { puppet_languageserver, "--feature-flags=puppetstrings" },
settings = { puppet = { editorServices = { formatOnType = { enable = true } } } },
})
lspconfig.ruff.setup({ on_attach = on_attach })
end,
},
}

View file

@ -0,0 +1,19 @@
return {
"nvim-lualine/lualine.nvim",
config = function()
require("lualine").setup({
options = {
icons_enabled = true,
-- theme = "dracula-nvim",
},
sections = {
lualine_a = {
{
"filename",
path = 1,
},
},
},
})
end,
}

View file

@ -0,0 +1,24 @@
return {
"nvim-neo-tree/neo-tree.nvim",
lazy = false,
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.keymap.set("n", "<C-n>", ":Neotree toggle<CR>", {})
require("neo-tree").setup({
filesystem = {
follow_current_file = {
enabled = true,
},
hijack_netrw_behavior = "open_default",
},
follow_current_file = { enabled = true },
})
end,
}

View file

@ -0,0 +1,61 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
-- add any options here
},
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
-- "rcarriga/nvim-notify",
},
config = function()
require("noice").setup({
cmdline = { enabled = true },
messages = { enabled = false },
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
views = {
cmdline_popup = {
position = {
row = "50%",
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = "61%",
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
})
end,
}

View file

@ -0,0 +1,40 @@
return {
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
},
config = function()
require("mason-null-ls").setup({
ensure_installed = {
"prettier", -- HTML, JS, JSON, etc.
"stylua", -- LUA
},
})
end,
},
{
-- none-ls replaces null_ls... it's weird
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.puppet_lint,
null_ls.builtins.diagnostics.rubocop,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.puppet_lint,
null_ls.builtins.formatting.rubocop,
null_ls.builtins.formatting.stylua,
},
})
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
},
}

View file

@ -0,0 +1,4 @@
return {
"nvim-tree/nvim-web-devicons",
config = true,
}

View file

@ -0,0 +1,40 @@
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
-- This is your opts table
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
},
},
})
-- load_extension, somewhere after setup function:
require("telescope").load_extension("cheat")
require("telescope").load_extension("ui-select")
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ts", ":Telescope<CR>")
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
vim.keymap.set("n", "<leader><leader>", builtin.oldfiles, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
end,
},
{
"nvim-telescope/telescope-cheat.nvim",
dependencies = {
"kkharji/sqlite.lua",
"nvim-telescope/telescope.nvim",
},
},
{ "nvim-telescope/telescope-symbols.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
}

View file

@ -0,0 +1,9 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
}

View file

@ -0,0 +1,5 @@
return {
"akinsho/toggleterm.nvim",
version = "*",
config = true,
}

View file

@ -0,0 +1,53 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
sync_install = false,
ensure_installed = {
"bash",
"css",
"csv",
"diff",
"dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitignore",
"go",
"hcl",
"hocon",
"html",
"javascript",
"json",
"lua",
"make",
"markdown",
"markdown_inline",
"nix",
"passwd",
"promql",
"puppet",
"python",
"regex",
--"pip_requirements",
"ruby",
"sql",
"ssh_config",
"terraform",
"toml",
"tsv",
"typescript",
"udev",
"vim",
"vimdoc",
"xml",
"yaml",
},
})
end,
}

View file

@ -0,0 +1,5 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = true,
}

View file

@ -0,0 +1,3 @@
return {
"christoomey/vim-tmux-navigator",
}

View file

@ -0,0 +1,4 @@
return {
"folke/which-key.nvim",
config = true,
}