19 Commits

Author SHA1 Message Date
86422bd68b feat: Adds kubectl completions to zshrc. 2025-01-29 13:41:26 -05:00
95139d50ba feat: Adds leaf autocommand to set the filetype to html for better highlight groups. 2025-01-05 13:14:26 -05:00
15b1aded69 feat: Adds ask-gpt script. 2025-01-03 16:12:56 -05:00
dcac27db37 feat: Updates nvim config to include ghostty config highlighting 2025-01-03 13:44:02 -05:00
a71ae05e5b feat: Adds ghostty config syntax highlighting. 2025-01-02 17:46:57 -05:00
9a1b00610e feat adds render-markdown.nvim plugin 2025-01-02 17:46:57 -05:00
4f47e288ea feat: Ghostty config changes. 2024-12-31 07:57:38 -05:00
963fcd2810 feat: Adds mini-ai, ghostty config updates, tmux config updates. 2024-12-29 09:07:18 -05:00
9ead148f34 feat: More ghostty config and updates tmux config to allow image pass through. 2024-12-26 18:57:33 -05:00
0d8364eaf9 feat: Adds ghostty config 2024-12-26 18:26:51 -05:00
4d42fa4dab feat: Adds brew-update function 2024-12-25 16:02:39 -05:00
f23adad4b0 feat: Disables blink.cmp 2024-12-23 08:46:59 -05:00
44f5c35d38 feat: Luasnip working with blink.cmp 2024-12-21 20:10:28 -05:00
25ddde6e12 feat: Updates todo comments. 2024-12-20 22:16:04 -05:00
4a023203bd feat: Adds filetype to xcodebuild.nvim plugin for lazy loading 2024-12-20 10:01:24 -05:00
5f07ffede9 fix: Fixes luasnip not loading custom snippets. 2024-12-20 09:55:53 -05:00
6cdf85b4e3 feat: Reworking nvim configuration 2024-12-20 09:48:54 -05:00
876e7f6d0e feat: Rearranges nvim configuration 2024-12-20 08:13:43 -05:00
b78fb64bd3 feat: Rearranges nvim configuration 2024-12-20 08:10:53 -05:00
57 changed files with 1075 additions and 909 deletions

24
ghostty/config Normal file
View File

@@ -0,0 +1,24 @@
theme = catppuccin-mocha
confirm-close-surface = false
font-size = 15
font-thicken = false
window-save-state = always
# NOTE: This setting removes tabs, rounded borders, and window controls.
# Also makes some of the below macos-titlebar-* things not matter, but
# will take affect if this is set to true.
window-decoration = false
copy-on-select = true
quit-after-last-window-closed = true
macos-auto-secure-input = true
macos-non-native-fullscreen = visible-menu
macos-titlebar-style = transparent
macos-titlebar-proxy-icon = hidden
macos-icon = custom-style
keybind = super+shift+t=toggle_quick_terminal

View File

@@ -15,11 +15,6 @@
[color]
ui = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = gopass

View File

@@ -7,28 +7,35 @@ local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local t = ls.text_node
local fmt = require("luasnip.extras.fmt").fmt
ls.add_snippets("lua", {
-- Setup a new snippet file.
s("sf", {
t({
"-- Setup snippets.",
'local ls = require("luasnip")',
"local s = ls.snippet",
"local sn = ls.snippet_node",
"local ms = ls.multi_snippet",
"local i = ls.insert_node",
"local f = ls.function_node",
"local c = ls.choice_node",
"local t = ls.text_node",
"-- Add snippets",
}),
t('ls.add_snippets("'),
i(1, "<file-type>"),
t({
'", {',
"\t-- Define snippets here.",
"})",
}),
}),
-- Setup a new snippet file.
s("sf", {
t({
"-- Setup snippets.",
'local ls = require("luasnip")',
"local s = ls.snippet",
"local sn = ls.snippet_node",
"local ms = ls.multi_snippet",
"local i = ls.insert_node",
"local f = ls.function_node",
"local c = ls.choice_node",
"local t = ls.text_node",
"-- Add snippets",
}),
t('ls.add_snippets("'),
i(1, "<file-type>"),
t({
'", {',
"\t-- Define snippets here.",
"})",
}),
}),
s("c", {
c(1, {
fmt("{}", { i(1), t("debug") }),
fmt("{}", { i(1), t("warning") }),
}),
}),
})

View File

@@ -7,16 +7,16 @@ vim.g.maplocalleader = " "
-- file for projects.
-- Common settings
require("user.settings")
require("config.settings")
-- Auto commands
require("user.autocmd")
require("config.autocmd")
-- Plugins
require("user.plugins")
require("config.lazy")
-- Key maps
require("user.keymaps")
require("config.keymaps")
-- Theme (must stay after plugins are loaded)
require("user.theme")
require("config.theme")

View File

