Added pastify and powershell debug
This commit is contained in:
32
AppData/Local/nvim/lua/kickstart/plugins/pastify.lua
Normal file
32
AppData/Local/nvim/lua/kickstart/plugins/pastify.lua
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user