From 37b59b8d193fd8dd5e9dd8756a30247e62732237 Mon Sep 17 00:00:00 2001 From: liph22 Date: Sun, 21 Dec 2025 14:25:58 +0100 Subject: [PATCH] updated markdown in nvim --- nvim/.config/nvim/init.lua | 55 ++--- nvim/.config/nvim/init.lua.bak | 64 ++--- nvim/.config/nvim/lazy-lock.json | 15 +- .../plugins.inactive/{cmp.lua.bak => cmp.lua} | 0 ...blankline.lua.bak => indent-blankline.lua} | 0 .../nvim/lua/plugins.inactive/markdown.lua | 166 +++++++++++++ .../nvim/lua/plugins.inactive/none-ls.lua.bak | 21 -- .../.config/nvim/lua/plugins.inactive/oil.lua | 100 +++++++- nvim/.config/nvim/lua/plugins/markdown.lua | 225 ++++++++++++++++++ nvim/.config/nvim/lua/plugins/obsidian.lua | 151 ++++-------- nvim/.config/nvim/lua/plugins/treesitter.lua | 30 ++- nvim/.config/nvim/lua/vim-options.lua | 11 +- 12 files changed, 624 insertions(+), 214 deletions(-) rename nvim/.config/nvim/lua/plugins.inactive/{cmp.lua.bak => cmp.lua} (100%) rename nvim/.config/nvim/lua/plugins.inactive/{indent-blankline.lua.bak => indent-blankline.lua} (100%) create mode 100644 nvim/.config/nvim/lua/plugins.inactive/markdown.lua delete mode 100644 nvim/.config/nvim/lua/plugins.inactive/none-ls.lua.bak create mode 100644 nvim/.config/nvim/lua/plugins/markdown.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 238356a..b474014 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,41 +1,42 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) -- Only enable spell checking for specific filetypes vim.api.nvim_create_autocmd("FileType", { - pattern = { "markdown", "text", "gitcommit", "tex" }, - callback = function() - vim.opt_local.spell = true - vim.opt_local.spelllang = "en_us,de" - end, + pattern = { "markdown", "text", "gitcommit", "tex" }, + callback = function() + vim.opt_local.spell = true + vim.opt_local.spelllang = "en_us,de" + end, }) + require("vim-options") require("lazy").setup("plugins") require("lualine").setup({ - sections = { - lualine_x = { - { - require("noice").api.statusline.mode.get, - cond = require("noice").api.statusline.mode.has, - color = { fg = "#ff9e64" }, - }, - }, - }, + sections = { + lualine_x = { + { + require("noice").api.statusline.mode.get, + cond = require("noice").api.statusline.mode.has, + color = { fg = "#ff9e64" }, + }, + }, + }, }) require("lazy").setup({ - { - "tzachar/cmp-tabnine", - build = "./install.sh", - dependencies = "hrsh7th/nvim-cmp", - }, + { + "tzachar/cmp-tabnine", + build = "./install.sh", + dependencies = "hrsh7th/nvim-cmp", + }, }) diff --git a/nvim/.config/nvim/init.lua.bak b/nvim/.config/nvim/init.lua.bak index 0b45ed4..238356a 100644 --- a/nvim/.config/nvim/init.lua.bak +++ b/nvim/.config/nvim/init.lua.bak @@ -1,35 +1,41 @@ -vim.cmd("set expandtab") -vim.cmd("set tabstop=2") -vim.cmd("set softtabstop=2") -vim.cmd("set shiftwidth=2") -vim.g.mapleader = " " - --- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - --- Setup lazy.nvim +-- Only enable spell checking for specific filetypes +vim.api.nvim_create_autocmd("FileType", { + pattern = { "markdown", "text", "gitcommit", "tex" }, + callback = function() + vim.opt_local.spell = true + vim.opt_local.spelllang = "en_us,de" + end, +}) require("vim-options") require("lazy").setup("plugins") - - - +require("lualine").setup({ + sections = { + lualine_x = { + { + require("noice").api.statusline.mode.get, + cond = require("noice").api.statusline.mode.has, + color = { fg = "#ff9e64" }, + }, + }, + }, +}) +require("lazy").setup({ + { + "tzachar/cmp-tabnine", + build = "./install.sh", + dependencies = "hrsh7th/nvim-cmp", + }, +}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index e00c821..4b50e0e 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -10,7 +10,7 @@ "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-tabnine": { "branch": "main", "commit": "c0167cdc86c15e782c5461ee62aebee89231c2ed" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "328c2f1dda56f933d3337a1316e1020ba30ba6aa" }, + "conform.nvim": { "branch": "master", "commit": "5f5152fae39a57e3a04cbce09fb21e10c49c9d95" }, "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, @@ -25,7 +25,8 @@ "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3b3571b4dadbcb464804466e9872e7246c316af7" }, + "markview.nvim": { "branch": "main", "commit": "0a5033326f703d99a8788e2d47753d6298195e8a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8f1a3e6eecb638817e8999aaa16ada27cd54d867" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, @@ -35,23 +36,23 @@ "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, "nvim-lint": { "branch": "master", "commit": "7a64f4067065c16a355d40d0d599b8ca6b25de6d" }, - "nvim-lspconfig": { "branch": "master", "commit": "c4f67bf85b01a57e3c130352c0a0e453ab8cd5b9" }, + "nvim-lspconfig": { "branch": "master", "commit": "d20d83b3f24f5884da73a9fc92fdc47e778b8d0d" }, "nvim-navic": { "branch": "master", "commit": "7d914a39a1ef8f4e22c2c4381abeef7c556f5a13" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, "nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "portal.nvim": { "branch": "main", "commit": "77d9d53fec945bfa407d5fd7120f1b4f117450ed" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "8aafe2cbd89cd4090f573a98cab6b20366576fde" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "3d757e586ff0bfc85bdb7b46c9d3d932147a0cde" }, + "telescope.nvim": { "branch": "master", "commit": "e709d31454ee6e6157f0537f861f797bd44c0bad" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, - "vim-test": { "branch": "master", "commit": "1eeb12774a0f251571700ccf68da27789b2f0852" }, + "vim-test": { "branch": "master", "commit": "aa619692ff48a3cf3e6bdb893765039488d4e5f3" }, "vimux": { "branch": "master", "commit": "614f0bb1fb598f97accdcea71d5f7b18d7d62436" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, - "yazi.nvim": { "branch": "main", "commit": "275c195596c857955f4627a8b48b68144d79478f" } + "yazi.nvim": { "branch": "main", "commit": "d87cd885e06d50e1bb5607e48d96c1094d3b10e3" } } diff --git a/nvim/.config/nvim/lua/plugins.inactive/cmp.lua.bak b/nvim/.config/nvim/lua/plugins.inactive/cmp.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins.inactive/cmp.lua.bak rename to nvim/.config/nvim/lua/plugins.inactive/cmp.lua diff --git a/nvim/.config/nvim/lua/plugins.inactive/indent-blankline.lua.bak b/nvim/.config/nvim/lua/plugins.inactive/indent-blankline.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins.inactive/indent-blankline.lua.bak rename to nvim/.config/nvim/lua/plugins.inactive/indent-blankline.lua diff --git a/nvim/.config/nvim/lua/plugins.inactive/markdown.lua b/nvim/.config/nvim/lua/plugins.inactive/markdown.lua new file mode 100644 index 0000000..c53c668 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins.inactive/markdown.lua @@ -0,0 +1,166 @@ +return { + { + "OXY2DEV/markview.nvim", + ft = "markdown", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("markview").setup({ + modes = { "n", "no", "c" }, + hybrid_modes = { "n" }, + + callbacks = { + on_enable = function(_, win) + vim.wo[win].conceallevel = 2 + vim.wo[win].concealcursor = "" + end, + }, + + checkboxes = { + enable = true, + checked = { + text = "✓", + hl = "MarkviewCheckboxChecked", + }, + unchecked = { + text = "☐", + hl = "MarkviewCheckboxUnchecked", + }, + custom = { + { + match_string = "!", + text = "!", + hl = "MarkviewCheckboxUrgent", + }, + }, + }, + + headings = { + enable = true, + shift_width = 0, + heading_1 = { + style = "icon", + icon = "# ", + hl = "MarkviewHeading1", + }, + heading_2 = { + style = "icon", + icon = "## ", + hl = "MarkviewHeading2", + }, + heading_3 = { + style = "icon", + icon = "### ", + hl = "MarkviewHeading3", + }, + heading_4 = { + style = "icon", + icon = "#### ", + hl = "MarkviewHeading4", + }, + heading_5 = { + style = "icon", + icon = "##### ", + hl = "MarkviewHeading5", + }, + heading_6 = { + style = "icon", + icon = "###### ", + hl = "MarkviewHeading6", + }, + }, + + code_blocks = { + enable = true, + style = "language", + hl = "MarkviewCode", + min_width = 60, + pad_amount = 1, + }, + + list_items = { + enable = true, + indent_size = 2, + marker_minus = { + text = "•", + hl = "MarkviewListItemMinus", + }, + marker_plus = { + text = "•", + hl = "MarkviewListItemPlus", + }, + marker_star = { + text = "•", + hl = "MarkviewListItemStar", + }, + }, + + links = { + enable = true, + hyperlinks = { + icon = "", + hl = "MarkviewHyperlink", + }, + images = { + icon = "", + hl = "MarkviewImageLink", + }, + }, + }) + + -- Catppuccin Mocha colors + vim.cmd([[ + " Checkboxes - Catppuccin Mocha palette + highlight MarkviewCheckboxChecked guifg=#a6e3a1 " Green + highlight MarkviewCheckboxUnchecked guifg=#6c7086 " Surface2 (gray) + highlight MarkviewCheckboxUrgent guifg=#f38ba8 gui=bold " Red + + " Headings - Catppuccin Mocha subtle + highlight MarkviewHeading1 guifg=#f38ba8 gui=bold " Red + highlight MarkviewHeading2 guifg=#fab387 gui=bold " Peach + highlight MarkviewHeading3 guifg=#f9e2af " Yellow + highlight MarkviewHeading4 guifg=#a6e3a1 " Green + highlight MarkviewHeading5 guifg=#89b4fa " Blue + highlight MarkviewHeading6 guifg=#cba6f7 " Mauve + + " Code blocks - Catppuccin Mocha mantle + highlight MarkviewCode guibg=#181825 + + " Lists - Catppuccin Mocha blue + highlight MarkviewListItemMinus guifg=#89b4fa + highlight MarkviewListItemPlus guifg=#89b4fa + highlight MarkviewListItemStar guifg=#89b4fa + + " Links - Catppuccin Mocha sapphire + highlight MarkviewHyperlink guifg=#74c7ec gui=underline + highlight MarkviewImageLink guifg=#74c7ec + ]]) + end, + }, + + { + "dhruvasagar/vim-table-mode", + ft = { "markdown" }, + cmd = { "TableModeToggle" }, + keys = { + { "tm", "TableModeToggle", desc = "Toggle Table Mode" }, + }, + config = function() + vim.g.table_mode_corner = "|" + vim.g.table_mode_corner_corner = "|" + vim.g.table_mode_header_fillchar = "-" + end, + }, + + { + "bullets-vim/bullets.vim", + ft = { "markdown", "text" }, + config = function() + vim.g.bullets_enabled_file_types = { "markdown", "text" } + vim.g.bullets_enable_in_empty_buffers = 0 + vim.g.bullets_checkbox_markers = " x!" + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins.inactive/none-ls.lua.bak b/nvim/.config/nvim/lua/plugins.inactive/none-ls.lua.bak deleted file mode 100644 index d28120e..0000000 --- a/nvim/.config/nvim/lua/plugins.inactive/none-ls.lua.bak +++ /dev/null @@ -1,21 +0,0 @@ -return { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.prettier, - -- null_ls.builtins.diagnostics.eslint_d, - null_ls.builtins.diagnostics.rubocop, - null_ls.builtins.formatting.rubocop, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, - null_ls.builtins.diagnostics.pylint, - }, - }) - - vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) - end, -} - diff --git a/nvim/.config/nvim/lua/plugins.inactive/oil.lua b/nvim/.config/nvim/lua/plugins.inactive/oil.lua index 4acbe58..670e698 100644 --- a/nvim/.config/nvim/lua/plugins.inactive/oil.lua +++ b/nvim/.config/nvim/lua/plugins.inactive/oil.lua @@ -1,8 +1,92 @@ --- return { --- "stevearc/oil.nvim", --- config = function() --- local oil = require("oil") --- oil.setup() --- vim.keymap.set("n", "-", oil.toggle_float, {}) --- end, ---} +return { + { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("oil").setup({ + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + default_file_explorer = true, + + -- Columns to show + columns = { + "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + + -- Buffer-local options + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + + -- Window-local options + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + + -- Delete to trash instead of permanently deleting + delete_to_trash = true, + + -- Skip confirmation for simple operations + skip_confirm_for_simple_edits = false, + + -- Prompt for confirmation on certain actions + prompt_save_on_select_new_entry = true, + + -- Keymaps in oil buffer + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = "actions.select_split", + [""] = "actions.select_tab", + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, + + view_options = { + -- Show files and directories that start with "." + show_hidden = false, + + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) + return vim.startswith(name, ".") + end, + + -- Sort file names in a more intuitive order + sort = { + { "type", "asc" }, + { "name", "asc" }, + }, + }, + }) + + -- Open parent directory in current window + vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) + + -- Open parent directory in floating window + vim.keymap.set("n", "-", require("oil").toggle_float, { desc = "Open Oil in floating window" }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/markdown.lua b/nvim/.config/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..d0034cc --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/markdown.lua @@ -0,0 +1,225 @@ +return { + { + "OXY2DEV/markview.nvim", + lazy = false, + ft = "markdown", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + config = function() + local presets = require("markview.presets") + + require("markview").setup({ + modes = { "n", "no", "c" }, + hybrid_modes = { "n" }, + + callbacks = { + on_enable = function(_, win) + vim.wo[win].conceallevel = 2 + vim.wo[win].concealcursor = "" + end, + }, + + -- Glow headings preset + headings = presets.headings.glow, + + -- Code blocks configuration + code_blocks = { + enable = true, + style = "language", + position = "overlay", + min_width = 60, + pad_amount = 2, + pad_char = " ", + + language_names = { + { "py", "python" }, + { "cpp", "C++" }, + { "js", "javascript" }, + { "ts", "typescript" }, + { "sh", "bash" }, + }, + + hl = "MarkviewCode", + sign = true, + sign_hl = "MarkviewCodeSign", + }, + + -- Block quotes configuration + block_quotes = { + enable = true, + default = { + border = "▋", + border_hl = "MarkviewBlockQuoteBorder", + }, + + callouts = { + { + match_string = "NOTE", + callout_preview = "󰋽 Note", + callout_preview_hl = "MarkviewBlockQuoteNote", + border = "▋", + border_hl = "MarkviewBlockQuoteNote", + }, + { + match_string = "TIP", + callout_preview = "󰌶 Tip", + callout_preview_hl = "MarkviewBlockQuoteTip", + border = "▋", + border_hl = "MarkviewBlockQuoteTip", + }, + { + match_string = "IMPORTANT", + callout_preview = " Important", + callout_preview_hl = "MarkviewBlockQuoteImportant", + border = "▋", + border_hl = "MarkviewBlockQuoteImportant", + }, + { + match_string = "WARNING", + callout_preview = " Warning", + callout_preview_hl = "MarkviewBlockQuoteWarn", + border = "▋", + border_hl = "MarkviewBlockQuoteWarn", + }, + { + match_string = "CAUTION", + callout_preview = " Caution", + callout_preview_hl = "MarkviewBlockQuoteError", + border = "▋", + border_hl = "MarkviewBlockQuoteError", + }, + }, + }, + + -- Checkboxes configuration + checkboxes = { + enable = true, + checked = { + text = "✓", + hl = "MarkviewCheckboxChecked", + scope_hl = nil, + }, + unchecked = { + text = "☐", + hl = "MarkviewCheckboxUnchecked", + scope_hl = nil, + }, + custom = { + { + match_string = "!", + text = "!", + hl = "MarkviewCheckboxImportant", + scope_hl = nil, + }, + { + match_string = "-", + text = "◐", + hl = "MarkviewCheckboxPending", + scope_hl = nil, + }, + { + match_string = "~", + text = "≈", + hl = "MarkviewCheckboxProgress", + scope_hl = nil, + }, + }, + }, + + -- Tables with rounded borders + tables = { + enable = true, + + parts = { + top = { "╭", "─", "┬", "─", "╮" }, + header = { "├", "─", "┼", "─", "┤" }, + separator = { "├", "─", "┼", "─", "┤" }, + row = { "│", " ", "│", " ", "│" }, + bottom = { "╰", "─", "┴", "─", "╯" }, + + overlap = { "┼" }, + }, + + hl = { + "MarkviewTableHeader", + "MarkviewTableBorder", + "MarkviewTableBorder", + "MarkviewTableBorder", + "MarkviewTableBorder", + }, + + use_virt_lines = true, + }, + + -- List items + list_items = { + enable = true, + indent_size = 2, + shift_width = 2, + + marker_minus = { + add_padding = true, + text = "•", + hl = "MarkviewListItemMinus", + }, + marker_plus = { + add_padding = true, + text = "•", + hl = "MarkviewListItemPlus", + }, + marker_star = { + add_padding = true, + text = "•", + hl = "MarkviewListItemStar", + }, + }, + }) + + -- Catppuccin Mocha colors + vim.cmd([[ + " Code blocks - Catppuccin Mocha + highlight MarkviewCode guibg=#181825 + highlight MarkviewCodeSign guifg=#89b4fa + + " Block quotes - Catppuccin Mocha + highlight MarkviewBlockQuoteBorder guifg=#6c7086 + highlight MarkviewBlockQuoteNote guifg=#89b4fa + highlight MarkviewBlockQuoteTip guifg=#a6e3a1 + highlight MarkviewBlockQuoteImportant guifg=#cba6f7 + highlight MarkviewBlockQuoteWarn guifg=#fab387 + highlight MarkviewBlockQuoteError guifg=#f38ba8 + + " Checkboxes - Catppuccin Mocha + highlight MarkviewCheckboxChecked guifg=#a6e3a1 + highlight MarkviewCheckboxUnchecked guifg=#6c7086 + highlight MarkviewCheckboxImportant guifg=#f38ba8 gui=bold + highlight MarkviewCheckboxPending guifg=#fab387 + highlight MarkviewCheckboxProgress guifg=#89b4fa + + " List items - Catppuccin Mocha + highlight MarkviewListItemMinus guifg=#89b4fa + highlight MarkviewListItemPlus guifg=#a6e3a1 + highlight MarkviewListItemStar guifg=#cba6f7 + + " Tables - Catppuccin Mocha + highlight MarkviewTableHeader guifg=#cba6f7 gui=bold + highlight MarkviewTableBorder guifg=#6c7086 + ]]) + + -- Setup checkbox toggle extras + require("markview.extras.checkboxes").setup({ + default = "X", + remove_markers = false, + exit = true, + default_marker = "-", + default_state = "X", + }) + + -- Keymaps + vim.keymap.set("n", "mt", "Markview toggle", { desc = "Toggle Markview" }) + vim.keymap.set("n", "ch", "Checkboxes toggle", { desc = "Toggle checkbox" }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/obsidian.lua b/nvim/.config/nvim/lua/plugins/obsidian.lua index 6a3537a..cd351e4 100644 --- a/nvim/.config/nvim/lua/plugins/obsidian.lua +++ b/nvim/.config/nvim/lua/plugins/obsidian.lua @@ -1,110 +1,53 @@ return { - { - "epwalsh/obsidian.nvim", - version = "*", - lazy = true, - ft = "markdown", - dependencies = { - "nvim-lua/plenary.nvim", - }, - opts = { - workspaces = { - { - name = "nvim", - path = "~/Documents/obsidian/vault", -- Change to your vault path - }, - -- { - -- name = "work", - -- path = "~/obsidian/work", -- Optional: add more vaults - -- }, - }, + { + "epwalsh/obsidian.nvim", + version = "*", + lazy = true, + ft = "markdown", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "personal", + path = "~/Documents/obsidian", + }, + }, - -- Daily notes - daily_notes = { - folder = "daily", - date_format = "%Y-%m-%d", - template = nil, - }, + completion = { + nvim_cmp = true, + min_chars = 2, + }, - -- Templates - templates = { - folder = "templates", - date_format = "%Y-%m-%d", - time_format = "%H:%M", - }, + mappings = { + ["ch"] = { + action = function() + return require("obsidian").util.toggle_checkbox() + end, + opts = { buffer = true, desc = "Toggle checkbox" }, + }, + [""] = { + action = function() + return require("obsidian").util.smart_action() + end, + opts = { buffer = true, expr = true }, + }, + ["gf"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + }, - -- Completion - completion = { - nvim_cmp = true, - min_chars = 2, - }, + note_id_func = function(title) + return title + end, - -- Use note title as filename - note_id_func = function(title) - if title ~= nil then - return title - else - return tostring(os.time()) - end - end, - - -- Disable UI features if you don't want them - ui = { - enable = true, -- Set to false to disable and suppress warning - }, - - -- Mappings (only active in markdown files) - mappings = { - -- Follow link under cursor - ["gf"] = { - action = function() - return require("obsidian").util.gf_passthrough() - end, - opts = { noremap = false, expr = true, buffer = true }, - }, - -- Toggle checkbox - ["ch"] = { - action = function() - return require("obsidian").util.toggle_checkbox() - end, - opts = { buffer = true }, - }, - -- Smart action (follow link or toggle checkbox) - [""] = { - action = function() - return require("obsidian").util.smart_action() - end, - opts = { buffer = true, expr = true }, - }, - }, - }, - - config = function(_, opts) - require("obsidian").setup(opts) - - -- Set conceallevel for markdown files (for UI features) - vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - vim.opt_local.conceallevel = 2 - end, - }) - end, - - -- Global keymaps - keys = { - { "on", "ObsidianNew", desc = "New Obsidian note" }, - { "oo", "ObsidianQuickSwitch", desc = "Quick switch notes" }, - { "os", "ObsidianSearch", desc = "Search notes" }, - { "ot", "ObsidianToday", desc = "Today's note" }, - { "oy", "ObsidianYesterday", desc = "Yesterday's note" }, - { "ob", "ObsidianBacklinks", desc = "Show backlinks" }, - { "og", "ObsidianTags", desc = "Search tags" }, - { "ol", "ObsidianLink", mode = "v", desc = "Link selection" }, - { "oL", "ObsidianLinkNew", mode = "v", desc = "Link to new note" }, - { "of", "ObsidianFollowLink", desc = "Follow link" }, - { "oT", "ObsidianTemplate", desc = "Insert template" }, - { "op", "ObsidianOpen", desc = "Open in Obsidian app" }, - }, - }, + ui = { + enable = false, -- DISABLE Obsidian UI, use markview instead + }, + }, + }, } diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index d722213..10ab0c8 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -1,14 +1,20 @@ return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local config = require("nvim-treesitter.configs") - config.setup({ - auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, - }, + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + ensure_installed = { + "bash", -- For bash code blocks + "html", -- For HTML code blocks + "sql", -- For SQL code blocks + "dockerfile", -- For Docker code blocks + }, + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, } diff --git a/nvim/.config/nvim/lua/vim-options.lua b/nvim/.config/nvim/lua/vim-options.lua index a94a27b..b492a11 100644 --- a/nvim/.config/nvim/lua/vim-options.lua +++ b/nvim/.config/nvim/lua/vim-options.lua @@ -8,11 +8,10 @@ vim.g.background = "light" vim.opt.swapfile = false -- Navigate vim panes better -vim.keymap.set('n', '', ':wincmd k') -vim.keymap.set('n', '', ':wincmd j') -vim.keymap.set('n', '', ':wincmd h') -vim.keymap.set('n', '', ':wincmd l') +vim.keymap.set("n", "", ":wincmd k") +vim.keymap.set("n", "", ":wincmd j") +vim.keymap.set("n", "", ":wincmd h") +vim.keymap.set("n", "", ":wincmd l") -vim.keymap.set('n', 'h', ':nohlsearch') +vim.keymap.set("n", "h", ":nohlsearch") vim.wo.number = true -