feat: add Dockerfile for easier project setup
This commit is contained in:
1 parent
087a24541f
commit
a89862a187
25 files changed
+1744
-1014
No files matched your search
+97
-83
@@ -1,87 +1,101 @@
|
||||
-- This will run last in the setup process and is a good place to configure
|
||||
-- things like custom filetypes. This just pure lua so anything that doesn't
|
||||
-- fit in the normal config locations above can go here
|
||||
-- Map <C-/> to toggle Aider terminal in all modes
|
||||
require("telescope").setup {
|
||||
pickers = {
|
||||
oldfiles = {
|
||||
cwd_only = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
-- Polish configuration: Final setup and overrides
|
||||
-- This runs last in the setup process
|
||||
|
||||
require("overseer").setup {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = false,
|
||||
size = vim.o.columns * 0.25,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
}
|
||||
-- Remove <leader>h mapping (conflicts with Telescope)
|
||||
vim.api.nvim_del_keymap("n", "<leader>h")
|
||||
|
||||
require("nvim_aider").setup {
|
||||
-- Command that executes Aider
|
||||
aider_cmd = "aider",
|
||||
-- Command line arguments passed to aider
|
||||
args = {
|
||||
"--no-auto-commits",
|
||||
"--pretty",
|
||||
"--stream",
|
||||
"--dark-mode", -- Enable dark mode in Aider
|
||||
},
|
||||
-- Theme colors (dark mode palette)
|
||||
theme = {
|
||||
-- Dark mode-friendly colors
|
||||
user_input_color = "#a6da95", -- Soft green for user input
|
||||
tool_output_color = "#8aadf4", -- Soft blue for tool output
|
||||
tool_error_color = "#ed8796", -- Soft red for errors
|
||||
tool_warning_color = "#eed49f", -- Soft yellow for warnings
|
||||
assistant_output_color = "#c6a0f6", -- Soft purple for assistant output
|
||||
completion_menu_color = "#a5adcb", -- Slightly dimmer text for completion menu
|
||||
completion_menu_bg_color = "#1e1e2e", -- Darker background for completion menu
|
||||
completion_menu_current_color = "#89dceb", -- Cyan for selected item
|
||||
completion_menu_current_bg_color = "#313244", -- Slightly lighter than bg for selection
|
||||
},
|
||||
-- snacks.picker.layout.Config configuration
|
||||
picker_cfg = {
|
||||
preset = "vscode",
|
||||
-- Add dark mode settings for picker
|
||||
theme = "dark",
|
||||
},
|
||||
-- Other snacks.terminal.Opts options
|
||||
config = {
|
||||
os = { editPreset = "nvim-remote" },
|
||||
gui = {
|
||||
nerdFontsVersion = "3",
|
||||
theme = "dark", -- Ensure terminal uses dark theme
|
||||
-- Overseer setup and template (optional)
|
||||
local ok_overseer, overseer = pcall(require, "overseer")
|
||||
if ok_overseer then
|
||||
overseer.setup {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = false,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
direction = "vertical",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
term = {
|
||||
-- Terminal settings for better dark mode appearance
|
||||
defaultBg = "#1e1e2e", -- Dark background
|
||||
defaultFg = "#cdd6f4", -- Light text color
|
||||
},
|
||||
},
|
||||
win = {
|
||||
wo = {
|
||||
winbar = "Aider",
|
||||
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", -- Ensure proper highlighting
|
||||
},
|
||||
position = "right",
|
||||
width = 0.33, -- This will make the terminal take up 1/3 of the total window width
|
||||
-- Additional window settings for dark mode
|
||||
border = "rounded", -- Rounded borders look nice in dark mode
|
||||
style = "minimal", -- Minimal UI style
|
||||
},
|
||||
-- Additional dark mode settings
|
||||
appearance = {
|
||||
dark_mode = true, -- Explicitly set dark mode
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- This will run last in the setup process and is a good place to configure
|
||||
-- things like custom filetypes. This is just pure lua so anything that doesn't
|
||||
-- fit in the normal config locations above can go here
|
||||
-- ToggleTerm setup (optional)
|
||||
local ok_toggleterm, toggleterm = pcall(require, "toggleterm")
|
||||
if ok_toggleterm then
|
||||
toggleterm.setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return math.floor(vim.o.columns * 0.35)
|
||||
else
|
||||
return 20
|
||||
end
|
||||
end,
|
||||
shade_terminals = false,
|
||||
start_in_insert = true,
|
||||
}
|
||||
end
|
||||
|
||||
-- Register Devbox template for Overseer (if available)
|
||||
if ok_overseer then
|
||||
overseer.register_template {
|
||||
name = "devbox",
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
optional = false,
|
||||
desc = "The devbox script to run",
|
||||
},
|
||||
},
|
||||
condition = {
|
||||
callback = function()
|
||||
if vim.fn.executable "git" == 0 then return false, "git not found" end
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then return false, "Not in a git repository" end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
if vim.fn.filereadable(devbox_file) == 0 then return false, "No devbox.json found in git root" end
|
||||
if vim.fn.executable "devbox" == 0 then return false, "devbox command not found" end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
generator = function(_, cb)
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
|
||||
local file = io.open(devbox_file, "r")
|
||||
if not file then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local content = file:read "*all"
|
||||
file:close()
|
||||
local ok, data = pcall(vim.json.decode, content)
|
||||
if not ok or not data then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
|
||||
local tasks = {}
|
||||
if data.shell and data.shell.scripts then
|
||||
for script_name, _ in pairs(data.shell.scripts) do
|
||||
table.insert(tasks, {
|
||||
name = "devbox run " .. script_name,
|
||||
builder = function() return { cmd = { "devbox" }, args = { "run", script_name }, cwd = git_root } end,
|
||||
})
|
||||
end
|
||||
end
|
||||
table.insert(tasks, {
|
||||
name = "devbox shell",
|
||||
builder = function() return { cmd = { "devbox" }, args = { "shell" }, cwd = git_root } end,
|
||||
})
|
||||
cb(tasks)
|
||||
end,
|
||||
}
|
||||
end
|
||||
Reference in new issue
Block a user