From aa5717f00fd14430c80939a68d7107c26de6e554 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Karimi Date: Tue, 20 Jan 2026 15:55:27 -0500 Subject: first commit --- plugin/plugins/alacritty.lua | 4 +++ plugin/plugins/conform.lua | 20 ++++++++++++ plugin/plugins/mini.lua | 37 +++++++++++++++++++++ plugin/plugins/oil.lua | 76 +++++++++++++++++++++++++++++++++++++++++++ plugin/plugins/quicker.lua | 14 ++++++++ plugin/plugins/rendermark.lua | 11 +++++++ plugin/plugins/scratch.vim | 15 +++++++++ plugin/plugins/vimtex.lua | 21 ++++++++++++ 8 files changed, 198 insertions(+) create mode 100644 plugin/plugins/alacritty.lua create mode 100644 plugin/plugins/conform.lua create mode 100644 plugin/plugins/mini.lua create mode 100644 plugin/plugins/oil.lua create mode 100644 plugin/plugins/quicker.lua create mode 100644 plugin/plugins/rendermark.lua create mode 100644 plugin/plugins/scratch.vim create mode 100644 plugin/plugins/vimtex.lua (limited to 'plugin/plugins') diff --git a/plugin/plugins/alacritty.lua b/plugin/plugins/alacritty.lua new file mode 100644 index 0000000..f6a323d --- /dev/null +++ b/plugin/plugins/alacritty.lua @@ -0,0 +1,4 @@ +local ok, alacritty = pcall(require, "alacritty") +if not ok then return end + +alacritty.setup() diff --git a/plugin/plugins/conform.lua b/plugin/plugins/conform.lua new file mode 100644 index 0000000..7dfcbb7 --- /dev/null +++ b/plugin/plugins/conform.lua @@ -0,0 +1,20 @@ +---@diagnostic disable: param-type-mismatch + +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + python = { "ruff_format" }, + rust = { "rustfmt", lsp_format = "fallback" }, + bash = { "shfmt" }, + sh = { "shfmt" }, + tex = { "latexindent" }, + }, + formatters = { + shfmt = { + append_args = { "-i", "4", "-fn" }, + }, + latexindent = { + append_args = { "-m", "-l" }, + }, + }, +}) diff --git a/plugin/plugins/mini.lua b/plugin/plugins/mini.lua new file mode 100644 index 0000000..24027e0 --- /dev/null +++ b/plugin/plugins/mini.lua @@ -0,0 +1,37 @@ +require("mini.notify").setup({ + lsp_progress = { enable = false }, +}) + +local misc = require("mini.misc") +misc.setup_restore_cursor() +misc.setup_termbg_sync() + +vim.schedule(function() + local snippets = require("mini.snippets") + snippets.setup({ + snippets = { + snippets.gen_loader.from_lang(), + }, + }) + local fin_stop = function(args) + if args.data.tabstop_to == "0" then snippets.session.stop() end + end + local au_opts = { pattern = "MiniSnippetsSessionJump", callback = fin_stop } + vim.api.nvim_create_autocmd("User", au_opts) +end) + +vim.schedule(function() + local hipatterns = require("mini.hipatterns") + hipatterns.setup({ + highlighters = { + fixme = { pattern = "FIXME", group = "MiniHipatternsFixme" }, + todo = { pattern = "TODO", group = "MiniHipatternsTodo" }, + note = { pattern = "NOTE", group = "MiniHipatternsNote" }, + hex_color = hipatterns.gen_highlighter.hex_color(), + }, + }) +end) + +vim.schedule(function() + require("mini.icons").setup() +end) diff --git a/plugin/plugins/oil.lua b/plugin/plugins/oil.lua new file mode 100644 index 0000000..edb3c50 --- /dev/null +++ b/plugin/plugins/oil.lua @@ -0,0 +1,76 @@ +require("oil").setup({ + default_file_explorer = true, + columns = { + "permissions", + "size", + -- "mtime", + }, + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + delete_to_trash = false, + skip_confirm_for_simple_edits = false, + prompt_save_on_select_new_entry = true, + cleanup_delay_ms = 2000, + lsp_file_methods = { + enabled = true, + timeout_ms = 1000, + autosave_changes = false, + }, + constrain_cursor = "editable", + watch_for_changes = false, + keymaps = { + ["g?"] = { "actions.show_help", mode = "n" }, + [""] = "actions.select", + [""] = { "actions.select", opts = { vertical = true } }, + [""] = { "actions.select", opts = { horizontal = true } }, + [""] = { "actions.select", opts = { tab = true } }, + [""] = false, + [""] = { "actions.close", mode = "n" }, + [""] = "actions.refresh", + ["-"] = { "actions.parent", mode = "n" }, + ["_"] = { "actions.open_cwd", mode = "n" }, + ["`"] = { "actions.cd", mode = "n" }, + ["g~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" }, + ["gs"] = false, + ["gx"] = "actions.open_external", + ["zh"] = { "actions.toggle_hidden", mode = "n" }, + ["gt"] = "actions.open_terminal", + ["Y"] = require("mo.oil-util").copy_to_clipboard, + ["y"] = function() require("mo.oil-util").copy_to_clipboard({ full_path = false }) end, + [":"] = { + "actions.open_cmdline", + opts = { shorten_path = true, modify = ":h" }, + }, + [";"] = { + "actions.open_cmdline", + opts = { shorten_path = true }, + }, + }, + use_default_keymaps = false, + view_options = { + show_hidden = false, + is_hidden_file = function(name, _bufnr) + local m = name:match("^%.") + return m ~= nil + end, + is_always_hidden = function(_name, _bufnr) return false end, + natural_order = "fast", + case_insensitive = false, + sort = { + { "type", "asc" }, + { "name", "asc" }, + }, + }, +} --[[@as oil.SetupOpts]]) diff --git a/plugin/plugins/quicker.lua b/plugin/plugins/quicker.lua new file mode 100644 index 0000000..05a537e --- /dev/null +++ b/plugin/plugins/quicker.lua @@ -0,0 +1,14 @@ +require("quicker").setup({ + keys = { + { + ">", + "lua require('quicker').expand()", + desc = "Expand quickfix content", + }, + { + "<", + "lua require('quicker').shrink()", + desc = "Shrink quickfix content", + }, + }, +}) diff --git a/plugin/plugins/rendermark.lua b/plugin/plugins/rendermark.lua new file mode 100644 index 0000000..24e2d16 --- /dev/null +++ b/plugin/plugins/rendermark.lua @@ -0,0 +1,11 @@ +-- vim.api.nvim_create_autocmd("FileType", { +-- pattern = { "markdown" }, +-- once = true, +-- callback = function() +-- vim.cmd([[ packadd render-markdown.nvim ]]) +-- require("render-markdown").setup({ +-- enabled = false, +-- ignore = function(buf) return vim.bo[buf].buftype ~= "nofile" end +-- }) +-- end, +-- }) diff --git a/plugin/plugins/scratch.vim b/plugin/plugins/scratch.vim new file mode 100644 index 0000000..059a21b --- /dev/null +++ b/plugin/plugins/scratch.vim @@ -0,0 +1,15 @@ +if exists('g:loaded_scratch') + finish +endif +let g:loaded_scratch = 1 + +command! -nargs=1 -complete=command Scratch call scratch#open(, ) +command! -nargs=? Marks Scratch marks +command! -nargs=0 Messages Scratch messages +command! -nargs=? Registers Scratch registers +command! -nargs=? Display Scratch display +command! -nargs=? -complete=highlight Highlight Scratch highlight +command! -nargs=0 Jumps Scratch jumps +command! -nargs=0 Changes Scratch changes +command! -nargs=0 Digraphs Scratch digraphs +command! -nargs=0 Scriptnames Scratch scriptnames diff --git a/plugin/plugins/vimtex.lua b/plugin/plugins/vimtex.lua new file mode 100644 index 0000000..05dfa3a --- /dev/null +++ b/plugin/plugins/vimtex.lua @@ -0,0 +1,21 @@ +vim.g.tex_flavor = "latex" +vim.g.vimtex_compiler_silent = 0 +vim.g.vimtex_complete_bib = { simple = 0 } +vim.g.vimtex_doc_handlers = { "vimtex#doc#handlers#texdoc" } +vim.g.vimtex_format_enabled = 0 +vim.g.vimtex_include_search_enabled = 1 +vim.g.vimtex_indent_on_ampersands = 0 +vim.g.vimtex_quickfix_ignore_filters = { + "Generic hook", + "Package hyperref Warning: Token not allowed in a PDF string", + "destination with the same identifier", + "LaTeX Font Warning:", +} +vim.g.vimtex_quickfix_open_on_warning = 0 +vim.g.vimtex_syntax_conceal_disabled = 1 +vim.g.vimtex_syntax_enabled = 1 +vim.g.vimtex_view_automatic = 0 +vim.g.vimtex_view_forward_search_on_start = 0 +vim.g.vimtex_view_method = "zathura_simple" + +vim.cmd([[packadd vimtex]]) -- cgit v1.2.3-71-gdd5e