feat: Minimal neovim v0.12 config.

This commit is contained in:
2025-11-08 13:17:18 -05:00
parent 9af452c849
commit 71eae2eb5b
25 changed files with 126 additions and 953 deletions

View File

@@ -1,15 +1,120 @@
-- bootstrap lazy.nvim, LazyVim and your plugin
-- NOTE: This requires neovim >= 0.12, you can use bob to download nightly.
--
vim.g.netrw_browsex_viewer = "xdg-open"
vim.g.mapleader = " "
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.swapfile = false
vim.opt.undofile = true
vim.opt.winborder = "rounded"
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.showtabline = 2
vim.opt.signcolumn = "yes"
vim.opt.wrap = false
vim.opt.smartindent = true
vim.opt.termguicolors = true
require("config.lazy")
vim.filetype.add({
pattern = {
[".*"] = function(path, bufnr)
local first_line = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ""
if first_line:match("^#!.*zsh") then
return "bash"
end
end,
},
vim.pack.add({
{ src = "https://github.com/catppuccin/nvim" },
{ src = "https://github.com/nvim-mini/mini.pick" },
{ src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src = "https://github.com/mason-org/mason.nvim" },
})
require("mason").setup()
require("mini.pick").setup()
require("oil").setup()
-- Set color scheme
vim.cmd([[colorscheme catppuccin-mocha]])
vim.cmd [[set completeopt+=menuone,noselect,popup]]
-- LSP
vim.lsp.enable({
"lua_ls", "tinymist", "marksman"
})
-- Fix warnings for 'vim' global keyword.
vim.lsp.config("lua_ls", {
settings = {
Lua = {
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
},
},
})
-- Keymaps
local map = vim.keymap.set
map('n', '<leader>e', ':Oil<CR>')
map('n', '<leader>f', ':Pick files tool="git"<CR>')
map('n', '<leader>lf', vim.lsp.buf.format)
map('n', '<leader>o', ':update<CR> :source<CR>')
-- Auto commands.
local defaultopts = { clear = true }
-- Force zsh files to use bash syntax highlighting
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
group = vim.api.nvim_create_augroup('my.zsh', defaultopts),
pattern = "*",
callback = function(args)
local first_line = vim.api.nvim_buf_get_lines(args.buf, 0, 1, false)[1] or ""
if first_line:match("^#!.*zsh") then
vim.bo[args.buf].filetype = "bash"
end
end,
})
-- Markdown
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.md",
group = vim.api.nvim_create_augroup('my.markdown', defaultopts),
callback = function(_)
-- HACK: Set filetype to markdown for '.md' files.
-- Not sure why it doesn't detect these as markdown files, but this fixes the issue.
vim.cmd.setlocal("filetype=markdown")
vim.cmd.setlocal("textwidth=120")
vim.cmd.setlocal("spell spelllang=en_us")
end,
})
-- Neomutt
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "neomutt*",
group = vim.api.nvim_create_augroup('my.neomutt', defaultopts),
callback = function(_)
-- HACK: Set filetype to markdown for '.md' files.
-- Not sure why it doesn't detect these as markdown files, but this fixes the issue.
vim.cmd.setlocal("filetype=markdown")
vim.cmd.setlocal("textwidth=120")
vim.cmd.setlocal("spell spelllang=en_us")
end,
})
-- GoPass
vim.api.nvim_exec2(
[[
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
]],
{}
)
-- Stolen from: https://github.com/SylvanFranklin/.config/blob/main/nvim/init.lua
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}),
callback = function(args)
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
if client:supports_method('textDocument/completion') then
-- Optional: trigger autocompletion on EVERY keypress. May be slow!
local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
client.server_capabilities.completionProvider.triggerCharacters = chars
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
end
end,
})

View File

@@ -1,27 +0,0 @@
{
"extras": [
"lazyvim.plugins.extras.coding.mini-snippets",
"lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.editor.fzf",
"lazyvim.plugins.extras.editor.harpoon2",
"lazyvim.plugins.extras.formatting.prettier",
"lazyvim.plugins.extras.lang.ansible",
"lazyvim.plugins.extras.lang.clangd",
"lazyvim.plugins.extras.lang.cmake",
"lazyvim.plugins.extras.lang.docker",
"lazyvim.plugins.extras.lang.git",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.sql",
"lazyvim.plugins.extras.lang.tailwind",
"lazyvim.plugins.extras.lang.tex",
"lazyvim.plugins.extras.lang.toml",
"lazyvim.plugins.extras.lang.yaml",
"lazyvim.plugins.extras.util.startuptime"
],
"install_version": 8,
"news": {
"NEWS.md": "11866"
},
"version": 8
}

