addet custom configs
This commit is contained in:
parent
f62470d43c
commit
bbc9a96be7
4 changed files with 71 additions and 25 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,4 +15,4 @@
|
||||||
|
|
||||||
lazy-lock.json
|
lazy-lock.json
|
||||||
cd-project.nvim.json
|
cd-project.nvim.json
|
||||||
custom/
|
# custom/
|
||||||
|
|
34
lua/pika/core/custom/hugopaste.lua
Normal file
34
lua/pika/core/custom/hugopaste.lua
Normal file
|
@ -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 = "\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", "<leader>ps", ":lua SaveScreenshotAndInsertLink()<CR>", { noremap = true, silent = true })
|
13
lua/pika/core/custom/init.lua
Normal file
13
lua/pika/core/custom/init.lua
Normal file
|
@ -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", "<leader>ts", function()
|
||||||
|
vim.cmd.new()
|
||||||
|
vim.cmd.term()
|
||||||
|
vim.api.nvim_win_set_height(0, 15)
|
||||||
|
end)
|
|
@ -1,10 +1,9 @@
|
||||||
return {
|
return {
|
||||||
-- { "folke/tokyonight.nvim" },
|
-- { "folke/tokyonight.nvim" },
|
||||||
-- { "catppuccin/nvim", name = "catppuccin" },
|
{ "catppuccin/nvim", name = "catppuccin" },
|
||||||
-- { "EdenEast/nightfox.nvim" },
|
{ "EdenEast/nightfox.nvim" },
|
||||||
-- { "DanWlker/primeppuccin", name = "primeppuccin" },
|
|
||||||
{ "fynnfluegge/monet.nvim", name = "monet" },
|
{ "fynnfluegge/monet.nvim", name = "monet" },
|
||||||
{ "L-Colombo/oldschool.nvim", config = "true" },
|
{ "L-Colombo/oldschool.nvim", config = true },
|
||||||
{ "rose-pine/neovim", name = "rose-pine" },
|
{ "rose-pine/neovim", name = "rose-pine" },
|
||||||
{ "AlexvZyl/nordic.nvim" },
|
{ "AlexvZyl/nordic.nvim" },
|
||||||
{ "eldritch-theme/eldritch.nvim" },
|
{ "eldritch-theme/eldritch.nvim" },
|
||||||
|
@ -91,26 +90,26 @@ return {
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
{
|
-- {
|
||||||
"neko-night/nvim",
|
-- "neko-night/nvim",
|
||||||
lazy = false,
|
-- lazy = false,
|
||||||
-- priority = 1000,
|
-- -- priority = 1000,
|
||||||
opts = {
|
-- opts = {
|
||||||
transparent = false, -- Enable this to disable setting the background color
|
-- transparent = false, -- Enable this to disable setting the background color
|
||||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||||
styles = {
|
-- styles = {
|
||||||
-- Style to be applied to different syntax groups
|
-- -- Style to be applied to different syntax groups
|
||||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
-- -- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||||
comments = { italic = false },
|
-- comments = { italic = false },
|
||||||
keywords = { italic = true },
|
-- keywords = { italic = true },
|
||||||
functions = { bold = true },
|
-- functions = { bold = true },
|
||||||
variables = { bold = true },
|
-- variables = { bold = true },
|
||||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
-- -- Background styles. Can be "dark", "transparent" or "normal"
|
||||||
sidebars = "dark", -- style for sidebars, see below
|
-- sidebars = "dark", -- style for sidebars, see below
|
||||||
floats = "dark", -- style for floating windows
|
-- floats = "dark", -- style for floating windows
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
{
|
{
|
||||||
"scottmckendry/cyberdream.nvim",
|
"scottmckendry/cyberdream.nvim",
|
||||||
name = "cyberdream",
|
name = "cyberdream",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue