Added pastify and powershell debug

This commit is contained in:
2025-11-11 10:33:26 +01:00
parent 8c0f3ec5b4
commit 47ffc1a523
8 changed files with 370 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
vim.api.nvim_set_keymap('v', '<leader>p', ':PastifyAfter<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>p', ':PastifyAfter<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>P', ':Pastify<CR>', { noremap = true, silent = true })
local function get_assets_dir()
-- Get the absolute path of the current buffer
local buf_path = vim.api.nvim_buf_get_name(0)
if buf_path == '' then
-- Fallback to current working directory if buffer has no file
buf_path = vim.loop.cwd()
end
-- Extract directory name
local dir = vim.fn.fnamemodify(buf_path, ':p:h')
-- Append "assets"
local assets_dir = dir .. '/assets'
return assets_dir
end
return {
'TobinPalmer/pastify.nvim',
cmd = { 'Pastify', 'PastifyAfter' },
config = function()
require('pastify').setup {
opts = {
apikey = '', -- Needed if you want to save online.
local_path = get_assets_dir,
},
}
end,
}