nvim plugins

98 阅读2分钟

-- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :)

-- See the kickstart.nvim README for more information

return { -- ui components { 'MunifTanjim/nui.nvim', lazy = true }, -- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu. { 'folke/noice.nvim', event = 'VeryLazy', opts = { lsp = { override = { ['vim.lsp.util.convert_input_to_markdown_lines'] = true, ['vim.lsp.util.stylize_markdown'] = true, ['cmp.entry.get_documentation'] = true, }, }, routes = { { filter = { event = 'msg_show', any = { { find = '%d+L, %d+B' }, { find = '; after #%d+' }, { find = '; before #%d+' }, }, }, view = 'mini', }, }, presets = { bottom_search = true, command_palette = true, long_message_to_split = true, inc_rename = true, }, }, -- stylua: ignore keys = { { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, }, }, { 'hrsh7th/cmp-cmdline', config = function() local cmp = require 'cmp' cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' }, }, { { name = 'cmdline' }, }), matching = { disallow_symbol_nonprefix_matching = false }, }) end, }, { 'folke/zen-mode.nvim', cmd = 'ZenMode', opts = { plugins = { gitsigns = true, tmux = false, kitty = { enabled = false, font = '+2' }, }, }, keys = { { 'z', 'ZenMode', desc = 'Zen Mode' } }, }, { 'kdheepak/lazygit.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, }, { 'theniceboy/joshuto.nvim', }, { 'windwp/nvim-autopairs', event = 'InsertEnter', opts = {}, }, { 'nvim-ts-autotag', opts = {}, }, { 'pmizio/typescript-tools.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, config = function() local api = require 'typescript-tools.api' require('typescript-tools').setup { handlers = { ['textDocument/publishDiagnostics'] = api.filter_diagnostics { 7044 }, }, settings = { -- spawn additional tsserver instance to calculate diagnostics on it separate_diagnostic_server = true, -- "change"|"insert_leave" determine when the client asks the server about diagnostic publish_diagnostic_on = 'insert_leave', -- array of strings("fix_all"|"add_missing_imports"|"remove_unused"| -- "remove_unused_imports"|"organize_imports") -- or string "all" -- to include all supported code actions -- specify commands exposed as code_actions expose_as_code_action = {}, -- string|nil - specify a custom path to tsserver.js file, if this is nil or file under path -- not exists then standard path resolution strategy is applied tsserver_path = nil, -- specify a list of plugins to load by tsserver, e.g., for support styled-components -- (see 💅 styled-components support section) tsserver_plugins = { -- for TypeScript v4.9+ '@styled/typescript-styled-plugin', -- or for older TypeScript versions -- "typescript-styled-plugin", }, -- this value is passed to: nodejs.org/api/cli.htm… -- memory limit in megabytes or "auto"(basically no limit) tsserver_max_memory = 'auto', -- described below tsserver_format_options = {}, tsserver_file_preferences = {}, -- locale of all tsserver messages, supported locales you can find here: -- github.com/microsoft/T… tsserver_locale = 'en', -- mirror of VSCode's typescript.suggest.completeFunctionCalls complete_function_calls = false, include_completions_with_insert_text = true, -- CodeLens -- WARNING: Experimental feature also in VSCode, because it might hit performance of server. -- possible values: ("off"|"all"|"implementations_only"|"references_only") code_lens = 'off', -- by default code lenses are displayed on all referencable values and for some of you it can -- be too much this option reduce count of them by removing member references from lenses disable_member_code_lens = true, -- JSXCloseTag -- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag, -- that maybe have a conflict if enable this feature. ) jsx_close_tag = { enable = false, filetypes = { 'javascriptreact', 'typescriptreact' }, }, }, } end, }, }