View File

@@ -1,86 +0,0 @@
local defaultGroupOptions = { clear = true }
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
local createCmd = vim.api.nvim_create_autocmd
createCmd("BufEnter", {
pattern = "*.md",
group = markdownGroup,
callback = function(_)
-- HACK: Set filetype to markdown for '.md' files.
-- Not sure why it doesn't detect these as markdown files, but this fixes the issue.
vim.cmd.setlocal("filetype=markdown")
vim.cmd.setlocal("textwidth=120")
vim.cmd.setlocal("spell spelllang=en_us")
end,
})
-- Hyprlang LSP
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.hl", "hypr*.conf" },
callback = function(event)
print(string.format("starting hyprls for %s", vim.inspect(event)))
vim.lsp.start({
name = "hyprlang",
cmd = { "hyprls" },
root_dir = vim.fn.getcwd(),
})
end,
})
-- Markdown
-- createCmd("BufWritePost", {
-- pattern = { "*.md", "*.markdown" },
-- group = markdownGroup,
-- callback = function(_)
-- -- local cursor = vim.fn.getpos(".")
-- vim.cmd("FormatWrite")
-- -- vim.fn.setpos(".", cursor)
-- end,
-- })
-- Set neomutt compose email file types to markdown.
vim.api.nvim_create_autocmd("BufRead", {
pattern = "neomutt*",
callback = function()
vim.cmd.setlocal("filetype=markdown")
vim.cmd.setlocal("textwidth=120")
vim.cmd.setlocal("spell spelllang=en_us")
end
})
-- Go
createCmd("BufWritePre", {
pattern = "*.go",
callback = function()
require("go.format").goimport()
end,
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
})
-- GoPass
vim.api.nvim_exec2(
[[
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
]],
{}
)
-- Highlight when yanking.
createCmd("TextYankPost", {
desc = "Highlight when yanking text.",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
-- Force zsh scripts to use bash syntax highlighting.
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*",
callback = function(args)
local first_line = vim.api.nvim_buf_get_lines(args.buf, 0, 1, false)[1] or ""
if first_line:match("^#!.*zsh") then
vim.bo[args.buf].filetype = "bash"
end
end,
})

View File

