diff --git a/lua/dot/init.lua b/lua/dot/init.lua new file mode 100644 index 0000000..ec7d96c --- /dev/null +++ b/lua/dot/init.lua @@ -0,0 +1,55 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- Filetype plugins +vim.o.filetype = "on" + +-- Terminal +vim.o.termguicolors = true -- True colors +vim.g.have_nerd_font = true + +---- Appearance + +-- Line numbers +vim.o.number = true +vim.o.relativenumber = true +vim.o.signcolumn = "yes" +vim.o.colorcolumn = "80" + +-- Indentation +vim.o.expandtab = false +vim.o.tabstop = 4 +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 +vim.o.breakindent = true +vim.o.list = true +vim.opt.listchars = { tab = "│ ", trail = ".", nbsp = "␣" } + +---- + +-- Mouse support +vim.o.mouse = "a" + +-- Save undo history +vim.o.undofile = true + +vim.o.ignorecase = true +vim.o.smartcase = true + +vim.o.updatetime = 250 +vim.o.timeoutlen = 300 + +vim.o.splitright = true +vim.o.splitbelow = true + +vim.o.inccommand = "split" + +vim.o.cursorline = true + +vim.o.scrolloff = 10 + +vim.o.completeopt = "menuone,noselect" + +-- Confirm on exit +vim.o.confirm = true + diff --git a/lua/dot013/grip/init.lua b/lua/dot013/grip/init.lua deleted file mode 100644 index da78282..0000000 --- a/lua/dot013/grip/init.lua +++ /dev/null @@ -1,40 +0,0 @@ -local grip_channel = nil -vim.api.nvim_create_user_command("GripStart", function() - if grip_channel then - return - end - - local file = vim.api.nvim_buf_get_name(0) - - local cmd = "go-grip -b false -H 0.0.0.0 " .. file - - grip_channel = vim.fn.jobstart(cmd, { - stderr_buffered = true, - on_stderr = function(_, err) - vim.fn.jobstop(grip_channel) - - local content = table.concat(err, "\n") - if content:len() > 0 then - vim.api.nvim_notify("Grip error: " .. content, vim.log.levels.ERROR, {}) - end - end, - on_exit = function() - vim.fn.chanclose(grip_channel) - grip_channel = nil - end, - }) -end, {}) - -vim.api.nvim_create_user_command("GripStop", function() - if grip_channel then - vim.fn.jobstop(grip_channel) - end -end, {}) - -vim.api.nvim_create_autocmd({ "QuitPre", "BufDelete" }, { - callback = function() - if grip_channel then - vim.fn.jobstop(grip_channel) - end - end, -}) diff --git a/lua/dot013/init.lua b/lua/dot013/init.lua deleted file mode 100644 index f7acbf3..0000000 --- a/lua/dot013/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -require("dot013.options") -require("dot013.tweaks") -require("dot013.grip") - -vim.g.lze = { - --@type fun(name: string) - load = vim.cmd.packadd, - --@type boolean - verbose = true, -} - -require("lze").load("dot013.plugins") - -require("dot013.keymap") diff --git a/lua/dot013/keymap.lua b/lua/dot013/keymap.lua deleted file mode 100644 index c4bb946..0000000 --- a/lua/dot013/keymap.lua +++ /dev/null @@ -1,35 +0,0 @@ -vim.keymap.set("n", "d", '"_d', { desc = "Delete to void" }) -vim.keymap.set("v", "d", '"_d', { desc = "Delete to void" }) - -vim.keymap.set("n", "v", ":vsplit", { desc = "Split the windows vertically" }) -vim.keymap.set("n", "h", ":split", { desc = "Split the windows horizontally" }) - -vim.keymap.set("n", "s=", "z=", { desc = "Suggest spelling currection" }) -vim.keymap.set("n", "st", function() - vim.o.spell = not vim.o.spell -end, { desc = "Toggle spelling correction" }) - -vim.keymap.set("n", "ee", vim.diagnostic.open_float, { desc = "Open diagnostics" }) - -vim.keymap.set({ "n", "v" }, "y", '"+y', { desc = "Copy to system's clipboard" }) -vim.keymap.set({ "n", "v" }, "p", '"+p', { desc = "Paste from system's clipboard" }) - --- ------ - -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(e) - vim.keymap.set("n", "r", vim.lsp.buf.rename, { desc = "[LSP] Rename", buffer = e.buf }) - vim.keymap.set("n", "a", vim.lsp.buf.code_action, { desc = "[LSP] Code action", buffer = e.buf }) - - vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "[LSP] Go to definition", buffer = e.buf }) - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "[LSP] Go to declaration", buffer = e.buf }) - vim.keymap.set("n", "gI", vim.lsp.buf.implementation, { desc = "[LSP] Go to implementation", buffer = e.buf }) - vim.keymap.set( - "n", - "D", - vim.lsp.buf.type_definition, - { desc = "[LSP] Go to type definition", buffer = e.buf } - ) - end, - group = vim.api.nvim_create_augroup("dot013_group", {}), -}) diff --git a/lua/dot013/options.lua b/lua/dot013/options.lua deleted file mode 100644 index 3eca92f..0000000 --- a/lua/dot013/options.lua +++ /dev/null @@ -1,57 +0,0 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- vim.g.loaded_netrw = 1; --- vim.g.loaded_netrwPlugin = 1; - -vim.wo.number = true -vim.o.mouse = "a" - --- True colors -vim.o.termguicolors = true - --- Enable filetype plugins -vim.o.filetype = "on" - --- Enable spell checking by default -vim.o.spell = true - --- Set relative line numbers -vim.o.number = true -vim.o.relativenumber = true -vim.o.signcolumn = "number" - --- Set indentation -vim.o.expandtab = false -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 --- vim.o.expandtab = 4; -vim.o.breakindent = true - --- Scroll off -vim.o.scrolloff = 10 - --- Line length column -vim.o.colorcolumn = "80" - --- Sync NeoVim and OS clipboards -vim.o.clipboard = "" - --- Highlight search -vim.o.hlsearch = false -vim.o.incsearch = true - --- Save undo history -vim.o.undofile = true - --- Case-insensitive search, unless \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true - -vim.wo.signcolumn = "yes" - -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 - -vim.o.completeopt = "menuone,noselect" diff --git a/lua/dot013/plugins/appearance.lua b/lua/dot013/plugins/appearance.lua deleted file mode 100644 index ddf0d6c..0000000 --- a/lua/dot013/plugins/appearance.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - -- Frappurccino/Catppuccin theme - { - "catppuccin-nvim", - priority = 1000, - after = function() - require("catppuccin").setup({ - flavour = "mocha", - transparent_background = true, - }) - vim.cmd.colorscheme("catppuccin") - end, - }, - - -- Status bar - { - "lualine.nvim", - priority = 1000, - after = function() - require("lualine").setup({ - options = { - icons_enabled = false, - theme = "catppuccin", - component_separators = "|", - section_separators = "", - }, - }) - end, - }, - { "nvim-web-devicons", dep_of = { "lualine.nvim" } }, - - -- Visual indentation - { - "indent-blankline.nvim", - priority = 1000, - after = function() - require("ibl").setup() - end, - }, -} diff --git a/lua/dot013/plugins/debugger.lua b/lua/dot013/plugins/debugger.lua deleted file mode 100644 index 37ef8ee..0000000 --- a/lua/dot013/plugins/debugger.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - -- DAP Debugger support - { - "nvim-dap", - dap_of = { - "nvim-dap-ui", - "nvim-dap-virtual-text", - "nvim-dap-go", - }, - keys = { - { "b", ":lua require('dap').toggle_breakpoint()", "[Debugger] Toggle breakpoint" }, - { "x", ":lua require('dap').continue()", "[Debugger] Continue debugger" }, - { "X", ":lua require('dap').terminate()", "[Debugger] Terminate debugger" }, - { "C", ":lua require('dap').clear_breakpoints()", "[Debugger] Clear all breakpoints" }, - -- UI - { "xu", ":lua require('dapui').toggle()", "[Debugger] Toggle debugger UI" }, - { - "K", - ":lua require('dapui').eval(nil, { enter = true })", - "[Debugger] Eval var under cursor", - }, - }, - after = function() - local dap = require("dap") - - local dapui = require("dapui") - dapui.setup() - - local dapvt = require("nvim-dap-virtual-text") - dapvt.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 - - -- Languages - local dapgo = require("dap-go") - dapgo.setup() - end, - }, - - -- Debugger UI - { - "nvim-dap-ui", - dep_of = { "nvim-dap" }, - }, - { - "nvim-nio", - dep_of = { "nvim-dap-ui" }, - }, - - -- Debugger state hover - { - "nvim-dap-virtual-text", - dep_of = { "nvim-dap" }, - }, - - -- Language specific debuggers - { - "nvim-dap-go", - dep_of = { "nvim-dap" }, - }, -} diff --git a/lua/dot013/plugins/formatting.lua b/lua/dot013/plugins/formatting.lua deleted file mode 100644 index 7e4e91d..0000000 --- a/lua/dot013/plugins/formatting.lua +++ /dev/null @@ -1,113 +0,0 @@ -local function js_fmt(bufnr) - local f = {} - - if require("conform").get_formatter_info("prettierd", bufnr).available then - table.insert(f, "prettierd") - elseif require("conform").get_formatter_info("prettier", bufnr).available then - table.insert(f, "prettier") - end - - if require("conform").get_formatter_info("eslint_d", bufnr).available then - table.insert(f, "eslint_d") - end - - if - require("conform").get_formatter_info("deno_fmt", bufnr).available - and (require("dot013.utils").is_in_cwd("deno.json") or require("dot013.utils").is_in_cwd("deno.jsonc")) - then - table.insert(f, "deno_fmt") - end - - return f -end - -return { - -- Formatters support - { - "conform.nvim", - event = { "InsertLeave", "TextChanged" }, - after = function() - require("conform").setup({ - formatters_by_ft = { - -- Simple formatters - lua = { "stylua" }, - nix = { --[[ "nixcmdfmt", ]] - "alejandra", - stop_after_first = true, - }, - rust = { "rustfmt", lsp_format = "fallback" }, - sh = { "shellharden", "shfmt" }, - xml = { "xmllint", "xmltidy" }, - xhtml = { "xmllint", "xmltidy" }, - markdown = { "mdfmt" }, - - html = { "prettierd", "prettier", stop_after_first = true }, - css = { "prettierd", "prettier", stop_after_first = true }, - scss = { "prettierd", "prettier", stop_after_first = true }, - less = { "prettierd", "prettier", stop_after_first = true }, - yaml = { "prettierd", "prettier", stop_after_first = true }, - - -- Golang's formatters used by priority - go = function(bufnr) - local f = {} - - if require("conform").get_formatter_info("gofumpt", bufnr).available then - table.insert(f, "gofumpt") - else - table.insert(f, "gofmt") - end - - if require("conform").get_formatter_info("golines", bufnr).available then - table.insert(f, "golines") - elseif require("conform").get_formatter_info("goimports", bufnr).available then - table.insert(f, "goimports") - end - - return f - end, - templ = { "templ" }, - - -- JavaScript's ecosystem - javascript = js_fmt, - javascriptreact = js_fmt, - typescript = js_fmt, - typescriptreact = js_fmt, - json = function(bufnr) - local fmts = js_fmt(bufnr) - if fmts then - return fmts - end - return { "jq" } - end, - - -- Fallback for any filetype - ["*"] = { "codespell" }, - ["_"] = { "trim_whitespace" }, - }, - format_on_save = { - timeout_ms = 500, - lsp_format = "fallback", - }, - formatters = { - mdfmt = { - command = "mdfmt", - }, - xmltidy = { - inherit = false, - -- Uses HTML Tidy - command = "tidy", - args = { "-xml", "-indent", "yes", "2", "-wrap", "100", "-" }, - }, - --[[ nixcmdfmt = { - inherit = false, - stdin = false, - cwd = require("conform.util").root_file({ "flake.nix" }), - require_cwd = true, - command = "nix", - args = { "fmt", "$FILENAME" }, - }, ]] - }, - }) - end, - }, -} diff --git a/lua/dot013/plugins/ide.lua b/lua/dot013/plugins/ide.lua deleted file mode 100644 index 1217efd..0000000 --- a/lua/dot013/plugins/ide.lua +++ /dev/null @@ -1,233 +0,0 @@ -return { - -- Auto saving on file save - { - "auto-save.nvim", - cmd = "ASToggle", - event = { "InsertLeave", "TextChanged" }, - after = function() - require("auto-save").setup({ - condition = function(buf) - if vim.bo[buf].filetype == "harpoon" then - return false - end - return true - end, - }) - end, - }, - - -- Session restore, enabled automatically in git repos - { - "auto-session", - lazy = not require("dot013.utils").is_in_cwd(".git"), - cmd = { - "SessionSave", - "SessionRestore", - "SessionDelete", - "SessionDisableAutoSave", - "SessionToggleSave", - "SessionPurgeOrphaned", - "SessionSearch", - "Auutosession", - }, - after = function() - require("auto-session").setup() - end, - }, - - -- Completion - { - "blink-cmp", - event = "InsertEnter", - dep_of = { "nvim-lspconfig" }, - after = function() - require("blink.cmp").setup({ - keymap = { - [""] = { "show", "show_documentation", "hide_documentation" }, - - [""] = { "hide", "fallback" }, - [""] = { "accept", "fallback" }, - [""] = { "accept", "fallback" }, - - [""] = { "select_prev", "snippet_backward", "fallback" }, - [""] = { "select_next", "snippet_forward", "fallback" }, - - [""] = { "scroll_documentation_up", "fallback" }, - [""] = { "scroll_documentation_down", "fallback" }, - }, - snippets = { - expand = function(snippet) - require("luasnip").lsp_expand(snippet) - end, - active = function(filter) - if filter and filter.direction then - require("luasnip").jumpable(filter.direction) - end - return require("luasnip").in_snippet() - end, - jump = function(direction) - require("luasnip").jump(direction) - end, - }, - sources = { - default = { - "snippets", - "lsp", - "path", - "buffer", - }, - }, - completion = { - list = { - selection = { preselect = true, auto_insert = true }, - }, - menu = { - draw = { - padding = { 1, 0 }, - columns = { { "label", "label_description", gap = 1 }, { "kind_icon", "kind" } }, - components = { - kind_icon = { width = { fill = true } }, - }, - }, - }, - documentation = { - auto_show = true, - }, - }, - fuzzy = { implementation = "prefer_rust" }, - }) - end, - }, - { - "luasnip", - dep_of = { "blink-cmp" }, - after = function() - require("luasnip.loaders.from_vscode").lazy_load() - require("luasnip").setup() - end, - }, - { "friendly-snippets", dep_of = { "luasnip" } }, - - -- Environment variables and secrets hidding - { - "cloak.nvim", - ft = { "sh" }, - cmd = { - "CloakDisable", - "CloakEnable", - "CloakToggle", - }, - after = function() - require("cloak").setup() - end, - }, - - -- Smart comments - { - "comment.nvim", - after = function() - require("Comment").setup({ - mappings = { - basic = true, - extra = true, - }, - }) - end, - }, - - -- Git integration, enabled just in git repos - { - "gitsigns.nvim", - cmd = "Gitsigns", - keys = { - { - "gt", - ":Gitsigns toggle_current_line_blame", - desc = "[Git] Toggle line blame", - }, - }, - enabled = require("dot013.utils").is_in_cwd(".git"), - lazy = not require("dot013.utils").is_in_cwd(".git"), - after = function() - require("gitsigns").setup({ - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "+" }, - topdelete = { text = "-" }, - changedelete = { text = "~" }, - }, - current_line_blame = false, - current_line_blame_opts = { - delay = 0, - }, - }) - end, - }, - - -- Auto closing pairs - { - "nvim-autopairs", - event = "InsertEnter", - after = function() - require("nvim-autopairs").setup() - end, - }, - - -- Auto closing and renaming tags - { - "nvim-ts-autotag", - event = { "BufReadPre", "BufNewFile" }, - after = function() - require("nvim-ts-autotag").setup({ - opts = { - enable_close = true, - enable_rename = true, - enable_close_on_slash = false, - }, - }) - end, - }, - - -- Automatic buffer options and .editorconfig support - { - "vim-sleuth", - event = { "BufReadPre", "BufNewFile" }, - }, - - -- Tailwind integration - { - "tailwind-tools.nvim", - after = function() - -- TODO: Fork the project to remove root_dir clauses in LSP config, - -- since Tailwind v4 doesn't use tailwind.config.js - require("tailwind-tools").setup() - end, - }, - - -- Todo comments explorer - { - "todo-comments.nvim", - after = function() - require("todo-comments").setup() - end, - }, - - -- File explorer - { - -- (Probably can be replaced by local functions in the config) - "tfm.nvim", - enabled = vim.fn.executable("yazi"), - cmd = { "Ex", "Tfm", "TfmSplit", "TfmVsplit", "TfmTabedit" }, - keys = { - { "", ":Tfm", desc = "[TFM] Open file manager" }, - }, - after = function() - require("tfm").setup({ - file_manager = "yazi", - replace_netrw = true, - enable_cmds = true, - }) - end, - }, -} diff --git a/lua/dot013/plugins/init.lua b/lua/dot013/plugins/init.lua deleted file mode 100644 index c3b68d0..0000000 --- a/lua/dot013/plugins/init.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { import = "dot013.plugins.appearance" }, - { import = "dot013.plugins.debugger" }, - { import = "dot013.plugins.formatting" }, - { import = "dot013.plugins.ide" }, - { import = "dot013.plugins.integrations" }, - { import = "dot013.plugins.lsp" }, - { import = "dot013.plugins.navigation" }, - { import = "dot013.plugins.treesitter" }, - - -- Global Dependencies - { - "plenary.nvim", - dep_of = { "harpoon", "telescope.nvim", "todo-comments.nvim" }, - }, -} diff --git a/lua/dot013/plugins/integrations.lua b/lua/dot013/plugins/integrations.lua deleted file mode 100644 index c382434..0000000 --- a/lua/dot013/plugins/integrations.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "aw-watcher.nvim", - after = function() - require("aw_watcher").setup({}) - end, - }, -} diff --git a/lua/dot013/plugins/lsp.lua b/lua/dot013/plugins/lsp.lua deleted file mode 100644 index 80c8535..0000000 --- a/lua/dot013/plugins/lsp.lua +++ /dev/null @@ -1,142 +0,0 @@ -local lsps = { - ["cssls"] = {}, - ["emmet_language_server"] = { - filetypes = require("lspconfig.configs.emmet_language_server").default_config.filetypes, - }, - ["eslint"] = {}, - ["denols"] = {}, - ["lemminx"] = { - filetypes = { "xml", "xsd", "xsl", "xslt", "svg", "xhtml" }, - }, - ["lua_ls"] = { - on_init = function(client) - if client.workspace_folders then - local path = client.workspace_folders[1].name - if - path ~= vim.fn.stdpath("config") and vim.loop.fs_stat(path .. "/.luarc.json") - or vim.loop.fs_stat(path .. "/.luarc.jsonc") - then - return - end - end - - client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { - runtime = { - version = "LuaJIT", - path = { - "lua/?.lua", - "lua/?/init.lua", - }, - }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - }, - }, - }) - end, - settings = { - Lua = { - codeLens = { enable = true }, - hint = { enable = true, semicolin = "Disable" }, - telemetry = { enable = false }, - }, - }, - }, - ["gopls"] = {}, - ["golangci_lint_ls"] = function() - if vim.fn.executable("golangci-list") == 1 then - return {} - else - return nil - end - end, - ["html"] = {}, - ["htmx"] = {}, - ["jsonls"] = {}, - ["nil_ls"] = { - cmd = { "nil" }, - filetypes = { "nix" }, - single_file_support = true, - root_dir = nil, - }, - ["marksman"] = {}, - ["ts_ls"] = {}, - ["rust_analyzer"] = {}, -} - -return { - -- Language Server Protocol (LSP) configuration - { - "nvim-lspconfig", - after = function() - local blink = require("blink.cmp") - for server, config in pairs(lsps) do - if type(config) == "function" then - config = config() - end - - if config == nil then - return - end - - -- config.capabilities = blink.get_lsp_capabilities(config.capabilities) - - vim.lsp.enable(server) - if next(config) ~= nil then - vim.lsp.config(server, config) - end - end - - vim.diagnostic.config({ - virtual_text = true, - }) - end, - }, - - -- Emmet integration - { - "nvim-emmet", - ft = lsps["emmet_language_server"].filetypes, - keys = { - { - "we", - ":lua require('nvim-emmet').wrap_with_abbreviation()", - desc = "[Emmet] Wrap with emmet abbreviation", - mode = { "n", "v" }, - }, - }, - }, - - -- Quickfix list and diagnostics - { - "trouble.nvim", - cmd = { "Trouble" }, - keys = { - { - "t", - "Trouble diagnostics toggle severity=vim.diagnostic.severity.ERROR", - desc = "[Trouble] Buffer diagnostics", - }, - { - "la", - "Trouble lsp toggle focus=false win.position=right win.type=split", - desc = "[Trouble] All LSP Definitions & references", - }, - { - "s", - "Trouble symbols toggle focus=false win.position=right win.type=split", - desc = "[Trouble] Symbols", - }, - { - "q", - "Trouble qflist toggle", - desc = "[Trouble] Quickfix list", - }, - }, - after = function() - require("trouble").setup() - end, - }, -} diff --git a/lua/dot013/plugins/navigation.lua b/lua/dot013/plugins/navigation.lua deleted file mode 100644 index bbd01b9..0000000 --- a/lua/dot013/plugins/navigation.lua +++ /dev/null @@ -1,144 +0,0 @@ -return { - -- File fuzzy finder - { - "telescope.nvim", - cmd = { - "Telescope", - }, - dep_of = { "tailwind-tools.nvim" }, - keys = { - { - "", - ":lua require('telescope.builtin').buffers()", - desc = "[Telescope] Find existing buffers", - }, - { - "/", - function() - return require("telescope.builtin").current_buffer_fuzzy_find( - require("telescope.themes").get_dropdown({ - windblend = 10, - previewer = false, - }) - ) - end, - desc = "[Telescope] Find in current buffer", - }, - { - "fr", - ":lua require('telescope.builtin').oldfiles()", - desc = "[Telescope] Find recent files", - }, - { - "ff", - function() - if require("dot013.utils").is_in_cwd(".git") then - return require("telescope.builtin").git_files() - else - return require("telescope.builtin").find_files() - end - end, - desc = "[Telescope] Git files", - }, - { - "ff", - function() - require("telescope.builtin").find_files({ no_ignore = true, no_ignore_parent = true, hidden = true }) - end, - desc = "[Telescope] Find files", - }, - { "fw", ":lua require('telescope.builtin').grep_string()", desc = "[Telescope] Find word" }, - { - "fw", - "Telescope live_grep", - desc = "[Telescope] Find word in all files", - }, - { "fs", ":lua require('telescope.builtin').resume()", desc = "[Telescope] Resume search" }, - { "u", "Telescope undo", desc = "[Telescope] Undo history" }, - }, - after = function() - require("telescope").setup() - require("telescope").load_extension("zf-native") - require("telescope").load_extension("undo") - end, - }, - { "telescope-zf-native.nvim", dep_of = { "telescope.nvim" } }, - { "telescope-undo.nvim", dep_of = { "telescope.nvim" } }, - - -- File quick switching - { - "harpoon2", - keys = (function() - local h = nil - local function harpoon() - if h == nil then - h = require("harpoon") - h:setup() - end - return h - end - - return { - { - "w", - function() - harpoon():list():add() - end, - desc = "[Harpoon] Append to list", - }, - { - "e", - function() - harpoon().ui:toggle_quick_menu(harpoon():list()) - end, - desc = "[Harpoon] Open quick menu", - }, - { - "E", - function() - harpoon().ui:toggle_quick_menu(harpoon():list()) - end, - desc = "[Harpoon] Open quick edit menu", - }, - { - "", - function() - harpoon():list():prev() - end, - desc = "[Harpoon] Jump to previous item", - }, - { - "", - function() - harpoon():list():next() - end, - desc = "[Harpoon] Jump to next item", - }, - } - end)(), - }, - - -- Visual jump marks - { - "marks.nvim", - after = function() - require("marks").setup({ - refresh_interval = 250, - }) - end, - }, - - -- Tmux panel jumping - { - "tmux.nvim", - keys = { - { "", ":lua require('tmux').move_left()", desc = "[Tmux] Move to left pane" }, - { "", ":lua require('tmux').move_bottom()", desc = "[Tmux] Move to bottom pane" }, - { "", ":lua require('tmux').move_top()", desc = "[Tmux] Move to top pane" }, - { "", ":lua require('tmux').move_right()", desc = "[Tmux] Move to right pane" }, - }, - after = function() - require("tmux").setup() - end, - }, -} diff --git a/lua/dot013/plugins/treesitter.lua b/lua/dot013/plugins/treesitter.lua deleted file mode 100644 index 6fdc3a4..0000000 --- a/lua/dot013/plugins/treesitter.lua +++ /dev/null @@ -1,110 +0,0 @@ -return { - -- Syntax highlight - { - "nvim-treesitter", - dep_of = { "indent-blankline.nvim" }, - priority = 1000, - after = function() - require("nvim-treesitter.configs").setup({ - auto_install = false, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - move = { - enable = true, - set_jumps = true, - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - }, - }, - textsubjects = { - enable = true, - prev_selection = ",", - keymaps = { - ["."] = "textsubjects-smart", - [";"] = "textsubjects-container-outer", - ["i;"] = "textsubjects-container-inner", - }, - }, - swap = { - enable = true, - swap_next = { - ["a"] = "@parameter.inner", - }, - swap_previous = { - ["A"] = "@parameter.inner", - }, - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, - persist_queries = false, - keybindings = { - toggle_query_editor = "o", - toggle_hl_groups = "i", - toggle_injected_languages = "t", - toggle_anonymous_nodes = "a", - toggle_language_display = "I", - focus_language = "f", - unfocus_language = "F", - update = "R", - goto_node = "", - show_help = "?", - }, - }, - query_linter = { - enable = true, - use_virtual_text = true, - lint_events = { "BugWrite", "CursorHold" }, - }, - }) - - local LANGUAGE_ALIASES = { - { from = "dataviewjs", to = "javascript" }, - { from = "js", to = "javascript" }, - { from = "ts", to = "typescript" }, - } - for _, v in pairs(LANGUAGE_ALIASES) do - vim.treesitter.language.register(v.to, v.from) - end - end, - }, - { "nvim-treesitter-textobjects", dep_of = { "nvim-treesitter" } }, - { "nvim-treesitter-textsubjects", dep_of = { "nvim-treesitter" } }, -} diff --git a/lua/dot013/tweaks.lua b/lua/dot013/tweaks.lua deleted file mode 100644 index 9de2888..0000000 --- a/lua/dot013/tweaks.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Highlight on yank -local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) -vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = "*", -}) - --- Move when highlighted -vim.keymap.set("n", "J", "mzJ`z") - --- Make cursor stay in place when using J -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "zz") - --- Just to be sure -vim.keymap.set("n", "", "") --- Don't press Q -vim.keymap.set("n", "Q", "") - -vim.keymap.set({ "n", "v" }, "", "", { desc = "Nop", silent = true }) - -vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) diff --git a/lua/dot013/utils.lua b/lua/dot013/utils.lua deleted file mode 100644 index 1cdaa76..0000000 --- a/lua/dot013/utils.lua +++ /dev/null @@ -1,23 +0,0 @@ -local M = {} - -M.is_in_cwd = function(name) - local cwd = vim.fn.getcwd() - local cwdContent = vim.split(vim.fn.glob(cwd .. "/*"), "\n", { trimempty = true }) - local hiddenCwdContent = vim.split(vim.fn.glob(cwd .. "/.*"), "\n", { trimempty = true }) - - for _, f in pairs(hiddenCwdContent) do - table.insert(cwdContent, f) - end - - local fullName = cwd .. "/" .. name - - for _, f in pairs(cwdContent) do - if f == fullName then - return true - end - end - - return false -end - -return M diff --git a/plugin/init.lua b/plugin/init.lua index cbd6fe4..d4d6a6c 100644 --- a/plugin/init.lua +++ b/plugin/init.lua @@ -1 +1 @@ -require("dot013") +require("dot")