Add notifications and neotree copy options

This commit is contained in:
Saeed Afzal
2024-01-03 14:30:28 +00:00
parent e62faa0b94
commit c094afe79c
7 changed files with 44 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ return {
"LunarVim/bigfile.nvim",
"wakatime/vim-wakatime",
"j-morano/buffer_manager.nvim",
"rcarriga/nvim-notify",
-- NOTE: Plugins

View File

@@ -1,20 +0,0 @@
return {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = "nvim-lua/plenary.nvim",
opts = {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/Sync/Neorg",
work = "~/Sync/Work"
},
default_workspace = "notes"
}
}
}
}
}

View File

@@ -10,7 +10,42 @@ return {
cmd = "Neotree",
opts = {
window = {
position = "current"
position = "current",
mappings = {
["Y"] = function(state)
local node = state.tree:get_node()
local filepath = node:get_id()
local filename = node.name
local modify = vim.fn.fnamemodify
local results = {
filepath,
modify(filepath, ':.'),
modify(filepath, ':~'),
filename,
modify(filename, ':r'),
modify(filename, ':e'),
}
vim.ui.select({
'1. Absolute path: ' .. results[1],
'2. Path relative to CWD: ' .. results[2],
'3. Path relative to HOME: ' .. results[3],
'4. Filename: ' .. results[4],
'5. Filename without extension: ' .. results[5],
'6. Extension of the filename: ' .. results[6],
}, { prompt = 'Choose to copy to clipboard:' }, function(choice)
if choice then
local i = tonumber(choice:sub(1, 1))
local result = results[i]
vim.fn.setreg('"+', result)
vim.notify("Copied: " .. result)
end
end)
end
}
}
}
}

View File

@@ -13,9 +13,8 @@ return {
telescope.setup {
pickers = {
find_files = {
theme = "dropdown"
}
fd = { theme = "dropdown" },
current_buffer_fuzzy_find = { theme = "dropdown" }
}
}

View File

@@ -6,7 +6,7 @@ local function config()
-- Finders
f = {
name = "Finders",
f = { "<cmd>Telescope find_files<CR>", "Find files" },
f = { "<cmd>Telescope fd<CR>", "Find files" },
w = { "<cmd>Telescope live_grep<CR>", "Text grep" },
s = { "<cmd>Telescope spell_suggest<CR>", "Spell suggest" },
t = { "<cmd>TodoTelescope<CR>", "Todos" },