@@ -1,54 +0,0 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local keymap = vim.keymap.set
local default_options = { noremap = true, silent = true }
local wk = require("which-key")
local wk_add = function(mode, keymaps)
wk.add(keymaps, { mode = mode, silent = true })
end
keymap("i", "jk", "<ESC>", default_options)
local make_executable = function()
local file = vim.fn.expand("%:p")
vim.cmd("silent !chmod +x " .. file)
print("Made " .. file .. " executable")
end
--------------------------------------------------------------------------------
-- Normal Mode
--------------------------------------------------------------------------------
wk_add("n", {
{ "<Left>", ":vertical resize +1<CR>", desc = "Resize Pane Left" },
{ "<Right>", ":vertical resize -1<CR>", desc = "Resize Pane Right" },
{ "<Up>", "resize -1<CR>", desc = "Resize Pane Up" },
{ "<Down>", "resize +1<CR>", desc = "Resize Pane Down" },
{ "<leader>n", "<CMD>:noh<CR>", desc = "[N]o highlighting" },
{ "<leader>s", "<CMD>:set spell!<CR>", desc = "[S]pell check toggle" },
{ "<C-s>", "<CMD>:write<CR>", desc = "[S]ave" },
{ "J", ":move .+1<CR>==", desc = "Move line down" },
{ "K", ":move .-2<CR>==", desc = "Move line up" },
{ "<leader>x", make_executable, desc = "Make current file e[x]ecutable" },
{ "<leader>z", "<CMD>:ZenMode<CR>", desc = "[Z]en Mode" },
})
--------------------------------------------------------------------------------
-- Visual Mode
--------------------------------------------------------------------------------
vim.keymap.set("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
vim.keymap.set("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
-- Toggle term key maps, that get attached when terminal is opened.
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
keymap("t", "<esc>", [[<C-\><C-n>]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")

View File

@@ -1,69 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{
import = "lazyvim.plugins.extras.editor.mini-files",
opts = {
options = {
use_as_default_explorer = true,
},
},
},
{
import = "lazyvim.plugins.extras.coding.blink",
keymap = {
preset = "enter",
["<C-y>"] = { "select_and_accept" },
},
},
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -1,72 +0,0 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
--
local o = vim.opt
local wo = vim.wo
local fn = vim.fn
vim.cmd.set("inccommand=split")
o.filetype = "on"
o.updatetime = 500 -- faster completion
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
o.backup = false -- creates a backup file
o.swapfile = false -- enable/disable swap file creation
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
o.undofile = false -- enable/disable undo file creation
o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
o.hidden = true -- required to keep multiple buffers and open multiple buffers
--o.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
o.fileencoding = "utf-8" -- the encoding written to a file
o.conceallevel = 0 -- so that `` is visible in markdown files
o.number = true -- set numbered lines
o.relativenumber = true -- set relative numbered lines
o.cmdheight = 1 -- space for displaying messages/commands
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
o.showtabline = 2 -- always show tabs
o.laststatus = 2 -- The value of this option influences when the last window will have a status line (2 always)
o.smartcase = true -- smart case
o.smartindent = true -- make indenting smarter again
o.splitbelow = true -- force all horizontal splits to go below current window
o.splitright = true -- force all vertical splits to go to the right of current window
o.autoindent = true -- turn on auto indent.
o.expandtab = true -- convert tabs to spaces
o.smarttab = true -- turn on smart tab
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
o.tabstop = 2 -- how many columns a tab counts for
o.termguicolors = true -- set term gui colors (most terminals support this)
o.cursorline = true -- highlight the current line
o.scrolloff = 20 -- Minimal number of screen lines to keep above and below the cursor
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
o.hlsearch = false -- highlight all matches on previous search pattern
o.ignorecase = true -- ignore case in search patterns
o.foldenable = false -- disable folding; enable with zi
o.foldmethod = "expr"
o.foldexpr = "nvim_treesitter#foldexpr()"
vim.cmd.set("nolist") -- don't show listchars.
-- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"
o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
wo.colorcolumn = "99999"
o.wildmode = "full"
o.lazyredraw = false -- do not redraw screen while running macros
o.grepprg = "rg --hidden --vimgrep --smart-case --"
o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion
o.wildignorecase = true -- When set case is ignored when completing file names and directories
o.wildignore = [[
.git,.hg,.svn
*.aux,*.out,*.toc
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
*.mp3,*.oga,*.ogg,*.wav,*.flac
*.eot,*.otf,*.ttf,*.woff
*.doc,*.pdf,*.cbr,*.cbz
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
*.swp,.lock,.DS_Store,._*
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]
o.viminfo = "" -- disable viminfo from copying information from current session, for security.
vim.g.snacks_animate = false

View File

@@ -1,8 +0,0 @@
return {
"saghen/blink.cmp",
opts = {
keymap = {
preset = "default"
}
}
}

View File

@@ -1,9 +0,0 @@
return {
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
}

View File

@@ -1,4 +0,0 @@
return {
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
{ "akinsho/bufferline.nvim", enabled = false },
}

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,30 +0,0 @@
return {
"stevearc/conform.nvim",
opts = {
formatters = {
["markdown-toc"] = {
condition = function(_, ctx)
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
if line:find("<!%-%- toc %-%->") then
return true
end
end
end,
},
["markdownlint-cli2"] = {
condition = function(_, ctx)
local diag = vim.tbl_filter(function(d)
return d.source == "markdownlint"
end, vim.diagnostic.get(ctx.buf))
return #diag > 0
end,
},
},
formatters_by_ft = {
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
lua = { "stulua" },
swift = { "swiftformat" },
},
},
}

View File

@@ -1,78 +0,0 @@
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
},
},
keys = {
{
"<C-e>",
function()
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
end,
desc = "Open Harpoon window.",
},
{
"<leader>a",
function()
require("harpoon"):list():add()
end,
desc = "[A]dd to the harpoon list.",
},
{
"<A-y>",
function()
require("harpoon"):list():select(1)
end,
desc = "Select first harpoon buffer.",
},
{
"<A-u>",
function()
require("harpoon"):list():select(2)
end,
desc = "Select second harpoon buffer.",
},
{
"<A-i>",
function()
require("harpoon"):list():select(3)
end,
desc = "Select third harpoon buffer.",
},
{
"<A-o>",
function()
require("harpoon"):list():select(4)
end,
desc = "Select fourth harpoon buffer.",
},
{
"<C-[>",
function()
require("harpoon"):list():prev()
end,
desc = "Previous harpoon buffer.",
},
{
"<C-]>",
function()
require("harpoon"):list():next()
end,
desc = "Next harpoon buffer.",
},
-- Extensions
require("harpoon"):extend({
UI_CREATE = function(cx)
vim.keymap.set("n", "<C-v>", function()
require("harpoon").ui:select_menu_item({ vsplit = true })
end, { buffer = cx.buffer, desc = "Open in [V]split" })
end,
}),
},
},
}

View File

@@ -1,29 +0,0 @@
-- Plugins that don't require much configuration are in here.
--
return {
{
"folke/snacks.nvim",
opts = {
indent = { enabled = false },
},
},
{
"christoomey/vim-tmux-navigator",
lazy = false,
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
"TmuxNavigatorProcessList",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
},
}

View File

@@ -1,12 +0,0 @@
return {
{
"mfussenegger/nvim-lint",
opts = {
linters = {
markdownlint = {
args = { "--config", "~/.markdownlint.jsonc", "--" },
},
},
},
},
}

View File

@@ -1,169 +0,0 @@
return {
{
"mason-org/mason.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
ensure_installed = {
"clangd",
"marksman",
"shfmt",
"tinymist",
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"cmake",
"dockerfile",
"editorconfig",
"ini",
"jq",
"latex",
"make",
},
},
},
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
opts = {
servers = {
bashls = {},
clangd = {},
dockerls = {},
gopls = {},
harper_ls = {},
jsonls = {},
lua_ls = {
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
diagnostics = {
globals = { "vim" },
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
},
marksman = {},
sourcekit = {},
tinymist = {
settings = {
formatterMode = "typstyle",
},
},
yamlls = {},
},
setup = {
clangd = function(_, opts)
opts.capabilities.offsetEncoding = { "utf-16" }
end,
sourcekit = function(_, opts)
opts.cmd = {
vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) or nil,
}
end,
},
},
},
}
-- return {
-- "neovim/nvim-lspconfig",
-- event = { "BufReadPre", "BufNewFile" },
-- dependencies = {
-- "hrsh7th/cmp-nvim-lsp",
-- { "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 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 = "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,39 +0,0 @@
return {
{
"L3MON4D3/LuaSnip",
opts = function()
LazyVim.cmp.actions.snippet_forward = function()
if require("luasnip").jumpable(1) then
require("luasnip").jump(1)
return true
end
end
LazyVim.cmp.actions.snippet_stop = function()
if require("luasnip").expand_or_jumpable() then -- or just jumpable(1) is fine?
require("luasnip").unlink_current()
return true
end
end
end,
keys = {
{
"<C-k>",
mode = { "i", "s" },
function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end
},
{
"<C-j>",
mode = { "i", "s" },
function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end
},
},
},
}

View File

@@ -1,40 +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 = {
show_hidden = true,
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
return false
end,
},
},
},
keys = {
-- Show the parent directory in current window.
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory." },
-- Open parent directory in floating window.
{
"<space>-",
function()
require("oil").toggle_float()
end,
desc = "Open parent directory in floating window.",
},
},
}

