From 5a016bf0b010d555e9756b2ebd25ccc99443d67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E9=82=A6?= Date: Thu, 9 Nov 2023 10:08:47 +0800 Subject: [PATCH] fix: recover README.md --- README.md | 121 +++++++++++++++++++++++++++--------------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 4d58bf1a64..7ecf7f3fe5 100644 --- a/README.md +++ b/README.md @@ -81,67 +81,68 @@ For neovim beginners who don't want to tinker with the configurations: 4. Paste the sample init.lua below to `~/.config/nvim/init.lua` 5. Start taking notes by `nvim test.norg` +
sample init.lua -```lua --- adapted from https://github.com/folke/lazy.nvim#-installation - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - print(vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - })) -end -vim.opt.rtp:prepend(lazypath) - -vim.g.mapleader = " " - -require("lazy").setup({ - "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - opts = { - highlight = { enable = true }, + ```lua + -- adapted from https://github.com/folke/lazy.nvim#-installation + + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then + print(vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + })) + end + vim.opt.rtp:prepend(lazypath) + + vim.g.mapleader = " " + + require("lazy").setup({ + "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + opts = { + highlight = { enable = true }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - }, - { - "nvim-neorg/neorg", - build = ":Neorg sync-parsers", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("neorg").setup { - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/notes", + { + "nvim-neorg/neorg", + build = ":Neorg sync-parsers", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("neorg").setup { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/notes", + }, + default_workspace = "notes", }, - default_workspace = "notes", }, }, - }, - } - - vim.wo.foldlevel = 99 - vim.wo.conceallevel = 2 - end, - } -}) - -vim.cmd.colorscheme('kanagawa') -``` + } + + vim.wo.foldlevel = 99 + vim.wo.conceallevel = 2 + end, + } + }) + + vim.cmd.colorscheme('kanagawa') + ```
@@ -149,8 +150,9 @@ vim.cmd.colorscheme('kanagawa') You can install it through your favorite plugin manager: --
- packer.nvim +- +
+ packer.nvim ```lua use { @@ -180,7 +182,7 @@ You can install it through your favorite plugin manager: You can also pin Neorg to one specific version through e.g. `tag = "2.0.0"`. - *** + --- Want to lazy load? You can use the `ft` key to load Neorg only upon entering a `.norg` file: @@ -212,7 +214,7 @@ You can install it through your favorite plugin manager: additional steps depending on how your lazyloading system and/or Neovim config is set up. -
+
-
vim-plug @@ -242,7 +244,6 @@ You can install it through your favorite plugin manager: ```
- -
lazy.nvim @@ -276,14 +277,12 @@ You can install it through your favorite plugin manager: ### Treesitter ###### _Be sure to have [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) installed on your system for this step!_ - Neorg will automatically attempt to install the parsers for you upon entering a `.norg` file if you have `core.defaults` loaded. A command is also exposed to reinstall and/or update these parsers: `:Neorg sync-parsers`. It is important to note that installation via this command isn't reproducible. There are a few ways to make it reproducible, but the recommended way is to set up an **update flag** for your plugin manager of choice. In packer, your configuration may look something like this: - ```lua use { "nvim-neorg/neorg",