feat: add markdown editing, preview, and math-aware writing support
This commit is contained in:
parent
fcdb4c03f9
commit
edf227aee8
|
|
@ -42,7 +42,7 @@ Or manually install dependencies:
|
|||
|
||||
```sh
|
||||
sudo pkg update -f
|
||||
sudo pkg install -y git gmake unzip llvm ripgrep fd-find tree-sitter stylua base64-by-elvis
|
||||
sudo pkg install -y git gmake unzip llvm ripgrep fd-find tree-sitter stylua base64-by-elvis node npm
|
||||
```
|
||||
|
||||
**Note:** `lua-language-server` is not available in FreeBSD pkg repositories, so LSP support for Lua is disabled in this config.
|
||||
|
|
@ -58,6 +58,7 @@ sudo pkg install -y git gmake unzip llvm ripgrep fd-find tree-sitter stylua base
|
|||
- Language Setup:
|
||||
- If you want to write Typescript, you need `npm`
|
||||
- If you want to write Golang, you will need `go`
|
||||
- If you want markdown live preview, you need `node` and `npm`
|
||||
- etc.
|
||||
|
||||
### Install Kickstart.nvim-FreeBSD
|
||||
|
|
@ -104,6 +105,12 @@ Wait for plugins to finish installing, then restart Neovim.
|
|||
|
||||
Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim.
|
||||
|
||||
#### Markdown Writing
|
||||
|
||||
This config includes built-in support for editing and previewing technical articles:
|
||||
- **Syntax & Math Highlighting**: `vim-markdown` handles syntax highlighting, frontmatter, and math support. Single `$...$` and double `$$...$$` math syntax is fully supported for highlight and structure awareness. Note that the actual math rendering happens in the browser preview.
|
||||
- **Live Preview**: Toggle a live browser preview with `<leader>mp` (runs `:MarkdownPreviewToggle`). This relies on `markdown-preview.nvim` which requires `node` and `npm` installed.
|
||||
|
||||
### FAQ
|
||||
|
||||
* What should I do if I already have a pre-existing Neovim configuration?
|
||||
|
|
|
|||
22
init.lua
22
init.lua
|
|
@ -213,6 +213,8 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
|
||||
vim.keymap.set('n', '<leader>mp', ':MarkdownPreviewToggle<CR>', { desc = '[M]arkdown [P]review toggle' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
|
|
@ -912,6 +914,26 @@ require('lazy').setup({
|
|||
-- Highlight todo, notes, etc in comments
|
||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
||||
|
||||
-- Markdown editing + live preview + math-aware writing
|
||||
{
|
||||
'preservim/vim-markdown',
|
||||
ft = { 'markdown' },
|
||||
init = function()
|
||||
vim.g.vim_markdown_math = 1
|
||||
vim.g.vim_markdown_frontmatter = 1
|
||||
vim.g.vim_markdown_folding_disabled = 1
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'iamcco/markdown-preview.nvim',
|
||||
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
|
||||
ft = { 'markdown' },
|
||||
build = function()
|
||||
vim.fn['mkdp#util#install']()
|
||||
end,
|
||||
},
|
||||
|
||||
{ -- Collection of various small independent plugins/modules
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ echo "[2/5] Installing core dependencies (git, make, unzip, clang)..."
|
|||
pkg install -y base64 git gmake unzip llvm
|
||||
|
||||
# Development tools
|
||||
echo "[3/5] Installing development tools (ripgrep, fd)..."
|
||||
pkg install -y ripgrep fd-find
|
||||
echo "[3/5] Installing development tools (ripgrep, fd, node, npm)..."
|
||||
pkg install -y ripgrep fd-find node npm
|
||||
|
||||
# Tree-sitter for syntax highlighting
|
||||
echo "[4/5] Installing tree-sitter..."
|
||||
|
|
|
|||
Loading…
Reference in New Issue