From fd7228b0ccae3a4a8aa65dc34251115d3d4718c4 Mon Sep 17 00:00:00 2001 From: jorgenwh Date: Sat, 6 Jul 2024 15:36:44 +0200 Subject: [PATCH] upd --- lua/plugins/aichat.lua | 8 +++++ lua/plugins/chatGPT.lua | 32 ----------------- lua/plugins/conform.lua | 73 ++++++++++++++++++++------------------- lua/plugins/leap.lua | 7 ++++ lua/plugins/neo_tree.lua | 2 +- lua/plugins/noice.lua | 34 ++++++++++++++++++ lua/plugins/resession.lua | 27 +++++++++++++++ 7 files changed, 114 insertions(+), 69 deletions(-) create mode 100644 lua/plugins/aichat.lua delete mode 100644 lua/plugins/chatGPT.lua create mode 100644 lua/plugins/leap.lua create mode 100644 lua/plugins/noice.lua create mode 100644 lua/plugins/resession.lua diff --git a/lua/plugins/aichat.lua b/lua/plugins/aichat.lua new file mode 100644 index 00000000..22e4e1ae --- /dev/null +++ b/lua/plugins/aichat.lua @@ -0,0 +1,8 @@ +return { + -- 'jorgenwh/aichat.nvim', + dir = '/home/jorgen/src/aichat.nvim', + + dependencies = { + {'MunifTanjim/nui.nvim'}, + }, +} diff --git a/lua/plugins/chatGPT.lua b/lua/plugins/chatGPT.lua deleted file mode 100644 index 1405105e..00000000 --- a/lua/plugins/chatGPT.lua +++ /dev/null @@ -1,32 +0,0 @@ -vim.keymap.set('v', 'a', 'ChatGPTEditWithInstructions', { noremap = true, silent = true }) -vim.keymap.set('n', 'a', 'ChatGPT', { noremap = true, silent = true }) - -return { - 'jackMort/ChatGPT.nvim', - event = 'VeryLazy', - config = function() - require('chatgpt').setup { - popup_input = { - submit = '', - }, - defaults = { - openai_params = { - model = 'gpt-4o', - max_tokens = 4096, - }, - openai_edit_params = { - model = 'gpt-4o', - }, - popup_layout = { - default = 'right', - }, - }, - } - end, - dependencies = { - 'MunifTanjim/nui.nvim', - 'nvim-lua/plenary.nvim', - 'folke/trouble.nvim', - 'nvim-telescope/telescope.nvim', - }, -} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 5f392429..26696566 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -1,36 +1,37 @@ -return { -- Autoformat - 'stevearc/conform.nvim', - lazy = false, - keys = { - { - 'f', - function() - require('conform').format { async = true, lsp_fallback = true } - end, - mode = '', - desc = '[F]ormat buffer', - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, - }, - }, -} +return { } +-- return { -- Autoformat +-- 'stevearc/conform.nvim', +-- lazy = false, +-- keys = { +-- { +-- 'f', +-- function() +-- require('conform').format { async = true, lsp_fallback = true } +-- end, +-- mode = '', +-- desc = '[F]ormat buffer', +-- }, +-- }, +-- opts = { +-- notify_on_error = false, +-- format_on_save = function(bufnr) +-- -- Disable "format_on_save lsp_fallback" for languages that don't +-- -- have a well standardized coding style. You can add additional +-- -- languages here or re-enable it for the disabled ones. +-- local disable_filetypes = { c = true, cpp = true } +-- return { +-- timeout_ms = 500, +-- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], +-- } +-- end, +-- formatters_by_ft = { +-- lua = { 'stylua' }, +-- -- Conform can also run multiple formatters sequentially +-- -- python = { "isort", "black" }, +-- -- +-- -- You can use a sub-list to tell conform to run *until* a formatter +-- -- is found. +-- -- javascript = { { "prettierd", "prettier" } }, +-- }, +-- }, +-- } diff --git a/lua/plugins/leap.lua b/lua/plugins/leap.lua new file mode 100644 index 00000000..ae3e3206 --- /dev/null +++ b/lua/plugins/leap.lua @@ -0,0 +1,7 @@ +vim.keymap.set({ 'n', 'x', 'o' }, 's', '(leap-forward)') +vim.keymap.set({ 'n', 'x', 'o' }, 'S', '(leap-backward)') +-- vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '(leap-from-window)') + +return { + 'ggandor/leap.nvim', +} diff --git a/lua/plugins/neo_tree.lua b/lua/plugins/neo_tree.lua index c85c200f..0e1e4ea3 100644 --- a/lua/plugins/neo_tree.lua +++ b/lua/plugins/neo_tree.lua @@ -6,7 +6,7 @@ return { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'MunifTanjim/nui.nvim', - '3rd/image.nvim', -- Optional image support in preview window: See `# Preview Mode` for more information + -- '3rd/image.nvim', -- Optional image support in preview window: See `# Preview Mode` for more information }, keys = { diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 00000000..e352321d --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,34 @@ +return { + -- lazy.nvim + { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, + }, +} diff --git a/lua/plugins/resession.lua b/lua/plugins/resession.lua new file mode 100644 index 00000000..4ccda1a4 --- /dev/null +++ b/lua/plugins/resession.lua @@ -0,0 +1,27 @@ +return { + { + 'stevearc/resession.nvim', + config = function() + local resession = require 'resession' + resession.setup {} + + -- Automatically save sessions on by working directory on exit + vim.api.nvim_create_autocmd('VimLeavePre', { + callback = function() + resession.save(vim.fn.getcwd(), { notify = true }) + end, + }) + + -- Automatically load sessions on startup by working directory + vim.api.nvim_create_autocmd('VimEnter', { + callback = function() + -- Only load the session if nvim was started with no args + if vim.fn.argc(-1) == 0 then + resession.load(vim.fn.getcwd(), { silence_errors = true }) + end + end, + nested = true, + }) + end, + }, +}