diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index ef162a4..b614c56 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -1143,4 +1143,21 @@ M.null_ls = { } } +M.venn = { + plugin = true, + n = { + ["nv"] = { "lua require'custom.plugins.configs.venn'.disable()", "disable venn" }, + } +} + +M.iconpicker = { + plugin = true, + n = { + ["ip"] = { "IconPickerNormal", "Icon Picker" }, + }, + i = { + ["ip"] = { "IconPickerInsert", "icon picker insert" }, + } +} + return M diff --git a/lua/custom/plugins/configs/code-gpt.lua b/lua/custom/plugins/configs/code-gpt.lua index 6c65ea9..d398fb7 100644 --- a/lua/custom/plugins/configs/code-gpt.lua +++ b/lua/custom/plugins/configs/code-gpt.lua @@ -15,9 +15,9 @@ M.setup = function() }, ["docu4"] = { system_message_template = "You are a technical documentation assistant to a software developer. You will help improving project documentation.", - user_message_template = "Improve the following text: ```{{text_selection}}```\n. Use a professional. Write as if you are writing a python project documentation for a Github repo. {{command_args}}" + user_message_template = "Improve the following text: ```{{text_selection}}```\n. Use a professional. Write as if you are writing a python project documentation for a Github repo. {{command_args}}", + model = "gpt-4" }, - model = "gpt-4" } end diff --git a/lua/custom/plugins/configs/venn.lua b/lua/custom/plugins/configs/venn.lua new file mode 100644 index 0000000..4dde609 --- /dev/null +++ b/lua/custom/plugins/configs/venn.lua @@ -0,0 +1,31 @@ +local M = {} + +M.enable = function() + local venn_enabled = vim.inspect(vim.b.venn_enabled) + if venn_enabled == "nil" then + vim.b.venn_enabled = true + vim.cmd[[setlocal ve=all]] + -- draw a line on HJKL keystokes + vim.api.nvim_buf_set_keymap(0, "n", "J", "j:VBox", {noremap = true}) + vim.api.nvim_buf_set_keymap(0, "n", "K", "k:VBox", {noremap = true}) + vim.api.nvim_buf_set_keymap(0, "n", "L", "l:VBox", {noremap = true}) + vim.api.nvim_buf_set_keymap(0, "n", "H", "h:VBox", {noremap = true}) + -- draw a box by pressing "f" with visual selection + vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox", {noremap = true}) + else + vim.cmd[[setlocal ve=]] + vim.cmd[[mapclear ]] + vim.b.venn_enabled = nil + end +end + +M.disable = function() + local venn_enabled = vim.inspect(vim.b.venn_enabled) + if venn_enabled ~= "nil" then + vim.cmd[[setlocal ve=]] + vim.cmd[[mapclear ]] + vim.b.venn_enabled = nil + end +end + +return M diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 740205e..7fd9264 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -280,6 +280,19 @@ return { }, + -- helper to select icons and fonts + ["ziontee113/icon-picker.nvim"] = { + cmd = {"IconPicker*"}, + setup = function() + require("core.utils").load_mappings "iconpicker" + end, + config = function() + require("icon-picker").setup({ + disable_legacy_commands = true + }) + end, + }, + -- ["p00f/nvim-ts-rainbow"] = { -- opt = true, -- }, @@ -817,6 +830,15 @@ return { -- ft = {"plantuml"}, }, + -- Diagram Tools + ["jbyuki/venn.nvim"] = { + keys = { "V" }, + config = function() + require("custom.plugins.configs.venn").enable() + require("core.utils").load_mappings "venn" + end, + }, + -- sql tools -- https://github.com/tpope/vim-dadbod -- https://github.com/kristijanhusak/vim-dadbod-ui