@@ -33,6 +33,14 @@ createCmd("BufWritePre", {
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
})
-- Leaf
createCmd({ "BufRead", "BufNewFile" }, {
pattern = "*.leaf",
callback = function()
vim.opt.filetype = "html"
end,
})
vim.api.nvim_exec2(
[[
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""

View File

@@ -0,0 +1,82 @@
-- Bootstrap Lazy.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
dev = {
path = "~/LocalProjects/plugins",
fallback = true,
},
-- Import all the plugin configs in the 'plugin' directory
{ import = "plugins" },
-- Plugins that don't have a configuration file.
{
"folke/zen-mode.nvim",
opts = {},
},
{
"christoomey/vim-tmux-navigator",
lazy = false,
},
{ "NoahTheDuke/vim-just", ft = { "just" } },
{
"chipsenkbeil/distant.nvim",
version = "v0.*",
event = "VeryLazy",
},
{
"echasnovski/mini.ai",
version = "*",
config = function()
require("mini.ai").setup({})
end,
},
{
"vhyrro/luarocks.nvim",
priority = 1001, -- this plugin needs to run before anything else
opts = {
rocks = { "magick" },
},
},
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
{
"MeanderingProgrammer/render-markdown.nvim",
-- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
opts = {},
},
}, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
rocks = {
hererocks = true, -- recommended if you do not have global installation of Lua 5.1.
},
})
vim.keymap.set("n", "<leader>ll", "<CMD>Lazy<CR>", { desc = "Open [L]azy" })

View File

@@ -0,0 +1,61 @@
-- https://cmp.saghen.dev/
return {
{
"saghen/blink.cmp",
enabled = false,
dependencies = {
-- "rafamadriz/friendly-snippets",
{ "L3MON4D3/LuaSnip", version = "v2.*" },
},
version = "v0.*",
opts = {
signature = { enabled = true },
sources = {
default = { "lsp", "path", "snippets", "buffer", "luasnip" },
providers = {
lsp = {
name = "lsp",
enabled = true,
module = "blink.cmp.sources.lsp",
score_offset = 1000, -- higher = higher priority
},
luasnip = {
name = "luasnip",
enabled = true,
module = "blink.cmp.sources.luasnip",
score_offset = 950,
},
snippets = {
name = "snippets",
enabled = true,
module = "blink.cmp.sources.snippets",
score_offset = 900,
},
},
},
snippets = {
expand = function(snippet)
require("luasnip").lsp_expand(snippet)
end,
active = function(filter)
if filter and filter.direction then
return require("luasnip").jumpable(filter.direction)
end
return require("luasnip").in_snippet()
end,
jump = function(direction)
require("luasnip").jump(direction)
end,
},
},
opts_extend = { "sources.default" },
keymap = {
preset = "default",
["<Tab>"] = {},
["<S-Tab>"] = {},
["<C-b>"] = { "snippet_backward", "fallback" },
["<C-f>"] = { "snippet_forward", "fallback" },
},
},
}

View File

@@ -3,6 +3,8 @@ return {
enabled = true,
event = "VeryLazy",
dependencies = {
"MeanderingProgrammer/render-markdown.nvim",
"folke/lazydev.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
@@ -74,8 +76,10 @@ return {
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "lazydev", group_index = 0 },
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "render-markdown" }, -- markdown
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),

View File

@@ -1,7 +1,7 @@
return {
'numToStr/Comment.nvim',
event = { 'BufReadPre', 'BufNewFile' },
opts = {
-- add any options here
},
event = { 'BufReadPre', 'BufNewFile' },
}

View File

@@ -0,0 +1,20 @@
return {
"j-hui/fidget.nvim",
event = "VeryLazy",
opts = {
notification = {
window = {
normal_hl = "String", -- Base highlight group in the notification window
winblend = 0, -- Background color opacity in the notification window
border = "rounded", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 1, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
},
}

View File

@@ -1,7 +1,19 @@
return {
"mhartington/formatter.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
keys = {
{
"<leader>f",
":Format",
desc = "[F]ormat",
},
{
"<leader>F",
":FormatWrite",
desc = "[F]ormat write",
},
},
config = function(_, opts)
local util = require("formatter.util")
require("formatter").setup({
filetype = {
@@ -50,13 +62,6 @@ return {
},
})
-- Keymaps
local wk = require("which-key")
wk.add({
{ "<space>f", ":Format", desc = "[F]ormat" },
{ "<space>F", ":FormateWrite", desc = "[F]ormat write" },
}, { mode = "n", silent = true })
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd

View File

@@ -0,0 +1,5 @@
return {
"ghostty",
dir = vim.env.GHOSTTY_PATH .. "/Contents/Resources/vim/vimfiles/",
lazy = false,
}

View File

@@ -0,0 +1,86 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local harpoon = require("harpoon")
harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
key = function()
return vim.loop.cwd()
end,
},
})
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers")
.new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
})
:find()
end
-- Keymaps
vim.keymap.set("n", "<C-e>", function()
toggle_telescope(harpoon:list())
end, { desc = "Open Harpoon window" })
vim.keymap.set("n", "<leader>a", function()
harpoon:list():add()
end, { desc = "[A]dd to harpoon list." })
vim.keymap.set("n", "<C-e>", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = "Toggle quick menu." })
-- Buffer key maps. Currently keeping all buffer movements
-- isolated to top left row of keys on keyboard and all begin
-- with the <Control> key.
-- Select buffer numbers.
vim.keymap.set("n", "<A-y>", function()
harpoon:list():select(1)
end, { desc = "Select first harpoon buffer." })
vim.keymap.set("n", "<A-u>", function()
harpoon:list():select(2)
end, { desc = "Select second harpoon buffer." })
vim.keymap.set("n", "<A-i>", function()
harpoon:list():select(3)
end, { desc = "Select third harpoon buffer." })
vim.keymap.set("n", "<A-o>", function()
harpoon:list():select(4)
end, { desc = "Select fourth harpoon buffer." })
-- Toggle previous and next buffers.
vim.keymap.set("n", "<C-[>", function()
harpoon:list():prev()
end, { desc = "[P]revious harpoon buffer." })
vim.keymap.set("n", "<C-]>", function()
harpoon:list():next()
end, { desc = "[N]ext harpoon buffer." })
-- Extensions
harpoon:extend({
UI_CREATE = function(cx)
vim.keymap.set("n", "<C-v>", function()
harpoon.ui:select_menu_item({ vsplit = true })
end, { buffer = cx.buffer, desc = "Open in [V]split" })
end,
})
end,
}

