From 898a383d4d3d06f80491739b4b73b9d37983ee74 Mon Sep 17 00:00:00 2001 From: blob42 Date: Sat, 18 Mar 2023 01:44:10 +0100 Subject: [PATCH] update --- last_stable_nvim_version | 8 +- lua/core/mappings.lua | 3 + lua/custom/plugins/configs/chat-gpt.lua | 132 ++++++++++--------- lua/custom/plugins/configs/dap-virt-text.lua | 33 +++++ lua/custom/plugins/configs/dap.lua | 32 ----- lua/custom/plugins/init.lua | 18 ++- lua/custom/plugins/nvchadui.lua | 13 +- lua/spike/dap/dapmode.lua | 1 + lua/spike/utils/nvterm.lua | 1 - mysnippets/python.lua | 1 + plugin/spike/fzf-marks.lua.disabled | 1 - 11 files changed, 130 insertions(+), 113 deletions(-) create mode 100644 lua/custom/plugins/configs/dap-virt-text.lua diff --git a/last_stable_nvim_version b/last_stable_nvim_version index 39fa4ab..231de77 100644 --- a/last_stable_nvim_version +++ b/last_stable_nvim_version @@ -1,10 +1,10 @@ -NVIM v0.9.0-dev-77-gf175ca9f7 +NVIM v0.9.0-dev-888+g81c5483dc Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 -Compilation: /usr/bin/gcc-10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -Compiled by runner@fv-az47-468 +Compilation: /usr/bin/gcc-10 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include +Compiled by runner@fv-az454-10 -Features: +acl +iconv +tui +Features: +acl +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index b078060..70b486b 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -1096,6 +1096,9 @@ M.copilot = { ["cpn"] = { " lua require'copilot.panel'.open()", "copilot panel" }, ["]p"] = { " lua require'copilot.panel'.jump_next() ", "copilot panel next" }, ["[p"] = { " lua require'copilot.panel'.jump_prev() ", "copilot panel prev" }, + }, + i = { + ["p"] = { " lua require'copilot.panel'.open()", "copilot panel" }, } } diff --git a/lua/custom/plugins/configs/chat-gpt.lua b/lua/custom/plugins/configs/chat-gpt.lua index 6b21b16..b498da8 100644 --- a/lua/custom/plugins/configs/chat-gpt.lua +++ b/lua/custom/plugins/configs/chat-gpt.lua @@ -9,73 +9,79 @@ end local config = { - -- welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot - loading_text = "loading", - question_sign = "", -- you can use emoji if you want e.g. 🙂 - answer_sign = "ﮧ", -- 🤖 - max_line_length = 120, - yank_register = "+", - chat_layout = { - relative = "editor", - position = "50%", - size = { - height = "80%", - width = "80%", + -- welcome_message = WELCOME_MESSAGE, + loading_text = "loading", + question_sign = "", -- you can use emoji if you want e.g. 🙂 + answer_sign = "ﮧ", -- 🤖 + max_line_length = 120, + yank_register = "+", + chat_layout = { + relative = "editor", + position = "50%", + size = { + height = "80%", + width = "80%", + }, }, - }, - settings_window = { - border = { - style = "rounded", - text = { - top = " Settings ", - }, + settings_window = { + border = { + style = "rounded", + text = { + top = " Settings ", + }, + }, }, - }, - chat_window = { - filetype = "chatgpt", - border = { - highlight = "FloatBorder", - style = "rounded", - text = { - top = " ChatGPT ", - }, + chat_window = { + filetype = "chatgpt", + border = { + highlight = "FloatBorder", + style = "rounded", + text = { + top = " ChatGPT ", + }, + }, }, - }, - chat_input = { - prompt = "  ", - border = { - highlight = "FloatBorder", - style = "rounded", - text = { - top_align = "center", - top = " Prompt ", - }, + chat_input = { + prompt = "  ", + border = { + highlight = "FloatBorder", + style = "rounded", + text = { + top_align = "center", + top = " Prompt ", + }, + }, + }, + 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, + }, + keymaps = { + close = { "" }, + submit = "", + yank_last = "", + yank_last_code = "", + scroll_up = "", + scroll_down = "", + toggle_settings = "", + new_session = "", + cycle_windows = "", + -- in the Sessions pane + select_session = "", + rename_session = "r", + delete_session = "d", }, - }, - openai_params = { - model = "text-davinci-003", - 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, - }, - keymaps = { - close = { "", "" }, - yank_last = "", - scroll_up = "", - scroll_down = "", - toggle_settings = "", - new_session = "", - cycle_windows = "", - }, } M.setup = function() diff --git a/lua/custom/plugins/configs/dap-virt-text.lua b/lua/custom/plugins/configs/dap-virt-text.lua new file mode 100644 index 0000000..f4a8a3d --- /dev/null +++ b/lua/custom/plugins/configs/dap-virt-text.lua @@ -0,0 +1,33 @@ +local M = {} + +-- config for dap ui virt text +local dap_ui_virt_text_config = { + enabled = true, -- enable this plugin (the default) + enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) + highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText + highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) + show_stop_reason = true, -- show stop reason when stopped for exceptions + commented = false, -- prefix virtual text with comment string + only_first_definition = true, -- only show virtual text at first definition (if there are multiple) + all_references = false, -- show virtual text on all all references of the variable (not only definitions) + filter_references_pattern = 'gpT"}, + }, ["jackMort/ChatGPT.nvim"] = { -- lock = true, opt = true, @@ -260,13 +266,13 @@ return { ["mfussenegger/nvim-dap"] = { -- {{{ lock = true, - module = "dap", + module = {"dap"}, setup = function() require("core.utils").load_mappings "dap" - require('spike.dap').setup() end, config = function() - require("custom.plugins.configs.dap").setup() + require('spike.dap').setup() + -- require("custom.plugins.configs.dap").setup() end }, @@ -274,7 +280,7 @@ return { -- tag = "*", lock = true, commit = "1e21b3b", - after = "nvim-dap", + after = {"nvim-dap"}, config = function() require('custom.plugins.configs.dapui').setup() end @@ -282,11 +288,9 @@ return { ["theHamsta/nvim-dap-virtual-text"] = { lock = true, - -- opt = true, after = {"nvim-dap"}, config = function() - require("custom.plugins.configs.dap").setup_virt_text() - -- P("config dap ui virt text") + require("custom.plugins.configs.dap-virt-text").setup_virt_text() end }, -- }}} diff --git a/lua/custom/plugins/nvchadui.lua b/lua/custom/plugins/nvchadui.lua index bb21bee..96a7c8f 100644 --- a/lua/custom/plugins/nvchadui.lua +++ b/lua/custom/plugins/nvchadui.lua @@ -41,6 +41,7 @@ local modes = { } local function is_dapmode() + if not _BLOB42_DAPMODE_LOADED then return false end return require("spike.dap.dapmode").is_active() -- return false end @@ -139,11 +140,13 @@ return { end - local present, dap = pcall(require, "dap") - if present then - local session = dap.session() - if session ~= nil and session.initialized == true then - dap_status = "%#St_Dap#" .. "%* " + if _BLOB42_DAPMODE_LOADED then + local present, dap = pcall(require, "dap") + if present then + local session = dap.session() + if session ~= nil and session.initialized == true then + dap_status = "%#St_Dap#" .. "%* " + end end end diff --git a/lua/spike/dap/dapmode.lua b/lua/spike/dap/dapmode.lua index c785361..60f6c38 100644 --- a/lua/spike/dap/dapmode.lua +++ b/lua/spike/dap/dapmode.lua @@ -3,6 +3,7 @@ local daputils = require 'spike.dap.utils' local M = {} M.layer = nil +_BLOB42_DAPMODE_LOADED = _BLOB42_DAPMODE_LOADED or true local config = { diff --git a/lua/spike/utils/nvterm.lua b/lua/spike/utils/nvterm.lua index 336d360..b8e051a 100644 --- a/lua/spike/utils/nvterm.lua +++ b/lua/spike/utils/nvterm.lua @@ -29,7 +29,6 @@ M.run_cmd = function(input, opts) end M.rerun_last_cmd = function() - P(M.last_cmds) if #M.last_cmds > 0 then terminal.send(M.last_cmds[1]) end end diff --git a/mysnippets/python.lua b/mysnippets/python.lua index 09789fd..6db5b4f 100644 --- a/mysnippets/python.lua +++ b/mysnippets/python.lua @@ -22,4 +22,5 @@ return { })) }, { --autosnippets -- s("uuid#", f(gen_uuid)) + s("ret ", t("return ")) } diff --git a/plugin/spike/fzf-marks.lua.disabled b/plugin/spike/fzf-marks.lua.disabled index 51a1792..b01ec44 100644 --- a/plugin/spike/fzf-marks.lua.disabled +++ b/plugin/spike/fzf-marks.lua.disabled @@ -7,7 +7,6 @@ local M = {} local function fzf_display_bookmarks(bookmarks) - P(bookmarks) local fzf_exec_opts = { previewer = "builtin",