diff --git a/.gitignore b/.gitignore index eed252c..9b945f4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ lazy-lock.json cd-project.nvim.json -custom/ +# custom/ diff --git a/lua/pika/core/custom/hugopaste.lua b/lua/pika/core/custom/hugopaste.lua new file mode 100644 index 0000000..02b21b7 --- /dev/null +++ b/lua/pika/core/custom/hugopaste.lua @@ -0,0 +1,34 @@ +function SaveScreenshotAndInsertLink() + -- Prompt for Hugo base directory if needed + + -- Define the Hugo base directory and screenshot subfolder path + local base_dir + local current_file_dir = vim.fn.expand("%:p:h") + + -- Detect base dir by looking for the Hugo structure, or prompt if not found + if current_file_dir:match("/content/") then + base_dir = current_file_dir:match("(.*)/content/") + else + -- Prompt for Hugo base directory if automatic detection fails + base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") + end + + local img_folder = base_dir .. "/static/images/screenshots/" + vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists + + -- Define the image name and full path + local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" + local full_path = img_folder .. img_name + + -- Save clipboard image as binary PNG file using wl-paste + os.execute("wl-paste --type image/png > " .. full_path) + + -- Insert markdown image link at cursor position + local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" + vim.api.nvim_put({ img_markdown }, "c", true, true) + + print("Screenshot saved and link added: " .. full_path) +end + +-- Keybind for saving clipboard screenshot and inserting a Markdown link +vim.api.nvim_set_keymap("n", "ps", ":lua SaveScreenshotAndInsertLink()", { noremap = true, silent = true }) diff --git a/lua/pika/core/custom/init.lua b/lua/pika/core/custom/init.lua new file mode 100644 index 0000000..215237a --- /dev/null +++ b/lua/pika/core/custom/init.lua @@ -0,0 +1,13 @@ +vim.api.nvim_create_autocmd("TermOpen", { + group = vim.api.nvim_create_augroup("custom-term-open", { clear = true }), + callback = function() + vim.opt.number = false + vim.opt.relativenumber = false + end, +}) + +vim.keymap.set("n", "ts", function() + vim.cmd.new() + vim.cmd.term() + vim.api.nvim_win_set_height(0, 15) +end) diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index 1cac46b..f71e803 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -1,10 +1,9 @@ return { -- { "folke/tokyonight.nvim" }, - -- { "catppuccin/nvim", name = "catppuccin" }, - -- { "EdenEast/nightfox.nvim" }, - -- { "DanWlker/primeppuccin", name = "primeppuccin" }, + { "catppuccin/nvim", name = "catppuccin" }, + { "EdenEast/nightfox.nvim" }, { "fynnfluegge/monet.nvim", name = "monet" }, - { "L-Colombo/oldschool.nvim", config = "true" }, + { "L-Colombo/oldschool.nvim", config = true }, { "rose-pine/neovim", name = "rose-pine" }, { "AlexvZyl/nordic.nvim" }, { "eldritch-theme/eldritch.nvim" }, @@ -91,26 +90,26 @@ return { -- }, -- }, -- }, - { - "neko-night/nvim", - lazy = false, - -- priority = 1000, - opts = { - transparent = false, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim - styles = { - -- Style to be applied to different syntax groups - -- Value is any valid attr-list value for `:help nvim_set_hl` - comments = { italic = false }, - keywords = { italic = true }, - functions = { bold = true }, - variables = { bold = true }, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "dark", -- style for sidebars, see below - floats = "dark", -- style for floating windows - }, - }, - }, + -- { + -- "neko-night/nvim", + -- lazy = false, + -- -- priority = 1000, + -- opts = { + -- transparent = false, -- Enable this to disable setting the background color + -- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + -- styles = { + -- -- Style to be applied to different syntax groups + -- -- Value is any valid attr-list value for `:help nvim_set_hl` + -- comments = { italic = false }, + -- keywords = { italic = true }, + -- functions = { bold = true }, + -- variables = { bold = true }, + -- -- Background styles. Can be "dark", "transparent" or "normal" + -- sidebars = "dark", -- style for sidebars, see below + -- floats = "dark", -- style for floating windows + -- }, + -- }, + -- }, { "scottmckendry/cyberdream.nvim", name = "cyberdream",