diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-06-04 18:42:09 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-06-04 18:43:00 +0800 |
commit | 494c9f27f2483440d022a11c4a81ddd7bea33cb5 (patch) | |
tree | 5c6cf80ae2ee849344be14832fb561bae1fc07be /store/home/config/nvim/lua/setup/plugins | |
parent | c3cdc6e002eec05be3bcaa4fb14e5dff06e975da (diff) | |
download | crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.tar.gz crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.tar.bz2 crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.zip |
chore(config): move dir.
Diffstat (limited to 'store/home/config/nvim/lua/setup/plugins')
6 files changed, 0 insertions, 223 deletions
diff --git a/store/home/config/nvim/lua/setup/plugins/cmp.lua b/store/home/config/nvim/lua/setup/plugins/cmp.lua deleted file mode 100644 index be9f8ea..0000000 --- a/store/home/config/nvim/lua/setup/plugins/cmp.lua +++ /dev/null @@ -1,30 +0,0 @@ -local function setup() - local cmp = require("cmp") - - cmp.setup { - snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-j>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), - ['<C-k>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), - ['<C-e>'] = cmp.mapping.abort(), - ['<C-y>'] = cmp.mapping.confirm({ select = true }), - ['<CR>'] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'path' }, - }, { - { name = 'buffer' }, - }) - } -end - -return { - setup = setup -} diff --git a/store/home/config/nvim/lua/setup/plugins/gitsigns.lua b/store/home/config/nvim/lua/setup/plugins/gitsigns.lua deleted file mode 100644 index 957c661..0000000 --- a/store/home/config/nvim/lua/setup/plugins/gitsigns.lua +++ /dev/null @@ -1,40 +0,0 @@ -local function setup() - local gitsigns = require('gitsigns') - - gitsigns.setup { - on_attach = function(bufnr) - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal({ ']c', bang = true }) - else - gitsigns.nav_hunk('next') - end - end) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal({ '[c', bang = true }) - else - gitsigns.nav_hunk('prev') - end - end) - - -- Actions - map('n', '<leader>gc', gitsigns.preview_hunk) - map('n', '<leader>gt', gitsigns.toggle_deleted) - map('n', '<leader>gd', gitsigns.diffthis) - map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end) - end - } -end - -return { - setup = setup -} diff --git a/store/home/config/nvim/lua/setup/plugins/init.lua b/store/home/config/nvim/lua/setup/plugins/init.lua deleted file mode 100644 index 5bcc219..0000000 --- a/store/home/config/nvim/lua/setup/plugins/init.lua +++ /dev/null @@ -1,16 +0,0 @@ -local function setup() - require("neo-tree").setup {} - require('lualine').setup {} - - require("setup.plugins.telescope").setup() - require("setup.plugins.gitsigns").setup() - - require("setup.plugins.tree-sitter").setup() - require("setup.plugins.lint").setup() - require("setup.plugins.cmp").setup() - require("nvim-autopairs").setup {} -end - -return { - setup = setup -} diff --git a/store/home/config/nvim/lua/setup/plugins/lint.lua b/store/home/config/nvim/lua/setup/plugins/lint.lua deleted file mode 100644 index 928841d..0000000 --- a/store/home/config/nvim/lua/setup/plugins/lint.lua +++ /dev/null @@ -1,98 +0,0 @@ -local lint = require("lint") - -local cspell = { - name = "cspell", - config_patterns = { - ".cspell.json", - "cspell.json", - ".cSpell.json", - "cSpell.json", - "cspell.config.js", - "cspell.config.cjs", - "cspell.config.json", - "cspell.config.yaml", - "cspell.config.yml", - "cspell.yaml", - "cspell.yml", - }, - fast = true, -} - -local markdownlint = { - name = "markdownlint", - config_patterns = { - ".markdownlint.jsonc", - ".markdownlint.json", - ".markdownlint.yaml", - ".markdownlint.yml", - ".markdownlintrc", - }, - filetypes = { "markdown" }, - fast = true, -} - -local linters = { cspell, markdownlint } - -local linter_names = vim.tbl_map(function(l) return l.name end, linters) - -local function cru_lint(linter, opt) - opt = opt or {} - - local buf = opt.buf or 0 - - if linter.filetypes then - local filetype = vim.api.nvim_get_option_value("filetype", { buf = buf }) - if not vim.list_contains(linter.filetypes, filetype) then - return - end - end - - if 0 ~= #vim.fs.find(linter.config_patterns, { - path = vim.api.nvim_buf_get_name(opt.buf), upward = true }) then - lint.try_lint(linter.name) - end -end - -local function cru_lint_one(name, opt) - for _, linter in ipairs(linters) do - if linter.name == name then - cru_lint(linter, opt) - return - end - end - vim.notify("No linter named " .. name .. " is configured.", vim.log.levels.ERROR, {}) -end - -local function cru_lint_all(opt, fast) - for _, linter in ipairs(linters) do - if not fast or linter.fast then - cru_lint(linter, opt) - end - end -end - -local function cru_lint_all_fast(opt) - local buf = opt.buf - if vim.api.nvim_get_option_value("buftype", { buf = buf }) == "" then - cru_lint_all(opt, true) - end -end - -local function setup() - vim.api.nvim_create_autocmd({ "BufReadPost", "InsertLeave", "TextChanged" }, { callback = cru_lint_all_fast }) - - local function cru_lint_cmd(opt) - if #opt.args == 0 then - cru_lint_all(opt, false) - else - cru_lint_one(opt.args, opt) - end - end - - vim.api.nvim_create_user_command("CruLint", cru_lint_cmd, - { nargs = '?', complete = function() return linter_names end }) -end - -return { - setup = setup, -} diff --git a/store/home/config/nvim/lua/setup/plugins/telescope.lua b/store/home/config/nvim/lua/setup/plugins/telescope.lua deleted file mode 100644 index 69a69c0..0000000 --- a/store/home/config/nvim/lua/setup/plugins/telescope.lua +++ /dev/null @@ -1,28 +0,0 @@ -local function setup() - local builtin = require('telescope.builtin') - vim.keymap.set('n', '<leader>/', builtin.live_grep, {}) - vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) - vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) - vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) - vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) - vim.keymap.set('n', '<leader>fr', builtin.registers, {}) - vim.keymap.set('n', '<leader>fq', builtin.quickfixhistory, {}) - vim.keymap.set('n', '<leader>fm', builtin.marks, {}) - vim.keymap.set('n', '<leader>fd', builtin.diagnostics, {}) - vim.keymap.set('n', '<leader>fs', builtin.lsp_workspace_symbols, {}) - - local function all_files(opts) - opts = vim.tbl_extend('force', { - hidden = true, - no_ignore = true, - no_ignore_parent = true, - }, opts or {}) - builtin.find_files(opts) - end - - vim.keymap.set('n', '<leader>fa', all_files, {}) -end - -return { - setup = setup -} diff --git a/store/home/config/nvim/lua/setup/plugins/tree-sitter.lua b/store/home/config/nvim/lua/setup/plugins/tree-sitter.lua deleted file mode 100644 index 043f425..0000000 --- a/store/home/config/nvim/lua/setup/plugins/tree-sitter.lua +++ /dev/null @@ -1,11 +0,0 @@ -local function setup() - require'nvim-treesitter.configs'.setup { - highlight = { enable = true }, - incremental_selection = { enable = true }, - textobjects = { enable = true }, - } -end - -return { - setup = setup -} |