This commit is contained in:
jorgenwh 2024-07-06 15:36:44 +02:00
parent 2fab75fd28
commit fd7228b0cc
7 changed files with 114 additions and 69 deletions

8
lua/plugins/aichat.lua Normal file
View File

@ -0,0 +1,8 @@
return {
-- 'jorgenwh/aichat.nvim',
dir = '/home/jorgen/src/aichat.nvim',
dependencies = {
{'MunifTanjim/nui.nvim'},
},
}

View File

@ -1,32 +0,0 @@
vim.keymap.set('v', '<leader>a', '<cmd>ChatGPTEditWithInstructions<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>a', '<cmd>ChatGPT<CR>', { noremap = true, silent = true })
return {
'jackMort/ChatGPT.nvim',
event = 'VeryLazy',
config = function()
require('chatgpt').setup {
popup_input = {
submit = '<S-CR>',
},
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',
},
}

View File

@ -1,36 +1,37 @@
return { -- Autoformat
'stevearc/conform.nvim',
lazy = false,
keys = {
{
'<leader>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 = {
-- {
-- '<leader>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" } },
-- },
-- },
-- }

7
lua/plugins/leap.lua Normal file
View File

@ -0,0 +1,7 @@
vim.keymap.set({ 'n', 'x', 'o' }, 's', '<Plug>(leap-forward)')
vim.keymap.set({ 'n', 'x', 'o' }, 'S', '<Plug>(leap-backward)')
-- vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '<Plug>(leap-from-window)')
return {
'ggandor/leap.nvim',
}

View File

@ -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 = {

34
lua/plugins/noice.lua Normal file
View File

@ -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',
},
},
}

27
lua/plugins/resession.lua Normal file
View File

@ -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,
},
}