From d3f94e12d6259a57698c37ba918f87a527bce9e0 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 15 Aug 2023 12:03:05 -0700 Subject: [PATCH] update --- init.vim | 5 +- lua/plugins.lua | 178 +++++++++-------------------------- plugin-confs/copilot-cmp.lua | 8 ++ plugin-confs/copilot.lua | 81 +++++++++------- plugin-confs/dressing.lua | 149 +++++++++++++++++++++++++++++ plugin-confs/neorg.lua | 10 ++ 6 files changed, 261 insertions(+), 170 deletions(-) create mode 100644 plugin-confs/copilot-cmp.lua create mode 100644 plugin-confs/dressing.lua create mode 100644 plugin-confs/neorg.lua diff --git a/init.vim b/init.vim index f0122ea..baf0283 100644 --- a/init.vim +++ b/init.vim @@ -25,6 +25,7 @@ source ~/.config/nvim/plugin-confs/treesitter.lua source ~/.config/nvim/plugin-confs/whichkey.lua source ~/.config/nvim/plugin-confs/telescope.lua source ~/.config/nvim/plugin-confs/telescope-file-browser.lua +source ~/.config/nvim/plugin-confs/dressing.lua source ~/.config/nvim/plugin-confs/code_actions.lua source ~/.config/nvim/plugin-confs/goto-preview.lua @@ -41,7 +42,9 @@ source ~/.config/nvim/plugin-confs/nvim-dap-python.lua source ~/.config/nvim/plugin-confs/nvim-dap-bash.lua source ~/.config/nvim/plugin-confs/nvim-dap-ui.lua source ~/.config/nvim/plugin-confs/nvim-dap-virtual-text.lua -" source ~/.config/nvim/plugin-confs/copilot.lua +source ~/.config/nvim/plugin-confs/copilot.lua +source ~/.config/nvim/plugin-confs/copilot-cmp.lua +source ~/.config/nvim/plugin-confs/neorg.lua " source ~/.config/nvim/plugin-confs/lsp-signature.lua " source ~/.config/nvim/plugin-confs/nvim-docs-view.lua diff --git a/lua/plugins.lua b/lua/plugins.lua index 2580eaf..3d54df6 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -8,123 +8,8 @@ require('packer').startup(function(use) require('nvim-treesitter.install').update({ with_sync = true }) end } - - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } - } - - use { - "zbirenbaum/copilot.lua", - event = "VimEnter", - config = function() - vim.defer_fn(function() - require('copilot').setup({ - panel = { - enabled = false, - auto_refresh = false, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, - layout = { - position = "right", -- | top | left | right - ratio = 0.4 - } - }, - suggestion = { - enabled = false, - auto_trigger = false, - debounce = 75, - keymap = { - accept = "", - -- accept = "", - next = "", - prev = "", - dismiss = "" - } - }, - -- filetypes = { - -- yaml = false, - -- markdown = false, - -- help = false, - -- gitcommit = false, - -- gitrebase = false, - -- hgcommit = false, - -- svn = false, - -- cvs = false, - -- ["."] = false, - -- }, - copilot_node_command = 'node', -- Node version must be < 18 - plugin_manager_path = vim.fn.stdpath("data") .. - "/site/pack/packer", - server_opts_overrides = { - trace = "verbose", - settings = { - advanced = { - listCount = 10, -- #completions for panel - inlineSuggestCount = 4 -- #completions for getCompletions - } - } - } - }) - end, 100) - end - } - - use { - "zbirenbaum/copilot-cmp", - config = function() - require("copilot_cmp").setup({ - suggestion = { enabled = false }, - panel = { enabled = false } - -- method = "getCompletionsCycling", - -- formatters = { - -- insert_text = require("copilot_cmp.format").remove_existing - -- } - }) - end - } - - use { - "nvim-neorg/neorg", - -- tag = "*", - ft = "norg", - after = "nvim-treesitter", -- You may want to specify Telescope here as well - config = function() - require('neorg').setup { - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.concealer"] = {}, -- Adds pretty icons to your documents - ["core.completion"] = { config = { engine = "nvim-cmp" } }, -- Adds completion - ["core.dirman"] = { -- Manages Neorg workspaces - config = { workspaces = { notes = "~/notes" } } - } - } - } - end - } - - use { 'junegunn/fzf', run = function() vim.fn['fzf#install']() end } - use 'junegunn/fzf.vim' - use 'norcalli/nvim-colorizer.lua' - use 'jiangmiao/auto-pairs' - use 'pechorin/any-jump.vim' - use 'tpope/vim-commentary' - use 'tpope/vim-surround' - use 'voldikss/vim-floaterm' - use 'wakatime/vim-wakatime' - - use { 'akinsho/nvim-bufferline.lua' } - use { 'andweeb/presence.nvim' } - use { 'folke/which-key.nvim' } - use { 'glepnir/dashboard-nvim' } - use { 'kyazdani42/nvim-tree.lua' } - use 'kyazdani42/nvim-web-devicons' - use { 'lewis6991/gitsigns.nvim' } + use { "MunifTanjim/nui.nvim" } + -- TELESCOPE use { 'nvim-telescope/telescope.nvim' } use { 'nvim-telescope/telescope-file-browser.nvim' } use 'nvim-telescope/telescope-dap.nvim' @@ -134,11 +19,29 @@ require('packer').startup(function(use) run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } + -- UI + use { 'akinsho/nvim-bufferline.lua' } + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } + use { 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' } + use { 'onsails/lspkind-nvim' } + use 'norcalli/nvim-colorizer.lua' + use { 'glepnir/dashboard-nvim' } + use 'kyazdani42/nvim-web-devicons' + use { 'stevearc/dressing.nvim' } + use { + 'j-hui/fidget.nvim', + tag = 'legacy', + config = function() require("fidget").setup {} end + } + -- LSP/DEV + use { "zbirenbaum/copilot.lua", event = "VimEnter" } + use { "zbirenbaum/copilot-cmp" } use { 'ojroques/nvim-lspfuzzy' } - use 'L3MON4D3/LuaSnip' - -- use 'amrbashir/nvim-docs-view' use { 'hrsh7th/nvim-cmp' } use { 'hrsh7th/cmp-nvim-lsp' } use { 'hrsh7th/cmp-nvim-lua' } @@ -146,23 +49,9 @@ require('packer').startup(function(use) use { 'hrsh7th/cmp-path' } use { 'hrsh7th/cmp-cmdline' } use { 'hrsh7th/cmp-buffer' } + use { 'saadparwaiz1/cmp_luasnip' } use { 'hrsh7th/cmp-nvim-lsp-document-symbol' } - use { - 'j-hui/fidget.nvim', - tag = 'legacy', - config = function() - require("fidget").setup { - -- options - } - end - } - use { 'jose-elias-alvarez/null-ls.nvim' } - use { 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' } use { 'neovim/nvim-lspconfig' } - use { 'onsails/lspkind-nvim' } - -- use 'ray-x/lsp_signature.nvim' - use { 'rmagatti/goto-preview' } - use 'saadparwaiz1/cmp_luasnip' use({ "jackMort/ChatGPT.nvim", commit = "24bcca7", @@ -172,16 +61,35 @@ require('packer').startup(function(use) } }) + -- EXTRA + use { + "nvim-neorg/neorg", + -- tag = "*", + ft = "norg", + after = "nvim-treesitter" -- You may want to specify Telescope here as well + } + use 'pechorin/any-jump.vim' + use { 'jose-elias-alvarez/null-ls.nvim' } + use { 'rmagatti/goto-preview' } + use 'folke/neodev.nvim' + use 'voldikss/vim-floaterm' + use 'wakatime/vim-wakatime' + use { 'junegunn/fzf', run = function() vim.fn['fzf#install']() end } + use { 'folke/which-key.nvim' } + use { 'kyazdani42/nvim-tree.lua' } + use { 'lewis6991/gitsigns.nvim' } use({ "iamcco/markdown-preview.nvim", run = function() vim.fn["mkdp#util#install"]() end }) - use 'folke/neodev.nvim' + -- DEBUG use 'mfussenegger/nvim-dap' use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } } use 'mfussenegger/nvim-dap-python' use 'theHamsta/nvim-dap-virtual-text' + + -- COLORSCHEMES use { 'Mofiqul/dracula.nvim' } use({ 'NTBBloodbath/doom-one.nvim', diff --git a/plugin-confs/copilot-cmp.lua b/plugin-confs/copilot-cmp.lua new file mode 100644 index 0000000..71883db --- /dev/null +++ b/plugin-confs/copilot-cmp.lua @@ -0,0 +1,8 @@ +require("copilot_cmp").setup({ + suggestion = { enabled = false }, + panel = { enabled = false } + -- method = "getCompletionsCycling", + -- formatters = { + -- insert_text = require("copilot_cmp.format").remove_existing + -- } +}) diff --git a/plugin-confs/copilot.lua b/plugin-confs/copilot.lua index 39b057a..1711316 100644 --- a/plugin-confs/copilot.lua +++ b/plugin-confs/copilot.lua @@ -1,38 +1,51 @@ require('copilot').setup({ - panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" + panel = { + enabled = false, + auto_refresh = false, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "", + refresh = "gr", + open = "" + }, + layout = { + position = "right", -- | top | left | right + ratio = 0.4 + } }, - }, - suggestion = { - enabled = true, - auto_trigger = false, - debounce = 75, - keymap = { - accept = "", - next = "", - prev = "", - dismiss = "", + suggestion = { + enabled = false, + auto_trigger = false, + debounce = 75, + keymap = { + accept = "", + -- accept = "", + next = "", + prev = "", + dismiss = "" + } }, - }, - filetypes = { - yaml = false, - markdown = false, - help = false, - gitcommit = false, - gitrebase = false, - hgcommit = false, - svn = false, - cvs = false, - ["."] = false, - }, - copilot_node_command = 'node', -- Node version must be < 18 - plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer", - server_opts_overrides = {}, + -- filetypes = { + -- yaml = false, + -- markdown = false, + -- help = false, + -- gitcommit = false, + -- gitrebase = false, + -- hgcommit = false, + -- svn = false, + -- cvs = false, + -- ["."] = false, + -- }, + copilot_node_command = 'node', -- Node version must be < 18 + plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer", + server_opts_overrides = { + trace = "verbose", + settings = { + advanced = { + listCount = 10, -- #completions for panel + inlineSuggestCount = 4 -- #completions for getCompletions + } + } + } }) diff --git a/plugin-confs/dressing.lua b/plugin-confs/dressing.lua new file mode 100644 index 0000000..a17401a --- /dev/null +++ b/plugin-confs/dressing.lua @@ -0,0 +1,149 @@ +require('dressing').setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input:", + + -- Can be 'left', 'right', or 'center' + title_pos = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 0.4, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.85 }, + min_width = { 20, 0.25 }, + + buf_options = {}, + win_options = { + -- Window transparency (0-100) + winblend = 10, + -- Disable line wrapping + wrap = false, + -- Indicator for when text exceeds window + list = true, + listchars = "precedes:…,extends:…", + -- Increase this for more context when text scrolls off the window + sidescrolloff = 0 + }, + + -- Set to `false` to disable + mappings = { + n = { [""] = "Close", [""] = "Confirm" }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext" + } + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { window = { width = 0.5, height = 0.4 } }, + + -- Options for fzf-lua + fzf_lua = { + -- winopts = { + -- height = 0.5, + -- width = 0.5, + -- }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { style = "rounded" }, + buf_options = { swapfile = false, filetype = "DressingSelect" }, + win_options = { winblend = 10 }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10 + }, + + -- Options for built-in selector + builtin = { + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + buf_options = {}, + win_options = { + -- Window transparency (0-100) + winblend = 10, + cursorline = true, + cursorlineopt = "both" + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm" + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil + } +}) diff --git a/plugin-confs/neorg.lua b/plugin-confs/neorg.lua new file mode 100644 index 0000000..762335f --- /dev/null +++ b/plugin-confs/neorg.lua @@ -0,0 +1,10 @@ +require('neorg').setup { + load = { + ["core.defaults"] = {}, -- Loads default behaviour + ["core.concealer"] = {}, -- Adds pretty icons to your documents + ["core.completion"] = { config = { engine = "nvim-cmp" } }, -- Adds completion + ["core.dirman"] = { -- Manages Neorg workspaces + config = { workspaces = { notes = "~/notes" } } + } + } +}