diff --git a/env/.config/nvim/init.lua b/env/.config/nvim/init.lua index a5ebf23..6a6941f 100644 --- a/env/.config/nvim/init.lua +++ b/env/.config/nvim/init.lua @@ -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', 'e', ':Oil') +map('n', 'f', ':Pick files tool="git"') +map('n', 'lf', vim.lsp.buf.format) +map('n', 'o', ':update :source') + +-- 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, }) diff --git a/env/.config/nvim/lazyvim.json b/env/.config/nvim/lazyvim.json deleted file mode 100644 index 78fa2db..0000000 --- a/env/.config/nvim/lazyvim.json +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/env/.config/nvim/lua/config/autocmds.lua b/env/.config/nvim/lua/config/autocmds.lua deleted file mode 100644 index f1e1e0d..0000000 --- a/env/.config/nvim/lua/config/autocmds.lua +++ /dev/null @@ -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, -}) diff --git a/env/.config/nvim/lua/config/keymaps.lua b/env/.config/nvim/lua/config/keymaps.lua deleted file mode 100644 index 2e0cb05..0000000 --- a/env/.config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -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", "", 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", { - { "", ":vertical resize +1", desc = "Resize Pane Left" }, - { "", ":vertical resize -1", desc = "Resize Pane Right" }, - { "", "resize -1", desc = "Resize Pane Up" }, - { "", "resize +1", desc = "Resize Pane Down" }, - - { "n", ":noh", desc = "[N]o highlighting" }, - { "s", ":set spell!", desc = "[S]pell check toggle" }, - { "", ":write", desc = "[S]ave" }, - - { "J", ":move .+1==", desc = "Move line down" }, - { "K", ":move .-2==", desc = "Move line up" }, - - { "x", make_executable, desc = "Make current file e[x]ecutable" }, - { "z", ":ZenMode", desc = "[Z]en Mode" }, -}) - --------------------------------------------------------------------------------- --- Visual Mode --------------------------------------------------------------------------------- - -vim.keymap.set("v", "K", ":move '<-2gv=gv", { desc = "Move selected block up.", silent = true, noremap = true }) -vim.keymap.set("v", "J", ":move '>+1gv=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", "", [[]], opts) -end - -vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") diff --git a/env/.config/nvim/lua/config/lazy.lua b/env/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index 7f73575..0000000 --- a/env/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -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", - [""] = { "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", - }, - }, - }, -}) diff --git a/env/.config/nvim/lua/config/options.lua b/env/.config/nvim/lua/config/options.lua deleted file mode 100644 index f144dbb..0000000 --- a/env/.config/nvim/lua/config/options.lua +++ /dev/null @@ -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 diff --git a/env/.config/nvim/lua/plugins/cmp.lua b/env/.config/nvim/lua/plugins/cmp.lua deleted file mode 100644 index 84fba81..0000000 --- a/env/.config/nvim/lua/plugins/cmp.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "saghen/blink.cmp", - opts = { - keymap = { - preset = "default" - } - } -} diff --git a/env/.config/nvim/lua/plugins/colorscheme.lua b/env/.config/nvim/lua/plugins/colorscheme.lua deleted file mode 100644 index e964eb0..0000000 --- a/env/.config/nvim/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "catppuccin", - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/disabled.lua b/env/.config/nvim/lua/plugins/disabled.lua deleted file mode 100644 index e4f4343..0000000 --- a/env/.config/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - { "nvim-neo-tree/neo-tree.nvim", enabled = false }, - { "akinsho/bufferline.nvim", enabled = false }, -} diff --git a/env/.config/nvim/lua/plugins/fidget.lua b/env/.config/nvim/lua/plugins/fidget.lua deleted file mode 100644 index 9adf66a..0000000 --- a/env/.config/nvim/lua/plugins/fidget.lua +++ /dev/null @@ -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, -} diff --git a/env/.config/nvim/lua/plugins/formatter.lua b/env/.config/nvim/lua/plugins/formatter.lua deleted file mode 100644 index b7eb5b4..0000000 --- a/env/.config/nvim/lua/plugins/formatter.lua +++ /dev/null @@ -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("") 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" }, - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/harpoon.lua b/env/.config/nvim/lua/plugins/harpoon.lua deleted file mode 100644 index 878756b..0000000 --- a/env/.config/nvim/lua/plugins/harpoon.lua +++ /dev/null @@ -1,78 +0,0 @@ -return { - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - opts = { - settings = { - save_on_toggle = true, - sync_on_ui_close = true, - }, - }, - keys = { - { - "", - function() - require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) - end, - desc = "Open Harpoon window.", - }, - { - "a", - function() - require("harpoon"):list():add() - end, - desc = "[A]dd to the harpoon list.", - }, - { - "", - function() - require("harpoon"):list():select(1) - end, - desc = "Select first harpoon buffer.", - }, - { - "", - function() - require("harpoon"):list():select(2) - end, - desc = "Select second harpoon buffer.", - }, - { - "", - function() - require("harpoon"):list():select(3) - end, - desc = "Select third harpoon buffer.", - }, - { - "", - function() - require("harpoon"):list():select(4) - end, - desc = "Select fourth harpoon buffer.", - }, - { - "", - function() - require("harpoon"):list():prev() - end, - desc = "Previous harpoon buffer.", - }, - { - "", - function() - require("harpoon"):list():next() - end, - desc = "Next harpoon buffer.", - }, - -- Extensions - require("harpoon"):extend({ - UI_CREATE = function(cx) - vim.keymap.set("n", "", function() - require("harpoon").ui:select_menu_item({ vsplit = true }) - end, { buffer = cx.buffer, desc = "Open in [V]split" }) - end, - }), - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/init.lua b/env/.config/nvim/lua/plugins/init.lua deleted file mode 100644 index b974bc7..0000000 --- a/env/.config/nvim/lua/plugins/init.lua +++ /dev/null @@ -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 = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/lint.lua b/env/.config/nvim/lua/plugins/lint.lua deleted file mode 100644 index 2b17cab..0000000 --- a/env/.config/nvim/lua/plugins/lint.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "mfussenegger/nvim-lint", - opts = { - linters = { - markdownlint = { - args = { "--config", "~/.markdownlint.jsonc", "--" }, - }, - }, - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/lsp.lua b/env/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index bc0c172..0000000 --- a/env/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -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", "d", vim.diagnostic.open_float, opts) --- --- opts.desc = "Show diagnostics in Telescope" --- vim.keymap.set("n", "d", "Telescope diagnostics bufnr=0", opts) --- --- opts.desc = "Show documentation for what is under cursor" --- vim.keymap.set("n", "", vim.lsp.buf.hover, opts) --- --- opts.desc = "[G]oto [D]efinition" --- vim.keymap.set("n", "gd", "Telescope lsp_definitions trim_text=true", 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", "ca", vim.lsp.buf.code_action, opts) --- --- --opts.desc = "[R]e-[N]ame" --- --vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) --- --- opts.desc = "[R]eload or start LSP" --- vim.keymap.set("n", "rl", ":LspRestart | :LspStart", 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", "rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" }) --- end, --- } diff --git a/env/.config/nvim/lua/plugins/luasnip.lua b/env/.config/nvim/lua/plugins/luasnip.lua deleted file mode 100644 index cf7ee9a..0000000 --- a/env/.config/nvim/lua/plugins/luasnip.lua +++ /dev/null @@ -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 = { - { - "", - mode = { "i", "s" }, - function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end - end - }, - { - "", - mode = { "i", "s" }, - function() - if ls.jumpable(-1) then - ls.jump(-1) - end - end - }, - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/oil.lua b/env/.config/nvim/lua/plugins/oil.lua deleted file mode 100644 index f39d065..0000000 --- a/env/.config/nvim/lua/plugins/oil.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "stevearc/oil.nvim", - event = "VeryLazy", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - opts = { - columns = { "icon" }, - keymaps = { - [""] = false, - [""] = "actions.select_split", - [""] = { - "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. - { "-", "Oil", desc = "Open parent directory." }, - -- Open parent directory in floating window. - { - "-", - function() - require("oil").toggle_float() - end, - desc = "Open parent directory in floating window.", - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/snacks.lua b/env/.config/nvim/lua/plugins/snacks.lua deleted file mode 100644 index 6ca4ce3..0000000 --- a/env/.config/nvim/lua/plugins/snacks.lua +++ /dev/null @@ -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 = [[ - * - +++++ - +++++++++ - ==+++++++++++ - +===:+++++++++++* - +======--+++++++++++*##+==== - +==========:=+++++++++++#+==== - +=============-=++++++++++++==== - +================-:+++++++++++++== - +===================--++++++++++++++* - +======================--+++++++++++++++* - =========================-++++++++++++++++ - ==========================:+++++++++++++++ - ===========================:++++++++++++++ - ===========================-.-++++++++++++ - ===========================-::.=++++++++++ - ===========================----..=++++++++ - ===========================------..:=+++++ - ===========================--------:...-++ - ===========================------------:.: - ===========================--------------- - ===========================--------------- - ===========================--------------- -]], - }, - - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/telescope.lua b/env/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 4ee501e..0000000 --- a/env/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - import = "lazyvim.plugins.extras.editor.telescope", - enabled = false, - opts = { - ensure_installed = { - "swift", - }, - }, - }, -} diff --git a/env/.config/nvim/lua/plugins/todo-comment.lua b/env/.config/nvim/lua/plugins/todo-comment.lua deleted file mode 100644 index f798321..0000000 --- a/env/.config/nvim/lua/plugins/todo-comment.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "folke/todo-comments.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", - }, - keys = { - { "xt", false }, - { "xT", false }, - { "tq", "Trouble todo toggle", desc = "[T]odo [Q]uick fix list." }, - { "t", "TodoTelescope", desc = "[T]odo telescope list." }, - { "tl", "TodoLocList", desc = "[T]odo [L]ocation list." }, - }, -} diff --git a/env/.config/nvim/lua/plugins/typst-preview.lua b/env/.config/nvim/lua/plugins/typst-preview.lua deleted file mode 100644 index 4efa683..0000000 --- a/env/.config/nvim/lua/plugins/typst-preview.lua +++ /dev/null @@ -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 = { - { - "tp", - "TypstPreviewToggle", - desc = "Toggle typst preview." - }, - } -} diff --git a/env/.config/nvim/lua/plugins/xcodebuild.lua b/env/.config/nvim/lua/plugins/xcodebuild.lua deleted file mode 100644 index 9df4831..0000000 --- a/env/.config/nvim/lua/plugins/xcodebuild.lua +++ /dev/null @@ -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 = { - { "X", "XcodebuildPicker", desc = "Show Xcodebuild Actions" }, - { "xf", "XcodebuildProjectManager", desc = "Show Project Manager Actions" }, - { "xb", "XcodebuildBuild", desc = "Build Project" }, - { "xB", "XcodebuildBuildForTesting", desc = "Build For Testing" }, - { "xr", "XcodebuildBuildRun", desc = "Build & Run Project" }, - { "xt", "XcodebuildTest", desc = "Run Tests" }, - { "xt", "XcodebuildTestSelected", desc = "Run Selected Tests" }, - { "xT", "XcodebuildTestClass", desc = "Run This Test Class" }, - { "xl", "XcodebuildToggleLogs", desc = "Toggle Xcodebuild Logs" }, - { "xc", "XcodebuildToggleCodeCoverage", desc = "Toggle Code Coverage" }, - { "xC", "XcodebuildShowCodeCoverageReport", desc = "Show Code Coverage Report" }, - { "xe", "XcodebuildTestExplorerToggle", desc = "Toggle Test Explorer" }, - { "xs", "XcodebuildFailingSnapshots", desc = "Show Failing Snapshots" }, - { "xd", "XcodebuildSelectDevice", desc = "Select Device" }, - { "xp", "XcodebuildSelectTestPlan", desc = "Select Test Plan" }, - { "xq", "Telescope quickfixxx", "XcodebuildQuickfixLine", desc = "Quickfix Line" }, - { "xa", "XcodebuildCodeActions", desc = "Show Code Actions" }, - }, -} diff --git a/env/.config/zsh/.zshrc b/env/.config/zsh/.zshrc index 9afa65e..7b11318 100755 --- a/env/.config/zsh/.zshrc +++ b/env/.config/zsh/.zshrc @@ -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' diff --git a/env/.config/zsh/functions/n b/env/.config/zsh/functions/n deleted file mode 100755 index a7999f0..0000000 --- a/env/.config/zsh/functions/n +++ /dev/null @@ -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 "$@" -} - diff --git a/env/.tmux.conf b/env/.tmux.conf index 5d23931..8d11379 100755 --- a/env/.tmux.conf +++ b/env/.tmux.conf @@ -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