mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-22 07:44:13 +00:00
Start refactoring to lazy specs in different files
This commit is contained in:
parent
1cacca0905
commit
c4dd78d1e8
@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
"lsp_signature.nvim": {
|
"lsp_signature.nvim": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b"
|
"commit": "5b64964ed02098c85613ee3d20f96bed1dfb64cc"
|
||||||
},
|
},
|
||||||
"lualine.nvim": {
|
"lualine.nvim": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
@ -117,7 +117,7 @@
|
|||||||
},
|
},
|
||||||
"nvim-dap-ui": {
|
"nvim-dap-ui": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"commit": "e94d98649dccb6a3884b66aabc2e07beb279e535"
|
"commit": "727c032a8f63899baccb42a1c26f27687e62fc5e"
|
||||||
},
|
},
|
||||||
"nvim-lspconfig": {
|
"nvim-lspconfig": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
@ -133,7 +133,7 @@
|
|||||||
},
|
},
|
||||||
"nvim-notify": {
|
"nvim-notify": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"commit": "bd9cd51f9ef2f6326fc2bc9931d0718c1794e247"
|
"commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17"
|
||||||
},
|
},
|
||||||
"nvim-solarized-lua": {
|
"nvim-solarized-lua": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
@ -141,7 +141,7 @@
|
|||||||
},
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"commit": "8ca76960ae75e0a3bb231402558eb50e79433161"
|
"commit": "306dd6e9dc806db1d79568d26e1c9b6c98b95fbc"
|
||||||
},
|
},
|
||||||
"nvim-treesitter-textobjects": {
|
"nvim-treesitter-textobjects": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
@ -269,7 +269,7 @@
|
|||||||
},
|
},
|
||||||
"wombat.nvim": {
|
"wombat.nvim": {
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"commit": "e41359fa29d1e09ae8339b8f4f1f0c2be2cb82fa"
|
"commit": "5b50320c994aca444e56f47ca86806651831e9ea"
|
||||||
},
|
},
|
||||||
"wombat256.vim": {
|
"wombat256.vim": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
|
25
neovim/lua/lazy/colorschemes.lua
Normal file
25
neovim/lua/lazy/colorschemes.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
local utils = require("utils")
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"https://github.com/ViViDboarder/wombat.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"https://github.com/rktjmp/lush.nvim",
|
||||||
|
tag = utils.map_version_rule({
|
||||||
|
[">=0.7.0"] = utils.nil_val,
|
||||||
|
[">=0.5.0"] = "v1.0.1",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
{ "https://github.com/vim-scripts/wombat256.vim" },
|
||||||
|
{ "https://github.com/ishan9299/nvim-solarized-lua" },
|
||||||
|
{
|
||||||
|
"https://github.com/folke/tokyonight.nvim",
|
||||||
|
-- Install fish theme
|
||||||
|
build = 'fish -c \'echo "set --path --prepend fish_themes_path "(pwd)"/extras" > ~/.config/fish/conf.d/tokyonight.fish\' || true', -- luacheck: no max line length
|
||||||
|
},
|
||||||
|
priority = 1000,
|
||||||
|
}
|
61
neovim/lua/lazy/completion.lua
Normal file
61
neovim/lua/lazy/completion.lua
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
local utils = require("utils")
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"https://github.com/L3MON4D3/LuaSnip",
|
||||||
|
version = "2.x.x",
|
||||||
|
event = "InsertEnter *",
|
||||||
|
config = function()
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/rafamadriz/friendly-snippets" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/hrsh7th/cmp-nvim-lsp",
|
||||||
|
commit = utils.map_version_rule({
|
||||||
|
[">=0.7.0"] = utils.nil_val,
|
||||||
|
["<0.7.0"] = "3cf38d9c957e95c397b66f91967758b31be4abe6",
|
||||||
|
}),
|
||||||
|
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
||||||
|
event = "InsertEnter *",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/hrsh7th/cmp-buffer",
|
||||||
|
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
||||||
|
event = "InsertEnter *",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/f3fora/cmp-spell",
|
||||||
|
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
||||||
|
event = "InsertEnter *",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/saadparwaiz1/cmp_luasnip",
|
||||||
|
commit = utils.map_version_rule({
|
||||||
|
[">0.7.0"] = utils.nil_val,
|
||||||
|
[">=0.5.0"] = "b10829736542e7cc9291e60bab134df1273165c9",
|
||||||
|
}),
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/hrsh7th/nvim-cmp" },
|
||||||
|
{ "https://github.com/L3MON4D3/LuaSnip" },
|
||||||
|
},
|
||||||
|
event = "InsertEnter *",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"https://github.com/hrsh7th/nvim-cmp",
|
||||||
|
config = function()
|
||||||
|
require("plugins.completion").config_cmp()
|
||||||
|
end,
|
||||||
|
commit = utils.map_version_rule({
|
||||||
|
[">=0.7.0"] = utils.nil_val,
|
||||||
|
[">=0.5.0"] = "bba6fb67fdafc0af7c5454058dfbabc2182741f4",
|
||||||
|
}),
|
||||||
|
event = "InsertEnter *",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Add snippets
|
||||||
|
event = "InsertEnter *",
|
||||||
|
}
|
48
neovim/lua/lazy/copilot.lua
Normal file
48
neovim/lua/lazy/copilot.lua
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"https://github.com/github/copilot.vim",
|
||||||
|
enabled = vim.g.install_copilot,
|
||||||
|
version = "1.x.x",
|
||||||
|
config = function()
|
||||||
|
require("plugins.copilot")
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
-- To avoid keymapping conflicts with Ctrl+F, load vim-rsi first
|
||||||
|
{ "https://github.com/tpope/vim-rsi" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"https://github.com/CopilotC-Nvim/CopilotChat.nvim",
|
||||||
|
enabled = vim.g.install_copilot,
|
||||||
|
version = "3.x.x",
|
||||||
|
build = "make tiktoken",
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/github/copilot.vim" },
|
||||||
|
{ "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("plugins.copilotchat").setup()
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>cc", ":echo 'Lazy load copilot chat'<cr>", desc = "Load copilot chat" },
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
"CopilotChat",
|
||||||
|
"CopilotChatOpen",
|
||||||
|
"CopilotChatToggle",
|
||||||
|
"CopilotChatModels",
|
||||||
|
"CopilotChatExplain",
|
||||||
|
"CopilotChatReview",
|
||||||
|
"CopilotChatOptimize",
|
||||||
|
"CopilotChatDocs",
|
||||||
|
"CopilotChatTests",
|
||||||
|
"CopilotChatFixDiagnostic",
|
||||||
|
"CopilotChatCommit",
|
||||||
|
"CopilotChatCommitStaged",
|
||||||
|
},
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
|
}
|
103
neovim/lua/lazy/dap.lua
Normal file
103
neovim/lua/lazy/dap.lua
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
local utils = require("utils")
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"https://github.com/mfussenegger/nvim-dap",
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
local dap_mapping = utils.curry_keymap("n", "<leader>d", {
|
||||||
|
group_desc = "Debugging",
|
||||||
|
silent = true,
|
||||||
|
noremap = true,
|
||||||
|
})
|
||||||
|
dap_mapping("d", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
||||||
|
dap_mapping("b", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
||||||
|
dap_mapping("p", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
||||||
|
|
||||||
|
dap_mapping("c", dap.continue, { desc = "Continue" })
|
||||||
|
dap_mapping("C", dap.run_to_cursor, { desc = "Run to cursor" })
|
||||||
|
dap_mapping("s", dap.stop, { desc = "Stop" })
|
||||||
|
dap_mapping("n", dap.step_over, { desc = "Step over" })
|
||||||
|
dap_mapping("i", dap.step_into, { desc = "Step into" })
|
||||||
|
dap_mapping("O", dap.step_out, { desc = "Step out" })
|
||||||
|
|
||||||
|
-- dap_mapping("h", dap.toggle_hover, { desc = "Toggle hover" })
|
||||||
|
dap_mapping("D", dap.disconnect, { desc = "Disconnect" })
|
||||||
|
-- dap_mapping("r", dap.repl.open, { desc = "Open REPL" })
|
||||||
|
-- dap_mapping("R", dap.repl.run_last, { desc = "Run last" })
|
||||||
|
|
||||||
|
local icons = require("icons")
|
||||||
|
|
||||||
|
-- Set dap signs
|
||||||
|
vim.fn.sign_define(
|
||||||
|
"DapBreakpoint",
|
||||||
|
{ text = icons.debug_icons.breakpoint, texthl = "", linehl = "", numhl = "" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.fn.sign_define(
|
||||||
|
"DapLogPoint",
|
||||||
|
{ text = icons.debug_icons.log_point, texthl = "", linehl = "", numhl = "" }
|
||||||
|
)
|
||||||
|
vim.fn.sign_define(
|
||||||
|
"DapBreakpointCondition",
|
||||||
|
{ text = icons.debug_icons.conditional_breakpoint, texthl = "", linehl = "", numhl = "" }
|
||||||
|
)
|
||||||
|
vim.fn.sign_define("DapStopped", { text = icons.debug_icons.current, texthl = "", linehl = "", numhl = "" })
|
||||||
|
vim.fn.sign_define(
|
||||||
|
"DapBreakpointRejected",
|
||||||
|
{ text = icons.debug_icons.breakpoint_rejected, texthl = "", linehl = "", numhl = "" }
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/rcarriga/nvim-dap-ui",
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/mfussenegger/nvim-dap" },
|
||||||
|
{ "nvim-neotest/nvim-nio" },
|
||||||
|
},
|
||||||
|
lazy = true,
|
||||||
|
opts = {
|
||||||
|
icons = {
|
||||||
|
expanded = require("icons").fold.open,
|
||||||
|
collapsed = require("icons").fold.closed,
|
||||||
|
current_frame = ">",
|
||||||
|
},
|
||||||
|
controls = {
|
||||||
|
icons = require("icons").debug_control_icons,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("dapui").setup(opts)
|
||||||
|
|
||||||
|
local dap, dapui = require("dap"), require("dapui")
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
-- Auto open on initialization
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
-- Auto close on termination
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
-- Auto close on exit
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"https://github.com/mfussenegger/nvim-dap-python",
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/rcarriga/nvim-dap-ui" },
|
||||||
|
{ "https://github.com/mfussenegger/nvim-dap" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- This is where pipx is installing debugpy via ./install-helpers.py
|
||||||
|
-- Could maybe detect by doing a which debugpy and then reading the interpreter
|
||||||
|
-- from the shebang line.
|
||||||
|
require("dap-python").setup("~/.local/pipx/venvs/debugpy/bin/python3")
|
||||||
|
end,
|
||||||
|
ft = { "python" },
|
||||||
|
},
|
||||||
|
}
|
86
neovim/lua/lazy/language_servers.lua
Normal file
86
neovim/lua/lazy/language_servers.lua
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
local utils = require("utils")
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"https://github.com/neovim/nvim-lspconfig",
|
||||||
|
version = utils.map_version_rule({
|
||||||
|
[">=0.8.0"] = "v0.1.*",
|
||||||
|
[">=0.7.0"] = "v0.1.7",
|
||||||
|
[">=0.6.1"] = "v0.1.2",
|
||||||
|
[">=0.6.0"] = "v0.1.0",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Language server installer
|
||||||
|
"https://github.com/williamboman/mason.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/neovim/nvim-lspconfig" },
|
||||||
|
{ "https://github.com/williamboman/mason-lspconfig.nvim" },
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
"Mason",
|
||||||
|
"MasonInstall",
|
||||||
|
"MasonLog",
|
||||||
|
"MasonUninstall",
|
||||||
|
"MasonUninstallAll",
|
||||||
|
"MasonUpdate",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Neovim language server config
|
||||||
|
{
|
||||||
|
"https://github.com/folke/neodev.nvim",
|
||||||
|
dependencies = { { "https://github.com/neovim/nvim-lspconfig" } },
|
||||||
|
ft = { "lua" },
|
||||||
|
-- Disable for nvim 0.10 because there is lazydev
|
||||||
|
enabled = vim.fn.has("nvim-0.10") ~= 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"https://github.com/folke/lazydev.nvim",
|
||||||
|
dependencies = { { "https://github.com/neovim/nvim-lspconfig" } },
|
||||||
|
ft = "lua",
|
||||||
|
opts = {},
|
||||||
|
enabled = vim.fn.has("nvim-0.10") == 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Rust analyzer
|
||||||
|
"https://github.com/mrcjkb/rustaceanvim",
|
||||||
|
version = "^5",
|
||||||
|
-- Already loads on ft
|
||||||
|
lazy = false,
|
||||||
|
ft = { "rust" },
|
||||||
|
init = function()
|
||||||
|
local lsp = require("plugins.lsp")
|
||||||
|
vim.g.rustaceanvim = {
|
||||||
|
server = {
|
||||||
|
capabilities = lsp.merged_capabilities(),
|
||||||
|
on_attach = lsp.get_default_attach(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
enabled = vim.fn.has("nvim-0.10") == 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
-- Generic linter/formatters in diagnostics API
|
||||||
|
"https://github.com/nvimtools/none-ls.nvim",
|
||||||
|
-- This is lazy and configured after lsps loaded in plugins/lsp.lua
|
||||||
|
lazy = true,
|
||||||
|
branch = utils.map_version_rule({
|
||||||
|
[">=0.8.0"] = utils.nil_val,
|
||||||
|
[">=0.7.0"] = "0.7-compat",
|
||||||
|
["<0.7.0"] = utils.nil_val, -- use pinned commit
|
||||||
|
}),
|
||||||
|
commit = utils.map_version_rule({
|
||||||
|
[">=0.8.0"] = utils.nil_val,
|
||||||
|
[">=0.7.0"] = utils.nil_val, -- Use pinned branch
|
||||||
|
[">=0.6.0"] = "4b403d2d724f48150ded41189ae4866492a8158b",
|
||||||
|
}),
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/nvimtools/none-ls-extras.nvim" },
|
||||||
|
{ "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
|
{ "https://github.com/neovim/nvim-lspconfig" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
40
neovim/lua/lazy/obsidian.lua
Normal file
40
neovim/lua/lazy/obsidian.lua
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
-- #selene: allow(mixed_table)
|
||||||
|
|
||||||
|
-- Obsidian notes
|
||||||
|
-- This loads an Obsidian plugin for better vault interraction as well as auto pulls
|
||||||
|
-- and commits to my vault git repo. On iOS devices, I use Working Copy to sync the
|
||||||
|
-- repo and use Shortcuts to automate pulling on open and auto committing and pushing
|
||||||
|
-- after closing Obsidian.
|
||||||
|
return {
|
||||||
|
"https://github.com/epwalsh/obsidian.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
version = "3.x.x",
|
||||||
|
opts = {
|
||||||
|
workspaces = {
|
||||||
|
{ name = "personal", path = require("plugins.obsidian").vault_path },
|
||||||
|
},
|
||||||
|
ui = {
|
||||||
|
checkboxes = {
|
||||||
|
[" "] = { char = "☐", hl_group = "ObsidianTodo" },
|
||||||
|
["x"] = { char = "✔", hl_group = "ObsidianDone" },
|
||||||
|
},
|
||||||
|
external_link_icon = { char = "🔗", hl_group = "ObsidianExtLinkIcon" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("plugins.obsidian").config(opts)
|
||||||
|
end,
|
||||||
|
event = {
|
||||||
|
"BufRead " .. require("plugins.obsidian").vault_path .. "/**",
|
||||||
|
"BufNewFile " .. require("plugins.obsidian").vault_path .. "/**",
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
"ObsidianOpen",
|
||||||
|
"ObsidianNew",
|
||||||
|
"ObsidianSearch",
|
||||||
|
"ObsidianNewFromTemplate",
|
||||||
|
"ObsidianWorkspace",
|
||||||
|
},
|
||||||
|
}
|
@ -1,37 +1,7 @@
|
|||||||
-- #selene: allow(mixed_table)
|
-- #selene: allow(mixed_table)
|
||||||
local utils = require("utils")
|
local utils = require("utils")
|
||||||
return {
|
return {
|
||||||
{
|
{ import = "lazy.colorschemes" },
|
||||||
-- Colorschemes
|
|
||||||
{
|
|
||||||
"https://github.com/vim-scripts/wombat256.vim",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/ViViDboarder/wombat.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"https://github.com/rktjmp/lush.nvim",
|
|
||||||
tag = utils.map_version_rule({
|
|
||||||
[">=0.7.0"] = utils.nil_val,
|
|
||||||
[">=0.5.0"] = "v1.0.1",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/ishan9299/nvim-solarized-lua",
|
|
||||||
commit = utils.map_version_rule({
|
|
||||||
[">=0.7.0"] = utils.nil_val,
|
|
||||||
["<0.7.0"] = "faba49b",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/folke/tokyonight.nvim",
|
|
||||||
build = 'fish -c \'echo "set --path --prepend fish_themes_path "(pwd)"/extras" > ~/.config/fish/conf.d/tokyonight.fish\' || true', -- luacheck: no max line length
|
|
||||||
},
|
|
||||||
priority = 1000,
|
|
||||||
},
|
|
||||||
-- Some helpers
|
-- Some helpers
|
||||||
-- Auto and ends to some ifs and dos
|
-- Auto and ends to some ifs and dos
|
||||||
{ "https://github.com/tpope/vim-endwise" },
|
{ "https://github.com/tpope/vim-endwise" },
|
||||||
@ -56,6 +26,7 @@ return {
|
|||||||
|
|
||||||
-- Auto ctags generation
|
-- Auto ctags generation
|
||||||
{ "https://github.com/ludovicchabant/vim-gutentags" },
|
{ "https://github.com/ludovicchabant/vim-gutentags" },
|
||||||
|
|
||||||
-- Make it easier to discover some of my keymaps
|
-- Make it easier to discover some of my keymaps
|
||||||
{
|
{
|
||||||
"https://github.com/folke/which-key.nvim",
|
"https://github.com/folke/which-key.nvim",
|
||||||
@ -213,164 +184,9 @@ return {
|
|||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
|
|
||||||
-- Configure language servers
|
|
||||||
{
|
|
||||||
"https://github.com/neovim/nvim-lspconfig",
|
|
||||||
version = utils.map_version_rule({
|
|
||||||
[">=0.8.0"] = "v0.1.*",
|
|
||||||
[">=0.7.0"] = "v0.1.7",
|
|
||||||
[">=0.6.1"] = "v0.1.2",
|
|
||||||
[">=0.6.0"] = "v0.1.0",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Debug adapter protocol
|
-- Debug adapter protocol
|
||||||
{
|
{ import = "lazy.dap" },
|
||||||
"https://github.com/mfussenegger/nvim-dap",
|
{ import = "lazy.language_servers" },
|
||||||
config = function()
|
|
||||||
local dap = require("dap")
|
|
||||||
local dap_mapping = utils.curry_keymap("n", "<leader>d", {
|
|
||||||
group_desc = "Debugging",
|
|
||||||
silent = true,
|
|
||||||
noremap = true,
|
|
||||||
})
|
|
||||||
dap_mapping("d", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
|
||||||
dap_mapping("b", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
|
||||||
dap_mapping("p", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
|
||||||
|
|
||||||
dap_mapping("c", dap.continue, { desc = "Continue" })
|
|
||||||
dap_mapping("C", dap.run_to_cursor, { desc = "Run to cursor" })
|
|
||||||
dap_mapping("s", dap.stop, { desc = "Stop" })
|
|
||||||
dap_mapping("n", dap.step_over, { desc = "Step over" })
|
|
||||||
dap_mapping("i", dap.step_into, { desc = "Step into" })
|
|
||||||
dap_mapping("O", dap.step_out, { desc = "Step out" })
|
|
||||||
|
|
||||||
-- dap_mapping("h", dap.toggle_hover, { desc = "Toggle hover" })
|
|
||||||
dap_mapping("D", dap.disconnect, { desc = "Disconnect" })
|
|
||||||
-- dap_mapping("r", dap.repl.open, { desc = "Open REPL" })
|
|
||||||
-- dap_mapping("R", dap.repl.run_last, { desc = "Run last" })
|
|
||||||
|
|
||||||
local icons = require("icons")
|
|
||||||
|
|
||||||
-- Set dap signs
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"DapBreakpoint",
|
|
||||||
{ text = icons.debug_icons.breakpoint, texthl = "", linehl = "", numhl = "" }
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"DapLogPoint",
|
|
||||||
{ text = icons.debug_icons.log_point, texthl = "", linehl = "", numhl = "" }
|
|
||||||
)
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"DapBreakpointCondition",
|
|
||||||
{ text = icons.debug_icons.conditional_breakpoint, texthl = "", linehl = "", numhl = "" }
|
|
||||||
)
|
|
||||||
vim.fn.sign_define("DapStopped", { text = icons.debug_icons.current, texthl = "", linehl = "", numhl = "" })
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"DapBreakpointRejected",
|
|
||||||
{ text = icons.debug_icons.breakpoint_rejected, texthl = "", linehl = "", numhl = "" }
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
lazy = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/rcarriga/nvim-dap-ui",
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/mfussenegger/nvim-dap" },
|
|
||||||
{ "nvim-neotest/nvim-nio" },
|
|
||||||
},
|
|
||||||
lazy = true,
|
|
||||||
config = function()
|
|
||||||
require("dapui").setup({
|
|
||||||
icons = {
|
|
||||||
expanded = "-",
|
|
||||||
collapsed = "+",
|
|
||||||
current_frame = ">",
|
|
||||||
},
|
|
||||||
controls = {
|
|
||||||
icons = require("icons").debug_control_icons,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
local dap, dapui = require("dap"), require("dapui")
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"https://github.com/mfussenegger/nvim-dap-python",
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/rcarriga/nvim-dap-ui" },
|
|
||||||
{ "https://github.com/mfussenegger/nvim-dap" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- This is where pipx is installing debugpy via ./install-helpers.py
|
|
||||||
-- Could maybe detect by doing a which debugpy and then reading the interpreter
|
|
||||||
-- from the shebang line.
|
|
||||||
require("dap-python").setup("~/.local/pipx/venvs/debugpy/bin/python3")
|
|
||||||
end,
|
|
||||||
ft = { "python" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Install language servers
|
|
||||||
{
|
|
||||||
"https://github.com/williamboman/mason.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/neovim/nvim-lspconfig" },
|
|
||||||
{ "https://github.com/williamboman/mason-lspconfig.nvim" },
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"Mason",
|
|
||||||
"MasonInstall",
|
|
||||||
"MasonLog",
|
|
||||||
"MasonUninstall",
|
|
||||||
"MasonUninstallAll",
|
|
||||||
"MasonUpdate",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Lua dev for vim
|
|
||||||
{
|
|
||||||
"https://github.com/folke/neodev.nvim",
|
|
||||||
dependencies = { { "https://github.com/neovim/nvim-lspconfig" } },
|
|
||||||
ft = { "lua" },
|
|
||||||
-- Disable for nvim 0.10 because there is lazydev
|
|
||||||
enabled = vim.fn.has("nvim-0.10") ~= 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/folke/lazydev.nvim",
|
|
||||||
dependencies = { { "https://github.com/neovim/nvim-lspconfig" } },
|
|
||||||
ft = "lua",
|
|
||||||
opts = {},
|
|
||||||
enabled = vim.fn.has("nvim-0.10") == 1,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Rust analyzer
|
|
||||||
{
|
|
||||||
"https://github.com/mrcjkb/rustaceanvim",
|
|
||||||
version = "^5",
|
|
||||||
-- Already loads on ft
|
|
||||||
lazy = false,
|
|
||||||
ft = { "rust" },
|
|
||||||
init = function()
|
|
||||||
local lsp = require("plugins.lsp")
|
|
||||||
vim.g.rustaceanvim = {
|
|
||||||
server = {
|
|
||||||
capabilities = lsp.merged_capabilities(),
|
|
||||||
on_attach = lsp.get_default_attach(),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
enabled = vim.fn.has("nvim-0.10") == 1,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Better display of lsp diagnostics
|
-- Better display of lsp diagnostics
|
||||||
{
|
{
|
||||||
@ -393,28 +209,6 @@ return {
|
|||||||
enabled = vim.fn.has("nvim-0.8") == 1,
|
enabled = vim.fn.has("nvim-0.8") == 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Generic linter/formatters in diagnostics API
|
|
||||||
{
|
|
||||||
"https://github.com/nvimtools/none-ls.nvim",
|
|
||||||
-- This is lazy and configured after lsps loaded in plugins/lsp.lua
|
|
||||||
lazy = true,
|
|
||||||
branch = utils.map_version_rule({
|
|
||||||
[">=0.8.0"] = utils.nil_val,
|
|
||||||
[">=0.7.0"] = "0.7-compat",
|
|
||||||
["<0.7.0"] = utils.nil_val, -- use pinned commit
|
|
||||||
}),
|
|
||||||
commit = utils.map_version_rule({
|
|
||||||
[">=0.8.0"] = utils.nil_val,
|
|
||||||
[">=0.7.0"] = utils.nil_val, -- Use pinned branch
|
|
||||||
[">=0.6.0"] = "4b403d2d724f48150ded41189ae4866492a8158b",
|
|
||||||
}),
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/nvimtools/none-ls-extras.nvim" },
|
|
||||||
{ "https://github.com/nvim-lua/plenary.nvim" },
|
|
||||||
{ "https://github.com/neovim/nvim-lspconfig" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Writing
|
-- Writing
|
||||||
-- abolish/pencil
|
-- abolish/pencil
|
||||||
{
|
{
|
||||||
@ -462,71 +256,9 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
-- Completion
|
|
||||||
{
|
|
||||||
"https://github.com/L3MON4D3/LuaSnip",
|
|
||||||
version = "2.x.x",
|
|
||||||
event = "InsertEnter *",
|
|
||||||
config = function()
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/rafamadriz/friendly-snippets" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/hrsh7th/cmp-nvim-lsp",
|
|
||||||
commit = utils.map_version_rule({
|
|
||||||
[">=0.7.0"] = utils.nil_val,
|
|
||||||
["<0.7.0"] = "3cf38d9c957e95c397b66f91967758b31be4abe6",
|
|
||||||
}),
|
|
||||||
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/hrsh7th/cmp-buffer",
|
|
||||||
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/f3fora/cmp-spell",
|
|
||||||
dependencies = { { "https://github.com/hrsh7th/nvim-cmp" } },
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"https://github.com/saadparwaiz1/cmp_luasnip",
|
|
||||||
commit = utils.map_version_rule({
|
|
||||||
[">0.7.0"] = utils.nil_val,
|
|
||||||
[">=0.5.0"] = "b10829736542e7cc9291e60bab134df1273165c9",
|
|
||||||
}),
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/hrsh7th/nvim-cmp" },
|
|
||||||
{ "https://github.com/L3MON4D3/LuaSnip" },
|
|
||||||
},
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"https://github.com/hrsh7th/nvim-cmp",
|
|
||||||
config = function()
|
|
||||||
require("plugins.completion").config_cmp()
|
|
||||||
end,
|
|
||||||
commit = utils.map_version_rule({
|
|
||||||
[">=0.7.0"] = utils.nil_val,
|
|
||||||
[">=0.5.0"] = "bba6fb67fdafc0af7c5454058dfbabc2182741f4",
|
|
||||||
}),
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Add snippets
|
|
||||||
event = "InsertEnter *",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"https://github.com/ray-x/lsp_signature.nvim",
|
"https://github.com/ray-x/lsp_signature.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {
|
opts = {
|
||||||
extra_trigger_chars = { "(", "," },
|
extra_trigger_chars = { "(", "," },
|
||||||
auto_close_after = nil,
|
auto_close_after = nil,
|
||||||
@ -534,6 +266,7 @@ return {
|
|||||||
floating_window = true,
|
floating_window = true,
|
||||||
hint_enable = false,
|
hint_enable = false,
|
||||||
},
|
},
|
||||||
|
event = "InsertEnter *",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Fuzzy Finder
|
-- Fuzzy Finder
|
||||||
@ -592,6 +325,9 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"https://github.com/sheerun/vim-polyglot",
|
"https://github.com/sheerun/vim-polyglot",
|
||||||
|
init = function()
|
||||||
|
vim.g.polyglot_disabled = { "go", "rust" }
|
||||||
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
local gid = vim.api.nvim_create_augroup("polyglot_fts", { clear = true })
|
local gid = vim.api.nvim_create_augroup("polyglot_fts", { clear = true })
|
||||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
@ -646,44 +382,8 @@ return {
|
|||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Obsidian notes
|
{ import = "lazy.completion" },
|
||||||
-- This loads an Obsidian plugin for better vault interraction as well as auto pulls
|
{ import = "lazy.obsidian" },
|
||||||
-- and commits to my vault git repo. On iOS devices, I use Working Copy to sync the
|
|
||||||
-- repo and use Shortcuts to automate pulling on open and auto committing and pushing
|
|
||||||
-- after closing Obsidian.
|
|
||||||
{
|
|
||||||
"https://github.com/epwalsh/obsidian.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/nvim-lua/plenary.nvim" },
|
|
||||||
},
|
|
||||||
version = "3.x.x",
|
|
||||||
opts = {
|
|
||||||
workspaces = {
|
|
||||||
{ name = "personal", path = require("plugins.obsidian").vault_path },
|
|
||||||
},
|
|
||||||
ui = {
|
|
||||||
checkboxes = {
|
|
||||||
[" "] = { char = "☐", hl_group = "ObsidianTodo" },
|
|
||||||
["x"] = { char = "✔", hl_group = "ObsidianDone" },
|
|
||||||
},
|
|
||||||
external_link_icon = { char = "🔗", hl_group = "ObsidianExtLinkIcon" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("plugins.obsidian").config(opts)
|
|
||||||
end,
|
|
||||||
event = {
|
|
||||||
"BufRead " .. require("plugins.obsidian").vault_path .. "/**",
|
|
||||||
"BufNewFile " .. require("plugins.obsidian").vault_path .. "/**",
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"ObsidianOpen",
|
|
||||||
"ObsidianNew",
|
|
||||||
"ObsidianSearch",
|
|
||||||
"ObsidianNewFromTemplate",
|
|
||||||
"ObsidianWorkspace",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Work things
|
-- Work things
|
||||||
-- Sourcegraph
|
-- Sourcegraph
|
||||||
@ -709,48 +409,5 @@ return {
|
|||||||
enabled = vim.g.install_sourcegraph,
|
enabled = vim.g.install_sourcegraph,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{ import = "lazy.copilot" },
|
||||||
"https://github.com/github/copilot.vim",
|
|
||||||
enabled = vim.g.install_copilot,
|
|
||||||
version = "1.x.x",
|
|
||||||
config = function()
|
|
||||||
require("plugins.copilot")
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
-- To avoid conflicts with Ctrl+F, load vim-rsi first
|
|
||||||
{ "https://github.com/tpope/vim-rsi" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"https://github.com/CopilotC-Nvim/CopilotChat.nvim",
|
|
||||||
enabled = vim.g.install_copilot,
|
|
||||||
version = "3.x.x",
|
|
||||||
build = "make tiktoken",
|
|
||||||
dependencies = {
|
|
||||||
{ "https://github.com/github/copilot.vim" },
|
|
||||||
{ "https://github.com/nvim-lua/plenary.nvim" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("plugins.copilotchat").setup()
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{ "<leader>cc", ":echo 'Lazy load copilot chat'<cr>", desc = "Load copilot chat" },
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"CopilotChat",
|
|
||||||
"CopilotChatOpen",
|
|
||||||
"CopilotChatToggle",
|
|
||||||
"CopilotChatModels",
|
|
||||||
"CopilotChatExplain",
|
|
||||||
"CopilotChatReview",
|
|
||||||
"CopilotChatOptimize",
|
|
||||||
"CopilotChatDocs",
|
|
||||||
"CopilotChatTests",
|
|
||||||
"CopilotChatFixDiagnostic",
|
|
||||||
"CopilotChatCommit",
|
|
||||||
"CopilotChatCommitStaged",
|
|
||||||
},
|
|
||||||
lazy = true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user