From 33cf2f8d34296ce15ab8da4930445f61e961a314 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 10 Feb 2023 19:02:46 +0100 Subject: [PATCH 01/14] init --- init.lua | 18 ++++++ lazy-lock.json | 33 ++++++++++ lua/plugins/autopairs.lua | 8 +++ lua/plugins/colorschema.lua | 15 +++++ lua/plugins/comment.lua | 8 +++ lua/plugins/git.lua | 37 +++++++++++ lua/plugins/lsp.lua | 68 ++++++++++++++++++++ lua/plugins/lualine.lua | 64 +++++++++++++++++++ lua/plugins/mini.lua | 35 +++++++++++ lua/plugins/neo-tree.lua | 46 ++++++++++++++ lua/plugins/nvim-cmp.lua | 120 ++++++++++++++++++++++++++++++++++++ lua/plugins/telescope.lua | 72 ++++++++++++++++++++++ lua/plugins/treesitter.lua | 18 ++++++ lua/plugins/which-key.lua | 36 +++++++++++ lua/util.lua | 42 +++++++++++++ plugin/keymap.lua | 31 ++++++++++ plugin/option.lua | 42 +++++++++++++ 17 files changed, 693 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/plugins/autopairs.lua create mode 100644 lua/plugins/colorschema.lua create mode 100644 lua/plugins/comment.lua create mode 100644 lua/plugins/git.lua create mode 100644 lua/plugins/lsp.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/mini.lua create mode 100644 lua/plugins/neo-tree.lua create mode 100644 lua/plugins/nvim-cmp.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/which-key.lua create mode 100644 lua/util.lua create mode 100644 plugin/keymap.lua create mode 100644 plugin/option.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..b6c5fd0 --- /dev/null +++ b/init.lua @@ -0,0 +1,18 @@ + +vim.g.mapleader=" " + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("plugins",{}) + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..4894758 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,33 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "eab2c83a0207369900e92783f56990808082eac2" }, + "LuaSnip": { "branch": "master", "commit": "9bff06b570df29434a88f9c6a9cea3b21ca17208" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "cmp-git": { "branch": "main", "commit": "414e6aefbc0f416ad1c83e5417455a861159e3b8" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-treesitter": { "branch": "master", "commit": "b40178b780d547bcf131c684bc5fd41af17d05f2" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, + "friendly-snippets": { "branch": "main", "commit": "80597f3ea824946c87fd29f82b5ed4f24ef473f3" }, + "gitsigns.nvim": { "branch": "main", "commit": "f29f0b22fd66c910b892aae3bc18a4872c002738" }, + "gruvbox.nvim": { "branch": "main", "commit": "b9d23a64dc8f22b4af8fa708d9fcbffbbf5747c6" }, + "lazy.nvim": { "branch": "main", "commit": "bab744565e9d8d743b1889c66707aa2e8018ae86" }, + "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, + "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7a97a77eee486ae152d2c559a459eda7c8aa12aa" }, + "mason.nvim": { "branch": "main", "commit": "14ae1ca58440b158a0a35cf90773013caddf788a" }, + "mini.ai": { "branch": "main", "commit": "2188cb1be3e9133fb1fe52374705b94630492401" }, + "mini.pairs": { "branch": "main", "commit": "50f07af5e47a67e74ec1a9b25bfb2eec93783d44" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "8238865e1d9c61f1a260c290653f2c419503e0a9" }, + "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, + "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, + "nvim-lspconfig": { "branch": "master", "commit": "b5bb6e3d7c775c241726d1ef564902263e93e2cd" }, + "nvim-treesitter": { "branch": "master", "commit": "f6df07be122de665fb363476cc3680c90f5bdf05" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "13edf91f47c91b390bb00e1df2f7cc1ca250af3a" }, + "nvim-web-devicons": { "branch": "master", "commit": "ade34ca7d19543904b28b903e606be8930fb9ee3" }, + "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, + "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, + "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } +} \ No newline at end of file diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua new file mode 100644 index 0000000..383a144 --- /dev/null +++ b/lua/plugins/autopairs.lua @@ -0,0 +1,8 @@ +return { + -- { + -- "windwp/nvim-autopairs", + -- init = function() require("nvim-autopairs").setup { + -- check_ts=true, + -- } end + -- } +} diff --git a/lua/plugins/colorschema.lua b/lua/plugins/colorschema.lua new file mode 100644 index 0000000..ee10c8a --- /dev/null +++ b/lua/plugins/colorschema.lua @@ -0,0 +1,15 @@ +return { + -- { + -- "RRethy/nvim-base16", + -- config=function() + -- vim.cmd([[colorscheme base16-gruvbox-dark-medium]]) + -- end + -- } + { + "ellisonleao/gruvbox.nvim", + config=function() + vim.o.background="dark" + vim.cmd([[colorscheme gruvbox]]) + end + } +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..bf5033d --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,8 @@ +return { + { + 'numToStr/Comment.nvim', + event="VeryLazy", + config=true + }, + +} diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua new file mode 100644 index 0000000..559dae2 --- /dev/null +++ b/lua/plugins/git.lua @@ -0,0 +1,37 @@ +return { + { + "lewis6991/gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "契" }, + topdelete = { text = "契" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end + + -- stylua: ignore start + map("n", "]h", gs.next_hunk, "Next Hunk") + map("n", "[h", gs.prev_hunk, "Prev Hunk") + map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") + map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") + map("n", "ghS", gs.stage_buffer, "Stage Buffer") + map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") + map("n", "ghR", gs.reset_buffer, "Reset Buffer") + map("n", "ghp", gs.preview_hunk, "Preview Hunk") + map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") + map("n", "ghd", gs.diffthis, "Diff This") + map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") + map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") + end, + }, + } +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..a3b2f3f --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,68 @@ +return { + { + "neovim/nvim-lspconfig", + event={ "BufReadPre", "BufNewFile" }, + config=function () + local lspconfig = require('lspconfig') + local lsp_defaults = lspconfig.util.default_config + + lsp_defaults.capabilities = vim.tbl_deep_extend( + 'force', + lsp_defaults.capabilities, + require('cmp_nvim_lsp').default_capabilities() + ) + + + function desc(bufopts, desc) + local options = {desc= desc} + vim.tbl_extend("force",bufopts, options) + return options + end + + lsp_defaults.on_attach = function (client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + print(vim.inspect(client.server_capabilities)) + + local bufopts = { noremap=true, silent=true, buffer=bufnr } + + vim.keymap.set( 'n', 'gD', function() require("telescope.builtin").lsp_references() end,desc(bufopts,'goto declaration')) + vim.keymap.set( 'n', 'gd', function() vim.lsp.buf.definition() end,desc(bufopts,"goto definition")) + vim.keymap.set( 'n', 'K', function() vim.lsp.buf.hover() end,desc(bufopts,"display info")) + vim.keymap.set( 'n', 'gi', function() vim.lsp.buf.implementation() end,desc(bufopts,"goto implementation")) + vim.keymap.set( 'n', '', function() vim.lsp.buf.signature_help() end,desc(bufopts,"show signature")) + vim.keymap.set( 'n', 'wa', function() vim.lsp.buf.add_workspace_folder() end,desc(bufopts,"add folder to workspace")) + vim.keymap.set( 'n', 'wr', function() vim.lsp.buf.remove_workspace_folder() end,desc(bufopts,"remove folder from workspace")) + vim.keymap.set( 'n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,desc(bufopts,"list all folder of workspace")) + vim.keymap.set( 'n', 'D', function() vim.lsp.buf.type_definition() end,desc(bufopts,"goto type definition")) + vim.keymap.set( {'n','v'}, 'cr', function() vim.lsp.buf.rename() end,desc(bufopts,"rename symbole")) + vim.keymap.set( 'n', 'gr', function() require("telescope.builtin").references() end,desc(bufopts,"goto references")) + vim.keymap.set( 'n', 'ca', function() vim.lsp.buf.code_action() end,desc(bufopts,"code action")) + -- vim.keymap.set( 'n', 'so', function () require('telescope.builtin').lsp_document_symbols() end,desc(bufopts,"document symbole")) + vim.keymap.set( 'n', 'cd', function() vim.diagnostic.open_float(nil, {focus=false}) end,desc(bufopts,"code diagnostic")) + -- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] + end + end + }, + { + "williamboman/mason.nvim", + dependencies={"williamboman/mason-lspconfig.nvim"}, + event={ "BufReadPre", "BufNewFile" }, + config=function () + require("mason").setup() + require("mason-lspconfig").setup({ + automatic_installation = false, + }) + + require("mason-lspconfig").setup_handlers { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function (server_name) -- default handler (optional) + require("lspconfig")[server_name].setup {} + end, + } + end + } +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..7d9cf1a --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,64 @@ +return { + { "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(plugin) + return { + options = { + theme = "auto", + globalstatus = true, + disabled_filetypes = { statusline = { "lazy" } }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { + { + "diagnostics", + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + }, + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + { "filename", path = 1, symbols = { modified = "  ", readonly = "", unnamed = "" } }, + }, + lualine_x = { + { + function() + local msg = 'No Active Lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' LSP:', + -- color = { fg = '#ffffff', gui = 'bold' }, + }, + -- stylua: ignore + { + "diff", + symbols = { added = ' ', modified = '柳 ', removed = ' ' }, + }, + }, + lualine_y = { + { "progress", separator = "", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + lualine_z = { + function() + return " " .. os.date("%R") + end, + }, + }, + extensions = { "neo-tree" }, + } + end, + }, + {"j-hui/fidget.nvim",event="VeryLazy",config=true} +} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua new file mode 100644 index 0000000..56ff5e5 --- /dev/null +++ b/lua/plugins/mini.lua @@ -0,0 +1,35 @@ +return { + { + { + "echasnovski/mini.ai", + event = "VeryLazy", + dependencies = { + { + "nvim-treesitter/nvim-treesitter-textobjects", + init = function() + -- no need to load the plugin, since we only need its queries + require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects") + end, + }, + }, + opts = function() + local ai = require("mini.ai") + return { + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ + a = { "@block.outer", "@conditional.outer", "@loop.outer" }, + i = { "@block.inner", "@conditional.inner", "@loop.inner" }, + }, {}), + f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}), + c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}), + }, + } + end, + config = function(_, opts) + local ai = require("mini.ai") + ai.setup(opts) + end, + }, + }, +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..f07f02f --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -0,0 +1,46 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v2.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config=function () + vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + require("neo-tree").setup({ + window = { + mappings={ + ["a"] = { + "add", + config = { + show_path = "relative" -- "none", "relative", "absolute" + } + }, + } + }, + source_selector = { + winbar = false, + statusline = false + }, + event_handlers = { + + { + event = "file_opened", + handler = function(file_path) + --auto close + require("neo-tree").close_all() + end + }, + + } + + }) + end, + keys={ + {'e', 'Neotree', desc = 'Explorer NeoTree' }, + } + + } +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..78b2ed3 --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,120 @@ +return { + { + "hrsh7th/nvim-cmp", + event = "VeryLazy", + dependencies={ + 'hrsh7th/nvim-cmp', -- Autocompletion plugin + 'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp + 'saadparwaiz1/cmp_luasnip', -- Snippets source for nvim-cmp + 'hrsh7th/cmp-buffer', -- completion pour le buffer + 'hrsh7th/cmp-path', -- path completion + 'petertriho/cmp-git', -- git completion + 'hrsh7th/cmp-cmdline', -- commende line completion + 'hrsh7th/cmp-nvim-lua', -- neovim api completion + 'ray-x/cmp-treesitter', -- treesiter completion + "onsails/lspkind.nvim", -- symbole + }, + opts=function () + local cmp=require("cmp") + local lspkind = require("lspkind") + return { + completion = { + completeopt = "menu,menuone,noinsert", + }, + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + {name = 'treesitter'}, + { name = 'path'}, + {name= 'nvim_lua'}, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + }), + experimental = { + ghost_text = { + hl_group = "LspCodeLens", + }, + }, + formatting = { + format = lspkind.cmp_format(), + }, + } + end, + config=function (_,opts) + local cmp = require("cmp") + cmp.setup(opts) + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + -- cmp.setup.cmdline(':', { + -- mapping = cmp.mapping.preset.cmdline(), + -- sources = cmp.config.sources({ + -- { name = 'path' } + -- }, { + -- { name = 'cmdline' } + -- }) + -- }) + + end + }, + + { + "L3MON4D3/LuaSnip", + dependencies = { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + -- stylua: ignore + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, silent = true, mode = "i", + }, + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + }, + }, + { + "echasnovski/mini.pairs", + event = "VeryLazy", + config = function(_, opts) + require("mini.pairs").setup(opts) + end, + } +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..14bc105 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,72 @@ +Util = require("util") + +return { + { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + depedencies={'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + keys = { + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + { "/", Util.telescope("live_grep"), desc = "Find in Files (Grep)" }, + { ":", "Telescope command_history", desc = "Command History" }, + { "", Util.telescope("files"), desc = "Find Files (root dir)" }, + -- find + { "fb", "Telescope buffers", desc = "Buffers" }, + { "ff", Util.telescope("files"), desc = "Find Files (root dir)" }, + { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + -- git + { "gc", "Telescope git_commits", desc = "commits" }, + { "gs", "Telescope git_status", desc = "status" }, + -- search + { "sa", "Telescope autocommands", desc = "Auto Commands" }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { "sc", "Telescope command_history", desc = "Command History" }, + { "sC", "Telescope commands", desc = "Commands" }, + { "sd", "Telescope diagnostics", desc = "Diagnostics" }, + { "sg", Util.telescope("live_grep"), desc = "Grep (root dir)" }, + { "sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sh", "Telescope help_tags", desc = "Help Pages" }, + { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, + { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sM", "Telescope man_pages", desc = "Man Pages" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope vim_options", desc = "Options" }, + { "sw", Util.telescope("grep_string"), desc = "Word (root dir)" }, + { "sW", Util.telescope("grep_string", { cwd = false }), desc = "Word (cwd)" }, + { "uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, + { + "ss", + Util.telescope("lsp_document_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + }, + }), + desc = "Goto Symbol", + }, + opts={ + extentions={ + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + } + }, + config=function (_,opts) + local telescope=require("telescope") + telescope.setup(opts) + telescope.load_extension('fzf') + end + }, + } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..09c1d2e --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,18 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + event={ "BufReadPost", "BufNewFile" }, + build=":TSUpdate", + opts={ + auto_install = true, + highlight={ + enable=true + }, + indent = { enable = true}, + context_commentstring = { enable = true, enable_autocmd = false }, + }, + config=function (_,opts) + require('nvim-treesitter.configs').setup(opts) + end + } +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..fb2b82b --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,36 @@ +return { + { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + plugins = { spelling = true }, + }, + config = function(_,opts) + vim.o.timeout = true + vim.o.timeoutlen = 300 + require("which-key").setup(opts) + require("which-key").register({ + f={name="file/find"}, + g={name="git"}, + c={mode={"n","v"},name="code"}, + w={name="workspace"}, + s = { name = "search" }, + u={name="ui"} + }, {prefix=""}) + require("which-key").register({ + i={ + f={"inner function"}, + c={"inner class"}, + o={"inner other (block, conditon, loop)"} + }, + a={ + f={"around function"}, + c={"around class"}, + o={"around other (block, conditon, loop)"} + } + },{ + mode={"x","o"} + }) + end, + }, +} diff --git a/lua/util.lua b/lua/util.lua new file mode 100644 index 0000000..1c55274 --- /dev/null +++ b/lua/util.lua @@ -0,0 +1,42 @@ +local M = {} + +M.root_patterns = { ".git" } + +-- returns the root directory based on: +-- * root pattern of filename of the current buffer +-- * root pattern of cwd +---@return string +function M.get_root() + ---@type string? + local path = vim.api.nvim_buf_get_name(0) + path = path ~= "" and vim.loop.fs_realpath(path) or nil + path = path and vim.fs.dirname(path) or vim.loop.cwd() + ---@type string? + root = vim.fs.find(M.root_patterns, { path = path, upward = true })[1] + root = root and vim.fs.dirname(root) or vim.loop.cwd() + ---@cast root string + return root +end + +-- this will return a function that calls telescope. +-- cwd will defautlt to lazyvim.util.get_root +-- for `files`, git_files or find_files will be chosen depending on .git +function M.telescope(builtin, opts) + local params = { builtin = builtin, opts = opts } + return function() + builtin = params.builtin + opts = params.opts + opts = vim.tbl_deep_extend("force", { cwd = M.get_root() }, opts or {}) + if builtin == "files" then + if vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") then + opts.show_untracked = true + builtin = "git_files" + else + builtin = "find_files" + end + end + require("telescope.builtin")[builtin](opts) + end +end + +return M diff --git a/plugin/keymap.lua b/plugin/keymap.lua new file mode 100644 index 0000000..cc0daf1 --- /dev/null +++ b/plugin/keymap.lua @@ -0,0 +1,31 @@ +local function map(mode, lhs, rhs, opts) + local keys = require("lazy.core.handler").handlers.keys + ---@cast keys LazyKeysHandler + -- do not create the keymap if a lazy keys handler exists + if not keys.active[keys.parse({ lhs, mode = mode }).id] then + opts = opts or {} + opts.silent = opts.silent ~= false + vim.keymap.set(mode, lhs, rhs, opts) + end +end + +map({ "i", "n" }, "", "noh", { desc = "Escape and clear hlsearch" }) + +-- better indenting +map("v", "<", "", ">gv") + +-- lazy +map("n", "l", ":Lazy", { desc = "Lazy" }) + +-- better up/down +map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + +-- Move Lines +map("n", "", "m .+1==", { desc = "Move down" }) +map("n", "", "m .-2==", { desc = "Move up" }) +map("i", "", "m .+1==gi", { desc = "Move down" }) +map("i", "", "m .-2==gi", { desc = "Move up" }) +map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) +map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) diff --git a/plugin/option.lua b/plugin/option.lua new file mode 100644 index 0000000..dde5713 --- /dev/null +++ b/plugin/option.lua @@ -0,0 +1,42 @@ + +local opt = vim.opt + +opt.showcmd = true +opt.cmdheight = 1 -- Height of the command bar +opt.incsearch = true -- Makes search act like search in modern browsers +opt.showmatch = true -- show matching brackets when text indicator is over them +opt.relativenumber = true -- Show line numbers +opt.number = true -- But show the actual number for the line we're on +opt.ignorecase = true -- Ignore case when searching... +opt.smartcase = true -- ... unless there is a capital letter in the query +opt.hidden = true -- I like having buffers stay around +opt.cursorline = true -- Highlight the current line +opt.equalalways = false -- I don't like my windows changing all the time +opt.splitright = true -- Prefer windows splitting to the right +opt.splitbelow = true -- Prefer windows splitting to the bottom +opt.updatetime = 1000 -- Make updates happen faster +opt.hlsearch = true -- I wouldn't use this without my DoNoHL function +opt.scrolloff = 10 -- Make it so there are always ten lines below my cursor +opt.wrap = true + +-- Tabs +opt.autoindent = true +opt.cindent = true +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.softtabstop = 4 +opt.expandtab = true + +opt.belloff = "all" -- Just turn the dang bell off + +-- opt.clipboard = "unnamedplus" + +opt.inccommand = "split" +opt.swapfile = false -- Living on the edge +opt.shada = { "!", "'1000", "<50", "s10", "h" } + +opt.mouse = "a" + +opt.undofile=true + + From 68697541ece4d3fc9d31c9ce84eecf31d8c992e4 Mon Sep 17 00:00:00 2001 From: feyleth Date: Wed, 15 Feb 2023 14:44:41 +0100 Subject: [PATCH 02/14] add lsp signature and treesiter context --- lazy-lock.json | 38 ++++++++++++++++++++------------------ lua/plugins/lsp.lua | 7 +++++++ lua/plugins/treesitter.lua | 1 + 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 4894758..cbe1a8b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,32 +1,34 @@ { - "Comment.nvim": { "branch": "master", "commit": "eab2c83a0207369900e92783f56990808082eac2" }, - "LuaSnip": { "branch": "master", "commit": "9bff06b570df29434a88f9c6a9cea3b21ca17208" }, + "Comment.nvim": { "branch": "master", "commit": "418d3117dab2f54c4340ea73e0070dd78fc81753" }, + "LuaSnip": { "branch": "master", "commit": "58fbfc627a93281a77f7d161d4ff702e639677b1" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, - "cmp-git": { "branch": "main", "commit": "414e6aefbc0f416ad1c83e5417455a861159e3b8" }, + "cmp-git": { "branch": "main", "commit": "191ec4788656c3d1ad59c9edc3d96e132f93e039" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "b40178b780d547bcf131c684bc5fd41af17d05f2" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, - "friendly-snippets": { "branch": "main", "commit": "80597f3ea824946c87fd29f82b5ed4f24ef473f3" }, - "gitsigns.nvim": { "branch": "main", "commit": "f29f0b22fd66c910b892aae3bc18a4872c002738" }, - "gruvbox.nvim": { "branch": "main", "commit": "b9d23a64dc8f22b4af8fa708d9fcbffbbf5747c6" }, - "lazy.nvim": { "branch": "main", "commit": "bab744565e9d8d743b1889c66707aa2e8018ae86" }, + "friendly-snippets": { "branch": "main", "commit": "1645e7cd98ed99e766c84ab3cf13a1612c77dcee" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f1451ea7d9a9005b3f0bedeab20cef7a4c65993" }, + "gruvbox.nvim": { "branch": "main", "commit": "73f009df5ed929a853244c413bb52c1d02c117ce" }, + "lazy.nvim": { "branch": "main", "commit": "c249ea376bcd3e5d121b79eac595837b7d0c73a4" }, + "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "7a97a77eee486ae152d2c559a459eda7c8aa12aa" }, - "mason.nvim": { "branch": "main", "commit": "14ae1ca58440b158a0a35cf90773013caddf788a" }, - "mini.ai": { "branch": "main", "commit": "2188cb1be3e9133fb1fe52374705b94630492401" }, - "mini.pairs": { "branch": "main", "commit": "50f07af5e47a67e74ec1a9b25bfb2eec93783d44" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "8238865e1d9c61f1a260c290653f2c419503e0a9" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, + "mason.nvim": { "branch": "main", "commit": "63ccfe5dd1a9afd16d9d3cdcf0aa59403eef5ef7" }, + "mini.ai": { "branch": "main", "commit": "d50b4d87e38d21ca2c5facee9f8a205ddb768358" }, + "mini.pairs": { "branch": "main", "commit": "4ebc1ff8d77fe75e8f219432302800ca29e17614" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "245cf1e68840defcc75a16297740f6203f5a045d" }, "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, - "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, - "nvim-lspconfig": { "branch": "master", "commit": "b5bb6e3d7c775c241726d1ef564902263e93e2cd" }, - "nvim-treesitter": { "branch": "master", "commit": "f6df07be122de665fb363476cc3680c90f5bdf05" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "13edf91f47c91b390bb00e1df2f7cc1ca250af3a" }, - "nvim-web-devicons": { "branch": "master", "commit": "ade34ca7d19543904b28b903e606be8930fb9ee3" }, + "nvim-cmp": { "branch": "main", "commit": "c4128bcd131fb7152bda8f8dd2b5e41d2fefa88c" }, + "nvim-lspconfig": { "branch": "master", "commit": "e20d77deac40e6e65d036acd60aff474c0f09282" }, + "nvim-treesitter": { "branch": "master", "commit": "b44871afb59e456bbff4113e416405c06c991cf5" }, + "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "15d9c62cb04079cf440ceb6882f2cbfaed66eda1" }, + "nvim-web-devicons": { "branch": "master", "commit": "bb6d4fd1e010300510172b173ab5205d37af084f" }, "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a3b2f3f..bad4175 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -2,6 +2,13 @@ return { { "neovim/nvim-lspconfig", event={ "BufReadPre", "BufNewFile" }, + dependencies={"ray-x/lsp_signature.nvim",opts={ + bind = true, -- This is mandatory, otherwise border config won't get registered. + hint_prefix = "", + handler_opts = { + border = "rounded" + } + },lazy=true}, config=function () local lspconfig = require('lspconfig') local lsp_defaults = lspconfig.util.default_config diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 09c1d2e..1d906bc 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -3,6 +3,7 @@ return { "nvim-treesitter/nvim-treesitter", event={ "BufReadPost", "BufNewFile" }, build=":TSUpdate", + dependencies={"nvim-treesitter/nvim-treesitter-context",config=true}, opts={ auto_install = true, highlight={ From b6e449444c3d36bf0ce8760f691040313807b113 Mon Sep 17 00:00:00 2001 From: feyleth <43912085+feyleth@users.noreply.github.com> Date: Thu, 16 Feb 2023 09:15:19 +0100 Subject: [PATCH 03/14] correct dependencies --- lua/plugins/telescope.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 14bc105..72149bf 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -4,7 +4,7 @@ return { { "nvim-telescope/telescope.nvim", cmd = "Telescope", - depedencies={'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + dependencies={'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, keys = { { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, { "/", Util.telescope("live_grep"), desc = "Find in Files (Grep)" }, From 73a181c31ff9097c6ff175229af4861c9cb42e55 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 3 Mar 2023 09:26:08 +0100 Subject: [PATCH 04/14] remove print --- lua/plugins/lsp.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bad4175..70e71a0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -30,8 +30,6 @@ return { -- Enable completion triggered by vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - print(vim.inspect(client.server_capabilities)) - local bufopts = { noremap=true, silent=true, buffer=bufnr } vim.keymap.set( 'n', 'gD', function() require("telescope.builtin").lsp_references() end,desc(bufopts,'goto declaration')) From 06511f34b599c3cbd6cc3fcadd89a6c11654baf5 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 3 Mar 2023 09:28:32 +0100 Subject: [PATCH 05/14] add spell check --- init.lua | 8 +++++++- plugin/option.lua | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index b6c5fd0..3502e90 100644 --- a/init.lua +++ b/init.lua @@ -14,5 +14,11 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require("lazy").setup("plugins",{}) +require("lazy").setup("plugins",{ + performance={ + rtp={ + paths={vim.fn.stdpath("data") .. "/site"} + } + } +}) diff --git a/plugin/option.lua b/plugin/option.lua index dde5713..7b08235 100644 --- a/plugin/option.lua +++ b/plugin/option.lua @@ -39,4 +39,5 @@ opt.mouse = "a" opt.undofile=true - +opt.spell=true +opt.spelllang={"fr","en"} From b1bf835e7aabed70171c5654bc893c0a67d29787 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 3 Mar 2023 09:29:51 +0100 Subject: [PATCH 06/14] change neotree config --- lua/plugins/neo-tree.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index f07f02f..a19cc68 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -24,6 +24,10 @@ return { winbar = false, statusline = false }, + filesystem={ + follow_current_file=true, + group_empty_dirs=true, + }, event_handlers = { { From d93a2e77e276a2741f7be012fe4e69bbfe76b43f Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 3 Mar 2023 09:40:12 +0100 Subject: [PATCH 07/14] change de mini.pair to nvim-autopairs --- lazy-lock.json | 3 ++- lua/plugins/autopairs.lua | 8 -------- lua/plugins/nvim-cmp.lua | 21 +++++++++++++-------- 3 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 lua/plugins/autopairs.lua diff --git a/lazy-lock.json b/lazy-lock.json index cbe1a8b..8016f44 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -20,9 +20,9 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, "mason.nvim": { "branch": "main", "commit": "63ccfe5dd1a9afd16d9d3cdcf0aa59403eef5ef7" }, "mini.ai": { "branch": "main", "commit": "d50b4d87e38d21ca2c5facee9f8a205ddb768358" }, - "mini.pairs": { "branch": "main", "commit": "4ebc1ff8d77fe75e8f219432302800ca29e17614" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "245cf1e68840defcc75a16297740f6203f5a045d" }, "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, + "nvim-autopairs": { "branch": "master", "commit": "ab49517cfd1765b3f3de52c1f0fda6190b44e27b" }, "nvim-cmp": { "branch": "main", "commit": "c4128bcd131fb7152bda8f8dd2b5e41d2fefa88c" }, "nvim-lspconfig": { "branch": "master", "commit": "e20d77deac40e6e65d036acd60aff474c0f09282" }, "nvim-treesitter": { "branch": "master", "commit": "b44871afb59e456bbff4113e416405c06c991cf5" }, @@ -30,6 +30,7 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "15d9c62cb04079cf440ceb6882f2cbfaed66eda1" }, "nvim-web-devicons": { "branch": "master", "commit": "bb6d4fd1e010300510172b173ab5205d37af084f" }, "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } } \ No newline at end of file diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua deleted file mode 100644 index 383a144..0000000 --- a/lua/plugins/autopairs.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - -- { - -- "windwp/nvim-autopairs", - -- init = function() require("nvim-autopairs").setup { - -- check_ts=true, - -- } end - -- } -} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index 78b2ed3..f2daacd 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -13,6 +13,13 @@ return { 'hrsh7th/cmp-nvim-lua', -- neovim api completion 'ray-x/cmp-treesitter', -- treesiter completion "onsails/lspkind.nvim", -- symbole + { + "windwp/nvim-autopairs", + opts={ + check_ts = true, + }, + config = true + } }, opts=function () local cmp=require("cmp") @@ -71,7 +78,12 @@ return { { name = 'buffer' } } }) - + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + local cmp = require('cmp') + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- cmp.setup.cmdline(':', { -- mapping = cmp.mapping.preset.cmdline(), @@ -110,11 +122,4 @@ return { { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, }, }, - { - "echasnovski/mini.pairs", - event = "VeryLazy", - config = function(_, opts) - require("mini.pairs").setup(opts) - end, - } } From 2902b44a9bdde046a78a39499bbc8a4b6ba3f283 Mon Sep 17 00:00:00 2001 From: feyleth <43912085+feyleth@users.noreply.github.com> Date: Wed, 29 Mar 2023 15:38:33 +0200 Subject: [PATCH 08/14] correct lsp config --- lua/plugins/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 70e71a0..2de6d54 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -32,7 +32,7 @@ return { local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set( 'n', 'gD', function() require("telescope.builtin").lsp_references() end,desc(bufopts,'goto declaration')) + vim.keymap.set( 'n', 'gD', function() vim.lsp.buf.declaration() end,desc(bufopts,'goto declaration')) vim.keymap.set( 'n', 'gd', function() vim.lsp.buf.definition() end,desc(bufopts,"goto definition")) vim.keymap.set( 'n', 'K', function() vim.lsp.buf.hover() end,desc(bufopts,"display info")) vim.keymap.set( 'n', 'gi', function() vim.lsp.buf.implementation() end,desc(bufopts,"goto implementation")) @@ -42,7 +42,7 @@ return { vim.keymap.set( 'n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,desc(bufopts,"list all folder of workspace")) vim.keymap.set( 'n', 'D', function() vim.lsp.buf.type_definition() end,desc(bufopts,"goto type definition")) vim.keymap.set( {'n','v'}, 'cr', function() vim.lsp.buf.rename() end,desc(bufopts,"rename symbole")) - vim.keymap.set( 'n', 'gr', function() require("telescope.builtin").references() end,desc(bufopts,"goto references")) + vim.keymap.set( 'n', 'gr', function() require("telescope.builtin").lsp_references() end,desc(bufopts,"goto references")) vim.keymap.set( 'n', 'ca', function() vim.lsp.buf.code_action() end,desc(bufopts,"code action")) -- vim.keymap.set( 'n', 'so', function () require('telescope.builtin').lsp_document_symbols() end,desc(bufopts,"document symbole")) vim.keymap.set( 'n', 'cd', function() vim.diagnostic.open_float(nil, {focus=false}) end,desc(bufopts,"code diagnostic")) From ab9b5622e880d9c0699e40d4a704844cb65a8589 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 12 May 2023 14:22:37 +0200 Subject: [PATCH 09/14] show all server running in lualine --- lazy-lock.json | 59 +++++++++++++++++++++-------------------- lua/plugins/lualine.lua | 8 ++++-- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 8016f44..e406bf9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,36 +1,37 @@ { - "Comment.nvim": { "branch": "master", "commit": "418d3117dab2f54c4340ea73e0070dd78fc81753" }, - "LuaSnip": { "branch": "master", "commit": "58fbfc627a93281a77f7d161d4ff702e639677b1" }, + "Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" }, + "LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, - "cmp-git": { "branch": "main", "commit": "191ec4788656c3d1ad59c9edc3d96e132f93e039" }, + "cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" }, + "cmp-git": { "branch": "main", "commit": "bace35c2ad3c86d35ed67862939b99afd9ff5932" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-treesitter": { "branch": "master", "commit": "b40178b780d547bcf131c684bc5fd41af17d05f2" }, + "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, - "friendly-snippets": { "branch": "main", "commit": "1645e7cd98ed99e766c84ab3cf13a1612c77dcee" }, - "gitsigns.nvim": { "branch": "main", "commit": "5f1451ea7d9a9005b3f0bedeab20cef7a4c65993" }, - "gruvbox.nvim": { "branch": "main", "commit": "73f009df5ed929a853244c413bb52c1d02c117ce" }, - "lazy.nvim": { "branch": "main", "commit": "c249ea376bcd3e5d121b79eac595837b7d0c73a4" }, - "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, - "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, - "mason.nvim": { "branch": "main", "commit": "63ccfe5dd1a9afd16d9d3cdcf0aa59403eef5ef7" }, - "mini.ai": { "branch": "main", "commit": "d50b4d87e38d21ca2c5facee9f8a205ddb768358" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "245cf1e68840defcc75a16297740f6203f5a045d" }, - "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, - "nvim-autopairs": { "branch": "master", "commit": "ab49517cfd1765b3f3de52c1f0fda6190b44e27b" }, - "nvim-cmp": { "branch": "main", "commit": "c4128bcd131fb7152bda8f8dd2b5e41d2fefa88c" }, - "nvim-lspconfig": { "branch": "master", "commit": "e20d77deac40e6e65d036acd60aff474c0f09282" }, - "nvim-treesitter": { "branch": "master", "commit": "b44871afb59e456bbff4113e416405c06c991cf5" }, - "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "15d9c62cb04079cf440ceb6882f2cbfaed66eda1" }, - "nvim-web-devicons": { "branch": "master", "commit": "bb6d4fd1e010300510172b173ab5205d37af084f" }, - "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, + "editorconfig-vim": { "branch": "master", "commit": "7f4e4dfc58c480d154116614e616d90aac77204d" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" }, + "gitsigns.nvim": { "branch": "main", "commit": "814158f6c4b1724c039fcefe79b0be72c9131c2d" }, + "gruvbox.nvim": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" }, + "lazy.nvim": { "branch": "main", "commit": "652b6febf8d5c99eb8cf4a1cec63da6db62e77d2" }, + "lsp_signature.nvim": { "branch": "master", "commit": "7a26ebaa7e36aa2aefa6c1994b2b866c96de32e6" }, + "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" }, + "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" }, + "mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "541f5c92d2492041afb354e2df6e74809094b051" }, + "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, + "nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" }, + "nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" }, + "nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" }, + "nvim-treesitter": { "branch": "master", "commit": "7e1cb38c382dc1f1feb90a759a26dd600bd39841" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f24a86c32238867f24fbff49913db0068f8488d2" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" }, + "nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" }, + "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, - "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } + "telescope.nvim": { "branch": "master", "commit": "d77b37f4520e5fc2cf4c74c12e42ed4b589bd367" }, + "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" } } \ No newline at end of file diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 7d9cf1a..93d5663 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -29,13 +29,17 @@ return { if next(clients) == nil then return msg end + local clientString = "" for _, client in ipairs(clients) do local filetypes = client.config.filetypes if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name + clientString = clientString .. ", " .. client.name end end - return msg + if clientString=="" then + return msg + end + return string.sub(clientString,3) end, icon = ' LSP:', -- color = { fg = '#ffffff', gui = 'bold' }, From 5d17175bea6d527162ca724ae941beadf5c69dbc Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 12 May 2023 14:36:17 +0200 Subject: [PATCH 10/14] add better ui for vim and signature help --- lazy-lock.json | 2 ++ lua/plugins/lsp.lua | 7 ------- lua/plugins/noice.lua | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 lua/plugins/noice.lua diff --git a/lazy-lock.json b/lazy-lock.json index e406bf9..5b31d52 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -22,10 +22,12 @@ "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" }, "mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "541f5c92d2492041afb354e2df6e74809094b051" }, + "noice.nvim": { "branch": "main", "commit": "c2a745a26ae562f1faecbf6177ac53377d2658d5" }, "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, "nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" }, "nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" }, "nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" }, + "nvim-notify": { "branch": "master", "commit": "159c6cf1be25a933f35e97499314c9faab55c98f" }, "nvim-treesitter": { "branch": "master", "commit": "7e1cb38c382dc1f1feb90a759a26dd600bd39841" }, "nvim-treesitter-context": { "branch": "master", "commit": "f24a86c32238867f24fbff49913db0068f8488d2" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 2de6d54..dbf93b0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -2,13 +2,6 @@ return { { "neovim/nvim-lspconfig", event={ "BufReadPre", "BufNewFile" }, - dependencies={"ray-x/lsp_signature.nvim",opts={ - bind = true, -- This is mandatory, otherwise border config won't get registered. - hint_prefix = "", - handler_opts = { - border = "rounded" - } - },lazy=true}, config=function () local lspconfig = require('lspconfig') local lsp_defaults = lspconfig.util.default_config diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..1add135 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,34 @@ +return { + "folke/noice.nvim", + dependencies={ + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify" + }, + event = "VeryLazy", + opts={ + lsp = { + progress={ + enabled=false, + }, + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + }, + routes = { + { + filter = { + event = "msg_show", + kind = "", + }, + opts = { skip = true }, + }, + }, + + } +} From f7562473044c8c63a1eb7b67beb5f951d9720067 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 12 May 2023 15:05:06 +0200 Subject: [PATCH 11/14] add indent scope --- lazy-lock.json | 3 ++- lua/plugins/indent.lua | 33 +++++++++++++++++++++++++++++++++ lua/plugins/noice.lua | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/indent.lua diff --git a/lazy-lock.json b/lazy-lock.json index 5b31d52..facd80a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,13 +14,14 @@ "friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" }, "gitsigns.nvim": { "branch": "main", "commit": "814158f6c4b1724c039fcefe79b0be72c9131c2d" }, "gruvbox.nvim": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" }, + "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, "lazy.nvim": { "branch": "main", "commit": "652b6febf8d5c99eb8cf4a1cec63da6db62e77d2" }, - "lsp_signature.nvim": { "branch": "master", "commit": "7a26ebaa7e36aa2aefa6c1994b2b866c96de32e6" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" }, "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" }, "mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" }, + "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "541f5c92d2492041afb354e2df6e74809094b051" }, "noice.nvim": { "branch": "main", "commit": "c2a745a26ae562f1faecbf6177ac53377d2658d5" }, "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, diff --git a/lua/plugins/indent.lua b/lua/plugins/indent.lua new file mode 100644 index 0000000..9e5d152 --- /dev/null +++ b/lua/plugins/indent.lua @@ -0,0 +1,33 @@ +return { + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPost", "BufNewFile" }, + opts = { + -- char = "▏", + char = "│", + filetype_exclude = { "help", "neo-tree", "lazy", "mason" }, + show_trailing_blankline_indent = false, + show_current_context = false, + }, + }, + { + "echasnovski/mini.indentscope", + event = { "BufReadPre", "BufNewFile" }, + opts = { + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { "help", "neo-tree", "lazy", "mason" }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + config = function(_, opts) + opts = vim.tbl_deep_extend("force", { draw = { animation = require('mini.indentscope').gen_animation.none() }}, opts or {}) + require("mini.indentscope").setup(opts) + end, + } +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 1add135..5c5cf9a 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -25,6 +25,7 @@ return { filter = { event = "msg_show", kind = "", + find="written" }, opts = { skip = true }, }, From cc23888e2eca0095df38142f9b76bc1b9a63ea13 Mon Sep 17 00:00:00 2001 From: feyleth Date: Fri, 12 May 2023 15:58:45 +0200 Subject: [PATCH 12/14] add name of completion --- lua/plugins/nvim-cmp.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index f2daacd..4882780 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -55,8 +55,13 @@ return { hl_group = "LspCodeLens", }, }, + formatting = { - format = lspkind.cmp_format(), + format = function (entry,vim_item) + local res = lspkind.cmp_format()(entry,vim_item) + res = vim.tbl_extend("force",res, {menu=entry.source.name}) + return res + end , }, } end, From d9281813b7abc3276c105a84c454510facc86745 Mon Sep 17 00:00:00 2001 From: feyleth Date: Wed, 24 May 2023 10:33:12 +0200 Subject: [PATCH 13/14] add dressing for option select --- lazy-lock.json | 34 +++++++++++++++++----------------- lua/plugins/dressing.lua | 4 ++++ 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 lua/plugins/dressing.lua diff --git a/lazy-lock.json b/lazy-lock.json index facd80a..8692cac 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,40 +1,40 @@ { "Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" }, - "LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" }, + "LuaSnip": { "branch": "master", "commit": "fcdaa4313305fe20d928551134c1ec2266e7af2a" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" }, - "cmp-git": { "branch": "main", "commit": "bace35c2ad3c86d35ed67862939b99afd9ff5932" }, + "cmp-git": { "branch": "main", "commit": "3b58a59f0238318ba20b1e19a1dec8e3589da2dc" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "editorconfig-vim": { "branch": "master", "commit": "7f4e4dfc58c480d154116614e616d90aac77204d" }, + "dressing.nvim": { "branch": "master", "commit": "2f17eee4d7709dacfad2a28f35e2acfe9a6cb09d" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" }, - "gitsigns.nvim": { "branch": "main", "commit": "814158f6c4b1724c039fcefe79b0be72c9131c2d" }, + "friendly-snippets": { "branch": "main", "commit": "2bb3958e1fe0a613e028f3c6fd2d2923fc23bd0c" }, + "gitsigns.nvim": { "branch": "main", "commit": "c18b7ca0b5b50596722f3a1572eb9b8eb520c0f1" }, "gruvbox.nvim": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, - "lazy.nvim": { "branch": "main", "commit": "652b6febf8d5c99eb8cf4a1cec63da6db62e77d2" }, + "lazy.nvim": { "branch": "main", "commit": "b382495d512fbc6dadbeac8b806efc72db7130e8" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" }, - "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c55d18f3947562e699d34d89681edbf9f0e250d3" }, + "mason.nvim": { "branch": "main", "commit": "08b2fd308e0107eab9f0b59d570b69089fd0b522" }, "mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" }, "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "541f5c92d2492041afb354e2df6e74809094b051" }, - "noice.nvim": { "branch": "main", "commit": "c2a745a26ae562f1faecbf6177ac53377d2658d5" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "e5594d53986b34e584e8afe2ea6ad99d6f6d2105" }, + "noice.nvim": { "branch": "main", "commit": "b4ff29c2492fbdc897866a4e3fdc413b27b48554" }, "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, "nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" }, - "nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" }, - "nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" }, - "nvim-notify": { "branch": "master", "commit": "159c6cf1be25a933f35e97499314c9faab55c98f" }, - "nvim-treesitter": { "branch": "master", "commit": "7e1cb38c382dc1f1feb90a759a26dd600bd39841" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f24a86c32238867f24fbff49913db0068f8488d2" }, + "nvim-cmp": { "branch": "main", "commit": "3ac8d6cd29c74ff482d8ea47d45e5081bfc3f5ad" }, + "nvim-lspconfig": { "branch": "master", "commit": "10142ff298f5fc3f8bf9d277c806593401b0fd06" }, + "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" }, + "nvim-treesitter": { "branch": "master", "commit": "f2778bd1a28b74adf5b1aa51aa57da85adfa3d16" }, + "nvim-treesitter-context": { "branch": "master", "commit": "c8f3a62c64bf6f9fed11260a424207f780505f83" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" }, - "nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" }, + "nvim-web-devicons": { "branch": "master", "commit": "e283ab937e0197b37ec5d8013e49495193407324" }, "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope.nvim": { "branch": "master", "commit": "d77b37f4520e5fc2cf4c74c12e42ed4b589bd367" }, + "telescope.nvim": { "branch": "master", "commit": "40c31fdde93bcd85aeb3447bb3e2a3208395a868" }, "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" } } \ No newline at end of file diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..65d7987 --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,4 @@ +return { + 'stevearc/dressing.nvim', + opts = {}, +} From 7da0a495b2777d359cb75518d9d56df1e9b7137d Mon Sep 17 00:00:00 2001 From: feyleth Date: Wed, 7 Jun 2023 11:15:12 +0200 Subject: [PATCH 14/14] move treesiter cmp to lower priority --- lua/plugins/nvim-cmp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index 4882780..869a044 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -43,11 +43,11 @@ return { }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, - {name = 'treesitter'}, { name = 'path'}, {name= 'nvim_lua'}, { name = 'luasnip' }, -- For luasnip users. }, { + {name = 'treesitter'}, { name = 'buffer' }, }), experimental = {