View File

@@ -0,0 +1,45 @@
return {
"3rd/image.nvim",
event = "VeryLazy",
dependencies = {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "markdown" },
highlight = { enable = true },
})
end,
},
},
opts = {
backend = "kitty",
--backend = "ueberzug",
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = true,
floating_windows = true,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "norg" },
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
editor_only_render_when_focused = true, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
kitty_method = "normal",
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
},
}

118
nvim/m-housh/lua/plugins/lsp.lua Executable file
View File

@@ -0,0 +1,118 @@
return {
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
-- "saghen/blink.cmp",
{ "antosha417/nvim-lsp-file-operations", config = true },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"bashls",
"clangd",
"dockerls",
"gopls",
"jinja_lsp",
"jqls",
"jsonls",
"ltex",
"lua_ls",
"marksman",
"yamlls",
},
automatic_installation = true,
})
local lspconfig = require("lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_nvim_lsp.default_capabilities()
-- local capabilities = require("blink.cmp").get_lsp_capabilities()
local opts = { noremap = true, silent = true }
local on_attach = function(_, bufnr)
opts.buffer = bufnr
opts.desc = "Show line diagnostics"
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
opts.desc = "Show diagnostics in Telescope"
vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show documentation for what is under cursor"
vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
opts.desc = "[G]oto [D]efinition"
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
opts.desc = "[G]oto [D]eclaration"
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "[G]oto [R]eferences"
vim.keymap.set("n", "gr", "<CMD>Telescope lsp_references<CR>", opts)
opts.desc = "LSP [C]ode [A]ction"
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
--opts.desc = "[R]e-[N]ame"
--vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "[R]eload or start LSP"
vim.keymap.set({ "n", "x" }, "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
opts.desc = "Goto previous diagnostic"
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
opts.desc = "Goto next diagnostic"
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
end
-- The language servers to setup.
local lsp_servers = {
"bashls",
"clangd",
"dockerls",
"gopls",
"jsonls",
"lua_ls",
"marksman",
"sourcekit",
"yamlls",
}
for _, lsp in ipairs(lsp_servers) do
lspconfig[lsp].setup({
capabilities = capabilities,
on_attach = on_attach,
on_init = function(client)
-- HACK: to fix some issues with LSP
-- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
client.offset_encoding = "utf-8"
end,
cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
})
end
-- nice icons
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
end,
},
}

View File

@@ -0,0 +1,69 @@
local function xcodebuild_device()
if vim.g.xcodebuild_platform == "macOS" then
return " macOS"
end
if vim.g.xcodebuild_os then
return "" .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
end
return "" .. vim.g.xcodebuild_device_name
end
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
globalstatus = true,
theme = "auto",
symbols = {
alternate_file = "#",
directory = "",
readonly = "",
unnamed = "[No Name]",
newfile = "[New]",
},
disabled_buftypes = { "quickfix", "prompt" },
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
-- { "mode" },
{ "filename" },
},
lualine_b = {
{ "diagnostics" },
{ "diff" },
{
"searchcount",
maxcount = 999,
timeout = 500,
},
},
lualine_c = {},
lualine_x = {
{ "' ' .. vim.g.xcodebuild_last_status", color = { fg = "#a6e3a1" } },
-- { "'󰙨 ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
{ xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
},
lualine_y = {
{ "branch" },
},
lualine_z = {
{ "location" },
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
},
}

View File

@@ -0,0 +1,55 @@
return {
"L3MON4D3/LuaSnip",
version = "v2.*",
event = "VeryLazy",
keys = {
{
"<C-k>",
mode = { "i", "s" },
function()
local ls = require("luasnip")
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end,
},
{
"<C-j>",
mode = { "i", "s" },
function()
local ls = require("luasnip")
if ls.jumpable(-1) then
ls.jump(-1)
end
end,
},
{
"<C-n>",
mode = { "i", "s" },
function()
local ls = require("luasnip")
if ls.choice_active() then
ls.change_choice(1)
end
end,
},
},
config = function()
local ls = require("luasnip")
ls.setup({
history = true,
enable_autosnippets = false,
updatevents = "TextChanged,TextChangedI",
extra_opts = {
[require("luasnip.util.types").choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
},
},
})
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
end,
}

View File

@@ -0,0 +1,46 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
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",
},
opts = {
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,
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
signature = { enabled = false },
},
routes = {
{ -- enables messages for showing macro recording.
view = "notify",
filter = { event = "msg_showmode" },
},
{ -- Hide the written messages.
view = "notify",
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
},
}

View File

