diff --git a/README.md b/README.md deleted file mode 100644 index 4df5425..0000000 --- a/README.md +++ /dev/null @@ -1,127 +0,0 @@ -
-vim.api.nvim_create_autocmd('FileType', { - group = augroup('close_with_q'), - pattern = { - 'Jaq', - 'PlenaryTestPopup', - 'Avante', - 'AvanteInput', - 'AvanteSelectedFiles', - 'fugitive', - 'git', - 'help', - 'lir', - 'lspinfo', - 'man', - 'netrw', - 'notify', - 'qf', - 'spectre_panel', - 'startuptime', - 'tsplayground', - }, - callback = function(event) - vim.bo[event.buf].buflisted = false - vim.keymap.set('n', 'q', 'close ', { buffer = event.buf, silent = true }) - end, +vim.api.nvim_create_autocmd("FileType", { + group = augroup("close_with_q"), + pattern = { + "Jaq", + "PlenaryTestPopup", + "Avante", + "AvanteInput", + "AvanteSelectedFiles", + "fugitive", + "git", + "help", + "lir", + "lspinfo", + "man", + "netrw", + "notify", + "qf", + "spectre_panel", + "startuptime", + "tsplayground", + }, + callback = function(event) + vim.bo[event.buf].buflisted = false + vim.keymap.set("n", "q", " close ", { buffer = event.buf, silent = true }) + end, }) -- wrap and check for spell in text filetypes -vim.api.nvim_create_autocmd('FileType', { - group = augroup('wrap_spell'), - pattern = { 'gitcommit', 'markdown' }, - callback = function() - vim.opt_local.wrap = true - vim.opt_local.spell = true - end, +vim.api.nvim_create_autocmd("FileType", { + group = augroup("wrap_spell"), + pattern = { "gitcommit", "markdown" }, + callback = function() + vim.opt_local.wrap = true + vim.opt_local.spell = true + end, }) -- Auto create dir when saving a file, in case some intermediate directory does not exist -vim.api.nvim_create_autocmd({ 'BufWritePre' }, { - group = augroup('auto_create_dir'), - callback = function(event) - local file = vim.loop.fs_realpath(event.match) or event.match - vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p') - end, +vim.api.nvim_create_autocmd({ "BufWritePre" }, { + group = augroup("auto_create_dir"), + callback = function(event) + local file = vim.loop.fs_realpath(event.match) or event.match + vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") + end, }) -- Set arb filetype -vim.api.nvim_create_autocmd({ 'BufEnter' }, { - group = augroup('set_file_type'), - pattern = { '*.arb' }, - command = require('lib.util').get_file_type_cmd('arb'), +vim.api.nvim_create_autocmd({ "BufEnter" }, { + group = augroup("set_file_type"), + pattern = { "*.arb" }, + command = "setfiletype arb", }) -- Disable format options -vim.api.nvim_create_autocmd('FileType', { - group = augroup('disable_formatoptions'), - pattern = '*', - callback = function() - vim.opt_local.formatoptions:remove({ 'c', 'r', 'o' }) - end, +vim.api.nvim_create_autocmd("FileType", { + group = augroup("disable_formatoptions"), + pattern = "*", + callback = function() + vim.opt_local.formatoptions:remove({ "c", "r", "o" }) + end, }) local function enable_autoformat() - vim.api.nvim_create_autocmd({ 'BufWritePre' }, { - group = augroup('autoformat'), - pattern = { '*' }, - callback = function() - vim.lsp.buf.format() - end, - }) + vim.api.nvim_create_autocmd({ "BufWritePre" }, { + group = augroup("autoformat"), + pattern = { "*" }, + callback = function() + vim.lsp.buf.format() + end, + }) end enable_autoformat() -vim.api.nvim_create_user_command('WriteNoFormat', function() - -- Temporarily disable the autoformat autocmd - vim.api.nvim_del_augroup_by_name('keycodex_autoformat') - vim.cmd('write') - -- Re-enable the autoformat autocmd - enable_autoformat() +vim.api.nvim_create_user_command("WriteNoFormat", function() + -- Temporarily disable the autoformat autocmd + vim.api.nvim_del_augroup_by_name("keycodex_autoformat") + vim.cmd("write") + -- Re-enable the autoformat autocmd + enable_autoformat() end, {}) - -local autocmd = vim.api.nvim_create_autocmd -autocmd('Signal', { - pattern = 'SIGUSR1', - callback = function() - require('nvchad.utils').reload() - end, -}) diff --git a/lua/core/functions.lua b/lua/core/functions.lua index 9f197ae..a92c3cb 100644 --- a/lua/core/functions.lua +++ b/lua/core/functions.lua @@ -46,10 +46,23 @@ end, {}) -- Switch to git root or file parent dir vim.api.nvim_create_user_command('RootDir', function() - local root = require('lib.util').get_root_dir() - - if root == '' then + local bufname = vim.fn.expand('%:p') + if vim.fn.filereadable(bufname) == 0 then return end - vim.cmd('lcd ' .. root) + + local parent = vim.fn.fnamemodify(bufname, ':h') + local git_root = vim.fn.systemlist('git -C ' .. vim.fn.fnameescape(parent) .. ' rev-parse --show-toplevel') + local root = '' + if #git_root > 0 and git_root[1] ~= '' then + root = git_root[1] + else + root = parent + end + + if root ~= '' then + vim.cmd('lcd ' .. vim.fn.fnameescape(root)) + vim.notify('Changed directory to ' .. root, vim.log.levels.INFO) + end end, {}) + diff --git a/lua/core/keys.lua b/lua/core/keys.lua index 043edaf..63064b9 100644 --- a/lua/core/keys.lua +++ b/lua/core/keys.lua @@ -1,160 +1,102 @@ local function map(mode, lhs, rhs, opts) - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) + opts = opts or {} + opts.silent = opts.silent ~= false + vim.keymap.set(mode, lhs, rhs, opts) end local opts = { noremap = true, silent = true } -- Space as leader -map('n', ' ', '', opts) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +map("n", " ", "", opts) +vim.g.mapleader = " " +vim.g.maplocalleader = " " -- Modes -- normal_mode = "n", insert_mode = "i", visual_mode = "v", -- visual_block_mode = "x", term_mode = "t", command_mode = "c", +-- Clear search, diff update and redraw +map({ "i", "n" }, " ", " noh ", { desc = "Escape and clear hlsearch" }) --- Use jj as escape -map('i', 'jj', ' ', opts) -map('i', 'jk', ' ', opts) -map('i', 'kj', ' ', opts) -map('t', 'JJ', ' ', opts) +map({ "i", "c" }, " ", " ") +map({ "i", "c" }, " ", " ") --- Terminal Mappings -map('t', 'jk', ' ') -map('t', 'kj', ' ') -map('t', ' ', ' ') +map("n", " r", vim.lsp.buf.rename) +map("n", "`", "'", { noremap = true }) -- better marks + +map("n", "H", "^", { desc = "Jump to line start" }) +map("n", "L", "$", { desc = "Jump to line end" }) -- Visual overwrite paste -map({ 'v', 'x' }, 'p', '"_dP', opts) +map({ "v", "x" }, "p", '"_dP', opts) -- Do not copy on x -map({ 'v', 'x' }, 'x', '"_x', opts) - --- VSCode style shortcuts --- File operations -map('n', ' ', ':w ', { desc = 'Save file' }) -map('i', ' ', ' :w a', { desc = 'Save file' }) -map('n', ' ', ':q ', { desc = 'Quit' }) -map('n', ' ', ':bd ', { desc = 'Close buffer' }) - --- Undo/Redo -map('n', ' ', 'u', { desc = 'Undo' }) -map('i', ' ', ' u', { desc = 'Undo' }) -map('n', ' ', ' ', { desc = 'Redo' }) -map('i', ' ', ' ', { desc = 'Redo' }) +map({ "v", "x" }, "x", '"_x', opts) +map("n", "X", '"_D', opts) +map({ "v", "x" }, "X", '"_d', opts) -- Select all -map('n', ' ', 'ggVG', { desc = 'Select all' }) -map('i', ' ', ' ggVG', { desc = 'Select all' }) - --- Copy/Cut -map('v', ' ', 'y', { desc = 'Copy' }) -map('v', ' ', 'd', { desc = 'Cut' }) - --- Line operations (VSCode style) -map('n', ' ', ':m .-2 ==', { desc = 'Move line up' }) -map('n', ' ', ':m .+1 ==', { desc = 'Move line down' }) -map('i', ' ', ' :m .-2 ==gi', { desc = 'Move line up' }) -map('i', ' ', ' :m .+1 ==gi', { desc = 'Move line down' }) -map('v', ' ', ":m '<-2 gv=gv", { desc = 'Move selection up' }) -map('v', ' ', ":m '>+1 gv=gv", { desc = 'Move selection down' }) - --- VSCode-style line operations -map('n', ' ', 'o ', { desc = 'Insert line below' }) -map('i', ' ', ' o', { desc = 'Insert line below' }) - --- Quick word operations -map('n', ' ', 'db', { desc = 'Delete word backward' }) -map('i', ' ', ' ', { desc = 'Delete word backward' }) -map('n', ' ', 'dw', { desc = 'Delete word forward' }) -map('i', ' ', ' dw', { desc = 'Delete word forward' }) - --- Duplicate line -map('n', ' ', 'yykP', { desc = 'Duplicate line up' }) -map('n', ' ', 'yyp', { desc = 'Duplicate line down' }) -map('v', ' ', "y' ', "y'>pgv", { desc = 'Duplicate selection down' }) - - --- Line manipulation -map('n', ' ', '>>', { desc = 'Indent line' }) -map('n', ' ', '<<', { desc = 'Unindent line' }) -map('i', ' ', ' >>', { desc = 'Indent line' }) -map('i', ' ', ' <<', { desc = 'Unindent line' }) - --- Visual overwrite paste -map({ 'v', 'x' }, 'p', '"_dP', opts) - --- Do not copy on x -map({ 'v', 'x' }, 'x', '"_x', opts) -map('n', 'X', '"_D', opts) -map({ 'v', 'x' }, 'X', '"_d', opts) - --- Increment/decrement -map({ 'n', 'v', 'x' }, '-', ' ', opts) -map({ 'n', 'v', 'x' }, '=', ' ', opts) - --- Move to line beginning and end -map({ 'n', 'v', 'x' }, 'gl', '$', { desc = 'End of line' }) -map({ 'n', 'v', 'x' }, 'gh', '^', { desc = 'Beginning of line' }) - --- Center Cursors -map('n', 'J', 'mzJ`z', opts) -map('n', ' ', ' zz', opts) -map('n', ' ', ' zz', opts) -map('n', 'n', 'nzzzv', opts) -map('n', 'N', 'Nzzzv', opts) - --- Better up/down -map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +map("n", " ", "ggVG", { desc = "Select all" }) +map("i", " ", " ggVG", { desc = "Select all" }) -- Move text up and down -map({ 'v', 'x' }, 'J', ":move '>+1 gv-gv", opts) -map({ 'v', 'x' }, 'K', ":move '<-2 gv-gv", opts) +map({ "v", "x" }, "K", ":move '<-2 gv-gv", opts) +map({ "v", "x" }, "J", ":move '>+1 gv-gv", opts) --- Clear search, diff update and redraw -map({ 'i', 'n' }, ' ', ' noh ', { desc = 'Escape and clear hlsearch' }) +-- Line operations +map("n", " ", ":m .-2 ==", { desc = "Move line up" }) +map("n", " ", ":m .+1 ==", { desc = "Move line down" }) +map("i", " ", " :m .-2 ==gi", { desc = "Move line up" }) +map("i", " ", " :m .+1 ==gi", { desc = "Move line down" }) +map("v", " ", ":m '<-2 gv=gv", { desc = "Move selection up" }) +map("v", " ", ":m '>+1 gv=gv", { desc = "Move selection down" }) --- Consistent n/N search navigation -map('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) -map('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) -map('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) -map('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) -map('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) -map('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) +-- Line manipulation +map("n", " ", ">>", { desc = "Indent line" }) +map("n", " ", "<<", { desc = "Unindent line" }) +map("i", " ", " >>", { desc = "Indent line" }) +map("i", " ", " <<", { desc = "Unindent line" }) --- Better indenting -map('v', '<', ' ', '>gv') +-- Quick word operations +map("n", " ", "db", { desc = "Delete word backward" }) +map("i", " ", " ", { desc = "Delete word backward" }) +map("n", " ", "dw", { desc = "Delete word forward" }) +map("i", " ", " dw", { desc = "Delete word forward" }) --- Add undo breakpoints -map('i', ',', ', u') -map('i', '.', '. u') -map('i', ';', '; u') - -map('n', 'd', '"_d', { desc = 'Delete without replacing clipboard' }) -map('n', 'x', '"_x', { desc = 'Cut without replacing clipboard' }) -map('n', 'c', '"_c', { desc = 'Change without replacing clipboard' }) -map('v', 'p', '"_dP', { desc = 'Paste without replacing clipboard' }) - --- Toggle relative numbers off or on (for code presentation) -map({ 'n', 'v' }, ' tn', ' set rnu! ', {}) +map("n", "d", '"_d', { desc = "Delete without replacing clipboard" }) +map("n", "x", '"_x', { desc = "Cut without replacing clipboard" }) +map("n", "c", '"_c', { desc = "Change without replacing clipboard" }) +map("v", "p", '"_dP', { desc = "Paste without replacing clipboard" }) --insert the following characters around the visual selection -map('v', ' (', 's() Pll', { desc = 'wrap selection with parens' }) -map('v', ' [', 's[] Pll', { desc = 'wrap selection with square braces' }) -map('v', ' {', 's{} Pll', { desc = 'wrap selection with curly braces' }) -map('v', " '", "s'' Pll", { desc = 'wrap selection with single quotes' }) -map('v', ' "', 's"" Pll', { desc = 'wrap selection with double quotes' }) +map("v", " (", "s() Pll", { desc = "wrap selection with parens" }) +map("v", " [", "s[] Pll", { desc = "wrap selection with square braces" }) +map("v", " {", "s{} Pll", { desc = "wrap selection with curly braces" }) +map("v", " '", "s'' Pll", { desc = "wrap selection with single quotes" }) +map("v", ' "', 's"" Pll', { desc = "wrap selection with double quotes" }) -- Insert mode cursor movement with Ctrl+hjkl -map('i', ' ', ' ', { desc = 'Move cursor left' }) -map('i', ' ', ' ', { desc = 'Move cursor down' }) -map('i', ' ', ' ', { desc = 'Move cursor up' }) -map('i', ' ', ' ', { desc = 'Move cursor right' }) +map("i", " ", " ", { desc = "Move to end of previous line" }) +map("i", " ", " ", { desc = "Move cursor down" }) +map("i", " ", " ", { desc = "Move cursor up" }) +map("i", " ", " ", { desc = "Move cursor right" }) +-- toggle inlay hints +vim.keymap.set("n", " th", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) +end) +-- No arrow navigation +vim.api.nvim_set_keymap("n", " ", " ", opts) +vim.api.nvim_set_keymap("n", " ", " ", opts) +vim.api.nvim_set_keymap("n", " ", " ", opts) +vim.api.nvim_set_keymap("n", " ", " ", opts) +vim.api.nvim_set_keymap("v", " ", " ", opts) +vim.api.nvim_set_keymap("v", " ", " ", opts) +vim.api.nvim_set_keymap("v", " ", " ", opts) +vim.api.nvim_set_keymap("v", " ", " ", opts) + +vim.api.nvim_set_keymap("i", " ", " ", opts) +vim.api.nvim_set_keymap("i", " ", " ", opts) +vim.api.nvim_set_keymap("i", " ", " ", opts) +vim.api.nvim_set_keymap("i", " ", " ", opts) diff --git a/lua/core/lazy.lua b/lua/core/lazy.lua new file mode 100644 index 0000000..b2ef8ad --- /dev/null +++ b/lua/core/lazy.lua @@ -0,0 +1,37 @@ +-------------------------------------------------------------------------------- +-- Bootstrap lazy plugin manager +-------------------------------------------------------------------------------- +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) + +-- lazy config +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + install = { + missing = true, + colorscheme = { "onedark" }, + }, + change_detection = { + enable = true, + notify = false, + }, + ui = { + border = "rounded", + backdrop = 100, + }, +}) diff --git a/lua/core/lsp.lua b/lua/core/lsp.lua new file mode 100644 index 0000000..888195b --- /dev/null +++ b/lua/core/lsp.lua @@ -0,0 +1,135 @@ +-------------------------------------------------------------------------------- +-- LSP +-------------------------------------------------------------------------------- + +-- ts_ls +vim.lsp.config("ts_ls", { + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, +}) +vim.lsp.enable("ts_ls") + +-- rust +vim.lsp.config("rust_analyzer", { + settings = { + ["rust-analyzer"] = { + diagnostics = { + enable = true, + experimental = { enable = true }, + }, + }, + }, +}) +vim.lsp.enable("rust_analyzer") + +-- lua +vim.lsp.config("lua_ls", { + settings = { + Lua = { + diagnostics = { + disable = { + "missing-fields", + "undefined-global", + }, + }, + }, + }, +}) +vim.lsp.enable("lua_ls") + +-- python +vim.lsp.config("basedpyright", { + settings = { + basedpyright = { + inlayHints = true, + disableDiagnostics = true, + disableOrganizeImports = true, + analysis = { + -- Ignore all files for analysis to exclusively use Ruff for linting + -- Enable diagnostics + -- ignore = { "*" }, + diagnosticSeverityOverrides = { + reportUnusedImport = "none", + reportUnusedVariable = "none", + reportAttributeAccessIssue = "none", + reportUnusedClass = "none", + reportUnusedFunction = "none", + reportDuplicateImport = "none", + reportArgumentType = "error", + }, + typeCheckingMode = "basic", + }, + }, + }, +}) +vim.lsp.enable("basedpyright") + +vim.lsp.config("pylsp", { + settings = { + pylsp = { + plugins = { + -- use black as default formatter + yapf = { enabled = false }, + autopep8 = { enabled = false }, + black = { enabled = true }, + pycodestyle = { + enabled = true, + ignore = { "E203", "E701", "W503" }, + maxLineLength = 88, + }, + }, + }, + }, +}) + +-- latex +vim.lsp.config("texlab", { + settings = { + texlab = { + build = { + executable = "latexmk", + args = { + "-lualatex", + "-interaction=nonstopmode", + "-outdir=build", + }, + onSave = true, + }, + }, + }, +}) +vim.lsp.enable("texlab") + +-- bash +vim.lsp.config("bashls", { + settings = { + bashIde = { + shellcheckArguments = { + "--exclude=SC1090,SC1091,SC2076,SC2164", + }, + }, + }, +}) +vim.lsp.enable("bashls") + +-- cpp +vim.lsp.config("clangd", { + cmd = { + "clangd", + "--fallback-style=llvm", + "--header-insertion=iwyu", + "-j=4", + }, +}) +vim.lsp.enable("clangd") diff --git a/lua/core/options.lua b/lua/core/options.lua index aa89df5..9402696 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,91 +1,64 @@ local options = { - ai = true, - autoindent = true, - autowrite = true, - backspace = 'indent,eol,start', - backup = false, -- creates a backup file - breakindent = true, - clipboard = 'unnamedplus', -- allows neovim to access the system clipboard - cmdheight = 1, -- more space in the neovim command line for displaying messages - completeopt = 'menu,menuone,noselect', -- mostly just for cmp - conceallevel = 0, -- so that `` is visible in markdown files - confirm = true, -- Confirm to save changes before exiting modified buffer - cursorline = true, -- highlight the current line - expandtab = true, -- convert tabs to spaces - fileencoding = 'utf-8', -- the encoding written to a file - formatoptions = 'jlnqt', -- set formatoptions, check help fo-table - grepformat = '%f:%l:%c:%m', - grepprg = 'rg --vimgrep', - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - inccommand = 'split', -- preview incremental substitute - laststatus = 3, - list = true, - -- listchars = { trail = '', tab = '', nbsp = '_', extends = '>', precedes = '<' }, -- highlight - mouse = 'a', -- allow the mouse to be used in neovim - number = true, -- set numbered lines - numberwidth = 4, -- set number column width to 2 {default 4} - pumblend = 10, -- Popup blen - pumheight = 10, -- pop up menu height - relativenumber = true, -- set relative numbered lines - scrolloff = 10, -- is one of my fav - sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal', - shiftround = true, -- Round indent - shiftwidth = 4, -- the number of spaces inserted for each indentation - showcmd = false, - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 0, -- always show tabs - si = true, - sidescrolloff = 8, - signcolumn = 'yes', -- always show the sign column, otherwise it would shift the text each time - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - smarttab = true, - splitbelow = true, -- force all horizontal splits to go below current window - splitright = true, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - tabstop = 4, -- insert 2 spaces for a tab - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 300, -- time to wait for a mapped sequence to complete (in milliseconds) - title = true, -- window titles - undofile = true, -- enable persistent undo - undodir = vim.fn.stdpath('cache') .. '/undo', - undolevels = 10000, - updatetime = 250, -- balance between responsiveness and performance - wildmenu = true, -- wildmenu - wildmode = 'longest:full,full', -- Command-line completion mode - winminwidth = 5, -- Minimum window width - wrap = false, -- display lines as one long line - writebackup = false, -- do not edit backups + ai = true, + clipboard = "unnamedplus", -- use system clipboard + number = true, + relativenumber = true, + undofile = true, -- save state of file on write + undodir = vim.fn.stdpath("cache") .. "/undo", + undolevels = 10000, + autoread = true, -- autoread changes from other sources + signcolumn = "yes", + cursorline = true, + cursorlineopt = "number", + wrap = false, + scrolloff = 3, + ruler = false, -- removes cursor position from lastline + pumheight = 10, -- size of completion window + showmode = false, -- do not show mode under statusline + swapfile = false, -- creates a swapfile + backup = false, -- creates a backup file + writebackup = false, -- do not edit backups + winminwidth = 5, -- Minimum window width + termguicolors = true, -- set term gui colors (most terminals support this) + showtabline = 0, -- always show tabs + showcmd = false, + mouse = "a", -- allow the mouse to be used in neovim + confirm = true, -- Confirm to save changes before exiting modified buffer + + -- tabs + smarttab = true, + tabstop = 4, -- 1 tab represented as 4 spaces + expandtab = true, -- key will create " " instead of "\t" + shiftwidth = 4, -- indent change after backspace and >> << + softtabstop = 4, -- number of spaces instead of tab + autoindent = true, -- auto indent + smartindent = true, -- make indenting smarter again + list = true, + -- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight + showbreak = string.rep(" ", 3), + + -- Search + ignorecase = true, + smartcase = true, + hlsearch = true, + wildmenu = true, + wildmode = "longest:full,full", + wildoptions = "pum", + + -- Window + splitright = true, + splitbelow = true, + title = true, } for k, v in pairs(options) do - vim.opt[k] = v + vim.opt[k] = v end --- netrw file explorer settings -vim.g.netrw_winsize = 20 -vim.g.netrw_banner = 0 -vim.g.netrw_liststyle = 1 +vim.opt.path:append({ "**" }) +vim.opt.shortmess:append({ W = true, I = true, c = true }) -- disable greeting -- Fix markdown indentation settings vim.g.markdown_recommended_style = 0 -vim.opt.path:append({ '**' }) -vim.opt.shortmess:append({ W = true, I = true, c = true }) - --- hides `~` at the end of the buffer vim.cmd([[set fillchars+=eob:\ ]]) - -vim.cmd([[ - setlocal spell spelllang=en "Set spellcheck language to en - setlocal spell! "Disable spell checks by default - filetype plugin indent on - if has('win32') - let g:python3_host_prog = $HOME . '/scoop/apps/python/current/python.exe' - endif - let &t_Cs = "\e[4:3m" "Undercurl - let &t_Ce = "\e[4:0m" - set whichwrap+=<,>,[,],h,l - set iskeyword+=- - ]]) diff --git a/lua/lib/icons.lua b/lua/lib/icons.lua deleted file mode 100644 index d2f2d15..0000000 --- a/lua/lib/icons.lua +++ /dev/null @@ -1,167 +0,0 @@ -return { - diagnostics = { - Error = ' ', - Hint = ' ', - Information = ' ', - Question = ' ', - Warning = ' ', - }, - documents = { - File = ' ', - FileEmpty = ' ', - Files = ' ', - Folder = ' ', - FolderEmpty = ' ', - OpenFolder = ' ', - OpenFolderEmpty = ' ', - SymLink = ' ', - SymlinkFolder = ' ', - Import = ' ', - }, - git = { - Add = ' ', - AddAlt = ' ', - Branch = ' ', - Diff = ' ', - DiffAlt = ' ', - Ignore = '◌ ', - Mod = ' ', - Octoface = ' ', - Remove = ' ', - RemoveAlt = ' ', - Rename = ' ', - Repo = ' ', - Tag = ' ', - Untrack = ' ', - Directory = '', - }, - kind = { - Class = ' ', - Color = ' ', - Constant = ' ', - Constructor = ' ', - Copilot = ' ', - Enum = ' ', - EnumMember = ' ', - Event = ' ', - Field = ' ', - File = ' ', - Folder = ' ', - Function = ' ', - Interface = ' ', - Keyword = ' ', - Method = ' ', - Module = '', - Operator = ' ', - Property = ' ', - Reference = ' ', - Snippet = ' ', - Struct = ' ', - Text = ' ', - TypeParameter = ' ', - Unit = ' ', - Value = ' ', - Variable = ' ', - }, - type = { - Array = ' ', - Boolean = '⏻ ', - Number = ' ', - Object = ' ', - String = ' ', - }, - ui = { - Arrow = ' ', - ArrowClosed = ' ', - ArrowLeft = ' ', - ArrowOpen = ' ', - ArrowRight = ' ', - Bluetooth = ' ', - Bookmark = ' ', - Bug = ' ', - Calendar = ' ', - Camera = ' ', - Check = ' ', - ChevronRight = '', - Circle = ' ', - CircleSmall = '● ', - CircleSmallEmpty = '○ ', - Clipboard = ' ', - Close = ' ', - Code = ' ', - Collection = ' ', - Color = ' ', - Command = ' ', - Comment = ' ', - Copilot = ' ', - CopilotError = ' ', - Corner = '└ ', - Dashboard = ' ', - Database = ' ', - Download = ' ', - Edit = ' ', - Edge = '│ ', - Electric = ' ', - Eye = ' ', - Fire = ' ', - Firefox = ' ', - Flag = ' ', - Game = ' ', - Gear = ' ', - GitHub = ' ', - Heart = ' ', - History = ' ', - Home = ' ', - Incoming = ' ', - Jump = ' ', - Keyboard = ' ', - Ligthbulb = ' ', - List = '', - Lock = ' ', - Minus = '‒ ', - Music = ' ', - Neovim = ' ', - NewFile = ' ', - None = ' ', - Note = ' ', - Outgoing = ' ', - Package = ' ', - Paint = ' ', - Pause = ' ', - Pencil = ' ', - Person = ' ', - Pin = ' ', - Play = ' ', - Plug = ' ', - Plus = ' ', - Power = ' ', - PowerlineArrowLeft = '', - PowerlineArrowRight = '', - PowerlineLeftRound = '', - PowerlineRightRound = '', - Project = ' ', - Question = ' ', - Reload = ' ', - Rocket = ' ', - Save = ' ', - Search = ' ', - Separator = '▊ ', - SeparatorLight = '▍', - SeparatorDashed = '┆', - SignIn = ' ', - SignOut = ' ', - Sleep = ' ', - Star = ' ', - Table = ' ', - Telescope = ' ', - Terminal = ' ', - Test = ' ', - Time = ' ', - Topline = '‾', - Trash = ' ', - User = ' ', - Vim = ' ', - Wifi = ' ', - Windows = ' ', - }, -} diff --git a/lua/lib/prompts.lua b/lua/lib/prompts.lua deleted file mode 100644 index 725557f..0000000 --- a/lua/lib/prompts.lua +++ /dev/null @@ -1,21 +0,0 @@ -local prompts = { - docs = 'Generate comprehensive documentation for this code including parameters, return values, and usage examples.', - explain = 'Explain this code in detail, including its purpose, logic flow, and any algorithms used.', - fix = 'Identify and fix any bugs, errors, or code smells in this code.', - commit = 'Create a descriptive commit message following conventional commits format for these changes.', - optimize = 'Optimize this code for better performance, readability, and maintainability.', - review = 'Review this code for best practices, potential issues, and suggest improvements.', - tests = 'Write comprehensive unit tests covering all edge cases for this code.', -} - ----Returns a function that inserts the named prompt at cursor position ----@param prompt_name string Name of the prompt to insert ----@return function Function to execute in a keybinding -prompts.add_prompt = function(prompt_name) - local prompt_text = prompts[prompt_name] - return function() - vim.cmd("put ='" .. prompt_text:gsub("'", "''") .. "'") - end -end - -return prompts diff --git a/lua/lib/util.lua b/lua/lib/util.lua deleted file mode 100644 index 1687021..0000000 --- a/lua/lib/util.lua +++ /dev/null @@ -1,65 +0,0 @@ -local util = {} - -util.get_user_config = function(key, default) - local status_ok, user = pcall(require, 'user') - if not status_ok then - return default - end - - local user_config = user[key] - if user_config == nil then - return default - end - return user_config -end - -util.get_root_dir = function() - local bufname = vim.fn.expand('%:p') - if vim.fn.filereadable(bufname) == 0 then - return - end - - local parent = vim.fn.fnamemodify(bufname, ':h') - local git_root = vim.fn.systemlist('git -C ' .. parent .. ' rev-parse --show-toplevel') - if #git_root > 0 and git_root[1] ~= '' then - return git_root[1] - else - return parent - end -end - -util.get_file_path = function() - local buf_name = vim.api.nvim_buf_get_name(0) - if vim.fn.filereadable(buf_name) == 1 then - return buf_name - end - - local dir_name = vim.fn.fnamemodify(buf_name, ':p:h') - if vim.fn.isdirectory(dir_name) == 1 then - return dir_name - end - - return vim.loop.cwd() -end - -util.get_file_type_cmd = function(extension) - local root = util.get_root_dir() - - if extension == 'arb' and root then - local gemfile_exists = vim.fn.filereadable(root .. '/Gemfile') == 1 - local pubspec_exists = vim.fn.filereadable(root .. '/pubspec.yaml') == 1 - if gemfile_exists then - return 'setfiletype ruby' - end - if pubspec_exists then - return 'setfiletype json' - end - end - return '' -end - -util.is_present = function(bin) - return vim.fn.executable(bin) == 1 -end - -return util diff --git a/lua/plugins/ai.lua b/lua/plugins/ai.lua new file mode 100644 index 0000000..67a7e69 --- /dev/null +++ b/lua/plugins/ai.lua @@ -0,0 +1,14 @@ +return { + { + "Exafunction/windsurf.vim", + event = "VeryLazy", + config = function() + vim.keymap.set("i", " ", function() + return vim.fn["codeium#Accept"]() + end, { expr = true, silent = true }) + vim.keymap.set("i", " ", function() + return vim.fn["codeium#Clear"]() + end, { expr = true, silent = true }) + end, + }, +} diff --git a/lua/plugins/ai/avante.lua b/lua/plugins/ai/avante.lua deleted file mode 100644 index 254b35b..0000000 --- a/lua/plugins/ai/avante.lua +++ /dev/null @@ -1,166 +0,0 @@ -local avante = require('avante') - -local model_names = { - 'claude-3.5-sonnet', - 'claude-3.7-sonnet', - 'claude-3.7-sonnet-thought', - 'claude-sonnet-4', - 'gemini-2.0-flash-001', - 'gemini-2.5-pro', - 'gpt-4.1', - 'gpt-4o-2024-11-20', - 'o1', - 'o3-mini', - 'o4-mini', -} - -avante.setup({ - mode = 'agentic', - provider = 'copilot-gpt-4.1', - -- cursor_applying_provider = 'copilot-o3-mini', - -- auto_suggestions_provider = 'copilot-claude-3.7-sonnet', - - providers = (function() - local providers_table = { - copilot = { - endpoint = 'https://api.githubcopilot.com', - allow_insecure = false, - timeout = 10 * 60 * 1000, - extra_request_body = { - temperature = 0, - max_completion_tokens = 1000000, - reasoning_effort = 'high', - }, - }, - } - for _, model_name in ipairs(model_names) do - local provider_key = 'copilot-' .. model_name - providers_table[provider_key] = { - __inherited_from = 'copilot', - model = model_name, - display_name = provider_key, - } - end - - return providers_table - end)(), - - behaviour = { - auto_suggestions = false, - auto_set_highlight_group = true, - auto_set_keymaps = true, - auto_apply_diff_after_generation = false, - support_paste_from_clipboard = false, - minimize_diff = true, -- Whether to remove unchanged lines when applying a code block - enable_token_counting = true, - }, - hints = { enabled = false }, - mappings = { - ---@class AvanteConflictMappings - diff = { - ours = 'co', - theirs = 'ct', - all_theirs = 'ca', - both = 'cb', - cursor = 'cc', - next = ']x', - prev = '[x', - }, - suggestion = { - accept = ' ', - next = ' ', - prev = ' ', - dismiss = ' ', - }, - jump = { - next = ']]', - prev = '[[', - }, - submit = { - normal = ' ', - insert = ' ', - }, - cancel = { - normal = { ' ', ' ', 'q' }, - insert = { ' ' }, - }, - ask = ' aa', - edit = ' ae', - refresh = ' ar', - focus = ' af', - stop = ' as', - select_model = ' aM', - select_history = ' ah', - files = { - add_current = ' ac', - add_all_buffers = ' ab', - }, - toggle = { - default = ' at', - debug = ' ad', - hint = ' aH', - suggestion = ' aS', - repomap = ' aR', - }, - sidebar = { - apply_all = 'A', - apply_cursor = 'a', - retry_user_request = 'r', - edit_user_request = 'e', - switch_windows = ' ', - reverse_switch_windows = ' ', - remove_file = 'd', - add_file = 'a', - close = { 'q' }, - close_from_input = nil, -- e.g., { normal = " ", insert = " " } - }, - }, - windows = { - ---@type "right" | "left" | "top" | "bottom" - position = 'right', - wrap = true, - width = 40, - sidebar_header = { - enabled = true, - align = 'center', - rounded = true, - }, - input = { - prefix = '> ', - height = 32, - }, - edit = { - border = 'rounded', - start_insert = true, - }, - ask = { - floating = false, - start_insert = true, - border = 'rounded', - ---@type "ours" | "theirs" - focus_on_apply = 'ours', - }, - }, - highlights = { - diff = { - current = 'DiffText', - incoming = 'DiffAdd', - }, - }, - --- @class AvanteConflictUserConfig - diff = { - autojump = true, - ---@type string | fun(): any - list_opener = 'copen', - override_timeoutlen = 500, - }, - suggestion = { - debounce = 600, - throttle = 600, - }, - disabled_tools = { - 'replace_in_file', - 'web_search', - }, - slash_commands = {}, -}) diff --git a/lua/plugins/ai/copilot.lua b/lua/plugins/ai/copilot.lua deleted file mode 100644 index 31ad413..0000000 --- a/lua/plugins/ai/copilot.lua +++ /dev/null @@ -1,45 +0,0 @@ -local copilot = require('copilot') - -copilot.setup({ - panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = '[[', - jump_next = ']]', - accept = ' ', - refresh = 'gr', - open = ' ', - }, - layout = { - position = 'bottom', - ratio = 0.4, - }, - }, - suggestion = { - enabled = true, - auto_trigger = false, - debounce = 75, - keymap = { - accept = ' ', - accept_word = false, - accept_line = false, - next = ' ', - prev = ' ', - dismiss = ' ', - }, - }, - filetypes = { - yaml = true, - markdown = true, - help = true, - gitcommit = true, - gitrebase = true, - hgcommit = true, - svn = true, - cvs = true, - ['.'] = true, - }, - copilot_node_command = 'node', -- Node.js version must be > 16.x - server_opts_overrides = {}, -}) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..4bf3efe --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,39 @@ +return { + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = function() + local palette = require("gruvbox").palette + require("gruvbox").setup({ + bold = false, + italic = { + strings = false, + emphasis = false, + comments = false, + folds = false, + }, + contrast = "hard", + transparent_mode = true, + overrides = { + -- builtin + SignColumn = { bg = "None" }, + CursorLineNr = { bg = "None" }, + Whitespace = { fg = palette.dark0 }, + EndOfBuffer = { fg = palette.dark0_hard }, + Visual = { fg = "None", bg = palette.dark1 }, + Label = { link = "GruvboxPurple" }, + + -- blink.cmp + BlinkCmpMenu = { link = "Normal" }, + BlinkCmpMenuBorder = { link = "BlinkCmpMenu" }, + BlinkCmpMenuSelection = { fg = "None", bg = palette.dark1 }, + BlinkCmpLabelMatch = { fg = palette.bright_green }, + BlinkCmpScrollBarGutter = { bg = palette.dark2 }, + BlinkCmpScrollBarThumb = { bg = palette.light1 }, + + -- indent guides + MiniIndentscopeSymbol = { fg = palette.dark1 }, + }, + }) + vim.cmd.colorscheme("gruvbox") + end, +} diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua new file mode 100644 index 0000000..fe5384e --- /dev/null +++ b/lua/plugins/completion.lua @@ -0,0 +1,58 @@ +return { + -- snippets + { + "L3MON4D3/LuaSnip", + version = "*", + dependencies = { "rafamadriz/friendly-snippets" }, + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + + -- completion + { + "saghen/blink.cmp", + version = "*", + dependencies = { + "L3MON4D3/LuaSnip", + }, + config = function() + require("blink.cmp").setup({ + completion = { + list = { + selection = { + preselect = false, + auto_insert = true, + }, + }, + documentation = { + window = { border = "rounded" }, + auto_show = true, + auto_show_delay_ms = 50, + }, + menu = { + border = "rounded", + }, + }, + signature = { + window = { border = "rounded" }, + }, + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + providers = {}, + }, + snippets = { preset = "luasnip" }, + keymap = { + preset = "none", + [" "] = { "select_prev", "snippet_backward", "fallback" }, + [" "] = { "select_next", "snippet_forward", "fallback" }, + [" "] = { "accept", "fallback" }, + [" "] = { "hide", "show" }, + [" "] = { "show", "show_documentation", "hide_documentation" }, + [" "] = { "scroll_documentation_up", "fallback" }, + [" "] = { "scroll_documentation_down", "fallback" }, + }, + }) + end, + }, +} diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua new file mode 100644 index 0000000..3e7edeb --- /dev/null +++ b/lua/plugins/editor.lua @@ -0,0 +1,170 @@ +return { + -- surround actions + { + "nvim-mini/mini.surround", + version = "*", + config = function() + require("mini.surround").setup() + end, + }, + + -- indent guides + { + "nvim-mini/mini.indentscope", + event = "VeryLazy", + config = function() + require("mini.indentscope").setup({ + draw = { + delay = 50, + animation = require("mini.indentscope").gen_animation.linear({ + ease = "out", + duration = 15, + }), + }, + options = { + border = "top", + try_as_border = true, + indent_at_cursor = false, + }, + }) + + -- disable for certain filetypes + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "*", + callback = function(args) + if vim.bo[args.buf].buftype ~= "" then + vim.b[args.buf].miniindentscope_disable = true + end + end, + }) + end, + }, + + -- Go forward/backward with square brackets + { + "echasnovski/mini.bracketed", + event = { "BufReadPost", "BufNewFile" }, + config = function() + require("mini.bracketed").setup() + end, + }, + + -- textobjects + { + "nvim-mini/mini.ai", + version = "*", + config = function() + require("mini.ai").setup({ + silent = true, + }) + end, + }, + + -- hiding colorcolumn when unneeded. + { + "m4xshen/smartcolumn.nvim", + opts = { + disabled_filetypes = { + "netrw", + "NvimTree", + "Lazy", + "mason", + "help", + "text", + "markdown", + "tex", + "html", + }, + custom_colorcolumn = { lua = "90", python = "100" }, + scope = "window", + }, + }, + + -- Dimming the highlights of unused functions, variables, parameters, and more. + { + "zbirenbaum/neodim", + enabled = false, + event = "LspAttach", + config = function() + require("neodim").setup({ + alpha = 0.5, + blend_color = nil, + hide = { + underline = true, + virtual_text = true, + signs = true, + }, + regex = { + "[uU]nused", + "[nN]ever [rR]ead", + "[nN]ot [rR]ead", + }, + priority = 128, + disable = {}, + }) + end, + }, + + { + "numToStr/Comment.nvim", + version = false, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + require("Comment").setup({ + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + mappings = { + basic = true, + extra = true, + }, + }) + end, + keys = { + { "gcc", mode = "n", desc = "Toggle comment line" }, + { "gc", mode = { "n", "o" }, desc = "Toggle comment linewise" }, + { "gc", mode = "x", desc = "Toggle comment linewise (visual)" }, + { "gbc", mode = "n", desc = "Toggle comment block" }, + { "gb", mode = { "n", "o" }, desc = "Toggle comment blockwise" }, + { "gb", mode = "x", desc = "Toggle comment blockwise (visual)" }, + { " /", " lua require('Comment.api').toggle.linewise.current() ", desc = "Toggle comment" }, + { + " /", + " lua require('Comment.api').toggle.linewise(vim.fn.visualmode()) ", + desc = "Toggle comment", + mode = "v", + }, + }, + opts = {}, + }, + + -- Todo Comments + { + "folke/todo-comments.nvim", + event = "BufRead", + opts = {}, + }, + + -- inline diagnostic + { + "rachartier/tiny-inline-diagnostic.nvim", + event = "VeryLazy", + priority = 1000, + config = function() + require("tiny-inline-diagnostic").setup() + vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text + end, + }, + + -- multiple cursor + -- { + -- "terryma/vim-multiple-cursors", + -- config = function() + -- vim.g.multi_cursor_use_default_mapping = 0 + -- vim.g.multi_cursor_next_key = " " + -- vim.g.multi_cursor_prev_key = " " + -- vim.g.multi_cursor_skip_key = " " + -- vim.g.multi_cursor_quit_key = " mc" + -- end, + -- }, +} diff --git a/lua/plugins/editor/ai.lua b/lua/plugins/editor/ai.lua deleted file mode 100644 index 45f69d4..0000000 --- a/lua/plugins/editor/ai.lua +++ /dev/null @@ -1,35 +0,0 @@ -local ai = require('mini.ai') - -ai.setup({ - custom_textobjects = { - o = ai.gen_spec.treesitter({ - a = { '@block.outer', '@conditional.outer', '@loop.outer' }, - i = { '@block.inner', '@conditional.inner', '@loop.inner' }, - }, {}), - f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }, {}), - c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }, {}), - t = { '<([%p%w]-)%f[^<%w][^<>]->.-%1>', '^<.->().*()[^/]->$' }, - }, - - mappings = { - -- Main textobject prefixes - around = 'a', - inside = 'i', - - -- Next/last variants - around_next = 'an', - inside_next = 'in', - around_last = 'al', - inside_last = 'il', - - -- Move cursor to corresponding edge of `a` textobject - goto_left = 'g[', - goto_right = 'g]', - }, - - -- How to search for object - -- 'cover', 'cover_or_next', 'cover_or_prev','cover_or_nearest', 'next', 'previous', 'nearest'. - search_method = 'cover_or_next', - n_lines = 500, - silent = false, -}) diff --git a/lua/plugins/editor/bracketed.lua b/lua/plugins/editor/bracketed.lua deleted file mode 100644 index 24b3034..0000000 --- a/lua/plugins/editor/bracketed.lua +++ /dev/null @@ -1,18 +0,0 @@ -local bracketed = require('mini.bracketed') - -bracketed.setup({ - buffer = { suffix = 'b', options = {} }, - comment = { suffix = 'c', options = {} }, - conflict = { suffix = 'x', options = {} }, - diagnostic = { suffix = 'd', options = {} }, - file = { suffix = 'f', options = {} }, - indent = { suffix = 'i', options = {} }, - jump = { suffix = 'j', options = {} }, - location = { suffix = 'l', options = {} }, - oldfile = { suffix = 'r', options = {} }, - quickfix = { suffix = 'q', options = {} }, - treesitter = { suffix = 'n', options = {} }, - undo = { suffix = 'u', options = {} }, - window = { suffix = 'w', options = {} }, - yank = { suffix = 'y', options = {} }, -}) diff --git a/lua/plugins/editor/pairs.lua b/lua/plugins/editor/pairs.lua deleted file mode 100644 index 29b6351..0000000 --- a/lua/plugins/editor/pairs.lua +++ /dev/null @@ -1,18 +0,0 @@ -local pairs = require('mini.pairs') - -pairs.setup({ - modes = { insert = true, command = true, terminal = false }, - mappings = { - ['('] = { action = 'open', pair = '()', neigh_pattern = '[^\\].' }, - ['['] = { action = 'open', pair = '[]', neigh_pattern = '[^\\].' }, - ['{'] = { action = 'open', pair = '{}', neigh_pattern = '[^\\].' }, - - [')'] = { action = 'close', pair = '()', neigh_pattern = '[^\\].' }, - [']'] = { action = 'close', pair = '[]', neigh_pattern = '[^\\].' }, - ['}'] = { action = 'close', pair = '{}', neigh_pattern = '[^\\].' }, - - ['"'] = { action = 'closeopen', pair = '""', neigh_pattern = '[^\\].', register = { cr = false } }, - ["'"] = { action = 'closeopen', pair = "''", neigh_pattern = '[^%a\\].', register = { cr = false } }, - ['`'] = { action = 'closeopen', pair = '``', neigh_pattern = '[^\\].', register = { cr = false } }, - }, -}) diff --git a/lua/plugins/editor/spider.lua b/lua/plugins/editor/spider.lua deleted file mode 100644 index 77a12b0..0000000 --- a/lua/plugins/editor/spider.lua +++ /dev/null @@ -1,10 +0,0 @@ -local spider = require('spider') - -spider.setup({ - skipInsignificantPunctuation = true, -}) - -vim.keymap.set({ 'n', 'o', 'x' }, 'w', " lua require('spider').motion('w') ", { desc = 'Spider-w' }) -vim.keymap.set({ 'n', 'o', 'x' }, 'e', " lua require('spider').motion('e') ", { desc = 'Spider-e' }) -vim.keymap.set({ 'n', 'o', 'x' }, 'b', " lua require('spider').motion('b') ", { desc = 'Spider-b' }) -vim.keymap.set({ 'n', 'o', 'x' }, 'ge', "