View File

@@ -1,47 +0,0 @@
-- NOTE: Header looks jacked up here, but fine when rendered in the ui.
return {
"folke/snacks.nvim",
opts = {
picker = {
hidden = true,
ignored = true
},
image = {
doc = {
enabled = true,
},
},
dashboard = {
row = nil,
col = nil,
preset = {
header = [[
*
+++++
+++++++++
==+++++++++++
+===:+++++++++++*
+======--+++++++++++*##+====
+==========:=+++++++++++#+====
+=============-=++++++++++++====
+================-:+++++++++++++==
+===================--++++++++++++++*
+======================--+++++++++++++++*
=========================-++++++++++++++++
==========================:+++++++++++++++
===========================:++++++++++++++
===========================-.-++++++++++++
===========================-::.=++++++++++
===========================----..=++++++++
===========================------..:=+++++
===========================--------:...-++
===========================------------:.:
===========================---------------
===========================---------------
===========================---------------
]],
},
},
},
}

View File

@@ -1,11 +0,0 @@
return {
{
import = "lazyvim.plugins.extras.editor.telescope",
enabled = false,
opts = {
ensure_installed = {
"swift",
},
},
},
}

View File

@@ -1,14 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
keys = {
{ "<leader>xt", false },
{ "<leader>xT", false },
{ "<leader>tq", "<CMD>Trouble todo toggle<CR>", desc = "[T]odo [Q]uick fix list." },
{ "<leader><leader>t", "<CMD>TodoTelescope<CR>", desc = "[T]odo telescope list." },
{ "<leader>tl", "<CMD>TodoLocList<CR>", desc = "[T]odo [L]ocation list." },
},
}

