chore: migrated to vim.pack
773f6ea0
15 file(s) · +212 −300
| 1 | 1 | require("config.options") |
|
| 2 | - | require("core.lazy") |
|
| 2 | + | require("core.plugins") |
|
| 3 | 3 | require("core.lsp") |
|
| 4 | 4 | require("core.treesitter") |
|
| 5 | 5 | require("config.keymaps") |
| 1 | - | { |
|
| 2 | - | "darkmatter-nvim": { "branch": "main", "commit": "5663ddc9d8580c0c43b996e01bfe1a335789e9c9" }, |
|
| 3 | - | "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, |
|
| 4 | - | "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, |
|
| 5 | - | "mini.nvim": { "branch": "main", "commit": "a995fe9cd4193fb492b5df69175a351a74b3d36b" }, |
|
| 6 | - | "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" } |
|
| 7 | - | } |
| 7 | 7 | "S", |
|
| 8 | 8 | "asm" |
|
| 9 | 9 | }, |
|
| 10 | - | -- settings = { |
|
| 11 | - | -- Lua = { |
|
| 12 | - | -- diagnostics = { |
|
| 13 | - | -- -- disable = { "missing-parameters", "missing-fields" }, |
|
| 14 | - | -- }, |
|
| 15 | - | -- }, |
|
| 16 | - | -- }, |
|
| 17 | - | ||
| 18 | 10 | single_file_support = true, |
|
| 19 | 11 | log_level = vim.lsp.protocol.MessageType.Warning, |
|
| 20 | 12 | } |
| 8 | 8 | ".gitignore", |
|
| 9 | 9 | "foundry.toml" |
|
| 10 | 10 | }, |
|
| 11 | - | -- settings = { |
|
| 12 | - | -- Lua = { |
|
| 13 | - | -- diagnostics = { |
|
| 14 | - | -- -- disable = { "missing-parameters", "missing-fields" }, |
|
| 15 | - | -- }, |
|
| 16 | - | -- }, |
|
| 17 | - | -- }, |
|
| 18 | - | ||
| 19 | 11 | single_file_support = true, |
|
| 20 | 12 | log_level = vim.lsp.protocol.MessageType.Warning, |
|
| 21 | 13 | } |
| 12 | 12 | }, |
|
| 13 | 13 | root_markers = { |
|
| 14 | 14 | 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' }, |
|
| 15 | - | -- settings = { |
|
| 16 | - | -- Lua = { |
|
| 17 | - | -- diagnostics = { |
|
| 18 | - | -- -- disable = { "missing-parameters", "missing-fields" }, |
|
| 19 | - | -- }, |
|
| 20 | - | -- }, |
|
| 21 | - | -- }, |
|
| 22 | - | ||
| 23 | 15 | single_file_support = true, |
|
| 24 | 16 | log_level = vim.lsp.protocol.MessageType.Warning, |
|
| 25 | 17 | } |
| 22 | 22 | end, |
|
| 23 | 23 | }) |
|
| 24 | 24 | ||
| 25 | - | vim.api.nvim_create_autocmd("LspAttach", { |
|
| 26 | - | group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), |
|
| 27 | - | callback = function(event) |
|
| 28 | - | local map = function(keys, func, desc) |
|
| 29 | - | vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) |
|
| 30 | - | end |
|
| 31 | - | ||
| 32 | - | -- defaults: |
|
| 33 | - | -- https://neovim.io/doc/user/news-0.11.html#_defaults |
|
| 34 | - | ||
| 35 | - | map("gl", vim.diagnostic.open_float, "Open Diagnostic Float") |
|
| 36 | - | map("K", vim.lsp.buf.hover, "Hover Documentation") |
|
| 37 | - | map("gs", vim.lsp.buf.signature_help, "Signature Documentation") |
|
| 38 | - | map("gD", vim.lsp.buf.declaration, "Goto Declaration") |
|
| 39 | - | map("<leader>la", vim.lsp.buf.code_action, "Code Action") |
|
| 40 | - | map("<leader>lr", vim.lsp.buf.rename, "Rename all references") |
|
| 41 | - | map("<leader>lf", vim.lsp.buf.format, "Format") |
|
| 42 | - | map("<leader>v", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>", "Goto Definition in Vertical Split") |
|
| 43 | - | ||
| 44 | - | local function client_supports_method(client, method, bufnr) |
|
| 45 | - | if vim.fn.has 'nvim-0.11' == 1 then |
|
| 46 | - | return client:supports_method(method, bufnr) |
|
| 47 | - | else |
|
| 48 | - | return client.supports_method(method, { bufnr = bufnr }) |
|
| 49 | - | end |
|
| 50 | - | end |
|
| 51 | - | ||
| 52 | - | local client = vim.lsp.get_client_by_id(event.data.client_id) |
|
| 53 | - | if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then |
|
| 54 | - | local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) |
|
| 55 | - | ||
| 56 | - | -- When cursor stops moving: Highlights all instances of the symbol under the cursor |
|
| 57 | - | -- When cursor moves: Clears the highlighting |
|
| 58 | - | vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { |
|
| 59 | - | buffer = event.buf, |
|
| 60 | - | group = highlight_augroup, |
|
| 61 | - | callback = vim.lsp.buf.document_highlight, |
|
| 62 | - | }) |
|
| 63 | - | vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { |
|
| 64 | - | buffer = event.buf, |
|
| 65 | - | group = highlight_augroup, |
|
| 66 | - | callback = vim.lsp.buf.clear_references, |
|
| 67 | - | }) |
|
| 68 | - | ||
| 69 | - | -- When LSP detaches: Clears the highlighting |
|
| 70 | - | vim.api.nvim_create_autocmd('LspDetach', { |
|
| 71 | - | group = vim.api.nvim_create_augroup('lsp-detach', { clear = true }), |
|
| 72 | - | callback = function(event2) |
|
| 73 | - | vim.lsp.buf.clear_references() |
|
| 74 | - | vim.api.nvim_clear_autocmds { group = 'lsp-highlight', buffer = event2.buf } |
|
| 75 | - | end, |
|
| 76 | - | }) |
|
| 77 | - | end |
|
| 78 | - | end, |
|
| 79 | - | ||
| 80 | - | }) |
|
| 81 | - | ||
| 82 | 25 | vim.api.nvim_create_autocmd("VimEnter", { |
|
| 83 | 26 | callback = function() |
|
| 84 | 27 | if vim.fn.argv(0) == "" then |
|
| 85 | - | vim.defer_fn(function() |
|
| 28 | + | vim.schedule(function() |
|
| 86 | 29 | require("mini.pick").builtin.files() |
|
| 87 | - | end, 100) -- Wait 100ms |
|
| 30 | + | end) |
|
| 88 | 31 | end |
|
| 89 | 32 | end, |
|
| 90 | 33 | }) |
| 4 | 4 | -- Saving |
|
| 5 | 5 | map("n", "++", "<cmd>write!<CR>", opts) |
|
| 6 | 6 | ||
| 7 | + | -- Tmux Navigation |
|
| 8 | + | map("n", "<C-h>", "<cmd>TmuxNavigateLeft<CR>", opts) |
|
| 9 | + | map("n", "<C-j>", "<cmd>TmuxNavigateDown<CR>", opts) |
|
| 10 | + | map("n", "<C-k>", "<cmd>TmuxNavigateUp<CR>", opts) |
|
| 11 | + | map("n", "<C-l>", "<cmd>TmuxNavigateRight<CR>", opts) |
|
| 12 | + | ||
| 7 | 13 | -- Navigation |
|
| 8 | 14 | map("n", "j", "gj", opts) |
|
| 9 | 15 | map("n", "k", "gk", opts) |
| 17 | 17 | vim.opt.inccommand = "nosplit" -- preview incremental substitute |
|
| 18 | 18 | vim.opt.incsearch = true |
|
| 19 | 19 | vim.opt.laststatus = 3 -- global statusline |
|
| 20 | - | vim.opt.list = true -- Show some invisible characters (tabs... |
|
| 20 | + | vim.opt.list = false -- Don't show invisible characters |
|
| 21 | 21 | vim.opt.mouse = "a" -- Enable mouse mode |
|
| 22 | 22 | vim.opt.number = true -- Print line number |
|
| 23 | 23 | vim.opt.pumblend = 10 -- Popup blend |
|
| 55 | 55 | diff = "╱", |
|
| 56 | 56 | eob = " ", |
|
| 57 | 57 | } |
|
| 58 | - | vim.opt.list = false |
|
| 59 | 58 | vim.opt.shell = "sh" |
|
| 60 | 59 | ||
| 61 | 60 | if vim.fn.has("nvim-0.10") == 1 then |
|
| 62 | 61 | vim.opt.smoothscroll = true |
|
| 63 | 62 | end |
|
| 63 | + | ||
| 64 | + | -- Treesitter folding |
|
| 65 | + | vim.o.foldenable = true |
|
| 66 | + | vim.o.foldlevel = 99 |
|
| 67 | + | vim.o.foldmethod = "expr" |
|
| 68 | + | vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" |
|
| 64 | 69 | ||
| 65 | 70 | -- Fix markdown indentation settings |
|
| 66 | 71 | vim.g.markdown_recommended_style = 0 |
|
| 1 | - | local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' |
|
| 2 | - | if not (vim.uv or vim.loop).fs_stat(lazypath) then |
|
| 3 | - | local lazyrepo = 'https://github.com/folke/lazy.nvim.git' |
|
| 4 | - | local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } |
|
| 5 | - | if vim.v.shell_error ~= 0 then |
|
| 6 | - | error('Error cloning lazy.nvim:\n' .. out) |
|
| 7 | - | end |
|
| 8 | - | end ---@diagnostic disable-next-line: undefined-field |
|
| 9 | - | vim.opt.rtp:prepend(lazypath) |
|
| 10 | - | ||
| 11 | - | require("lazy").setup({ import = "plugins" }, { |
|
| 12 | - | install = { |
|
| 13 | - | missing = true, |
|
| 14 | - | }, |
|
| 15 | - | checker = { |
|
| 16 | - | enabled = true, |
|
| 17 | - | notify = false, |
|
| 18 | - | }, |
|
| 19 | - | change_detection = { |
|
| 20 | - | enabled = true, |
|
| 21 | - | notify = false, |
|
| 22 | - | }, |
|
| 23 | - | ui = { |
|
| 24 | - | -- border = "rounded" |
|
| 25 | - | }, |
|
| 26 | - | performance = { |
|
| 27 | - | rtp = { |
|
| 28 | - | disabled_plugins = { |
|
| 29 | - | "gzip", |
|
| 30 | - | "tarPlugin", |
|
| 31 | - | "tohtml", |
|
| 32 | - | "tutor", |
|
| 33 | - | "zipPlugin", |
|
| 34 | - | }, |
|
| 35 | - | }, |
|
| 36 | - | }, |
|
| 37 | - | }) |
| 10 | 10 | "json" |
|
| 11 | 11 | }) |
|
| 12 | 12 | ||
| 13 | + | vim.api.nvim_create_autocmd("LspAttach", { |
|
| 14 | + | group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), |
|
| 15 | + | callback = function(event) |
|
| 16 | + | local map = function(keys, func, desc) |
|
| 17 | + | vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) |
|
| 18 | + | end |
|
| 19 | + | ||
| 20 | + | -- defaults: |
|
| 21 | + | -- https://neovim.io/doc/user/news-0.11.html#_defaults |
|
| 22 | + | ||
| 23 | + | map("gl", vim.diagnostic.open_float, "Open Diagnostic Float") |
|
| 24 | + | map("K", vim.lsp.buf.hover, "Hover Documentation") |
|
| 25 | + | map("gs", vim.lsp.buf.signature_help, "Signature Documentation") |
|
| 26 | + | map("gD", vim.lsp.buf.declaration, "Goto Declaration") |
|
| 27 | + | map("<leader>la", vim.lsp.buf.code_action, "Code Action") |
|
| 28 | + | map("<leader>lr", vim.lsp.buf.rename, "Rename all references") |
|
| 29 | + | map("<leader>lf", vim.lsp.buf.format, "Format") |
|
| 30 | + | map("<leader>v", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>", "Goto Definition in Vertical Split") |
|
| 31 | + | ||
| 32 | + | local function client_supports_method(client, method, bufnr) |
|
| 33 | + | if vim.fn.has 'nvim-0.11' == 1 then |
|
| 34 | + | return client:supports_method(method, bufnr) |
|
| 35 | + | else |
|
| 36 | + | return client.supports_method(method, { bufnr = bufnr }) |
|
| 37 | + | end |
|
| 38 | + | end |
|
| 39 | + | ||
| 40 | + | local client = vim.lsp.get_client_by_id(event.data.client_id) |
|
| 41 | + | if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then |
|
| 42 | + | local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) |
|
| 43 | + | ||
| 44 | + | -- When cursor stops moving: Highlights all instances of the symbol under the cursor |
|
| 45 | + | -- When cursor moves: Clears the highlighting |
|
| 46 | + | vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { |
|
| 47 | + | buffer = event.buf, |
|
| 48 | + | group = highlight_augroup, |
|
| 49 | + | callback = vim.lsp.buf.document_highlight, |
|
| 50 | + | }) |
|
| 51 | + | vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { |
|
| 52 | + | buffer = event.buf, |
|
| 53 | + | group = highlight_augroup, |
|
| 54 | + | callback = vim.lsp.buf.clear_references, |
|
| 55 | + | }) |
|
| 56 | + | ||
| 57 | + | -- When LSP detaches: Clears the highlighting |
|
| 58 | + | vim.api.nvim_create_autocmd('LspDetach', { |
|
| 59 | + | group = vim.api.nvim_create_augroup('lsp-detach', { clear = true }), |
|
| 60 | + | callback = function(event2) |
|
| 61 | + | vim.lsp.buf.clear_references() |
|
| 62 | + | vim.api.nvim_clear_autocmds { group = 'lsp-highlight', buffer = event2.buf } |
|
| 63 | + | end, |
|
| 64 | + | }) |
|
| 65 | + | end |
|
| 66 | + | end, |
|
| 67 | + | }) |
|
| 68 | + | ||
| 13 | 69 | vim.diagnostic.config({ |
|
| 14 | 70 | virtual_lines = false, |
|
| 15 | 71 | -- virtual_text = true, |
| 1 | + | -- ============================================================================ |
|
| 2 | + | -- Colorscheme (must load at startup) |
|
| 3 | + | -- ============================================================================ |
|
| 4 | + | vim.pack.add({ |
|
| 5 | + | "https://github.com/stevedylandev/darkmatter-nvim", |
|
| 6 | + | }) |
|
| 7 | + | vim.cmd.colorscheme('darkmatter') |
|
| 8 | + | ||
| 9 | + | -- ============================================================================ |
|
| 10 | + | -- Mini.nvim — startup modules |
|
| 11 | + | -- ============================================================================ |
|
| 12 | + | vim.pack.add({ |
|
| 13 | + | 'https://github.com/echasnovski/mini.nvim', |
|
| 14 | + | }) |
|
| 15 | + | ||
| 16 | + | local win_config = function() |
|
| 17 | + | local height = math.floor(0.618 * vim.o.lines) |
|
| 18 | + | local width = math.floor(0.618 * vim.o.columns) |
|
| 19 | + | return { |
|
| 20 | + | anchor = 'NW', |
|
| 21 | + | height = height, |
|
| 22 | + | width = width, |
|
| 23 | + | row = math.floor(0.5 * (vim.o.lines - height)), |
|
| 24 | + | col = math.floor(0.5 * (vim.o.columns - width)), |
|
| 25 | + | } |
|
| 26 | + | end |
|
| 27 | + | ||
| 28 | + | require("mini.pick").setup({ |
|
| 29 | + | mappings = { |
|
| 30 | + | choose_marked = '<C-y>', |
|
| 31 | + | move_down = '<C-j>', |
|
| 32 | + | move_up = '<C-k>', |
|
| 33 | + | }, |
|
| 34 | + | window = { config = win_config } |
|
| 35 | + | }) |
|
| 36 | + | ||
| 37 | + | vim.api.nvim_set_hl(0, "MiniPickMatchCurrent", |
|
| 38 | + | { bg = vim.g.terminal_color_8 |
|
| 39 | + | }) |
|
| 40 | + | ||
| 41 | + | require('mini.icons').setup() |
|
| 42 | + | vim.api.nvim_set_hl(0, 'MiniIconsAzure', { fg = vim.g.terminal_color_12 }) |
|
| 43 | + | vim.api.nvim_set_hl(0, 'MiniIconsBlue', { fg = vim.g.terminal_color_4 }) |
|
| 44 | + | vim.api.nvim_set_hl(0, 'MiniIconsCyan', { fg = vim.g.terminal_color_6 }) |
|
| 45 | + | vim.api.nvim_set_hl(0, 'MiniIconsGreen', { fg = vim.g.terminal_color_2 }) |
|
| 46 | + | vim.api.nvim_set_hl(0, 'MiniIconsGrey', { fg = vim.g.terminal_color_8 }) |
|
| 47 | + | vim.api.nvim_set_hl(0, 'MiniIconsOrange', { fg = vim.g.terminal_color_3 }) |
|
| 48 | + | vim.api.nvim_set_hl(0, 'MiniIconsPurple', { fg = vim.g.terminal_color_5 }) |
|
| 49 | + | vim.api.nvim_set_hl(0, 'MiniIconsRed', { fg = vim.g.terminal_color_1 }) |
|
| 50 | + | vim.api.nvim_set_hl(0, 'MiniIconsYellow', { fg = vim.g.terminal_color_11 }) |
|
| 51 | + | ||
| 52 | + | require('mini.diff').setup({ |
|
| 53 | + | view = { |
|
| 54 | + | style = vim.go.number and 'sign' or 'number', |
|
| 55 | + | ||
| 56 | + | signs = { |
|
| 57 | + | add = "+", |
|
| 58 | + | change = "~", |
|
| 59 | + | delete = "-", |
|
| 60 | + | topdelete = "", |
|
| 61 | + | changedelete = "▎", |
|
| 62 | + | untracked = "+" |
|
| 63 | + | }, |
|
| 64 | + | ||
| 65 | + | priority = 199, |
|
| 66 | + | }, |
|
| 67 | + | ||
| 68 | + | delay = { |
|
| 69 | + | text_change = 200, |
|
| 70 | + | }, |
|
| 71 | + | ||
| 72 | + | mappings = { |
|
| 73 | + | apply = 'gh', |
|
| 74 | + | reset = 'gH', |
|
| 75 | + | textobject = 'gh', |
|
| 76 | + | goto_first = '[H', |
|
| 77 | + | goto_prev = '[h', |
|
| 78 | + | goto_next = ']h', |
|
| 79 | + | goto_last = ']H', |
|
| 80 | + | }, |
|
| 81 | + | ||
| 82 | + | options = { |
|
| 83 | + | algorithm = 'histogram', |
|
| 84 | + | indent_heuristic = true, |
|
| 85 | + | linematch = 60, |
|
| 86 | + | wrap_goto = false, |
|
| 87 | + | }, |
|
| 88 | + | }) |
|
| 89 | + | require('mini.statusline').setup() |
|
| 90 | + | require('mini.extra').setup() |
|
| 91 | + | ||
| 92 | + | -- ============================================================================ |
|
| 93 | + | -- Deferred — loads right after startup via vim.schedule() |
|
| 94 | + | -- ============================================================================ |
|
| 95 | + | vim.schedule(function() |
|
| 96 | + | vim.pack.add({ |
|
| 97 | + | "https://github.com/christoomey/vim-tmux-navigator", |
|
| 98 | + | }) |
|
| 99 | + | ||
| 100 | + | require("mini.comment").setup({ |
|
| 101 | + | mappings = { |
|
| 102 | + | comment = 'gb', |
|
| 103 | + | comment_visual = 'gb', |
|
| 104 | + | textobject = 'gb' |
|
| 105 | + | } |
|
| 106 | + | }) |
|
| 107 | + | ||
| 108 | + | require('mini.surround').setup({ |
|
| 109 | + | mappings = { |
|
| 110 | + | replace = 'cs', -- Replace surrounding |
|
| 111 | + | }, |
|
| 112 | + | }) |
|
| 113 | + | ||
| 114 | + | require('mini.files').setup({ |
|
| 115 | + | mappings = { |
|
| 116 | + | close = '<ESC>', |
|
| 117 | + | go_in_plus = '<CR>' |
|
| 118 | + | } |
|
| 119 | + | }) |
|
| 120 | + | end) |
|
| 121 | + | ||
| 122 | + | -- ============================================================================ |
|
| 123 | + | -- Lazy — loads on InsertEnter |
|
| 124 | + | -- ============================================================================ |
|
| 125 | + | vim.api.nvim_create_autocmd('InsertEnter', { once = true, callback = function() |
|
| 126 | + | require("mini.completion").setup({ |
|
| 127 | + | mappings = { |
|
| 128 | + | scroll_down = '<C-j>', |
|
| 129 | + | scroll_up = '<C-k>', |
|
| 130 | + | }, |
|
| 131 | + | }) |
|
| 132 | + | ||
| 133 | + | local gen_loader = require('mini.snippets').gen_loader |
|
| 134 | + | require('mini.snippets').setup({ |
|
| 135 | + | snippets = { |
|
| 136 | + | gen_loader.from_lang(), |
|
| 137 | + | }, |
|
| 138 | + | }) |
|
| 139 | + | MiniSnippets.start_lsp_server() |
|
| 140 | + | end }) |
| 3 | 3 | for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. "/tree-sitter-*/*/", true, true)) do |
|
| 4 | 4 | vim.opt.runtimepath:prepend(parser_dir) |
|
| 5 | 5 | end |
|
| 6 | - | ||
| 7 | - | vim.o.foldenable = true |
|
| 8 | - | vim.o.foldlevel = 99 |
|
| 9 | - | vim.o.foldmethod = "expr" |
|
| 10 | - | vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" |
| 1 | - | return { |
|
| 2 | - | "stevedylandev/darkmatter-nvim", |
|
| 3 | - | lazy = false, |
|
| 4 | - | priority = 1000, |
|
| 5 | - | config = function() |
|
| 6 | - | vim.cmd.colorscheme "darkmatter" |
|
| 7 | - | end, |
|
| 8 | - | } |
|
| 9 | - | ||
| 10 | - | -- return { |
|
| 11 | - | -- 'olivercederborg/poimandres.nvim', |
|
| 12 | - | -- lazy = false, |
|
| 13 | - | -- priority = 1000, |
|
| 14 | - | -- config = function() |
|
| 15 | - | -- require('poimandres').setup { |
|
| 16 | - | -- -- leave this setup function empty for default config |
|
| 17 | - | -- -- or refer to the configuration section |
|
| 18 | - | -- -- for configuration options |
|
| 19 | - | -- } |
|
| 20 | - | -- end, |
|
| 21 | - | -- |
|
| 22 | - | -- -- optionally set the colorscheme within lazy config |
|
| 23 | - | -- init = function() |
|
| 24 | - | -- vim.cmd("colorscheme poimandres") |
|
| 25 | - | -- end |
|
| 26 | - | -- } |
| 1 | - | return { |
|
| 2 | - | 'echasnovski/mini.nvim', |
|
| 3 | - | version = '*', |
|
| 4 | - | dependencies = { 'rafamadriz/friendly-snippets' }, |
|
| 5 | - | config = function() |
|
| 6 | - | local win_config = function() |
|
| 7 | - | local height = math.floor(0.618 * vim.o.lines) |
|
| 8 | - | local width = math.floor(0.618 * vim.o.columns) |
|
| 9 | - | return { |
|
| 10 | - | anchor = 'NW', |
|
| 11 | - | height = height, |
|
| 12 | - | width = width, |
|
| 13 | - | row = math.floor(0.5 * (vim.o.lines - height)), |
|
| 14 | - | col = math.floor(0.5 * (vim.o.columns - width)), |
|
| 15 | - | } |
|
| 16 | - | end |
|
| 17 | - | require("mini.pick").setup({ |
|
| 18 | - | mappings = { |
|
| 19 | - | choose_marked = '<C-y>', |
|
| 20 | - | move_down = '<C-j>', |
|
| 21 | - | move_up = '<C-k>', |
|
| 22 | - | }, |
|
| 23 | - | window = { config = win_config } |
|
| 24 | - | }) |
|
| 25 | - | ||
| 26 | - | vim.api.nvim_set_hl(0, "MiniPickMatchCurrent", |
|
| 27 | - | { bg = vim.g.terminal_color_8 |
|
| 28 | - | }) |
|
| 29 | - | ||
| 30 | - | require("mini.comment").setup({ |
|
| 31 | - | mappings = { |
|
| 32 | - | comment = 'gb', |
|
| 33 | - | comment_visual = 'gb', |
|
| 34 | - | textobject = 'gb' |
|
| 35 | - | } |
|
| 36 | - | }) |
|
| 37 | - | ||
| 38 | - | require("mini.completion").setup({ |
|
| 39 | - | mappings = { |
|
| 40 | - | scroll_down = '<C-j>', |
|
| 41 | - | scroll_up = '<C-k>', |
|
| 42 | - | }, |
|
| 43 | - | }) |
|
| 44 | - | ||
| 45 | - | local gen_loader = require('mini.snippets').gen_loader |
|
| 46 | - | require('mini.snippets').setup({ |
|
| 47 | - | snippets = { |
|
| 48 | - | gen_loader.from_lang(), |
|
| 49 | - | }, |
|
| 50 | - | }) |
|
| 51 | - | MiniSnippets.start_lsp_server() |
|
| 52 | - | ||
| 53 | - | require('mini.files').setup({ |
|
| 54 | - | mappings = { |
|
| 55 | - | close = '<ESC>', |
|
| 56 | - | go_in_plus = '<CR>' |
|
| 57 | - | } |
|
| 58 | - | }) |
|
| 59 | - | ||
| 60 | - | require('mini.icons').setup() |
|
| 61 | - | vim.api.nvim_set_hl(0, 'MiniIconsAzure', { fg = vim.g.terminal_color_12 }) |
|
| 62 | - | vim.api.nvim_set_hl(0, 'MiniIconsBlue', { fg = vim.g.terminal_color_4 }) |
|
| 63 | - | vim.api.nvim_set_hl(0, 'MiniIconsCyan', { fg = vim.g.terminal_color_6 }) |
|
| 64 | - | vim.api.nvim_set_hl(0, 'MiniIconsGreen', { fg = vim.g.terminal_color_2 }) |
|
| 65 | - | vim.api.nvim_set_hl(0, 'MiniIconsGrey', { fg = vim.g.terminal_color_8 }) |
|
| 66 | - | vim.api.nvim_set_hl(0, 'MiniIconsOrange', { fg = vim.g.terminal_color_3 }) |
|
| 67 | - | vim.api.nvim_set_hl(0, 'MiniIconsPurple', { fg = vim.g.terminal_color_5 }) |
|
| 68 | - | vim.api.nvim_set_hl(0, 'MiniIconsRed', { fg = vim.g.terminal_color_1 }) |
|
| 69 | - | vim.api.nvim_set_hl(0, 'MiniIconsYellow', { fg = vim.g.terminal_color_11 }) |
|
| 70 | - | ||
| 71 | - | require('mini.surround').setup({ |
|
| 72 | - | mappings = { |
|
| 73 | - | replace = 'cs', -- Replace surrounding |
|
| 74 | - | }, |
|
| 75 | - | }) |
|
| 76 | - | require('mini.diff').setup({ |
|
| 77 | - | view = { |
|
| 78 | - | -- Visualization style. Possible values are 'sign' and 'number'. |
|
| 79 | - | -- Default: 'number' if line numbers are enabled, 'sign' otherwise. |
|
| 80 | - | -- Suppress vim.tbl_islist deprecation warning |
|
| 81 | - | style = vim.go.number and 'sign' or 'number', |
|
| 82 | - | ||
| 83 | - | -- Signs used for hunks with 'sign' view |
|
| 84 | - | signs = { |
|
| 85 | - | add = "+", |
|
| 86 | - | change = "~", |
|
| 87 | - | delete = "-", |
|
| 88 | - | topdelete = "", |
|
| 89 | - | changedelete = "▎", |
|
| 90 | - | untracked = "+" |
|
| 91 | - | }, |
|
| 92 | - | ||
| 93 | - | priority = 199, |
|
| 94 | - | }, |
|
| 95 | - | ||
| 96 | - | delay = { |
|
| 97 | - | text_change = 200, |
|
| 98 | - | }, |
|
| 99 | - | ||
| 100 | - | mappings = { |
|
| 101 | - | -- Apply hunks inside a visual/operator region |
|
| 102 | - | apply = 'gh', |
|
| 103 | - | ||
| 104 | - | -- Reset hunks inside a visual/operator region |
|
| 105 | - | reset = 'gH', |
|
| 106 | - | ||
| 107 | - | -- Hunk range textobject to be used inside operator |
|
| 108 | - | -- Works also in Visual mode if mapping differs from apply and reset |
|
| 109 | - | textobject = 'gh', |
|
| 110 | - | ||
| 111 | - | -- Go to hunk range in corresponding direction |
|
| 112 | - | goto_first = '[H', |
|
| 113 | - | goto_prev = '[h', |
|
| 114 | - | goto_next = ']h', |
|
| 115 | - | goto_last = ']H', |
|
| 116 | - | }, |
|
| 117 | - | ||
| 118 | - | options = { |
|
| 119 | - | algorithm = 'histogram', |
|
| 120 | - | indent_heuristic = true, |
|
| 121 | - | linematch = 60, |
|
| 122 | - | wrap_goto = false, |
|
| 123 | - | }, |
|
| 124 | - | }) |
|
| 125 | - | require('mini.statusline').setup() |
|
| 126 | - | require('mini.extra').setup() |
|
| 127 | - | end |
|
| 128 | - | } |
| 1 | - | local opts = { noremap = true, silent = true } |
|
| 2 | - | ||
| 3 | - | return { |
|
| 4 | - | "christoomey/vim-tmux-navigator", |
|
| 5 | - | config = function() |
|
| 6 | - | vim.keymap.set("n", "<C-h>", "<cmd>TmuxNavigateLeft<CR>", opts) |
|
| 7 | - | vim.keymap.set("n", "<C-j>", "<cmd>TmuxNavigateDown<CR>", opts) |
|
| 8 | - | vim.keymap.set("n", "<C-k>", "<cmd>TmuxNavigateUp<CR>", opts) |
|
| 9 | - | vim.keymap.set("n", "<C-l>", "<cmd>TmuxNavigateRight<CR>", opts) |
|
| 10 | - | end, |
|
| 11 | - | } |