@@ -0,0 +1,38 @@
return {
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["<C-v>"] = {
"actions.select",
opts = { vertical = true },
desc = "Open the entry in a vertical split",
},
},
view_options = {
is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- Don't show .DS_Store in output.
local is_ds_store = name ~= ".DS_Store"
return not is_ds_store
end,
},
},
keys = {
-- Show the parent directory in current window.
{ "-", "<CMD>Oil<CR>", desc = "Open directory." },
-- Open parent directory in floating window.
{
"<leader>-",
function()
require("oil").toggle_float()
end,
desc = "Open directory in float.",
},
},
}

View File

@@ -0,0 +1,8 @@
return {
"sotte/presenting.nvim",
opts = {
-- fill in your options here
-- see :help Presenting.config
},
cmd = { "Presenting" },
}

View File

@@ -0,0 +1,49 @@
return {
"folke/todo-comments.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
opts = {
keywords = {
-- Adds the important keyword, I primarily use this in markdown
-- documents to be able to jump and color appropriately.
FIX = { alt = { "IMPORTANT" } },
-- Adds mark keyword, used in swift.
NOTE = { alt = { "MARK" } },
},
},
keys = {
{
"<leader>tq",
"<CMD>Trouble todo toggle<CR>",
desc = "Todo quick fix list.",
},
{
"<leader><leader>t",
"<CMD>TodoTelescope<CR>",
desc = "Todo telescope list.",
},
{
"<leader>tl",
"<CMD>TodoLocList<CR>",
desc = "Todo location list.",
},
{
"]t",
function()
require("todo-comments").jump_next()
end,
desc = "Next todo.",
},
{
"[t",
function()
require("todo-comments").jump_prev()
end,
desc = "Previous todo.",
},
},
}

View File

@@ -0,0 +1,76 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
"nvim-treesitter/nvim-treesitter-textobjects",
},
build = ":TSUpdate",
event = { "BufReadPre", "BufNewFile" },
opts = {
ensure_installed = {
"bash",
"cmake",
"dockerfile",
"go",
"hcl",
"html",
"java",
"javascript",
"json",
"latex",
"ledger",
"llvm",
"lua",
"make",
"markdown",
"python",
"swift",
"toml",
"xml",
"yaml",
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = {}, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = {}, -- list of language that will be disabled
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
scope_incremental = "<CR>",
node_incremental = "<TAB>",
node_decremental = "<S-TAB>",
},
},
indent = { enable = true },
autopairs = { { enable = true } },
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
["ir"] = "@parameter.inner",
["ar"] = "@parameter.outer",
["a="] = "@assignment.outer",
["i="] = "@assignment.inner",
},
},
},
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 2000, -- Do not enable for files with more than specified lines
},
},
}

View File

@@ -0,0 +1,16 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
preset = "helix",
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}

View File

