Plugins
This commit is contained in:
@@ -39,23 +39,36 @@ end, { desc = 'Log node' })
|
|||||||
-- Use CTRL+<hjkl> to switch between windows
|
-- Use CTRL+<hjkl> to switch between windows
|
||||||
--
|
--
|
||||||
-- See `:help wincmd` for a list of all window commands
|
-- See `:help wincmd` for a list of all window commands
|
||||||
|
local function win_or_treesj(dir_cmd, desc)
|
||||||
|
return function()
|
||||||
|
local cur = vim.api.nvim_get_current_win()
|
||||||
|
vim.cmd('wincmd ' .. dir_cmd)
|
||||||
|
if vim.api.nvim_get_current_win() == cur then
|
||||||
|
local ok, treesj = pcall(require, 'treesj')
|
||||||
|
if ok and type(treesj.toggle) == 'function' then
|
||||||
|
treesj.toggle()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, { desc = desc }
|
||||||
|
end
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
vim.keymap.set('n', '<C-j>', (win_or_treesj)('j', 'Move focus to the lower window or treesj.toggle()'))
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
vim.keymap.set('n', '<C-k>', (win_or_treesj)('k', 'Move focus to the upper window or treesj.toggle()'))
|
||||||
|
|
||||||
vim.keymap.set({ 'i' }, '<C-J>', function()
|
vim.keymap.set({ 'i' }, '<C-J>', function()
|
||||||
local ls = require 'luasnip'
|
local ls = require 'luasnip'
|
||||||
if ls.choice_active() then
|
if ls.choice_active() then
|
||||||
ls.change_choice(1)
|
ls.change_choice(1)
|
||||||
end
|
end
|
||||||
end, { silent = true })
|
end, { desc = 'Toggle snippet choice', silent = true })
|
||||||
vim.keymap.set({ 'i' }, '<C-k>', function()
|
vim.keymap.set({ 'i' }, '<C-k>', function()
|
||||||
local ls = require 'luasnip'
|
local ls = require 'luasnip'
|
||||||
if ls.choice_active() then
|
if ls.choice_active() then
|
||||||
ls.change_choice(-1)
|
ls.change_choice(-1)
|
||||||
end
|
end
|
||||||
end, { silent = true })
|
end, { desc = 'Toggle snippet choice', silent = true })
|
||||||
vim.keymap.set({ 'i', 's' }, '<C-L>', function()
|
vim.keymap.set({ 'i', 's' }, '<C-L>', function()
|
||||||
local ls = require 'luasnip'
|
local ls = require 'luasnip'
|
||||||
if ls.expandable() then
|
if ls.expandable() then
|
||||||
@@ -63,13 +76,13 @@ vim.keymap.set({ 'i', 's' }, '<C-L>', function()
|
|||||||
elseif ls.in_snippet() then
|
elseif ls.in_snippet() then
|
||||||
ls.jump(1)
|
ls.jump(1)
|
||||||
end
|
end
|
||||||
end, { silent = true })
|
end, { desc = 'Expand snippet', silent = true })
|
||||||
vim.keymap.set({ 'i', 's' }, '<C-H>', function()
|
vim.keymap.set({ 'i', 's' }, '<C-H>', function()
|
||||||
local ls = require 'luasnip'
|
local ls = require 'luasnip'
|
||||||
if ls.in_snippet() then
|
if ls.in_snippet() then
|
||||||
ls.jump(-1)
|
ls.jump(-1)
|
||||||
end
|
end
|
||||||
end, { silent = true })
|
end, { desc = 'Go back a snippet slot', silent = true })
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-S-h>', '<C-w>H', { desc = 'Move window to the left' })
|
vim.keymap.set('n', '<C-S-h>', '<C-w>H', { desc = 'Move window to the left' })
|
||||||
vim.keymap.set('n', '<C-S-l>', '<C-w>L', { desc = 'Move window to the right' })
|
vim.keymap.set('n', '<C-S-l>', '<C-w>L', { desc = 'Move window to the right' })
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
return {
|
|
||||||
'ravitemer/mcphub.nvim',
|
|
||||||
dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim', -- Required for Job and HTTP requests
|
|
||||||
},
|
|
||||||
-- uncomment the following line to load hub lazily
|
|
||||||
cmd = 'MCPHub', -- lazy load
|
|
||||||
build = 'npm install -g mcp-hub@latest', -- Installs required mcp-hub npm module
|
|
||||||
-- uncomment this if you don't want mcp-hub to be available globally or can't use -g
|
|
||||||
-- build = "bundled_build.lua", -- Use this and set use_bundled_binary = true in opts (see Advanced configuration)
|
|
||||||
config = function()
|
|
||||||
require('mcphub').setup({
|
|
||||||
auto_approve = true,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -25,16 +25,36 @@ return {
|
|||||||
|
|
||||||
require('mini.pairs').setup()
|
require('mini.pairs').setup()
|
||||||
|
|
||||||
-- require('mini.jump').setup()
|
require('mini.jump').setup {
|
||||||
|
mappings = {
|
||||||
|
repeat_jump = ':',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
require('mini.jump2d').setup()
|
local MiniJump2d = require 'mini.jump2d'
|
||||||
|
MiniJump2d.setup {
|
||||||
|
spotter = MiniJump2d.gen_spotter.union(
|
||||||
|
MiniJump2d.gen_spotter.pattern('[([{][^$]', 'end'),
|
||||||
|
MiniJump2d.gen_spotter.pattern('%$.', 'end'),
|
||||||
|
MiniJump2d.gen_spotter.pattern('->.', 'end'),
|
||||||
|
MiniJump2d.gen_spotter.pattern('^%s*%S', 'end')
|
||||||
|
),
|
||||||
|
mappings = {
|
||||||
|
start_jumping = 'S',
|
||||||
|
},
|
||||||
|
allowed_lines = {
|
||||||
|
blank = false,
|
||||||
|
cursor_at = false,
|
||||||
|
fold = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
require('mini.splitjoin').setup()
|
require('mini.splitjoin').setup()
|
||||||
|
|
||||||
require('mini.map').setup()
|
require('mini.map').setup()
|
||||||
|
|
||||||
-- Simple and easy statusline.
|
-- Simple and easy statusline.
|
||||||
-- You could remove this setup call if you don't like it,
|
-- You could remove this setup call i you don't like it,
|
||||||
-- and try some other statusline plugin
|
-- and try some other statusline plugin
|
||||||
local statusline = require 'mini.statusline'
|
local statusline = require 'mini.statusline'
|
||||||
-- set use_icons to true if you have a Nerd Font
|
-- set use_icons to true if you have a Nerd Font
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
-- Neo-tree is a Neovim plugin to browse the file system
|
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
|
||||||
|
|
||||||
return {
|
|
||||||
-- 'nvim-neo-tree/neo-tree.nvim',
|
|
||||||
-- version = '*',
|
|
||||||
-- dependencies = {
|
|
||||||
-- 'nvim-lua/plenary.nvim',
|
|
||||||
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
|
||||||
-- 'MunifTanjim/nui.nvim',
|
|
||||||
-- },
|
|
||||||
-- cmd = 'Neotree',
|
|
||||||
-- keys = {
|
|
||||||
-- { '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
|
||||||
-- },
|
|
||||||
--
|
|
||||||
-- build = function()
|
|
||||||
-- if vim.fn.executable 'fd' == 0 then
|
|
||||||
-- local install_cmd
|
|
||||||
-- if vim.fn.has 'mac' == 1 then
|
|
||||||
-- install_cmd = 'brew install fd'
|
|
||||||
-- elseif vim.fn.has 'unix' == 1 then
|
|
||||||
-- if vim.fn.filereadable '/etc/arch-release' == 1 then
|
|
||||||
-- install_cmd = 'sudo pacman -S --noconfirm fd'
|
|
||||||
-- else
|
|
||||||
-- install_cmd = 'sudo apt-get install -y fd-find'
|
|
||||||
-- end
|
|
||||||
-- else
|
|
||||||
-- vim.notify("Please install 'fd' manually for neo-tree.", vim.log.levels.WARN)
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- vim.fn.system(install_cmd)
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
--
|
|
||||||
-- opts = function(_, opts)
|
|
||||||
-- local function on_move(data)
|
|
||||||
-- Snacks.rename.on_rename_file(data.source, data.destination)
|
|
||||||
-- end
|
|
||||||
-- local events = require 'neo-tree.events'
|
|
||||||
-- opts.event_handlers = opts.event_handlers or {}
|
|
||||||
-- vim.list_extend(opts.event_handlers, {
|
|
||||||
-- { event = events.FILE_MOVED, handler = on_move },
|
|
||||||
-- { event = events.FILE_RENAMED, handler = on_move },
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- opts.filesystem = {
|
|
||||||
-- window = {
|
|
||||||
-- mappings = {
|
|
||||||
-- ['\\'] = 'close_window',
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- filtered_items = {
|
|
||||||
-- hide_dotfiles = false,
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- end,
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
require('helpers').edit_cf('pt', '/lua/plugins/neotest.lua')
|
|
||||||
return {
|
|
||||||
'nvim-neotest/neotest',
|
|
||||||
lazy = true,
|
|
||||||
dependencies = {
|
|
||||||
'nvim-neotest/nvim-nio',
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'antoinemadec/FixCursorHold.nvim',
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
-- Adapters
|
|
||||||
'V13Axel/neotest-pest',
|
|
||||||
-- "olimorris/neotest-phpunit",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require('neotest').setup {
|
|
||||||
adapters = {
|
|
||||||
require 'neotest-pest' {
|
|
||||||
sail_enabled = function()
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
parallel = 10,
|
|
||||||
},
|
|
||||||
-- require('neotest-phpunit'),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
10
lua/plugins/treesj.lua
Normal file
10
lua/plugins/treesj.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
'Wansmer/treesj',
|
||||||
|
lazy = true,
|
||||||
|
dependencies = { 'nvim-treesitter/nvim-treesitter' }, -- if you install parsers with `nvim-treesitter`
|
||||||
|
config = function()
|
||||||
|
require('treesj').setup({
|
||||||
|
use_default_keymaps = false,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
require('helpers').edit_cf('pv', '/lua/plugins/vectorcode.lua')
|
|
||||||
|
|
||||||
return {}
|
|
||||||
-- return {
|
|
||||||
-- 'Davidyz/VectorCode',
|
|
||||||
-- version = '*', -- optional, depending on whether you're on nightly or release
|
|
||||||
-- dependencies = { 'nvim-lua/plenary.nvim' },
|
|
||||||
-- build = 'pipx upgrade vectorcode',
|
|
||||||
-- cmd = 'VectorCode', -- if you're lazy-loading VectorCode
|
|
||||||
-- opts = {
|
|
||||||
-- async_backend = 'lsp',
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
if vim.loop.os_uname().sysname == 'Darwin' then
|
|
||||||
return {
|
|
||||||
'wakatime/vim-wakatime',
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user