nvim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 1cce27b9ce87c3e39e9a89420284ff3d10308ddc
parent f0b9518204dd1ad3435bbf529389246cda06721e
Author: AndrewLockVI <andrewlaack1@gmail.com>
Date:   Mon,  6 Jan 2025 22:34:07 -0600

Viewing markdown online

Diffstat:
Mlua/core/keymaps.lua | 30++++++++++++++++++++++++++++++
Mlua/core/plugins.lua | 6+-----
Anotes.md | 12++++++++++++
Mplugin/packer_compiled.lua | 6+++---
4 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua @@ -142,3 +142,33 @@ vim.o.laststatus = 0 ---- remap new window direction vim.api.nvim_set_keymap('n', '<C-w>h', ':vsplit<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<C-w>v', ':split<CR>', { noremap = true, silent = true }) + + +-- leader+pn pastes notes template. + + +local notesFile = vim.fn.expand("~/.config/nvim/notes.md") + +local function load_file_to_clipboard() + local file = io.open(notesFile, "r") + if file then + -- Read the file content + local content = file:read("*a") + file:close() + + -- Set the content to the clipboard + vim.fn.setreg("+", content) + + -- Split the content into lines + local lines = vim.split(content, "\n", true) + + -- Paste the content into the current buffer + vim.api.nvim_put(lines, 'c', true, true) + else + print("Error: Unable to open file: " .. notesFile) + end +end + + +-- Map the function to <leader>pn +vim.keymap.set("n", "<leader>pn", load_file_to_clipboard, { noremap = true, silent = true }) diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua @@ -61,8 +61,7 @@ require("luasnip").config.set_config({ -- Setting LuaSnip config requires = { { "nvim-lua/plenary.nvim" } }, }) - -- Markview... that shit makes everything so fucking annying to edit. Try to check a checkbox... I dare you... - -- use("OXY2DEV/markview.nvim") + use("OXY2DEV/markview.nvim") -- needed for icons for telescope use("nvim-tree/nvim-web-devicons") @@ -73,7 +72,6 @@ require("luasnip").config.set_config({ -- Setting LuaSnip config -- Tree sitter (syntax highlighting) use("nvim-treesitter/nvim-treesitter") - use("iamcco/markdown-preview.nvim") use("scottmckendry/cyberdream.nvim") require("cyberdream").setup({ @@ -95,8 +93,6 @@ require("luasnip").config.set_config({ -- Setting LuaSnip config debug = false, } - - use({ "kylechui/nvim-surround", tag = "*", -- Use for stability; omit to use `main` branch for the latest features diff --git a/notes.md b/notes.md @@ -0,0 +1,12 @@ +:: :: +# TITLE + +**Source** +Linear Algebra Done Right + +**Chapter** +Linear Algebra Done Right + +## Notes + +**Definition:** diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua @@ -94,10 +94,10 @@ _G.packer_plugins = { path = "/home/andrew/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", url = "https://github.com/VonHeikemen/lsp-zero.nvim" }, - ["markdown-preview.nvim"] = { + ["markview.nvim"] = { loaded = true, - path = "/home/andrew/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim", - url = "https://github.com/iamcco/markdown-preview.nvim" + path = "/home/andrew/.local/share/nvim/site/pack/packer/start/markview.nvim", + url = "https://github.com/OXY2DEV/markview.nvim" }, ["mason-lspconfig.nvim"] = { loaded = true,