@@ -1,57 +1,58 @@
local progress_handle
return {
"wojciech-kulik/xcodebuild.nvim",
event = "VeryLazy",
--branch = "fix/issue-249",
dependencies = {
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
config = function()
require("xcodebuild").setup({
show_build_progress_bar = false,
logs = {
auto_open_on_success_tests = false,
auto_open_on_failed_tests = false,
auto_open_on_success_build = false,
auto_open_on_failed_build = false,
auto_focus = false,
auto_close_on_app_launch = true,
only_summary = true,
notify = function(message, severity)
local fidget = require("fidget")
if progress_handle then
progress_handle.message = message
if not message:find("Loading") then
progress_handle:finish()
progress_handle = nil
if vim.trim(message) ~= "" then
fidget.notify(message, severity)
end
end
else
fidget.notify(message, severity)
end
end,
notify_progress = function(message)
local progress = require("fidget.progress")
"wojciech-kulik/xcodebuild.nvim",
--event = "VeryLazy",
ft = "swift",
--branch = "fix/issue-249",
dependencies = {
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
config = function()
require("xcodebuild").setup({
show_build_progress_bar = false,
logs = {
auto_open_on_success_tests = false,
auto_open_on_failed_tests = false,
auto_open_on_success_build = false,
auto_open_on_failed_build = false,
auto_focus = false,
auto_close_on_app_launch = true,
only_summary = true,
notify = function(message, severity)
local fidget = require("fidget")
if progress_handle then
progress_handle.message = message
if not message:find("Loading") then
progress_handle:finish()
progress_handle = nil
if vim.trim(message) ~= "" then
fidget.notify(message, severity)
end
end
else
fidget.notify(message, severity)
end
end,
notify_progress = function(message)
local progress = require("fidget.progress")
if progress_handle then
progress_handle.title = ""
progress_handle.message = message
else
progress_handle = progress.handle.create({
message = message,
lsp_client = { name = "xcodebuild.nvim" },
})
end
end,
},
code_coverage = {
enabled = true,
},
})
if progress_handle then
progress_handle.title = ""
progress_handle.message = message
else
progress_handle = progress.handle.create({
message = message,
lsp_client = { name = "xcodebuild.nvim" },
})
end
end,
},
code_coverage = {
enabled = true,
},
})
-- stylua: ignore start
vim.keymap.set("n", "<leader>X", "<cmd>XcodebuildPicker<cr>", { desc = "Show Xcodebuild Actions" })
@@ -77,5 +78,5 @@ return {
vim.keymap.set("n", "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", { desc = "Quickfix Line" })
vim.keymap.set("n", "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", { desc = "Show Code Actions" })
end,
end,
}

View File

@@ -1,58 +0,0 @@
return {
{
"saghen/blink.cmp",
enabeld = false,
dependencies = {
"rafamadriz/friendly-snippets",
--"L3MON4D3/LuaSnip",
},
version = "v0.*",
opts = {
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = "mono",
},
signature = { enabled = true },
keymap = {
preset = "default",
["<CR>"] = { "accept", "fallback" },
["<C-space>"] = {
function(cmp)
cmp.show({ providers = { "snippets" } })
end,
},
--["<C-k>"] = { "select_prev", "fallback" },
--["<C-j>"] = { "select_next", "fallback" },
["<C-n>"] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
"snippet_forward",
"fallback",
},
},
-- snippets = {
-- expand = function(snippet)
-- require("luasnip").lsp_expand(snippet)
-- end,
-- active = function(filter)
-- if filter and filter.direction then
-- return require("luasnip").jumpable(filter.direction)
-- end
-- return require("luasnip").in_snippet()
-- end,
-- jump = function(direction)
-- require("luasnip").jump(direction)
-- end,
-- },
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
},
opts_extend = { "sources.default" },
},
}

View File

@@ -1,23 +0,0 @@
return {
"j-hui/fidget.nvim",
event = "VeryLazy",
config = function()
local fidget = require("fidget")
fidget.setup({
notification = {
window = {
normal_hl = "String", -- Base highlight group in the notification window
winblend = 0, -- Background color opacity in the notification window
border = "rounded", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 1, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
})
end,
}

View File

@@ -1,86 +0,0 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local harpoon = require("harpoon")
harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
key = function()
return vim.loop.cwd()
end,
},
})
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers")
.new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
})
:find()
end
-- Keymaps
vim.keymap.set("n", "<C-e>", function()
toggle_telescope(harpoon:list())
end, { desc = "Open Harpoon window" })
vim.keymap.set("n", "<leader>a", function()
harpoon:list():add()
end, { desc = "[A]dd to harpoon list." })
vim.keymap.set("n", "<C-e>", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = "Toggle quick menu." })
-- Buffer key maps. Currently keeping all buffer movements
-- isolated to top left row of keys on keyboard and all begin
-- with the <Control> key.
-- Select buffer numbers.
vim.keymap.set("n", "<A-y>", function()
harpoon:list():select(1)
end, { desc = "Select first harpoon buffer." })
vim.keymap.set("n", "<A-u>", function()
harpoon:list():select(2)
end, { desc = "Select second harpoon buffer." })
vim.keymap.set("n", "<A-i>", function()
harpoon:list():select(3)
end, { desc = "Select third harpoon buffer." })
vim.keymap.set("n", "<A-o>", function()
harpoon:list():select(4)
end, { desc = "Select fourth harpoon buffer." })
-- Toggle previous and next buffers.
vim.keymap.set("n", "<C-[>", function()
harpoon:list():prev()
end, { desc = "[P]revious harpoon buffer." })
vim.keymap.set("n", "<C-]>", function()
harpoon:list():next()
end, { desc = "[N]ext harpoon buffer." })
-- Extensions
harpoon:extend({
UI_CREATE = function(cx)
vim.keymap.set("n", "<C-v>", function()
harpoon.ui:select_menu_item({ vsplit = true })
end, { buffer = cx.buffer, desc = "Open in [V]split" })
end,
})
end,
}

View File

@@ -1,105 +0,0 @@
-- The language servers to setup.
local lsp_servers = {
"bashls",
"clangd",
"dockerls",
"gopls",
"jsonls",
"lua_ls",
"marksman",
"sourcekit",
"yamlls",
}
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
-- "hrsh7th/cmp-nvim-lsp",
"saghen/blink.cmp",
{ "antosha417/nvim-lsp-file-operations", config = true },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
opts = {
ensure_installed = lsp_servers,
},
})
local lspconfig = require("lspconfig")
--local cmp_nvim_lsp = require("cmp_nvim_lsp")
--local capabilities = cmp_nvim_lsp.default_capabilities()
local capabilities = require("blink.cmp").get_lsp_capabilities()
local opts = { noremap = true, silent = true }
local on_attach = function(_, bufnr)
opts.buffer = bufnr
opts.desc = "Show line diagnostics"
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
opts.desc = "Show diagnostics in Telescope"
vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show documentation for what is under cursor"
vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
opts.desc = "[G]oto [D]efinition"
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
opts.desc = "[G]oto [D]eclaration"
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "[G]oto [R]eferences"
vim.keymap.set("n", "gr", "<CMD>Telescope lsp_references<CR>", opts)
opts.desc = "LSP [C]ode [A]ction"
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
--opts.desc = "[R]e-[N]ame"
--vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "[R]eload or start LSP"
vim.keymap.set("n", "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
opts.desc = "Goto previous diagnostic"
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
opts.desc = "Goto next diagnostic"
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
end
for _, lsp in ipairs(lsp_servers) do
lspconfig[lsp].setup({
capabilities = capabilities,
on_attach = on_attach,
on_init = function(client)
-- HACK: to fix some issues with LSP
-- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
client.offset_encoding = "utf-8"
end,
cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
})
end
-- nice icons
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
end,
}

View File

@@ -1,217 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local lualine = require("lualine")
local function xcodebuild_device()
if vim.g.xcodebuild_platform == "macOS" then
return " macOS"
end
if vim.g.xcodebuild_os then
return "" .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
end
return "" .. vim.g.xcodebuild_device_name
end
lualine.setup({
options = {
globalstatus = true,
theme = "auto",
symbols = {
alternate_file = "#",
directory = "",
readonly = "",
unnamed = "[No Name]",
newfile = "[New]",
},
disabled_buftypes = { "quickfix", "prompt" },
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
-- { "mode" },
{ "filename" },
},
lualine_b = {
{ "diagnostics" },
{ "diff" },
{
"searchcount",
maxcount = 999,
timeout = 500,
},
},
lualine_c = {},
lualine_x = {
{ "' ' .. vim.g.xcodebuild_last_status", color = { fg = "#a6e3a1" } },
-- { "'󰙨 ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
{ xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
},
lualine_y = {
{ "branch" },
},
lualine_z = {
{ "location" },
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
})
end,
}
-- return {
-- "nvim-lualine/lualine.nvim",
-- config = function()
-- local colors = {
-- red = '#ca1243',
-- grey = '#a0a1a7',
-- black = '#383a42',
-- white = '#f3f3f3',
-- light_green = '#83a598',
-- orange = '#fe8019',
-- green = '#8ec07c',
-- }
--
-- local empty = require('lualine.component'):extend()
-- function empty:draw(default_highlight)
-- self.status = ''
-- self.applied_separator = ''
-- self:apply_highlights(default_highlight)
-- self:apply_section_separators()
-- return self.status
-- end
--
-- -- Put proper separators and gaps between components in sections
-- local function process_sections(sections)
-- for name, section in pairs(sections) do
-- local left = name:sub(9, 10) < 'x'
-- for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
-- table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
-- end
-- for id, comp in ipairs(section) do
-- if type(comp) ~= 'table' then
-- comp = { comp }
-- section[id] = comp
-- end
-- comp.separator = left and { right = '' } or { left = '' }
-- end
-- end
-- return sections
-- end
--
-- local function search_result()
-- if vim.v.hlsearch == 0 then
-- return ''
-- end
-- local last_search = vim.fn.getreg '/'
-- if not last_search or last_search == '' then
-- return ''
-- end
-- local searchcount = vim.fn.searchcount { maxcount = 9999 }
-- return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
-- end
--
-- local function modified()
-- if vim.bo.modified then
-- return '+'
-- elseif vim.bo.modifiable == false or vim.bo.readonly == true then
-- return '-'
-- end
-- return ''
-- end
--
-- local function xcodebuild_device()
-- if vim.g.xcodebuild_platform == "macOS" then
-- return " macOS"
-- end
--
-- local deviceIcon = ""
-- if vim.g.xcodebuild_platform:match("watch") then
-- deviceIcon = "􀟤"
-- elseif vim.g.xcodebuild_platform:match("tv") then
-- deviceIcon = "􀡴 "
-- elseif vim.g.xcodebuild_platform:match("vision") then
-- deviceIcon = "􁎖 "
-- end
--
-- if vim.g.xcodebuild_os then
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
-- end
--
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name
-- end
--
--
-- require('lualine').setup {
-- options = {
-- theme = 'auto',
-- component_separators = '',
-- section_separators = { left = '', right = '' },
-- },
-- sections = process_sections {
-- lualine_a = { 'mode' },
-- lualine_b = {
-- 'branch',
-- 'diff',
-- {
-- 'diagnostics',
-- source = { 'nvim' },
-- sections = { 'error' },
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
-- },
-- {
-- 'diagnostics',
-- source = { 'nvim' },
-- sections = { 'warn' },
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
-- },
-- { 'filename', file_status = false, path = 1 },
-- { modified, color = { bg = colors.red } },
-- {
-- '%w',
-- cond = function()
-- return vim.wo.previewwindow
-- end,
-- },
-- {
-- '%r',
-- cond = function()
-- return vim.bo.readonly
-- end,
-- },
-- {
-- '%q',
-- cond = function()
-- return vim.bo.buftype == 'quickfix'
-- end,
-- },
-- },
-- lualine_c = {},
-- lualine_x = {
-- { "' ' .. vim.g.xcodebuild_last_status", color = { fg = "Gray" } },
-- { "'󰙨 ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
-- { xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
-- },
-- lualine_y = { search_result, 'filetype' },
-- lualine_z = { '%l:%c', '%p%%/%L' },
-- },
-- inactive_sections = {
-- lualine_c = { '%f %y %m' },
-- lualine_x = {},
-- },
-- tabline = {},
-- extensions = {"nvim-tree"}
-- }
-- end
-- }

View File

@@ -1,45 +0,0 @@
return {
"L3MON4D3/LuaSnip",
version = "v2.*",
event = "VeryLazy",
config = function()
local ls = require("luasnip")
local types = require("luasnip.util.types")
ls.setup({
history = true,
enable_autosnippets = false,
updatevents = "TextChanged,TextChangedI",
extra_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
},
},
})
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
-- Keymaps
local opts = { silent = true }
-- Use <Ctrl>k to expand snippets.
-- This will expand the current item or jump to the next item within the snippet.
vim.keymap.set({ "i", "s" }, "<C-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, opts)
-- Use <Ctrl>j to jump backwards in a snippet.
-- This always moves to the previous item within a snippet.
vim.keymap.set({ "i", "s" }, "<C-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, opts)
-- Reload snippets.
vim.keymap.set("n", "<leader><leader>s", "<CMD>source ~/.config/m-housh/lua/user/plugin/luasnip.lua<CR>")
end,
}

View File

@@ -1,47 +0,0 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
-- config.lsp.signature.enabled = false
opts = {
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,
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
signature = { enabled = false },
},
routes = {
{ -- enables messages for showing macro recording.
view = "notify",
filter = { event = "msg_showmode" },
},
{ -- Hide the written messages.
view = 'notify',
filter = {
event = "msg_show",
kind = "",
find = "written"
},
opts = { skip = true }
}
},
},
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",
},
}

View File

@@ -1,68 +0,0 @@
return {
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["<C-v>"] = {
"actions.select",
opts = { vertical = true },
desc = "Open the entry in a vertical split",
},
},
view_options = {
is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- Don't show .DS_Store in output.
local is_ds_store = name ~= ".DS_Store"
return not is_ds_store
end,
},
},
keys = {
-- Show the parent directory in current window.
{ "-", "<CMD>Oil<CR>", desc = "Open directory." },
-- Open parent directory in floating window.
{
"<leader>-",
function()
require("oil").toggle_float()
end,
desc = "Open directory in float.",
},
},
-- config = function()
-- require("oil").setup({
-- columns = { "icon" },
-- keymaps = {
-- ["<C-h>"] = false,
-- ["<M-h>"] = "actions.select_split",
-- ["<C-v>"] = {
-- "actions.select",
-- opts = { vertical = true },
-- desc = "Open the entry in a vertical split",
-- },
-- },
-- view_options = {
-- is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
-- -- Don't show .DS_Store in output.
-- local is_ds_store = name ~= ".DS_Store"
-- return not is_ds_store
-- end,
-- },
-- })
--
-- -- Show the parent directory in current window.
-- vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory." })
--
-- -- Open parent directory in floating window.
-- vim.keymap.set("n", "<space>-", require("oil").toggle_float)
--
-- -- Old habits die hard, map what used to toggle neo-tree to just open a float.
-- vim.keymap.set("n", "<C-n>", require("oil").toggle_float)
-- end,
}

