updates
This commit is contained in:
15
lua/code_action_utils.lua
Normal file
15
lua/code_action_utils.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local M = {}
|
||||
|
||||
local lsp_util = vim.lsp.util
|
||||
|
||||
function M.code_action_listener()
|
||||
local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
|
||||
local params = lsp_util.make_range_params()
|
||||
params.context = context
|
||||
vim.lsp.buf_request(0, 'textDocument/codeAction', params,
|
||||
function(err, result, ctx, config)
|
||||
-- do something with result - e.g. check if empty and show some indication such as a sign
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
129
lua/plugins.lua
129
lua/plugins.lua
@@ -25,6 +25,7 @@ require('packer').startup(function(use)
|
||||
|
||||
-- LSP/DEV {{{
|
||||
|
||||
-- COPILOT {{{
|
||||
use {
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "VimEnter",
|
||||
@@ -85,9 +86,132 @@ require('packer').startup(function(use)
|
||||
}
|
||||
|
||||
use { "zbirenbaum/copilot-cmp" }
|
||||
-- }}}
|
||||
use({
|
||||
"jackMort/ChatGPT.nvim",
|
||||
commit = "24bcca7",
|
||||
config = function()
|
||||
require("chatgpt").setup({
|
||||
api_key_cmd = "cat /home/stickuser/.config/openai/apikey",
|
||||
yank_register = "+",
|
||||
edit_with_instructions = {
|
||||
diff = false,
|
||||
keymaps = {
|
||||
close = "<C-c>",
|
||||
accept = "<C-y>",
|
||||
toggle_diff = "<C-d>",
|
||||
toggle_settings = "<C-o>",
|
||||
cycle_windows = "<Tab>",
|
||||
use_output_as_input = "<C-i>"
|
||||
}
|
||||
},
|
||||
chat = {
|
||||
welcome_message = "HELLO FREUD",
|
||||
loading_text = "Loading, please wait ...",
|
||||
question_sign = "",
|
||||
answer_sign = "ﮧ",
|
||||
max_line_length = 120,
|
||||
sessions_window = {
|
||||
border = {
|
||||
style = "rounded",
|
||||
text = { top = " Sessions " }
|
||||
},
|
||||
win_options = {
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder"
|
||||
}
|
||||
},
|
||||
keymaps = {
|
||||
close = { "<C-c>" },
|
||||
yank_last = "<C-y>",
|
||||
yank_last_code = "<C-k>",
|
||||
scroll_up = "<C-u>",
|
||||
scroll_down = "<C-d>",
|
||||
new_session = "<C-n>",
|
||||
cycle_windows = "<Tab>",
|
||||
cycle_modes = "<C-f>",
|
||||
select_session = "<Space>",
|
||||
rename_session = "r",
|
||||
delete_session = "d",
|
||||
draft_message = "<C-d>",
|
||||
toggle_settings = "<C-o>",
|
||||
toggle_message_role = "<C-r>",
|
||||
toggle_system_role_open = "<C-s>",
|
||||
stop_generating = "<C-x>"
|
||||
}
|
||||
},
|
||||
popup_layout = {
|
||||
default = "center",
|
||||
center = { width = "80%", height = "80%" },
|
||||
right = { width = "30%", width_settings_open = "50%" }
|
||||
},
|
||||
popup_window = {
|
||||
border = {
|
||||
highlight = "FloatBorder",
|
||||
style = "rounded",
|
||||
text = { top = " ChatGPT " }
|
||||
},
|
||||
win_options = {
|
||||
wrap = true,
|
||||
linebreak = true,
|
||||
foldcolumn = "1",
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder"
|
||||
},
|
||||
buf_options = { filetype = "markdown" }
|
||||
},
|
||||
system_window = {
|
||||
border = {
|
||||
highlight = "FloatBorder",
|
||||
style = "rounded",
|
||||
text = { top = " SYSTEM " }
|
||||
},
|
||||
win_options = {
|
||||
wrap = true,
|
||||
linebreak = true,
|
||||
foldcolumn = "2",
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder"
|
||||
}
|
||||
},
|
||||
popup_input = {
|
||||
prompt = " ",
|
||||
border = {
|
||||
highlight = "FloatBorder",
|
||||
style = "rounded",
|
||||
text = { top_align = "center", top = " Prompt " }
|
||||
},
|
||||
win_options = {
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder"
|
||||
},
|
||||
submit = "<C-Enter>",
|
||||
submit_n = "<Enter>",
|
||||
max_visible_lines = 20
|
||||
},
|
||||
settings_window = {
|
||||
border = { style = "rounded", text = { top = " Settings " } },
|
||||
win_options = {
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder"
|
||||
}
|
||||
},
|
||||
openai_params = {
|
||||
model = "gpt-3.5-turbo",
|
||||
frequency_penalty = 0,
|
||||
presence_penalty = 0,
|
||||
max_tokens = 300,
|
||||
temperature = 0,
|
||||
top_p = 1,
|
||||
n = 1
|
||||
},
|
||||
openai_edit_params = {
|
||||
model = "code-davinci-edit-001",
|
||||
temperature = 0,
|
||||
top_p = 1,
|
||||
n = 1
|
||||
},
|
||||
actions_paths = {},
|
||||
show_quickfixes_cmd = "Trouble quickfix",
|
||||
predefined_chat_gpt_prompts =
|
||||
"https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv"
|
||||
})
|
||||
end,
|
||||
requires = {
|
||||
"MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim"
|
||||
@@ -113,6 +237,9 @@ require('packer').startup(function(use)
|
||||
use { 'onsails/lspkind-nvim' }
|
||||
use { 'jose-elias-alvarez/null-ls.nvim' }
|
||||
use 'folke/neodev.nvim'
|
||||
|
||||
-- DAP {{{
|
||||
|
||||
use 'mfussenegger/nvim-dap'
|
||||
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
use { 'mfussenegger/nvim-dap-python' }
|
||||
@@ -120,6 +247,8 @@ require('packer').startup(function(use)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- }}}
|
||||
|
||||
-- UI {{{
|
||||
|
||||
use {
|
||||
|
||||
Reference in New Issue
Block a user