From 70a1581228f838b03545a4295aa6adf67b67c2a8 Mon Sep 17 00:00:00 2001 From: Grace Yoder Date: Mon, 23 Mar 2026 19:19:54 -0400 Subject: nvim overhaul --- vim/.config/nvim/.luarc.json | 0 vim/.config/nvim/init.lua | 30 ++- vim/.config/nvim/lua/native-lsp.lua | 4 + vim/.config/nvim/lua/packed.lua | 127 ++++++++++ vim/.config/nvim/lua/plugins.lua | 242 ++++++++++++++++++ vim/.config/nvim/lua/plugins/blink_config.lua | 11 - vim/.config/nvim/lua/plugins/init.lua | 319 ------------------------ vim/.config/nvim/lua/plugins/lualine-config.lua | 4 - vim/.config/nvim/lua/plugins/marks-config.lua | 36 --- vim/.config/nvim/lua/plugins/rust-config.lua | 34 --- vim/.config/nvim/lua/plugins/ts.lua | 41 --- vim/.config/nvim/lua/remap.lua | 57 ++--- vim/.config/nvim/lua/westwood-lint.lua | 9 +- vim/.config/nvim/nvim-pack-lock.json | 106 ++++++++ 14 files changed, 517 insertions(+), 503 deletions(-) create mode 100644 vim/.config/nvim/.luarc.json create mode 100644 vim/.config/nvim/lua/packed.lua create mode 100644 vim/.config/nvim/lua/plugins.lua delete mode 100644 vim/.config/nvim/lua/plugins/blink_config.lua delete mode 100644 vim/.config/nvim/lua/plugins/init.lua delete mode 100644 vim/.config/nvim/lua/plugins/lualine-config.lua delete mode 100644 vim/.config/nvim/lua/plugins/marks-config.lua delete mode 100644 vim/.config/nvim/lua/plugins/rust-config.lua delete mode 100644 vim/.config/nvim/lua/plugins/ts.lua create mode 100644 vim/.config/nvim/nvim-pack-lock.json diff --git a/vim/.config/nvim/.luarc.json b/vim/.config/nvim/.luarc.json new file mode 100644 index 0000000..e69de29 diff --git a/vim/.config/nvim/init.lua b/vim/.config/nvim/init.lua index 21cd978..3fa4cb9 100644 --- a/vim/.config/nvim/init.lua +++ b/vim/.config/nvim/init.lua @@ -26,8 +26,9 @@ require("remap") if vim.g.is_purdue then - -- require("westwood-lint") + require("westwood-lint") end + require("standard-lint") vim.cmd("source ~/.vim/settings.vim") @@ -118,17 +119,22 @@ vim.api.nvim_create_autocmd("TermOpen", { vim.o.clipboard = "unnamedplus" -vim.g.clipboard = { - name = "OSC 52", - copy = { - ["+"] = require("vim.ui.clipboard.osc52").copy("+"), - ["*"] = require("vim.ui.clipboard.osc52").copy("*"), - }, - paste = { - ["+"] = require("vim.ui.clipboard.osc52").paste("+"), - ["*"] = require("vim.ui.clipboard.osc52").paste("*"), - }, -} +-- vim.g.clipboard = { +-- name = "OSC 52", +-- copy = { +-- ["+"] = require("vim.ui.clipboard.osc52").copy("+"), +-- ["*"] = require("vim.ui.clipboard.osc52").copy("*"), +-- }, +-- paste = { +-- ["+"] = require("vim.ui.clipboard.osc52").paste("+"), +-- ["*"] = require("vim.ui.clipboard.osc52").paste("*"), +-- }, +-- } +vim.g.clipboard = "osc52" +vim.keymap.set("n", "p", '"+p') +vim.keymap.set("n", "P", '"+P') + + -- stupid hacky workaround to make it so i can paste from tmux with OSC52 -- https://github.com/neovim/neovim/discussions/29350#discussioncomment-10299517 -- tracking issue about tmux behavior: https://github.com/tmux/tmux/issues/4275 diff --git a/vim/.config/nvim/lua/native-lsp.lua b/vim/.config/nvim/lua/native-lsp.lua index 33c9c01..ee97f80 100644 --- a/vim/.config/nvim/lua/native-lsp.lua +++ b/vim/.config/nvim/lua/native-lsp.lua @@ -88,6 +88,10 @@ vim.lsp.enable("fish-lsp") +vim.diagnostic.config({ + virtual_text = { priority = 100 }, +}) + -- https://lsp-zero.netlify.app/blog/lsp-client-features.html vim.opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' } diff --git a/vim/.config/nvim/lua/packed.lua b/vim/.config/nvim/lua/packed.lua new file mode 100644 index 0000000..28a21cc --- /dev/null +++ b/vim/.config/nvim/lua/packed.lua @@ -0,0 +1,127 @@ +-- +-- Packed: a single file, somewhat compatible Packer replacement +-- Written by grace +-- + +local function resolve_src(s) + if s:match("^https?://") then + return s + end + if s:match("^[%w%-]+/[%w%-_.]+$") then + return "https://github.com/" .. s + end + return s +end + +local function normalize_plugin(p) + if type(p) == "string" then + return { + src = resolve_src(p), + name = p:match(".*/(.*)"), + } + end + + if type(p[1]) == "string" then + p.src = resolve_src(p[1]) + p[1] = nil + end + + if p.src then + p.src = resolve_src(p.src) + end + + if not p.name and p.as then + p.name = p.as + end + + if not p.version then + if p.commit then + p.version = p.commit + elseif p.tag then + p.version = p.tag + elseif p.branch then + p.version = p.branch + end + end + + + + local unsupported = { + 'disable', 'installer', 'updater', 'after', 'rtp', + 'opt', 'bufread', 'lock', 'run', 'requires', 'rocks', 'setup' + } + + for _, field in ipairs(unsupported) do + if p[field] then + vim.notify("Packed does not support `" .. field .. "`: " .. (p.name or p.src), vim.log.levels.WARN) + vim.api.nvim_echo({ { "Press Enter to continue...", "MoreMsg" } }, false, {}) + vim.fn.getchar() + end + end + + if p.cmd or p.ft or p.keys or p.event or p.fn or p.cond or p.module or p.module_pattern then + vim.notify("Packed does not support lazy loading: " .. (p.name or p.src), vim.log.levels.WARN) + vim.api.nvim_echo({ { "Press Enter to continue...", "MoreMsg" } }, false, {}) + vim.fn.getchar() + end + + + + return p +end + +local function setup_plugins(plugs) + local plugins = {} + + if type(plugs) == "function" then + local function use(p) + table.insert(plugins, p) + end + + plugs(use) + else + plugins = plugs + end + local specs = {} + + for _, p in ipairs(plugins) do + p = normalize_plugin(p) + + local spec = vim.deepcopy(p) + spec.config = nil + + table.insert(specs, spec) + end + + vim.pack.add(specs, { confirm = true, load = true }) + + + for _, p in ipairs(plugins) do + if type(p) ~= "string" and p.config then + local ok = pcall(p.config) + if not ok then + vim.notify("Config failed: " .. (p.name or p.src), vim.log.levels.ERROR) + vim.api.nvim_echo({ { "Press Enter to continue...", "MoreMsg" } }, false, {}) + vim.fn.getchar() + end + end + end + + + local unused = vim.iter(vim.pack.get()) + :filter(function(p) + return not p.active + end) + :map(function(p) + return p.spec.name + end) + :totable() + + vim.pack.del(unused) +end + + +local r = {} +r.setup = setup_plugins + +return r diff --git a/vim/.config/nvim/lua/plugins.lua b/vim/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..dcdf5df --- /dev/null +++ b/vim/.config/nvim/lua/plugins.lua @@ -0,0 +1,242 @@ +-- vim.pack.update(nil, { target = 'lockfile' }) + +return require("packed").setup(function(use) + use 'nvim-lua/plenary.nvim' + use { + 'nvim-telescope/telescope.nvim', + config = function() + require('telescope').setup({ + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--glob=!node_modules/**", + "--glob=!build/**", + }, + file_ignore_patterns = { "node_modules", "build" }, + }, + }) + end, + } + + + use { + 'nvim-treesitter/nvim-treesitter', + branch = 'main', + config = function() + require('nvim-treesitter').setup() + + require('nvim-treesitter').install({ + 'c', 'lua', 'vim', 'vimdoc', 'query', 'markdown', 'markdown_inline', 'go' + }):wait() + + -- enable highlighting + vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(args.buf)) + if ok and stats and stats.size > max_filesize then + return + end + pcall(vim.treesitter.start) + end, + }) + end + } + + + + use 'mbbill/undotree' + use 'nvim-tree/nvim-web-devicons' + use 'mfussenegger/nvim-lint' + use { + 'nvim-lualine/lualine.nvim', + config = function() + require('lualine').setup { + options = { theme = "rose-pine" } + } + end + } + + -- grrr why does neovim not have this? + use { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup {} + end + } + + use { "akinsho/toggleterm.nvim", config = function() + require("toggleterm").setup { + size = 30 + } + vim.keymap.set({ "n", "t", "v" }, "tt", require("toggleterm").toggle, { desc = "Toggle terminal" }) + end } + use { 'nvim-telescope/telescope.nvim' } + use { + 'anurag3301/nvim-platformio.lua', + config = function() + if not vim.g.is_purdue then + require('platformio').setup({ + lsp = "ccls" --default: ccls, other option: clangd + -- If you pick clangd, it also creates compile_commands.json + }) + end + end + } + + use { + "chentoast/marks.nvim", + config = function() require('marks').setup() end + } + + -- use { "MunifTanjim/nui.nvim" } + + use { 'rafamadriz/friendly-snippets' } + use { + 'saghen/blink.cmp', + version = 'v1.10.1', + config = function() + require("blink.cmp").setup({ + fuzzy = { + implementation = "prefer_rust_with_warning", + prebuilt_binaries = { + download = true, + force_version = "v1.*" + }, + }, + keymap = { preset = "enter" }, + }) + end + } + + use { + 'f-person/git-blame.nvim', + config = function() + require("gitblame").setup { + gitblame_delay = 1 + } + end + } + + + use { + "mfussenegger/nvim-dap", + + config = function() + local dap = require("dap") + + -- require('dap.ext.vscode').load_launchjs(nil, { + -- node = { 'javascript', 'typescript' }, + -- python = { 'python' }, + -- go = { 'go' }, + -- codelldb = { 'c', 'cpp', 'rust' } + -- }) + + vim.keymap.set('n', '', function() dap.continue() end, { desc = 'DAP: Continue' }) + vim.keymap.set('n', '', function() dap.step_into() end, { desc = 'DAP: Step Into' }) + vim.keymap.set('n', '', function() dap.step_out() end, { desc = 'DAP: Step Out' }) + vim.keymap.set('n', '', function() dap.step_over() end, { desc = 'DAP: Step Over' }) + vim.keymap.set('n', '', function() dap.toggle_breakpoint() end, { desc = 'DAP: Toggle Breakpoint' }) + vim.keymap.set('n', '', function() dap.continue() end) + vim.keymap.set('n', '', function() dap.step_over() end) + vim.keymap.set('n', '', function() dap.step_into() end) + vim.keymap.set('n', '', function() dap.step_out() end) + vim.keymap.set('n', 'b', function() dap.toggle_breakpoint() end) + vim.keymap.set('n', 'dr', function() dap.repl.open() end) + + dap.adapters.codelldb = { + type = "executable", + command = "codelldb" + } + dap.configurations.cpp = { + { + name = "Launch file", + type = "codelldb", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + }, + } + end + } + + + use { + 'stevearc/overseer.nvim', + config = function() require('overseer').setup() end + } + use 'theHamsta/nvim-dap-virtual-text' + use "nvim-neotest/nvim-nio" + use { + "rcarriga/nvim-dap-ui", + config = function() + local dap, dapui = require("dap"), require("dapui") + dapui.setup() + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + end + } + + use { "geigerzaehler/tree-sitter-jinja2" } + + use { + "rose-pine/neovim", + as = "rose-pine", + config = function() + require("rose-pine").setup({ + variant = "moon" + }) + vim.cmd("colorscheme rose-pine") + end + } + + use { + 'chomosuke/typst-preview.nvim', + config = function() + require 'typst-preview'.setup {} + end, + } + + + use({ + "iamcco/markdown-preview.nvim", + config = function() + vim.api.nvim_create_user_command("MDPreviewInstall", function() + vim.vim.fn["mkdp#util#install"]() + end, {}) + end, + }) + + + use { + 'LukasPietzschmann/telescope-tabs', + config = function() + require 'telescope-tabs'.setup { + -- Your custom config :^) + } + end + } + use "HiPhish/rainbow-delimiters.nvim" + + + ------------------------ +end) diff --git a/vim/.config/nvim/lua/plugins/blink_config.lua b/vim/.config/nvim/lua/plugins/blink_config.lua deleted file mode 100644 index 00d5a59..0000000 --- a/vim/.config/nvim/lua/plugins/blink_config.lua +++ /dev/null @@ -1,11 +0,0 @@ -require("blink.cmp").setup({ - fuzzy = { - implementation = "lua", - prebuilt_binaries = { - download = true, - force_version = 'v1.2.0', - }, - }, - keymap = { preset = "enter" }, -}) - diff --git a/vim/.config/nvim/lua/plugins/init.lua b/vim/.config/nvim/lua/plugins/init.lua deleted file mode 100644 index 574aaf0..0000000 --- a/vim/.config/nvim/lua/plugins/init.lua +++ /dev/null @@ -1,319 +0,0 @@ -vim.cmd [[packadd packer.nvim]] - -local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - vim.cmd [[packadd packer.nvim]] - return true - end - return false -end - -local packer_bootstrap = ensure_packer() - -return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - - -- use "neovim/nvim-lspconfig" - - use { - 'maxmx03/solarized.nvim', - config = function() - vim.o.background = 'dark' - ---@type solarized - local solarized = require('solarized') - vim.o.termguicolors = true - vim.o.background = 'dark' - solarized.setup({}) - -- vim.cmd.colorscheme 'solarized' - end - } - use { - 'nvim-telescope/telescope.nvim', - requires = { { 'nvim-lua/plenary.nvim' } }, - run = ":TSUpdate", - config = function() - require('telescope').setup({ - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--glob=!node_modules/**", - "--glob=!build/**", - }, - file_ignore_patterns = { "node_modules", "build" }, - }, - }) - end, - } - - - use { - 'nvim-treesitter/nvim-treesitter', - branch = 'main', - run = ':TSUpdate', - config = function() - require('nvim-treesitter').setup() - - require('nvim-treesitter').install({ - 'c', 'lua', 'vim', 'vimdoc', 'query', 'markdown', 'markdown_inline', 'go' - }):wait() - - -- enable highlighting - vim.api.nvim_create_autocmd('FileType', { - callback = function(args) - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(args.buf)) - if ok and stats and stats.size > max_filesize then - return - end - pcall(vim.treesitter.start) - end, - }) - end - } - - - - use 'mbbill/undotree' - use 'mfussenegger/nvim-lint' - use { - 'nvim-lualine/lualine.nvim', - requires = { 'nvim-tree/nvim-web-devicons', opt = true }, - config = function() require('plugins/lualine-config') end - } - -- use { - -- 'm4xshen/autoclose.nvim', - -- config = function() require("autoclose").setup() end - -- } - -- - use { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - require("nvim-autopairs").setup {} - end - } - - use { - 'CRAG666/betterTerm.nvim', - config = function() require('betterTerm').setup() end - } - - use { - 'anurag3301/nvim-platformio.lua', - requires = { - { 'akinsho/nvim-toggleterm.lua' }, - { 'nvim-telescope/telescope.nvim' }, - { 'nvim-lua/plenary.nvim' }, - }, - config = function() - if not vim.g.is_purdue then - require('platformio').setup({ - lsp = "clangd" --default: ccls, other option: clangd - -- If you pick clangd, it also creates compile_commands.json - }) - end - end - } - - use { - "chentoast/marks.nvim", - config = function() require('plugins/marks-config') end - } - - use { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - requires = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - } - } - - - use { "nvim-tree/nvim-web-devicons" } - use { "MunifTanjim/nui.nvim" } - - use { 'rafamadriz/friendly-snippets' } - use { - 'saghen/blink.cmp', - run = 'cargo build --release', - config = function() - require("plugins/blink_config") - end - } - - use { - 'f-person/git-blame.nvim', - config = function() - require("gitblame").setup { - gitblame_delay = 1 - } - end - } - - -- use { - -- 'mrcjkb/rustaceanvim', - -- config = function() require('plugins/rust-config') end - -- } - - use { - "NeogitOrg/neogit", - config = function() - require("neogit").setup {} - end - } - - use { - "mfussenegger/nvim-dap", - - config = function() - local dap = require("dap") - - require('dap.ext.vscode').load_launchjs(nil, { - node = { 'javascript', 'typescript' }, - python = { 'python' }, - go = { 'go' }, - codelldb = { 'c', 'cpp', 'rust' } - }) - - vim.keymap.set('n', '', function() dap.continue() end, { desc = 'DAP: Continue' }) - vim.keymap.set('n', '', function() dap.step_into() end, { desc = 'DAP: Step Into' }) - vim.keymap.set('n', '', function() dap.step_out() end, { desc = 'DAP: Step Out' }) - vim.keymap.set('n', '', function() dap.step_over() end, { desc = 'DAP: Step Over' }) - vim.keymap.set('n', '', function() dap.toggle_breakpoint() end, { desc = 'DAP: Toggle Breakpoint' }) - vim.keymap.set('n', '', function() dap.continue() end) - vim.keymap.set('n', '', function() dap.step_over() end) - vim.keymap.set('n', '', function() dap.step_into() end) - vim.keymap.set('n', '', function() dap.step_out() end) - vim.keymap.set('n', 'b', function() dap.toggle_breakpoint() end) - vim.keymap.set('n', 'dr', function() dap.repl.open() end) - - dap.adapters.codelldb = { - type = "executable", - command = "codelldb" - } - dap.configurations.cpp = { - { - name = "Launch file", - type = "codelldb", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - }, - } - end - } - - - use { - 'stevearc/overseer.nvim', - config = function() require('overseer').setup() end - } - use 'theHamsta/nvim-dap-virtual-text' - use { - "rcarriga/nvim-dap-ui", - requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, - config = function() - local dap, dapui = require("dap"), require("dapui") - dapui.setup() - dap.listeners.before.attach.dapui_config = function() - dapui.open() - end - dap.listeners.before.launch.dapui_config = function() - dapui.open() - end - dap.listeners.before.event_terminated.dapui_config = function() - dapui.close() - end - dap.listeners.before.event_exited.dapui_config = function() - dapui.close() - end - end - } - - use { "geigerzaehler/tree-sitter-jinja2" } - - use "echasnovski/mini.base16" - - use 'rktjmp/lush.nvim' - - use { - "rose-pine/neovim", - as = "rose-pine", - config = function() - require("rose-pine").setup({ - variant = "moon" - }) - vim.cmd("colorscheme rose-pine") - end - } - - use { - 'chomosuke/typst-preview.nvim', - tag = 'v1.*', - config = function() - require 'typst-preview'.setup {} - end, - } - - -- use "folke/which-key.nvim" - - use({ - "andrewferrier/wrapping.nvim", - config = function() - require("wrapping").setup() - end, - }) - - use({ - "iamcco/markdown-preview.nvim", - run = function() vim.fn["mkdp#util#install"]() end, - }) - - - -- use { - -- 'preservim/vim-pencil', - -- config = function() - -- vim.cmd([[ - -- augroup PencilSetup - -- autocmd! - -- autocmd FileType markdown,text,tex,gitcommit setlocal formatoptions+=t - -- autocmd FileType markdown,text,tex,gitcommit PencilHard - -- augroup END augroup END - -- ]]) - -- end - -- } - - use { - 'LukasPietzschmann/telescope-tabs', - requires = { 'nvim-telescope/telescope.nvim' }, - config = function() - require 'telescope-tabs'.setup { - -- Your custom config :^) - } - end - } - - use "HiPhish/rainbow-delimiters.nvim" - - - ------------------------ - - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/vim/.config/nvim/lua/plugins/lualine-config.lua b/vim/.config/nvim/lua/plugins/lualine-config.lua deleted file mode 100644 index fe47e43..0000000 --- a/vim/.config/nvim/lua/plugins/lualine-config.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('lualine').setup { - options = { theme = "rose-pine" } -} - diff --git a/vim/.config/nvim/lua/plugins/marks-config.lua b/vim/.config/nvim/lua/plugins/marks-config.lua deleted file mode 100644 index d1b4c82..0000000 --- a/vim/.config/nvim/lua/plugins/marks-config.lua +++ /dev/null @@ -1,36 +0,0 @@ -require'marks'.setup { - -- whether to map keybinds or not. default true - default_mappings = true, - -- which builtin marks to show. default {} - builtin_marks = { ".", "<", ">", "^" }, - -- whether movements cycle back to the beginning/end of buffer. default true - cyclic = true, - -- whether the shada file is updated after modifying uppercase marks. default false - force_write_shada = false, - -- how often (in ms) to redraw signs/recompute mark positions. - -- higher values will have better performance but may cause visual lag, - -- while lower values may cause performance penalties. default 150. - refresh_interval = 250, - -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase - -- marks, and bookmarks. - -- can be either a table with all/none of the keys, or a single number, in which case - -- the priority applies to all marks. - -- default 10. - sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 }, - -- disables mark tracking for specific filetypes. default {} - excluded_filetypes = {}, - -- disables mark tracking for specific buftypes. default {} - excluded_buftypes = {}, - -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own - -- sign/virttext. Bookmarks can be used to group together positions and quickly move - -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and - -- default virt_text is "". - bookmark_0 = { - sign = "⚑", - virt_text = "hello world", - -- explicitly prompt for a virtual line annotation when setting a bookmark from this group. - -- defaults to false. - annotate = false, - }, - mappings = {} -} diff --git a/vim/.config/nvim/lua/plugins/rust-config.lua b/vim/.config/nvim/lua/plugins/rust-config.lua deleted file mode 100644 index c52d382..0000000 --- a/vim/.config/nvim/lua/plugins/rust-config.lua +++ /dev/null @@ -1,34 +0,0 @@ -local bufnr = vim.api.nvim_get_current_buf() -vim.keymap.set( - "n", - "a", - function() - vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping - -- or vim.lsp.buf.codeAction() if you don't want grouping. - end, - { silent = true, buffer = bufnr } -) -vim.keymap.set( - "n", - "K", - function() - if vim.bo.filetype == "rust" then - vim.cmd.RustLsp({'hover', 'actions'}) - else - vim.lsp.buf.hover() - end - end, - { silent = true, buffer = bufnr } -) - -vim.g.rustaceanvim = { - server = { - settings = { - ["rust-analyzer"] = { - checkOnSave = { - command = "clippy", - }, - }, - }, - }, -} diff --git a/vim/.config/nvim/lua/plugins/ts.lua b/vim/.config/nvim/lua/plugins/ts.lua deleted file mode 100644 index 5f1b8b0..0000000 --- a/vim/.config/nvim/lua/plugins/ts.lua +++ /dev/null @@ -1,41 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the listed parsers MUST always be installed) - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - -- List of parsers to ignore installing (or "all") - -- ignore_install = { "javascript" }, - - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - - highlight = { - enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - -- disable = { "c", "rust" }, - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - disable = function(lang, buf) - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end - end, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} diff --git a/vim/.config/nvim/lua/remap.lua b/vim/.config/nvim/lua/remap.lua index 1f8964e..0128949 100644 --- a/vim/.config/nvim/lua/remap.lua +++ b/vim/.config/nvim/lua/remap.lua @@ -57,45 +57,18 @@ vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) -- Better Term -local betterTerm = require('betterTerm') --- toggle firts term -vim.keymap.set({ "n", "t" }, "tt", betterTerm.open, { desc = "Open terminal" }) --- Select term focus --- vim.keymap.set({"n"}, "tf", betterTerm.select, { desc = "Select terminal"}) --- Create new term -local current = 2 -vim.keymap.set( - { "n" }, "tn", - function() - betterTerm.open(current) - current = current + 1 - end, - { desc = "New terminal" } -) - --- Neotree - -local ntc = require('neo-tree.command') -vim.keymap.set('n', '', function() - local reveal_file = vim.fn.expand('%:p') - if (reveal_file == '') then - reveal_file = vim.fn.getcwd() - else - local f = io.open(reveal_file, "r") - if (f) then - f.close(f) - else - reveal_file = vim.fn.getcwd() - end - end - ntc.execute({ - action = "focus", -- OPTIONAL, this is the default value - source = "filesystem", -- OPTIONAL, this is the default value - position = "right", -- OPTIONAL, this is the default value - reveal_file = reveal_file, -- path to file or folder to reveal - reveal_force_cwd = true, -- change cwd without asking if needed - toggle = true, - }) - end, - { desc = "Show Sidebar" } -) +-- local betterTerm = require('betterTerm') +-- -- toggle firts term +-- vim.keymap.set({ "n", "t" }, "tt", betterTerm.open, { desc = "Open terminal" }) +-- -- Select term focus +-- -- vim.keymap.set({"n"}, "tf", betterTerm.select, { desc = "Select terminal"}) +-- -- Create new term +-- local current = 2 +-- vim.keymap.set( +-- { "n" }, "tn", +-- function() +-- betterTerm.open(current) +-- current = current + 1 +-- end, +-- { desc = "New terminal" } +-- ) diff --git a/vim/.config/nvim/lua/westwood-lint.lua b/vim/.config/nvim/lua/westwood-lint.lua index 0ffc8d8..04501b2 100644 --- a/vim/.config/nvim/lua/westwood-lint.lua +++ b/vim/.config/nvim/lua/westwood-lint.lua @@ -1,18 +1,19 @@ local lint = require("lint") -local errorformat = "%WWARNING: %m,%Z%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\sat (stdin) from line %l column %c to line %e column %k" +local errorformat = +"%WWARNING: %m,%Z%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\sat (stdin) from line %l column %c to line %e column %k" lint.linters.westwood = { cmd = '/homes/kkasad/share/westwood', stdin = true, - args = {'-f', 'machine', '-'}, + args = { '-f', 'machine', '-' }, stream = both, ignore_exitcode = false, env = nil, parser = require('lint.parser').from_errorformat(errorformat) } -lint.linters_by_ft.c = {"westwood", "clangtidy"} -lint.linters_by_ft.cpp = {"westwood"} +lint.linters_by_ft.c = { "westwood", "clangtidy" } +lint.linters_by_ft.cpp = { "westwood" } vim.list_extend(lint.linters_by_ft.c, { "westwood", "clangtidy" }) vim.list_extend(lint.linters_by_ft.cpp, { "westwood" }) diff --git a/vim/.config/nvim/nvim-pack-lock.json b/vim/.config/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..ece9140 --- /dev/null +++ b/vim/.config/nvim/nvim-pack-lock.json @@ -0,0 +1,106 @@ +{ + "plugins": { + "blink.cmp": { + "rev": "451168851e8e2466bc97ee3e026c3dcb9141ce07", + "src": "https://github.com/saghen/blink.cmp", + "version": "'v1.10.1'" + }, + "friendly-snippets": { + "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", + "src": "https://github.com/rafamadriz/friendly-snippets" + }, + "git-blame.nvim": { + "rev": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7", + "src": "https://github.com/f-person/git-blame.nvim" + }, + "lualine.nvim": { + "rev": "47f91c416daef12db467145e16bed5bbfe00add8", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "markdown-preview.nvim": { + "rev": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee", + "src": "https://github.com/iamcco/markdown-preview.nvim" + }, + "marks.nvim": { + "rev": "f353e8c08c50f39e99a9ed474172df7eddd89b72", + "src": "https://github.com/chentoast/marks.nvim" + }, + "nvim-autopairs": { + "rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5", + "src": "https://github.com/windwp/nvim-autopairs" + }, + "nvim-dap": { + "rev": "a9d8cb68ee7184111dc66156c4a2ebabfbe01bc5", + "src": "https://github.com/mfussenegger/nvim-dap" + }, + "nvim-dap-ui": { + "rev": "f5b6673f374626515401c5bc51b005f784a4f252", + "src": "https://github.com/rcarriga/nvim-dap-ui" + }, + "nvim-dap-virtual-text": { + "rev": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6", + "src": "https://github.com/theHamsta/nvim-dap-virtual-text" + }, + "nvim-lint": { + "rev": "606b823a57b027502a9ae00978ebf4f5d5158098", + "src": "https://github.com/mfussenegger/nvim-lint" + }, + "nvim-nio": { + "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", + "src": "https://github.com/nvim-neotest/nvim-nio" + }, + "nvim-platformio.lua": { + "rev": "3bc47194d0917a1f174e8c05d90e93824bd5d76f", + "src": "https://github.com/anurag3301/nvim-platformio.lua" + }, + "nvim-treesitter": { + "rev": "6620ae1c44dfa8623b22d0cbf873a9e8d073b849", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'main'" + }, + "nvim-web-devicons": { + "rev": "d7462543c9e366c0d196c7f67a945eaaf5d99414", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "overseer.nvim": { + "rev": "a2194447f4c5a1baf95139c5c7b539fa7b0d012f", + "src": "https://github.com/stevearc/overseer.nvim" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "rainbow-delimiters.nvim": { + "rev": "607a438d8c647a355749973fd295e33505afafde", + "src": "https://github.com/HiPhish/rainbow-delimiters.nvim" + }, + "rose-pine": { + "rev": "cf2a288696b03d0934da713d66c6d71557b5c997", + "src": "https://github.com/rose-pine/neovim" + }, + "telescope-tabs": { + "rev": "777b1f630f3d6a12a2e71635a82581c988d6da2e", + "src": "https://github.com/LukasPietzschmann/telescope-tabs" + }, + "telescope.nvim": { + "rev": "5255aa27c422de944791318024167ad5d40aad20", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "toggleterm.nvim": { + "rev": "9a88eae817ef395952e08650b3283726786fb5fb", + "src": "https://github.com/akinsho/toggleterm.nvim" + }, + "tree-sitter-jinja2": { + "rev": "ecab6215c53da5c1126d81d1bf664b3b5cf87d15", + "src": "https://github.com/geigerzaehler/tree-sitter-jinja2" + }, + "typst-preview.nvim": { + "rev": "a42c86ef1875100c2be92e90a637064efb0eab06", + "src": "https://github.com/chomosuke/typst-preview.nvim" + }, + "undotree": { + "rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d", + "src": "https://github.com/mbbill/undotree" + } + } +} \ No newline at end of file -- cgit v1.3.1