View File

@@ -1,29 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
opts = {},
config = function()
local todos = require("todo-comments")
todos.setup({
keywords = {
-- Adds the important keyword, I primarily use this in markdown
-- documents to be able to jump and color appropriately.
FIX = { alt = { "IMPORTANT" } },
},
})
vim.keymap.set("n", "<leader>tq", "<CMD>Trouble todo toggle<CR>", { desc = "[T]odo [Q]uick fix list." })
vim.keymap.set("n", "<leader><leader>t", "<CMD>TodoTelescope<CR>", { desc = "[T]odo telescope list." })
vim.keymap.set("n", "<leader>tl", "<CMD>TodoLocList<CR>", { desc = "[T]odo [L]ocation list." })
vim.keymap.set("n", "]t", function()
todos.jump_next()
end, { desc = "Next [T]odo" })
vim.keymap.set("n", "[t", function()
todos.jump_prev()
end, { desc = "Previous [T]odo" })
end,
}

View File

@@ -1,78 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
"nvim-treesitter/nvim-treesitter-textobjects",
},
build = ":TSUpdate",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"cmake",
"dockerfile",
"go",
"hcl",
"html",
"java",
"javascript",
"json",
"latex",
"ledger",
"llvm",
"lua",
"make",
"markdown",
"python",
"swift",
"toml",
"xml",
"yaml",
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = {}, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = {}, -- list of language that will be disabled
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
scope_incremental = "<CR>",
node_incremental = "<TAB>",
node_decremental = "<S-TAB>",
},
},
indent = { enable = true },
autopairs = { { enable = true } },
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
["ir"] = "@parameter.inner",
["ar"] = "@parameter.outer",
["a="] = "@assignment.outer",
["i="] = "@assignment.inner",
},
},
},
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 2000, -- Do not enable for files with more than specified lines
},
})
end,
}

View File

@@ -1,8 +0,0 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
}

View File

@@ -1,47 +0,0 @@
-- Bootstrap Lazy.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
dev = {
path = "~/LocalProjects/plugins",
fallback = true,
},
-- Import all the plugin configs in the 'plugin' directory
{ import = "user.plugin" },
-- Plugins that don't have a configuration file.
{
"folke/zen-mode.nvim",
opts = {},
},
{
"christoomey/vim-tmux-navigator",
lazy = false,
},
{ "NoahTheDuke/vim-just", ft = { "just" } },
{
"chipsenkbeil/distant.nvim",
version = "v0.*",
event = "VeryLazy",
},
}, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})
vim.keymap.set("n", "<leader>ll", "<CMD>Lazy<CR>", { desc = "Open [L]azy" })

View File

@@ -31,4 +31,11 @@ ls.add_snippets("lua", {
"})",
}),
}),
s("c", {
c(1, {
t("1st"),
t("2nd"),
}),
}),
})

View File

