diff --git a/after/plugin/abolish.vim b/after/plugin/abolish.vim index f977eae..d658131 100644 --- a/after/plugin/abolish.vim +++ b/after/plugin/abolish.vim @@ -1,2 +1,5 @@ let g:abolish_save_file = "/home/spike/.config/nvim/after/plugin/abolish.vim" Abolish place{ho,h}ler{} placeholder +Abolish improt import +Abolish flase false +Abolish optinoal optional diff --git a/bob.json b/bob.json new file mode 100644 index 0000000..7b462b1 --- /dev/null +++ b/bob.json @@ -0,0 +1 @@ +{"tag_name":"nightly","target_commitish":"91d8f2ac534a51859c0e3c6562d07c94b27f4478","published_at":"2023-08-21T05:16:03Z"} \ No newline at end of file diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 0eb4e29..1730908 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -99,6 +99,10 @@ M.general = { --{{{ -- Copy all ["Y"] = { " %y+ ", "copy whole file" }, + + -- toggle undotree + ["U"] = { vim.cmd.UndotreeToggle, "toggle undotree panel" }, + -- line numbers ["N"] = { " set nu! set rnu!", "toggle line number" }, @@ -627,15 +631,19 @@ M.lspconfig = { --{{{ } } --}}} +local setup_dap = function() + local mydap = require("spike.dap") + local dap = require("dap") + mydap.setup() + return {dap, mydap} +end + M.dap = { -- {{{ plugin = true, n = { ["ds"] = { function() - local mydap = require("spike.dap") - local dap = require("dap") - - mydap.setup() + local dap, mydap = unpack (setup_dap()) require('spike.dap.utils').init_breakpoints() -- set a breakpoint at current line if there are none in -- the project @@ -688,6 +696,13 @@ M.dap = { -- {{{ }, ["dt"] = { "lua require'dapui'.toggle()", "[dap] toggle UI" }, }, + v = { + ["d"] = { function() + if vim.o.filetype == 'python' then + require('dap-python').debug_selection() + end + end, "dap debug visual selection" }, + }, } -- }}} diff --git a/lua/custom/plugins/configs/code-gpt.lua b/lua/custom/plugins/configs/code-gpt.lua index eba3d6a..1d31285 100644 --- a/lua/custom/plugins/configs/code-gpt.lua +++ b/lua/custom/plugins/configs/code-gpt.lua @@ -8,6 +8,12 @@ local M = {} M.setup = function() vim.g["codegpt_commands"] = { + ["q4"] = { + callback_type = "text_popup", + system_message_template = "You are a {{filetype}} software pair assistant AI. Answer my questions. Think step by step out loud.", + user_message_template = "I have a question about the following {{language}} code: ```{{filetype}} {{text_selection}}``` {{command_args}}" + + }, ["tests"] = { language_instructions = { python = "Use pytest framework." diff --git a/lua/custom/plugins/configs/todo-comments.lua b/lua/custom/plugins/configs/todo-comments.lua index 1a63bc2..0efb391 100644 --- a/lua/custom/plugins/configs/todo-comments.lua +++ b/lua/custom/plugins/configs/todo-comments.lua @@ -16,9 +16,9 @@ local config = { alt = {"TODO!"}, -- a set of other keywords that all map to this FIX keywords }, LEARN = { color = "hint" }, - WIP = { color = "default"}, + WIP = { color = "default", alt = {"REFACT"}}, NOTE = { alt = { "TIP", "INFO", "TRICK", "RELEASE"}}, - DEBUG = {}, + DEBUG = { alt = { "DBG", }, color = "debug" }, REVIEW = { color = "info" } }, colors = { @@ -26,7 +26,8 @@ local config = { info = {colors.blue}, default = {colors.nord_blue}, warning = {colors.orange}, - error = { colors.pink } + error = { colors.red }, + debug = { colors.purple } }, highlight = { -- multiline = false, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 51f3b65..120b7f7 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -56,7 +56,7 @@ return { ["nvim-treesitter/nvim-treesitter"] = { -- {{{ -- commit = "4f8b2480", -- pin to latest working commit -- custom config in chadrc -> custom.configs.treesitter - lock = true, + lock = false, setup = function() require("core.lazy_load").on_file_open "nvim-treesitter" require("core.lazy_load").on_file_open "nvim-treesitter-textobjects" @@ -67,7 +67,7 @@ return { end, }, ["nvim-treesitter/nvim-treesitter-textobjects"] = { - lock = true, + lock = false, opt = true, }, -- ["RRethy/nvim-treesitter-textsubjects"] = { @@ -75,7 +75,7 @@ return { -- }, ["ziontee113/syntax-tree-surfer"] = { - lock = true, + lock = false, opt = true, config = function() require("syntax-tree-surfer").setup() @@ -85,14 +85,14 @@ return { -- https://git.blob42.xyz/blob42/playground/commit/460fe1b3e3b2971c52c5f02a7dbbb132f1f30584 ["nvim-treesitter/playground"] = { -- ["https://git.blob42.xyz/blob42/playground"] = { - lock = true, + lock = false, -- opt = true, cmd = { "TSPlayground*" }, -- commit = "460fe1b3e3b2971c52c5f02a7dbbb132f1f30584", }, ["nvim-treesitter/nvim-treesitter-context"] = { - lock = true, + lock = false, opt = true, config = function() require("custom.plugins.configs.treesitter-context").setup() @@ -280,6 +280,10 @@ return { -- end }, + ["mbbill/undotree"] = { + cmd = {"UndotreeToggle"} + }, + -- helper to select icons and fonts ["ziontee113/icon-picker.nvim"] = { @@ -301,7 +305,7 @@ return { -- dap - ["mfussenegger/nvim-dap"] = { -- {{{ + ["mfussenegger/nvim-dap"] = { -- lock = true, module = {"dap"}, setup = function() @@ -317,8 +321,14 @@ return { after = {"nvim-dap"}, config = function() -- expand share folder - venv_path = vim.fn.stdpath('data') .. '/mason/packages/debugpy/venv/bin/python' - require('dap-python').setup(venv_path) + local venv_path = vim.fn.stdpath('data') .. '/mason/packages/debugpy/venv/bin/python' + local ok, dappy = pcall(require, 'dap-python') + if not ok then + vim.notify("dap-python not found", vim.log.levels.ERROR) + return + end + dappy.setup(venv_path) + dappy.test_runner = 'pytest' end, cond = function() -- filetype is python @@ -342,7 +352,7 @@ return { config = function() require("custom.plugins.configs.dap-virt-text").setup_virt_text() end - }, -- }}} + }, -- User Interface / UX ["stevearc/dressing.nvim"] = { diff --git a/lua/custom/plugins/nvchadui.lua b/lua/custom/plugins/nvchadui.lua index 4679199..733cf25 100644 --- a/lua/custom/plugins/nvchadui.lua +++ b/lua/custom/plugins/nvchadui.lua @@ -106,11 +106,11 @@ return { end, LSP_progress = function() - if not rawget(vim, "lsp") then + if not rawget(vim, "lsp") or vim.lsp.status then return "" end - local Lsp = vim.lsp.util.get_progress_messages()[1] + local Lsp = vim.lsp.status()[1] -- hide spammy null-ls progress if Lsp and Lsp.name:match "null%-ls" then diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 602f48a..6acf8e6 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -171,6 +171,24 @@ local options = { { name = "copilot", priority = 100, group_index = 2 }, { name = "path", group_index = 2 }, }, + sorting = { + priority_weight = 2, + comparators = { + require("copilot_cmp.comparators").prioritize, + + -- Below is the default comparitor list and order for nvim-cmp + cmp.config.compare.offset, + -- cmp.config.compare.scopes, --this is commented in nvim-cmp too + cmp.config.compare.exact, + cmp.config.compare.score, + cmp.config.compare.recently_used, + cmp.config.compare.locality, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, } -- check for any override diff --git a/lua/theme/highlights/init.lua b/lua/theme/highlights/init.lua index 4e6c5d3..5b05e04 100644 --- a/lua/theme/highlights/init.lua +++ b/lua/theme/highlights/init.lua @@ -29,6 +29,7 @@ M.blankline = function() -- indentline Group.new("IndentBlanklineChar", colors.background) Group.new("IndentBlanklineContextChar", colors.primary) + Group.new("IndentBlanklineContextStart", nil, colors.base02) end M.show_blank_tabs = function() @@ -46,12 +47,14 @@ M.setup = function() Group.new("Error", colors.primary, nil, styles.underline) + Group.new("Visual", colors.background, colors.base0D) + -- search -- select -- menus - Group.new("PmenuSel", nil, colors.noir_8 ) + Group.new("PmenuSel", nil, colors.noir_6 ) Group.new('LineNr', colors.gray2:light()) Group.new('CursorLineNr', colors.gray3) diff --git a/mysnippets/python.lua b/mysnippets/python.lua index b0d010e..60882d7 100644 --- a/mysnippets/python.lua +++ b/mysnippets/python.lua @@ -26,6 +26,9 @@ return { -- mypy reveal_type s("revl", fmt([[reveal_type({})]], {i(1)})), + + -- quick print debug + s("dbgp", fmt([[print(f"---\n\n{{{}}}---\n\n")]], {i(0)})), }, { --autosnippets -- s("uuid#", f(gen_uuid)) s("ret ", t("return ")), diff --git a/packer_snapshot b/packer_snapshot new file mode 100644 index 0000000..9ad992e --- /dev/null +++ b/packer_snapshot @@ -0,0 +1 @@ +{"extensions": {"commit": "7098870"}, "nvim-noirbuddy": {"commit": "d6125a2"}, "nvim-dap": {"commit": "1c63f37"}, "guihua.lua": {"commit": "9a15128"}, "plantuml-syntax": {"commit": "845abb5"}, "telescope-fzf-native.nvim": {"commit": "9bc8237"}, "vim-vimux": {"commit": "a62c16c"}, "Comment.nvim": {"commit": "0236521"}, "vim-surround": {"commit": "3d188ed"}, "nvim-lspconfig": {"commit": "c0de180"}, "playground": {"commit": "2b81a01"}, "CodeGPT.nvim": {"commit": "6e3714e"}, "go.nvim": {"commit": "7e5602d"}, "vim-table-mode": {"commit": "9555a3e"}, "vim-fugitive": {"commit": "b3b838d"}, "vim-dadbod-ui": {"commit": "200aebf"}, "ChatGPT.nvim": {"commit": "2107f70"}, "nvim-dap-virtual-text": {"commit": "ab988db"}, "null-ls.nvim": {"commit": "33b853a"}, "vim-argwrap": {"commit": "feaba6b"}, "base46": {"commit": "be301b2"}, "telescope-vim-bookmarks.nvim": {"commit": "92498cb"}, "which-key.nvim": {"commit": "4acffc9"}, "colorbuddy.nvim": {"commit": "8508c6f"}, "nvim-treesitter-textobjects": {"commit": "5627216"}, "nvim-autopairs": {"commit": "ae5b41c"}, "nvterm": {"commit": "5ae78fb"}, "ccc.nvim": {"commit": "4a0ddaf"}, "cmp_luasnip": {"commit": "1809552"}, "friendly-snippets": {"commit": "bc38057"}, "leap.nvim": {"commit": "5efe985"}, "vim-slumlord": {"commit": "5c34739"}, "live-command.nvim": {"commit": "bc7e094"}, "tabular": {"commit": "339091a"}, "nui.nvim": {"commit": "9e3916e"}, "nvim-libmodal": {"commit": "875636e"}, "vim-bookmarks": {"commit": "9cc5fa7"}, "rust-tools.nvim": {"commit": "0cc8ada"}, "todo-comments.nvim": {"commit": "8febc60"}, "gitsigns.nvim": {"commit": "bae45ef"}, "delaytrain.nvim": {"commit": "eb8d215"}, "indent-blankline.nvim": {"commit": "4541d69"}, "mason-lspconfig.nvim": {"commit": "e86a4c8"}, "dressing.nvim": {"commit": "db716a0"}, "info.vim.git": {"commit": "f5947fd"}, "packer.nvim": {"commit": "1d0cf98"}, "telescope.nvim": {"commit": "dc192fa"}, "lsp_signature.nvim": {"commit": "9616a1a"}, "nvim-cmp": {"commit": "c4e491a"}, "plantuml-previewer.vim": {"commit": "1dd4d0f"}, "mason.nvim": {"commit": "fe9e34a"}, "copilot-cmp": {"commit": "d631b3a"}, "icon-picker.nvim": {"commit": "e6dca18"}, "aerial.nvim": {"commit": "de460a4"}, "ui": {"commit": "a7445f5"}, "cmp-nvim-lsp": {"commit": "44b16d1"}, "LuaSnip": {"commit": "99a94cc"}, "zk-nvim": {"commit": "2755788"}, "restore_view.vim": {"commit": "8b93343"}, "nvim-dap-ui": {"commit": "1e21b3b"}, "neorepl.nvim": {"commit": "bc819bb"}, "nvim-web-devicons": {"commit": "eb8f80f"}, "vim-repeat": {"commit": "24afe92"}, "grapple.nvim": {"commit": "ab274a3"}, "vim-jukit": {"commit": "ae16294"}, "nvim-treesitter": {"commit": "620b60b"}, "overseer.nvim": {"commit": "4f8ea34"}, "venn.nvim": {"commit": "c114563"}, "impatient.nvim": {"commit": "47302af"}, "nvim-projectconfig": {"commit": "05fd348"}, "nvim-colorizer.lua": {"commit": "3e7c1e0"}, "vim-dadbod": {"commit": "7d80bbd"}, "vim-abolish": {"commit": "cb3dcb2"}, "vim-tmux-navigator": {"commit": "cdd66d6"}, "navigator.lua": {"commit": "4ba2c95"}, "undotree": {"commit": "0e11ba7"}, "asyncrun.vim": {"commit": "0f99f96"}, "diffview.nvim": {"commit": "500d8b2"}, "nvim-tree.lua": {"commit": "9e87ee2"}, "fzf-lua": {"commit": "c56c492"}, "syntax-tree-surfer": {"commit": "6571f0f"}, "refactoring.nvim": {"commit": "5359e74"}, "nvim-dap-python": {"commit": "37b4cba"}, "copilot.lua": {"commit": "50ca36f"}, "plenary.nvim": {"commit": "267282a"}, "iron.nvim": {"commit": "7f876ee"}, "tmpl.vim": {"commit": "c6c1d6b"}, "nvim-treesitter-context": {"commit": "14856c9"}, "vim-snippets": {"commit": "76e35f3"}, "vim-lexical": {"commit": "9204fca"}, "neodev.nvim": {"commit": "7e3f718"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}} diff --git a/plugin/spike/commands.lua b/plugin/spike/commands.lua new file mode 100644 index 0000000..e641a42 --- /dev/null +++ b/plugin/spike/commands.lua @@ -0,0 +1,11 @@ +local command = vim.api.nvim_create_user_command +local del_command = vim.api.nvim_del_user_command + + +command("DapPyMethod", function() + require("dap-python").test_method() +end, {}) + +command("DapPyClass", function() + require("dap-python").test_class() +end, {})