From 9f21612deec258184714f1112a320e1c2253c281 Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Mon, 28 Jul 2025 10:28:47 -0400 Subject: [PATCH] save --- nvim/.config/nvim/init.lua | 190 ++++++------------ nvim/bak.config/nvim/init.lua | 3 - nvim/bak.config/nvim/lazy-lock.json | 32 --- nvim/bak.config/nvim/lua/vxclutch/init.lua | 3 - .../nvim/lua/vxclutch/lazy/colors.lua | 33 --- .../nvim/lua/vxclutch/lazy/format.lua | 42 ---- .../bak.config/nvim/lua/vxclutch/lazy/git.lua | 18 -- .../nvim/lua/vxclutch/lazy/harpoon.lua | 32 --- .../bak.config/nvim/lua/vxclutch/lazy/lsp.lua | 166 --------------- .../nvim/lua/vxclutch/lazy/luasnip.lua | 25 --- .../nvim/lua/vxclutch/lazy/mini.lua | 23 --- .../bak.config/nvim/lua/vxclutch/lazy/oil.lua | 37 ---- .../nvim/lua/vxclutch/lazy/snacks.lua | 37 ---- .../nvim/lua/vxclutch/lazy/telescope.lua | 49 ----- .../nvim/lua/vxclutch/lazy/treesitter.lua | 61 ------ .../nvim/lua/vxclutch/lazy/trouble.lua | 12 -- .../nvim/lua/vxclutch/lazy_init.lua | 17 -- nvim/bak.config/nvim/lua/vxclutch/remap.lua | 36 ---- nvim/bak.config/nvim/lua/vxclutch/set.lua | 40 ---- .../nvim/lua/vxclutch/snippets/all.lua | 3 - .../nvim/lua/vxclutch/snippets/c.lua | 33 --- .../nvim/lua/vxclutch/snippets/typst.lua | 26 --- 22 files changed, 59 insertions(+), 859 deletions(-) delete mode 100644 nvim/bak.config/nvim/init.lua delete mode 100644 nvim/bak.config/nvim/lazy-lock.json delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/init.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/remap.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/set.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua delete mode 100644 nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index ed1496a..f3caa88 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,87 +1,31 @@ --- Colorscheme & Theme vim.cmd.colorscheme("vim") - vim.g.mapleader = " " -local opt = vim.opt +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", ":nohlsearch") +vim.keymap.set("n", "f", vim.lsp.buf.format) +vim.keymap.set("n", "pv", ":Ex") +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") +vim.keymap.set({ 'n', 'v', 'x' }, 'd', '"+d') +vim.keymap.set({ 'n', 'v', 'x' }, 'y', '"+y') +vim.o.number = true +vim.o.relativenumber = true +vim.o.shiftwidth = 2 +vim.o.tabstop = 2 +vim.o.expandtab = true +vim.o.scrolloff = 8 +vim.o.wrap = false +vim.o.winborder = "rounded" +vim.o.clipboard = "unnamedplus" +vim.o.swapfile = false -local function map(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.keymap.set(mode, lhs, rhs, options) -end - -map("n", "en", ":e ~/dotfiles/nvim/.config/nvim/init.lua") -- Edit NeoVim config file ( this file ) - -map("n", "", ":nohlsearch") -- Clear search highlight -map("v", "J", ":m '>+1gv=gv") -- Move the current line down -map("v", "K", ":m '<-2gv=gv") -- Move the current line up -map("n", "", "zz") -- Scroll down and move cursor to center -map("n", "", "zz") -- Scroll up and move cursor to center -map("n", "pv", ":Ex") -- Open up netrw on pv -map("n", "", "") -- Focus right -map("n", "", "") -- Focus left -map("n", "", "") -- Focus down -map("n", "", "") -- Focus up -vim.keymap.set("n", "e", function() -- Populate then toggle the quick-fix list - vim.diagnostic.setqflist({ open = false }) - local is_open = false - for _, win in ipairs(vim.fn.getwininfo()) do - if win.quickfix == 1 then - is_open = true - break - end - end - vim.schedule(function() - if is_open then - vim.cmd("cclose") - else - vim.cmd("copen") - end - end) -end) - --- Visual settings -opt.inccommand = "split" -- Live substitution preview -opt.smartcase = true -- Override 'ignorecase' when pattern has uppercase -opt.ignorecase = true -- Ignore case in search -opt.number = true -- Show line numbers -opt.relativenumber = true -- Show relative line numbers -opt.splitbelow = true -- New horizontal splits open below -opt.splitright = true -- New vertical splits open to the right -opt.shiftwidth = 2 -- Spaces for auto-indent -opt.tabstop = 2 -- Spaces for a tab character -opt.expandtab = true -- Use spaces instead of tabs -opt.scrolloff = 8 -- Lines to keep above/below cursor -vim.cmd('autocmd BufEnter * set formatoptions-=cro') -- Disable auto-commenting on new lines -vim.cmd('autocmd BufEnter * setlocal formatoptions-=cro') -- Disable auto-commenting for local buffers -opt.wrap = false -- Do not wrap lines -opt.cursorline = true -- Highlight current line - --- File Handling -opt.swapfile = false -- Disable swap file -opt.backup = false -- Don't create backup files -opt.writebackup = false -- Don't create backup before writing -opt.backup = false -- Disable backup file -opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -- Set undo file directory -opt.undofile = true -- Enable persistent undo -opt.updatetime = 300 -- Faster completion -opt.autoread = true -- Auto reload files changed outside vim -opt.autowrite = false -- Don't auto save - --- Behavior settings -opt.hidden = true -- Allow hidden buffers -opt.errorbells = false -- No error bells -opt.backspace = "indent,eol,start" -- Better backspace behavior -opt.autochdir = false -- Don't auto change directory -opt.iskeyword:append("-") -- Treat dash as part of word -opt.path:append("**") -- include subdirectories in search - --- Basic autocommands local augroup = vim.api.nvim_create_augroup("vxclutch", {}) --- Return to last edit position when opening files vim.api.nvim_create_autocmd("BufReadPost", { group = augroup, callback = function() @@ -93,17 +37,16 @@ vim.api.nvim_create_autocmd("BufReadPost", { end, }) --- Disable line numbers in terminal vim.api.nvim_create_autocmd("TermOpen", { group = augroup, callback = function() - vim.opt_local.number = false - vim.opt_local.relativenumber = false - vim.opt_local.signcolumn = "no" + vim.vim.o_local.number = false + vim.vim.o_local.relativenumber = false + vim.vim.o_local.signcolumn = "no" end, }) --- Create directories when saving files + vim.api.nvim_create_autocmd("BufWritePre", { group = augroup, callback = function() @@ -114,22 +57,11 @@ vim.api.nvim_create_autocmd("BufWritePre", { end, }) --- Command-line completion -vim.opt.wildmenu = true -vim.opt.wildmode = "longest:full,full" -vim.opt.wildignore:append({ "*.o", "*.obj" }) - --- Performance improvements -vim.opt.redrawtime = 10000 -vim.opt.maxmempattern = 20000 - --- Create undo directory if it doesn't exist local undodir = vim.fn.expand("~/.vim/undodir") if vim.fn.isdirectory(undodir) == 0 then vim.fn.mkdir(undodir, "p") end --- terminal local terminal_state = { buf = nil, win = nil, @@ -137,27 +69,26 @@ local terminal_state = { } local function FloatingTerminal() - -- If terminal is already open, close it (toggle behavior) if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then vim.api.nvim_win_close(terminal_state.win, false) terminal_state.is_open = false return end - -- Create buffer if it doesn't exist or is invalid + if not terminal_state.buf or not vim.api.nvim_buf_is_valid(terminal_state.buf) then terminal_state.buf = vim.api.nvim_create_buf(false, true) - -- Set buffer options for better terminal experience - vim.api.nvim_buf_set_option(terminal_state.buf, 'bufhidden', 'hide') + + vim.api.nvim_buf_set_vim.oion(terminal_state.buf, 'bufhidden', 'hide') end - -- Calculate window dimensions + local width = math.floor(vim.o.columns * 0.8) local height = math.floor(vim.o.lines * 0.8) local row = math.floor((vim.o.lines - height) / 2) local col = math.floor((vim.o.columns - width) / 2) - -- Create the floating window + terminal_state.win = vim.api.nvim_open_win(terminal_state.buf, true, { relative = 'editor', width = width, @@ -168,18 +99,18 @@ local function FloatingTerminal() border = 'rounded', }) - -- Set transparency for the floating window - vim.api.nvim_win_set_option(terminal_state.win, 'winblend', 0) - -- Set transparent background for the window - vim.api.nvim_win_set_option(terminal_state.win, 'winhighlight', + vim.api.nvim_win_set_vim.oion(terminal_state.win, 'winblend', 0) + + + vim.api.nvim_win_set_vim.oion(terminal_state.win, 'winhighlight', 'Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder') - -- Define highlight groups for transparency + vim.api.nvim_set_hl(0, "FloatingTermNormal", { bg = "none" }) vim.api.nvim_set_hl(0, "FloatingTermBorder", { bg = "none", }) - -- Start terminal if not already running + local has_terminal = false local lines = vim.api.nvim_buf_get_lines(terminal_state.buf, 0, -1, false) for _, line in ipairs(lines) do @@ -196,7 +127,7 @@ local function FloatingTerminal() terminal_state.is_open = true vim.cmd("startinsert") - -- Set up auto-close on buffer leave + vim.api.nvim_create_autocmd("BufLeave", { buffer = terminal_state.buf, callback = function() @@ -209,39 +140,29 @@ local function FloatingTerminal() }) end --- Function to explicitly close the terminal + local function CloseFloatingTerminal() if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then vim.api.nvim_win_close(terminal_state.win, false) terminal_state.is_open = false end end - --- Key mappings -vim.keymap.set("n", "t", FloatingTerminal, { noremap = true, silent = true}) +vim.keymap.set("n", "t", FloatingTerminal, { noremap = true, silent = true }) vim.keymap.set("t", "", function() if terminal_state.is_open then vim.api.nvim_win_close(terminal_state.win, false) terminal_state.is_open = false end -end, { noremap = true, silent = true}) - --- Plugins -local function bootstrap_pckr() - local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim" - - if not (vim.uv or vim.loop).fs_stat(pckr_path) then - vim.fn.system({ - 'git', - 'clone', - "--filter=blob:none", - 'https://github.com/lewis6991/pckr.nvim', - pckr_path - }) - end - - vim.opt.rtp:prepend(pckr_path) +end, { noremap = true, silent = true }) +vim.pack.add({ + { src = "https://github.com/neovim/nvim-lspconfig" }, +}) +local lspconfig = require("lspconfig") +local servers = { "lua_ls", "clangd" } +for _, server in ipairs(servers) do + lspconfig[server].setup({}) end +<<<<<<< HEAD bootstrap_pckr() @@ -296,6 +217,13 @@ require("pckr").add { end lspconfig[server].setup(opts) end +======= +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client:supports_method('textDocument/completion') then + vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) +>>>>>>> 0fdc7d8 (save) end - }, -} + end, +}) diff --git a/nvim/bak.config/nvim/init.lua b/nvim/bak.config/nvim/init.lua deleted file mode 100644 index d730689..0000000 --- a/nvim/bak.config/nvim/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("vxclutch") - --- greetings diff --git a/nvim/bak.config/nvim/lazy-lock.json b/nvim/bak.config/nvim/lazy-lock.json deleted file mode 100644 index 6440d3d..0000000 --- a/nvim/bak.config/nvim/lazy-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-tw2css": { "branch": "main", "commit": "1abe0eebcb57fcbd5538d054f0db61f4e4a1302b" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "6dc21d4ce050c2e592d9635b7983d67baf216e3d" }, - "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, - "fidget.nvim": { "branch": "main", "commit": "a0abbf18084b77d28bc70e24752e4f4fd54aea17" }, - "gitsigns.nvim": { "branch": "main", "commit": "0797734e2bf229cc67b05e82a17e22a18f191913" }, - "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, - "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.nvim": { "branch": "main", "commit": "44a3ab2bc6b40edeb7a76359826c9779d5c70cb5" }, - "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, - "nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" }, - "nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" }, - "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, - "oil.nvim": { "branch": "master", "commit": "09fa1d22f5edf0730824d2b222d726c8c81bbdc9" }, - "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, - "rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" }, - "snacks.nvim": { "branch": "main", "commit": "706b1abc1697ca050314dc667e0900d53cad8aa4" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/init.lua b/nvim/bak.config/nvim/lua/vxclutch/init.lua deleted file mode 100644 index df0c13b..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("vxclutch.set") -require("vxclutch.remap") -require("vxclutch.lazy_init") diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua deleted file mode 100644 index 2bac5ce..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua +++ /dev/null @@ -1,33 +0,0 @@ -function ColorMyPencils(color) - color = color or "rose-pine" - vim.cmd.colorscheme(color) -end - -return { - { - "folke/tokyonight.nvim", - config = function() - require("tokyonight").setup({ - style = "storm", - transparent = true, - terminal_colors = true, - styles = { - comments = { italic = false }, - keywords = { italic = false }, - sidebars = "dark", - floats = "dark", - }, - }) - end, - }, - { - "rose-pine/neovim", - name = "rose-pine", - config = function() - require("rose-pine").setup({ disable_background = true }) - - vim.cmd("colorscheme rose-pine") - ColorMyPencils() - end, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua deleted file mode 100644 index a9d1a47..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - "stevearc/conform.nvim", - dependencies = { - "tpope/vim-sleuth", - }, - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format { async = true, lsp_fallback = true } - end, - mode = "", - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { "stylua" }, - }, - hooks = { - pre_format = function(lines, _) - -- Strip comments - local no_comments = {} - for _, line in ipairs(lines) do - if not line:match "%s*//" and not line:match "%s*/%*.*%*/" then - table.insert(no_comments, line) - end - end - return no_comments - end, - }, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua deleted file mode 100644 index 3bf8496..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - { - "tpope/vim-fugitive", - }, - - { - "lewis6991/gitsigns.nvim", - opts = { - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "_" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, - }, - }, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua deleted file mode 100644 index a4e47f2..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local harpoon = require("harpoon") - - -- REQUIRED - harpoon:setup() - -- REQUIRED - - vim.keymap.set("n", "a", function() - harpoon:list():add() - end) - vim.keymap.set("n", "", function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end) - - vim.keymap.set("n", "", function() - harpoon:list():select(1) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(2) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(3) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(4) - end) - end, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua deleted file mode 100644 index 6ec8f41..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua +++ /dev/null @@ -1,166 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - dependencies = { - { "mason-org/mason.nvim", version = "^1.0.0" }, - { "mason-org/mason-lspconfig.nvim", version = "^1.0.0" }, - "j-hui/fidget.nvim", - "stevearc/conform.nvim", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "jcha0713/cmp-tw2css", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - }, - - config = function() - vim.diagnostic.config({ - virtual_text = true, - signs = true, - underline = true, - update_in_insert = false, - severity_sort = true, - float = { border = "rounded" }, - }) - - local cmp = require("cmp") - local luasnip = require("luasnip") - local cmp_lsp = require("cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - vim.lsp.protocol.make_client_capabilities(), - cmp_lsp.default_capabilities() - ) - - vim.api.nvim_set_hl(0, "CmpNormal", {}) - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.confirm({ select = true }), - [""] = vim.NIL, - }), - window = { - completion = { - scrollbar = false, - border = "rounded", - winhighlight = "Normal:CmpNormal", - }, - documentation = { - scrollbar = false, - border = "rounded", - winhighlight = "Normal:CmpNormal", - }, - }, - sources = cmp.config.sources({ - { - name = "nvim_lsp", - max_item_count = 5, - entry_filter = function(entry, _) - return cmp.lsp.CompletionItemKind.Snippet ~= entry:get_kind() - end, - }, - { name = "cmp-tw2css" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), - }) - - require("conform").setup({ - formatters_by_ft = {}, - }) - - require("fidget").setup({}) - require("mason").setup() - - require("mason-lspconfig").setup({ - automatic_installation = false, - ensure_installed = { - "lua_ls", - "clangd", - "tinymist", - }, - handlers = { - function(server_name) - require("lspconfig")[server_name].setup({ - capabilities = capabilities, - }) - end, - - ["lua_ls"] = function() - require("lspconfig").lua_ls.setup({ - capabilities = capabilities, - settings = { - Lua = { - runtime = { version = "Lua 5.1" }, - diagnostics = { - globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, - }, - }, - }, - }) - end, - - ["clangd"] = function() - require("lspconfig").clangd.setup({ - capabilities = capabilities, - cmd = { "clangd", "--header-insertion=iwyu" }, - }) - end, - - ["tinymist"] = function() - require("lspconfig").tinymist.setup({ - capabilities = capabilities, - settings = { - formatterMode = "typstyle", - exportPdf = "never", - }, - }) - end, - }, - }) - - local l = vim.lsp - l.handlers["textDocument/hover"] = function(_, result, ctx, config) - config = config or { border = "rounded", focusable = true } - config.focus_id = ctx.method - if not (result and result.contents) then - return - end - local markdown_lines = l.util.convert_input_to_markdown_lines(result.contents) - markdown_lines = vim.tbl_filter(function(line) - return line ~= "" - end, markdown_lines) - if vim.tbl_isempty(markdown_lines) then - return - end - return l.util.open_floating_preview(markdown_lines, "markdown", config) - end - - local autocmd = vim.api.nvim_create_autocmd - autocmd({ "BufEnter", "BufWinEnter" }, { - pattern = { "*.vert", "*.frag" }, - callback = function() - vim.cmd("set filetype=glsl") - end, - }) - - autocmd("LspAttach", { - callback = function(e) - local opts = { buffer = e.buf } - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - end, - }) - end, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua deleted file mode 100644 index 2f5f85f..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp", - config = function() - require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/vxclutch/snippets/" }) - - local ls = require("luasnip") - vim.keymap.set({ "i" }, "", function() - ls.expand() - end, { silent = true }) - vim.keymap.set({ "i", "s" }, "", function() - ls.jump(1) - end, { silent = true }) - vim.keymap.set({ "i", "s" }, "", function() - ls.jump(-1) - end, { silent = true }) - - ls.config.setup({ - enable_autosnippets = true, - region_check_events = "InsertEnter", - delete_check_events = "InsertLeave", - }) - end, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua deleted file mode 100644 index 9fd6eef..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - "echasnovski/mini.nvim", - version = false, - config = function() - require("mini.ai").setup() - require("mini.surround").setup() - require("mini.pick").setup { - window = { - config = { - anchor = "NW", - row = 0, - col = 0, - width = 30, - }, - style = 'minimal', - border = 'rounded', - }, - options = { - use_cache = true, - }, - } - end, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua deleted file mode 100644 index b51a451..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua +++ /dev/null @@ -1,37 +0,0 @@ -return { - "stevearc/oil.nvim", - opts = {}, - config = function() - require("oil").setup({ - default_file_explorer = true, - delete_to_trash = true, - skip_confirm_for_simple_edits = true, - use_default_keymaps = true, - keymaps = { - ["g?"] = { "actions.show_help", mode = "n" }, - [""] = { "actions.select" }, - [""] = false, - [""] = false, - [""] = false, - [""] = false, - [""] = false, - [""] = { "actions.refresh" }, - ["-"] = { "actions.parent", mode = "n" }, - ["_"] = { "actions.open_cwd", mode = "n" }, - ["d"] = { "actions.cd", mode = "n" }, - ["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" }, - ["gs"] = false, - ["gx"] = { "actions.open_external" }, - ["g."] = { "actions.toggle_hidden", mode = "n" }, - }, - view_options = { - show_hidden = true, - natural_order = true, - is_always_hidden = function(name, _) - return name == ".." or name == ".git" - end, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua deleted file mode 100644 index a026ce4..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua +++ /dev/null @@ -1,37 +0,0 @@ -return { - { - -- this is a sort of related - "stevearc/dressing.nvim", - }, - { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - ---@type snacks.Config - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - bigfile = { enabled = true }, - indent = { enabled = true }, - input = { enabled = true }, - quickfile = { enabled = true }, - statuscolumn = { enabled = true }, - words = { enabled = true }, - }, - keys = { - { - "t", - function() - Snacks.terminal.toggle() - end, - }, - { - "lg", - function() - Snacks.lazygit() - end, - }, - }, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua deleted file mode 100644 index ca8a0cd..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - { - "nvim-telescope/telescope.nvim", - - dependencies = { - "nvim-lua/plenary.nvim", - }, - - config = function() - local data = assert(vim.fn.stdpath "data") --[[@as string]] - - require("telescope").setup { - extensions = { - wrap_results = true, - - fzf = {}, - history = { - path = vim.fs.joinpath(data, "telescope_history.sqlite3"), - limit = 100, - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown {}, - }, - }, - } - - pcall(require("telescope").load_extension, "fzf") - pcall(require("telescope").load_extension, "smart_history") - pcall(require("telescope").load_extension, "ui-select") - - local builtin = require "telescope.builtin" - - vim.keymap.set("n", "pf", builtin.find_files) - vim.keymap.set("n", "", builtin.git_files) - vim.keymap.set("n", "fh", builtin.help_tags) - vim.keymap.set("n", "fg", builtin.git_files) - vim.keymap.set("n", "/", builtin.current_buffer_fuzzy_find) - - vim.keymap.set("n", "ps", function() - builtin.grep_string { search = vim.fn.input "Grep > " } - end) - - vim.keymap.set("n", "en", function() - builtin.find_files { cwd = vim.fn.stdpath "config" } - end) - end, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua deleted file mode 100644 index cfa19aa..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua +++ /dev/null @@ -1,61 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup { - -- A list of parser names, or "all" - ensure_installed = { - "vimdoc", - "c", - "lua", - "bash", - }, - - textobjects = { - select = { - enable = false, - } - }, - - -- 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, - - indent = { - enable = true, - }, - - highlight = { - -- `false` will disable the whole extension - enable = true, - disable = function(lang, buf) - if lang == "html" then - print "disabled" - return true - end - - 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 - vim.notify( - "File larger than 100KB treesitter disabled for performance", - vim.log.levels.WARN, - { title = "Treesitter" } - ) - 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 = { "markdown" }, - }, - } - - end, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua deleted file mode 100644 index 39377d4..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - }, -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua b/nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua deleted file mode 100644 index a128388..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua +++ /dev/null @@ -1,17 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = "vxclutch.lazy", - change_detection = { notify = false }, -}) diff --git a/nvim/bak.config/nvim/lua/vxclutch/remap.lua b/nvim/bak.config/nvim/lua/vxclutch/remap.lua deleted file mode 100644 index 589636d..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/remap.lua +++ /dev/null @@ -1,36 +0,0 @@ -vim.g.mapleader = " " - -local function map(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.keymap.set(mode, lhs, rhs, options) -end - --- Remove search highlight -- -map("n", "", ":nohlsearch") - --- Move lines -- -map("v", "J", ":m '>+1gv=gv") -map("v", "K", ":m '<-2gv=gv") - --- Scrolling -- -map("n", "", "zz") -map("n", "", "zz") - --- File navigation -- -map("n", "o", ":Oil") - --- LSP -map("n", "gd", vim.lsp.buf.definition) -map("n", "r", vim.lsp.buf.rename, { noremap = true, silent = true }) - --- Window Controls -map("n", "", "") -map("n", "", "") -map("n", "", "") -map("n", "", "") - --- Typst -map("n", "p", "tinymist preview " .. vim.fn.expand("%:t")) diff --git a/nvim/bak.config/nvim/lua/vxclutch/set.lua b/nvim/bak.config/nvim/lua/vxclutch/set.lua deleted file mode 100644 index a541ac9..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/set.lua +++ /dev/null @@ -1,40 +0,0 @@ -local opt = vim.opt - --- command mode -- -opt.inccommand = "split" -opt.smartcase = true -opt.ignorecase = true - --- line numbers -- -opt.number = true -opt.relativenumber = true - --- splits -- -opt.splitbelow = true -opt.splitright = true - --- tabs -- -opt.shiftwidth = 2 -opt.tabstop = 2 -opt.expandtab = true - --- cursor -- -opt.guicursor = "" -opt.scrolloff = 8 - --- format -- -vim.cmd('autocmd BufEnter * set formatoptions-=cro') -vim.cmd('autocmd BufEnter * setlocal formatoptions-=cro') -opt.signcolumn = "yes" -opt.termguicolors = true -opt.colorcolumn = "80" -opt.wrap = false - --- Changes -- -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true - --- Statusline -- -vim.o.statusline = "%f %m" diff --git a/nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua b/nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua deleted file mode 100644 index e7c5e46..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - s("date", t(os.date("%Y/%m/%d"))) -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua b/nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua deleted file mode 100644 index 9fe0f05..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua +++ /dev/null @@ -1,33 +0,0 @@ -local ls = require("luasnip") -local s = ls.snippet -local i = ls.insert_node -local fmta = require("luasnip.extras.fmt").fmta - -return { - s( - { trig = "main" }, - fmta( - [[ - int - main(void) - { - <> - return 0; - } - ]], - { i(1), i(2), i(3) } - ) - ), - - s( - { trig = "for" }, - fmta( - [[ - for (int i = <>; i <>; i++) { - <> - } - ]], - { i(1), i(2), i(3) } - ) - ), -} diff --git a/nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua b/nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua deleted file mode 100644 index cac8154..0000000 --- a/nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua +++ /dev/null @@ -1,26 +0,0 @@ -local ls = require("luasnip") -local s = ls.snippet -local sn = ls.snippet_node -local t = ls.text_node -local i = ls.insert_node -local f = ls.function_node -local d = ls.dynamic_node -local fmt = require("luasnip.extras.fmt").fmt -local fmta = require("luasnip.extras.fmt").fmta -local rep = require("luasnip.extras").rep - -return { - s( - { trig = "mla" }, - fmta( - [[ - Owen Westness - - #datetime.today().display("d MMMM yyyy") - - <> - ]], - { i(1) } - ) - ), -}