mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2026-09-10 17:16:18 -07:00
update nvim
This commit is contained in:
@@ -42,16 +42,4 @@ function M.git_paste_prompt()
|
||||
end)
|
||||
end
|
||||
|
||||
--- Sets up the git-paste module.
|
||||
---
|
||||
--- The module expects an optional configuration table:
|
||||
--- { telescope_key = "<leader>pg" } (or any other keymap you prefer)
|
||||
---
|
||||
---@param opts table|nil
|
||||
function M.setup(opts)
|
||||
opts = opts or {}
|
||||
local telescope_key = opts.telescope_key or "<leader>pg"
|
||||
vim.keymap.set("n", telescope_key, M.git_paste_prompt, { desc = "Git Paste: paste content from git raw URL" })
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
return {
|
||||
require("utils.functions.git_paste"),
|
||||
require("utils.functions.mkdir_under_cursor"),
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
local M = {}
|
||||
vim.notify = require("notify")
|
||||
|
||||
function M.mkdir_under_cursor()
|
||||
local word
|
||||
@@ -19,18 +18,16 @@ function M.mkdir_under_cursor()
|
||||
-- Remove quotes if present
|
||||
word = word:gsub("^[\"']", ""):gsub("[\"']$", "")
|
||||
-- Check if directory exists
|
||||
local stat = vim.loop.fs_stat(word)
|
||||
local stat = vim.uv.fs_stat(word)
|
||||
if not stat then
|
||||
-- Create directory (recursive)
|
||||
vim.loop.fs_mkdir(word, 493) -- 493 = 0755 in decimal
|
||||
vim.notify("Directory created: " .. word, vim.log.levels.INFO)
|
||||
if vim.fn.mkdir(word, "p") == 1 then
|
||||
vim.notify("Directory created: " .. word, vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("Failed to create directory: " .. word, vim.log.levels.ERROR)
|
||||
end
|
||||
else
|
||||
vim.notify("Directory already exists: " .. word, vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
return M.mkdir_under_cursor
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user