View File

@@ -1,15 +0,0 @@
return {
'chomosuke/typst-preview.nvim',
ft = 'typst', -- or ft = 'typst'
version = '1.*',
opts = {
debug = true,
}, -- lazy.nvim will implicitly calls `setup {}`
keys = {
{
"<leader>tp",
"<CMD>TypstPreviewToggle<CR>",
desc = "Toggle typst preview."
},
}
}

View File

@@ -1,73 +0,0 @@
local progress_handle
return {
"wojciech-kulik/xcodebuild.nvim",
event = "VeryLazy",
dependencies = {
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
},
opts = {
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,
},
},
keys = {
{ "<leader>X", "<cmd>XcodebuildPicker<cr>", desc = "Show Xcodebuild Actions" },
{ "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", desc = "Show Project Manager Actions" },
{ "<leader>xb", "<cmd>XcodebuildBuild<cr>", desc = "Build Project" },
{ "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", desc = "Build For Testing" },
{ "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", desc = "Build & Run Project" },
{ "<leader>xt", "<cmd>XcodebuildTest<cr>", desc = "Run Tests" },
{ "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", desc = "Run Selected Tests" },
{ "<leader>xT", "<cmd>XcodebuildTestClass<cr>", desc = "Run This Test Class" },
{ "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", desc = "Toggle Xcodebuild Logs" },
{ "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", desc = "Toggle Code Coverage" },
{ "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", desc = "Show Code Coverage Report" },
{ "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", desc = "Toggle Test Explorer" },
{ "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", desc = "Show Failing Snapshots" },
{ "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", desc = "Select Device" },
{ "<leader>xp", "<cmd>XcodebuildSelectTestPlan<cr>", desc = "Select Test Plan" },
{ "<leader>xq", "<cmd>Telescope quickfix<cr", desc = "Show QuickFix List" },
{ "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", desc = "Quickfix Line" },
{ "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", desc = "Show Code Actions" },
},
}

View File

@@ -70,7 +70,8 @@ path_prepend \
"$SCRIPTS/mail" \
"$HOME/.local/pnpm" \
"$CARGO_HOME/bin" \
"$HOME/.local/bin"
"$HOME/.local/bin" \
"$XDG_DATA_HOME/bob/nvim-bin"
# last arg will be first in $FPATH
fpath_prepend \
@@ -201,11 +202,12 @@ alias tks='tmux kill-session -t' # kill tmux session
alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
alias vi='nvim' # set vi to open neovim
alias newf='"$SCRIPTS"/newx --function' # generate a new shell function
alias nlnv='nvim "$LOCAL_ENV"' # open local environment overrides file in neovime
alias nvim='unset VIMINIT && unset MYVIMRC && nvim' # alias nvim to unset vimrc, useful when using both vim & neovim
alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my config.
alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickstart config.
alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
alias n='nvim'
# alias nlnv='nvim "$LOCAL_ENV"' # open local environment overrides file in neovime
# alias nvim='unset VIMINIT && unset MYVIMRC && nvim' # alias nvim to unset vimrc, useful when using both vim & neovim
# alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my config.
# alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickstart config.
# alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
# GPG Yubikey restart relearn when switching keys and stubbed.
alias yubikeyrestart='gpg-connect-agent killagent /bye && gpg-connect-agent "scd serialno" "learn --force" /bye && gpg --card-status'

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env zsh
# Open's neovim.
#
# If the argument passed in is a directory or not supplied, then
# open neovim with telescope find files opened. Otherwise open the
# file that is supplied.
#
function n() {
# if [ -z "$1" ]; then
# local gitdir=$(git rev-parse --show-toplevel 2> /dev/null)
#
# [ -n "$gitdir" ] \
# && nvim -c ":Telescope git_files" \
# && return 0
#
# [ -d "$1" ] \
# && nvim -c ":Telescope find_files" \
# && return 0
# fi
nvim "$@"
}

2
env/.tmux.conf vendored
View File

@@ -14,7 +14,7 @@ TMUX_FZF_OPTIONS="-p -w 60% -h 80% -m"
set-option -sa terminal-overrides ",xterm*:Tc"
# Change the default $TERM to tmux-256color
set -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
# Change windows to start with an index of 1 instead of 0
set -g base-index 1