@@ -11,8 +11,18 @@ local fmt = require("luasnip.extras.fmt").fmt
local rep = require("luasnip.extras").rep
-- Add snippets
ls.add_snippets("swift", {
-- Logging
s(
{ trig = "logg", desc = "Log a message" },
fmt('logger.{}("{}")', {
i(1),
i(2),
})
),
-- Add a dependency snippet.
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
s({ trig = "@dep", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
-- Add a dependency client.
s(

129
scripts/scripts/ask-gpt Executable file
View File

@@ -0,0 +1,129 @@
#!/bin/zsh
#
# Ask chat-gpt a question and view the output.
local api_key="${OPENAI_API_KEY}"
local debug="${DEBUG}"
local outputFile="/tmp/output.json"
function usage() {
cat << EOF
Ask chat-gpt a question and view the output.
Example usage:
ask-gpt 'Who are you?'
# Send output to a file:
ask-gpt --print 'Who are you' > /tmp/gpt.md
Usage: ask-gpt [-k <key>] [-m <model>] [-p] [-j] [-h] question
Options:
-k | --key : Use api key (default: environment variable 'OPENAI_API_KEY')
-m | --model: Specify the chat-gpt model (default is 'gpt-4o-mini')
-j | --json: Print the full json output to stdout.
-p | --print: Print the output to stdout in markdown format.
-h | --help: Show usage.
Include debug output:
DEBUG=1 ask-gpt 'Who are you?'
EOF
}
######################### Helpers #########################
function debug_print {
if [ ! -z "$debug" ]; then
echo "$1"
fi
}
function makeGptInput {
echo $(jq --null-input \
--arg model "$1" \
--arg question "$2" \
'{
"model": $model,
"messages": [
{ "role": "system", "content": "You are such a helpful assistant!" },
{ "role": "developer", "content": "You message data is escaped properly to parse as JSON, including escaping newline characters." },
{ "role": "user", "content": $question }
]
}')
}
function getGptOutput {
echo "$1" | jq -r '.choices[].message.content'
}
function askGpt {
local key=$1
local input=$2
echo $(curl "https://api.openai.com/v1/chat/completions" \
-sS \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $key" \
-d "$input")
}
######################### MAIN #########################
zparseopts -D -E -F -- \
{h,-help}=help \
{k,-key}:=key \
{m,-model}=model \
{j,-json}=json \
{p,-print}=printOutput
# Check if help was specified and show usage.
[ ! -z "$help" ] && usage && exit 0
local question="$1"
# Ensure there is a question / first argument.
[ -z "$question" ] && print "No question found." && usage && exit 1
# parse the api key.
if [ ! -z "$key" ]; then
api_key="${key[-1]}"
debug_print "Using custom passed in key."
fi
# Fail if we did not find an api key.
[ -z "$api_key" ] && echo "No api key found." && usage && exit 1
# Set default model if not specified.
if [ -z "$model" ]; then
model="gpt-4o-mini"
fi
debug_print "Model: $model"
# Generate the input for chat-gpt.
local input="$(makeGptInput $model $question)"
debug_print "Input: $input"
# Get the chat-gpt output.
local output="$(askGpt $api_key $input)"
# TODO: Remove.
echo "$output" > "$outputFile"
debug_print "Full ouptput: $(echo $output | jq '.')"
# If json option is specified, then send full output to stdout and exit.
[ ! -z "$json" ] && (echo "$output" | jq '.') && exit 0
# parse the output message.
local parsedOutput="$(getGptOutput $output)"
echo "$parsedOutput"
# Show the output based on options passed in.
# if [ -z "$printOutput" ]; then
# echo "# $question\n$parsedOutput" | gum format | gum pager
# else
# echo "# $question\n$parsedOutput" | gum format
# fi

View File

@@ -58,10 +58,10 @@ bind \\ splitw -h
bind - splitw -v
# Use Alt-arrow keys to navigate panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# bind -n M-Left select-pane -L
# bind -n M-Right select-pane -R
# bind -n M-Up select-pane -U
# bind -n M-Down select-pane -D
# Close a pane quickly
bind-key -r K kill-pane
@@ -73,7 +73,7 @@ bind -n M-h previous-window
bind -n M-l next-window
bind C-l send-keys 'C-l'
bind f run-shell "tmux display-popup -E -w 80% -h 80% ~/.local/scripts/tmux-sessionator"
bind f run-shell "tmux display-popup -E -w 80% -h 80% $SCRIPTS/tmux-sessionator"
bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles"
unbind s
bind s run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
@@ -126,11 +126,18 @@ set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_blue}] 󰭦 %Y-%m-%d 󰅐 %H:%M
# bootstrap tpm
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Configure Tmux
set -g status-position top
set -g status-style "bg=#{@thm_bg}"
set -g status-justify "absolute-centre"
# For yazi images to work correctly
set -gq allow-passthrough on
set -g visual-activity off
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
# pane border look and feel
setw -g pane-border-status top
setw -g pane-border-format ""

View File

@@ -205,6 +205,7 @@ alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history locat
# NOTE: This needs to stay near the bottom, or it doesn't work properly.
# Use fzf in history / search contexts.
source <(fzf --zsh)
source <(kubectl completion zsh)
#------------------------------ local configs ------------------------------

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env zsh
function brew-update() {
brew update && brew upgrade --greedy && brew cleanup
}