diff options
author | Matthew Lemon <y@yulqen.org> | 2023-04-07 20:01:40 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-04-07 20:01:40 +0100 |
commit | 3fde8747b178ab76788e245419653f3c173a2abc (patch) | |
tree | 617ec47d8b7a3d81fb4899b3abc9b2eb014ba0fb /nvim | |
parent | 6ad9ebb4d05d0f5de73a76b81464db2b673251d0 (diff) |
Removes harpoon, etc and adds neotest
This also removes treesitter-playground and is a basic install of
neotest and neotest-python.
Diffstat (limited to 'nvim')
-rw-r--r-- | nvim/after/plugin/harpoon.lua | 12 | ||||
-rw-r--r-- | nvim/after/plugin/lsp.lua | 2 | ||||
-rw-r--r-- | nvim/after/plugin/luasnip.lua | 46 | ||||
-rw-r--r-- | nvim/after/plugin/neotest-python.lua | 28 | ||||
-rw-r--r-- | nvim/lua/lemon/packer.lua | 17 | ||||
-rw-r--r-- | nvim/lua/lemon/remap.lua | 2 | ||||
-rw-r--r-- | nvim/plugin/packer_compiled.lua | 53 |
7 files changed, 129 insertions, 31 deletions
diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua deleted file mode 100644 index 4a6ba87..0000000 --- a/nvim/after/plugin/harpoon.lua +++ /dev/null @@ -1,12 +0,0 @@ -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -vim.keymap.set("n", "<leader>a", mark.add_file) -vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu) - -vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end) -vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end) -vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end) -vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end) - - diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index e644f74..c54e03b 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -35,7 +35,7 @@ lsp.setup_nvim_cmp({ }) lsp.set_preferences({ - suggest_lsp_servers = false, + suggest_lsp_servers = true, sign_icons = { error = 'E', warn = 'W', diff --git a/nvim/after/plugin/luasnip.lua b/nvim/after/plugin/luasnip.lua new file mode 100644 index 0000000..6ff1131 --- /dev/null +++ b/nvim/after/plugin/luasnip.lua @@ -0,0 +1,46 @@ +local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil +end + +local luasnip = require("luasnip") +local cmp = require("cmp") + +cmp.setup({ + + -- ... Your other configuration ... + + mapping = { + + -- ... Your other mappings ... + + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + + -- ... Your other mappings ... + }, + + -- ... Your other configuration ... +}) diff --git a/nvim/after/plugin/neotest-python.lua b/nvim/after/plugin/neotest-python.lua new file mode 100644 index 0000000..9df429d --- /dev/null +++ b/nvim/after/plugin/neotest-python.lua @@ -0,0 +1,28 @@ +require("neotest").setup({ + adapters = { + require("neotest-python")({ + -- Extra arguments for nvim-dap configuration + -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values + dap = { justMyCode = false }, + -- Command line arguments for runner + -- Can also be a function to return dynamic values + args = {"--log-level", "DEBUG"}, + -- Runner to use. Will use pytest if available by default. + -- Can be a function to return dynamic value. + runner = "pytest", + -- Custom python path for the runner. + -- Can be a string or a list of strings. + -- Can also be a function to return dynamic value. + -- If not provided, the path will be inferred by checking for + -- virtual envs in the local directory and for Pipenev/Poetry configs + python = ".venv/bin/python", + -- Returns if a given file path is a test file. + -- NB: This function is called a lot so don't perform any heavy tasks within it. + }) + } +}) + +require("neodev").setup({ + library = { plugins = { "neotest" }, types = true }, + ... +}) diff --git a/nvim/lua/lemon/packer.lua b/nvim/lua/lemon/packer.lua index 61948cf..4a66fc2 100644 --- a/nvim/lua/lemon/packer.lua +++ b/nvim/lua/lemon/packer.lua @@ -35,11 +35,10 @@ return require('packer').startup(function(use) use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) - use("nvim-treesitter/playground") - use("theprimeagen/harpoon") -- use("theprimeagen/refactoring.nvim") use("mbbill/undotree") use("tpope/vim-fugitive") + use("tpope/vim-commentary") use("nvim-treesitter/nvim-treesitter-context"); use { @@ -68,7 +67,19 @@ return require('packer').startup(function(use) use("folke/zen-mode.nvim") use("github/copilot.vim") use("eandrju/cellular-automaton.nvim") --- use("laytan/cloak.nvim") + -- use("laytan/cloak.nvim") + use("jlanzarotta/bufexplorer") + use { + "nvim-neotest/neotest", + requires = { + "nvim-neotest/neotest-python", + "nvim-neotest/neotest-plenary", + "folke/neodev.nvim", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim" + } + } end) diff --git a/nvim/lua/lemon/remap.lua b/nvim/lua/lemon/remap.lua index 3999c8a..4151214 100644 --- a/nvim/lua/lemon/remap.lua +++ b/nvim/lua/lemon/remap.lua @@ -1,5 +1,5 @@ -vim.g.mapleader = " " +vim.g.mapleader = "," vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua index 84c5906..8ddac8b 100644 --- a/nvim/plugin/packer_compiled.lua +++ b/nvim/plugin/packer_compiled.lua @@ -74,11 +74,21 @@ end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { + ["FixCursorHold.nvim"] = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", + url = "https://github.com/antoinemadec/FixCursorHold.nvim" + }, LuaSnip = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/LuaSnip", url = "https://github.com/L3MON4D3/LuaSnip" }, + bufexplorer = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/bufexplorer", + url = "https://github.com/jlanzarotta/bufexplorer" + }, ["cellular-automaton.nvim"] = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/cellular-automaton.nvim", @@ -119,11 +129,6 @@ _G.packer_plugins = { path = "/home/lemon/.local/share/nvim/site/pack/packer/start/friendly-snippets", url = "https://github.com/rafamadriz/friendly-snippets" }, - harpoon = { - loaded = true, - path = "/home/lemon/.local/share/nvim/site/pack/packer/start/harpoon", - url = "https://github.com/theprimeagen/harpoon" - }, ["lsp-zero.nvim"] = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", @@ -139,6 +144,26 @@ _G.packer_plugins = { path = "/home/lemon/.local/share/nvim/site/pack/packer/start/mason.nvim", url = "https://github.com/williamboman/mason.nvim" }, + ["neodev.nvim"] = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/neodev.nvim", + url = "https://github.com/folke/neodev.nvim" + }, + neotest = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/neotest", + url = "https://github.com/nvim-neotest/neotest" + }, + ["neotest-plenary"] = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/neotest-plenary", + url = "https://github.com/nvim-neotest/neotest-plenary" + }, + ["neotest-python"] = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/neotest-python", + url = "https://github.com/nvim-neotest/neotest-python" + }, ["nvim-cmp"] = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/nvim-cmp", @@ -164,11 +189,6 @@ _G.packer_plugins = { path = "/home/lemon/.local/share/nvim/site/pack/packer/start/packer.nvim", url = "https://github.com/wbthomason/packer.nvim" }, - playground = { - loaded = true, - path = "/home/lemon/.local/share/nvim/site/pack/packer/start/playground", - url = "https://github.com/nvim-treesitter/playground" - }, ["plenary.nvim"] = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/plenary.nvim", @@ -196,6 +216,11 @@ _G.packer_plugins = { path = "/home/lemon/.local/share/nvim/site/pack/packer/start/undotree", url = "https://github.com/mbbill/undotree" }, + ["vim-commentary"] = { + loaded = true, + path = "/home/lemon/.local/share/nvim/site/pack/packer/start/vim-commentary", + url = "https://github.com/tpope/vim-commentary" + }, ["vim-fugitive"] = { loaded = true, path = "/home/lemon/.local/share/nvim/site/pack/packer/start/vim-fugitive", @@ -209,14 +234,14 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) --- Config for: rose-pine -time([[Config for rose-pine]], true) -try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\26colorscheme rose-pine\bcmd\bvim\0", "config", "rose-pine") -time([[Config for rose-pine]], false) -- Config for: trouble.nvim time([[Config for trouble.nvim]], true) try_loadstring("\27LJ\2\nC\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\nicons\1\nsetup\ftrouble\frequire\0", "config", "trouble.nvim") time([[Config for trouble.nvim]], false) +-- Config for: rose-pine +time([[Config for rose-pine]], true) +try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\26colorscheme rose-pine\bcmd\bvim\0", "config", "rose-pine") +time([[Config for rose-pine]], false) _G._packer.inside_compile = false if _G._packer.needs_bufread == true then |