[Fix] cleanup
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "None"
|
||||
@@ -0,0 +1,98 @@
|
||||
# Neovim Configuration Setup
|
||||
|
||||
This Neovim configuration is built on top of [NvChad](https://nvchad.com/), a popular Neovim framework designed for speed and aesthetics. It uses [lazy.nvim](https://github.com/folke/lazy.nvim) as the plugin manager.
|
||||
|
||||
## Core Components
|
||||
|
||||
- **Framework**: [NvChad](https://nvchad.com/) (v2.5)
|
||||
- **Plugin Manager**: `lazy.nvim`
|
||||
- **Theme Engine**: `base46` (integrated with NvChad)
|
||||
- **Keybindings**: Custom mappings are defined in `lua/mappings.lua`.
|
||||
- **Options**: Base options are inherited from NvChad, with customizations in `lua/options.lua`.
|
||||
|
||||
## Installed Plugins & Features
|
||||
|
||||
The configuration includes several key plugins and features:
|
||||
|
||||
### Development Tools
|
||||
- **LSP (Language Server Protocol)**: Configured via `nvim-lspconfig`. Note that you must install the actual language servers using [Mason.nvim](https://github.com/williamboman/mason.nvim).
|
||||
- **Formatting**: Uses `conform.nvim` for code formatting (configured in `lua/configs/conform.lua`).
|
||||
- **Treesitter**: Provides advanced syntax highlighting and code folding (configured in `lua/plugins/init.lua`).
|
||||
- **Telescope**: Powerful fuzzy finder for files, text, and LSP symbols.
|
||||
|
||||
### UI & Productivity
|
||||
- **Snacks.nvim**: A collection of useful utilities including:
|
||||
- `explorer`: File explorer.
|
||||
- `indent`: Indent guides (replaces `indent-blankline.nvim` to avoid duplication).
|
||||
- `picker`: Fast picker for various tasks.
|
||||
- `notifier`: Improved notification system.
|
||||
- `words`: Word count and related features.
|
||||
- **Render Markdown**: Enhances the appearance of Markdown files in the buffer (`lua/configs/render-markdown.lua`).
|
||||
|
||||
## Maintenance & Package Management
|
||||
|
||||
### Managing Plugins (lazy.nvim)
|
||||
To update your installed Neovim plugins:
|
||||
1. Open Neovim.
|
||||
2. Run `:Lazy` to open the plugin manager UI.
|
||||
3. Press `U` to check for updates and `u` to update everything.
|
||||
|
||||
### Managing LSPs & Tools (Mason.nvim)
|
||||
While plugins are managed by `lazy.nvim`, the actual language servers, debuggers, and formatters are managed by **Mason**.
|
||||
1. Open Neovim.
|
||||
2. Run `:Mason` to open the Mason UI.
|
||||
3. Use the UI to install or update your desired LSPs (e.g., `ts_ls`, `html`, `cssls`), linters, or formatters.
|
||||
|
||||
### Managing Syntax Highlighting (Treesitter)
|
||||
To ensure all language parsers are installed for proper syntax highlighting:
|
||||
1. Open Neovim.
|
||||
2. Run `:TSUpdate` (or `:TSInstall <language>` for a specific one).
|
||||
|
||||
## Custom Keybindings
|
||||
|
||||
Some notable custom mappings (defined in `lua/mappings.lua`):
|
||||
|
||||
| Mapping | Action | Description |
|
||||
|---------|--------|-------------|
|
||||
| `gd` | `vim.lsp.buf.definition` | Go to definition |
|
||||
| `gD` | `Telescope lsp_definitions` | Go to definitions (Telescope) |
|
||||
| `grr` | `Telescope lsp_references` | Go to references (Telescope) |
|
||||
| `<leader>da` | `vim.lsp.buf.code_action()` | Code actions |
|
||||
| `<leader>dh` | `vim.diagnostic.open_float()` | Show diagnostics in float |
|
||||
| `<leader>dj` | `vim.diagnostic.jump` | Go to next diagnostic |
|
||||
| `<leader>dk` | `vim.diagnostic.jump` | Go to previous diagnostic |
|
||||
| `<leader>fr` | `Telescope resume` | Resume last Telescope search |
|
||||
| `<leader>fs` | `Telescope grep_string` | Find selected string |
|
||||
| `<leader>fk` | `Telescope keymaps` | Find keymaps |
|
||||
| `<leader>fd` | `Telescope diagnostics` | Search diagnostics |
|
||||
|
||||
**Improved Deletion/Change:**
|
||||
- `x` (in Normal/Visual mode): Deletes a character without yanking it to the register.
|
||||
- `c` (in Normal/Visual mode): Changes text without yanking it to the register.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```text
|
||||
.
|
||||
├── init.lua # Entry point: bootstraps lazy.nvim and loads config
|
||||
├── lazy-lock.json # Lockfile for lazy.nvim
|
||||
└── lua/
|
||||
├── chadrc.lua # NvChad configuration
|
||||
├── configs/ # Plugin-specific configurations
|
||||
│ ├── conform.lua
|
||||
│ ├── lazy.lua
|
||||
│ ├── lspconfig.lua
|
||||
│ └── render-markdown.lua
|
||||
├── mappings.lua # Custom keybindings
|
||||
├── options.lua # Custom Neovim options
|
||||
└── plugins/
|
||||
└── init.lua # Plugin definitions and setup
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
1. Ensure you have [Neovim](https://neovim.io/) (latest stable or nightly) installed.
|
||||
2. Clone this repository to your Neovim configuration directory (usually `~/.config/nvim`).
|
||||
3. Open Neovim. `lazy.nvim` will automatically bootstrap and install all required plugins.
|
||||
4. **Important**: After the initial plugin installation, run `:MasonInstall <server_name>` (or use the `:Mason` UI) to install the language servers required for your workflow.
|
||||
5. Restart Neovim after the initial installation completes.
|
||||
@@ -0,0 +1,38 @@
|
||||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||
vim.g.mapleader = " "
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- bootstrap lazy and all plugins
|
||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_config = require "configs.lazy"
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup({
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
},
|
||||
|
||||
{ import = "plugins" },
|
||||
}, lazy_config)
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
dofile(vim.g.base46_cache .. "statusline")
|
||||
|
||||
require "options"
|
||||
require "nvchad.autocmds"
|
||||
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
end)
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||
"NvChad": { "branch": "v2.5", "commit": "add44b952d631981614bbb8cfc6f7002f296dfe6" },
|
||||
"base46": { "branch": "v3.0", "commit": "267954c8663607823f03a3259bb8deb15688212f" },
|
||||
"cmp-async-path": { "branch": "main", "commit": "98185a91d49ff5dd249aebf2f7456e18063fa2a0" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "d29ecf6626cf6ffb109fb04a8ecd92c46f4a1ce9" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" },
|
||||
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "4267d26e60323a45e18f8e7a63a964cc8f53ca4e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "b2aadda94b107480c48e548d6db51c6840b7b33c" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "c9f9ed6c1892f629ea399f4ee7905f2686fa13f2" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
|
||||
"ui": { "branch": "v3.0", "commit": "fe781d1c12860d6a25d45e588fe4fdd27eb34a1a" },
|
||||
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
|
||||
-- Please read that file to know all available options :(
|
||||
|
||||
---@type ChadrcConfig
|
||||
|
||||
local M = {
|
||||
lsp = { signature = true },
|
||||
|
||||
base46 = {
|
||||
theme = "onedark",
|
||||
transparency = true,
|
||||
hl_override = {
|
||||
NvimTreeGitDirty = {
|
||||
fg = "#DBA55D",
|
||||
},
|
||||
},
|
||||
-- Comment = { italic = true },
|
||||
-- ["@comment"] = { italic = true },
|
||||
},
|
||||
|
||||
nvdash = {
|
||||
load_on_startup = true,
|
||||
-- buttons = {
|
||||
-- { txt = " Find File", keys = "Spc f f", cmd = "Telescope find_files custom" },
|
||||
-- { txt = " Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" },
|
||||
-- -- more... check nvconfig.lua file for full list of buttons
|
||||
-- },
|
||||
},
|
||||
|
||||
ui = {
|
||||
-- lazyload it when there are 1+ buffers
|
||||
tabufline = {
|
||||
enabled = true,
|
||||
lazyload = true,
|
||||
order = { "treeOffset", "buffers", "tabs", "btns" },
|
||||
modules = nil,
|
||||
bufwidth = 21,
|
||||
},
|
||||
},
|
||||
|
||||
term = {
|
||||
base46_colors = true,
|
||||
winopts = { number = false },
|
||||
sizes = { sp = 0.5, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 },
|
||||
float = {
|
||||
relative = "editor",
|
||||
row = 0.05,
|
||||
col = 0.05,
|
||||
width = 0.9,
|
||||
height = 0.8,
|
||||
border = "single",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,17 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascript = { "prettier" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
}
|
||||
|
||||
return options
|
||||
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local servers = { "html", "cssls", "ts_ls", "eslint" }
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
-- local lspconfig = require "lspconfig"
|
||||
-- local nvlsp = require "nvchad.configs.lspconfig"
|
||||
--
|
||||
-- -- lsps with default config
|
||||
-- for _, lsp in ipairs(servers) do
|
||||
-- lspconfig[lsp].setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
-- end
|
||||
--
|
||||
-- -- configuring single server, example: typescript
|
||||
-- lspconfig.ts_ls.setup {
|
||||
-- filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'markdown' },
|
||||
-- }
|
||||
--
|
||||
-- -- configuring single server, example: typescript
|
||||
-- -- lspconfig.ts_ls.setup {
|
||||
-- -- on_attach = nvlsp.on_attach,
|
||||
-- -- on_init = nvlsp.on_init,
|
||||
-- -- capabilities = nvlsp.capabilities,
|
||||
-- -- }
|
||||
@@ -0,0 +1,851 @@
|
||||
return {
|
||||
-- Whether markdown should be rendered by default.
|
||||
enabled = true,
|
||||
-- Vim modes that will show a rendered view of the markdown file, :h mode(), for all enabled
|
||||
-- components. Individual components can be enabled for other modes. Remaining modes will be
|
||||
-- unaffected by this plugin.
|
||||
render_modes = { "i", "n", "c", "t" },
|
||||
-- Maximum file size (in MB) that this plugin will attempt to render.
|
||||
-- Any file larger than this will effectively be ignored.
|
||||
max_file_size = 10.0,
|
||||
-- Milliseconds that must pass before updating marks, updates occur.
|
||||
-- within the context of the visible window, not the entire buffer.
|
||||
debounce = 100,
|
||||
-- Pre configured settings that will attempt to mimic various target user experiences.
|
||||
-- Any user provided settings will take precedence.
|
||||
-- | obsidian | mimic Obsidian UI |
|
||||
-- | lazy | will attempt to stay up to date with LazyVim configuration |
|
||||
-- | none | does nothing |
|
||||
preset = "none",
|
||||
-- The level of logs to write to file: vim.fn.stdpath('state') .. '/render-markdown.log'.
|
||||
-- Only intended to be used for plugin development / debugging.
|
||||
log_level = "error",
|
||||
-- Print runtime of main update method.
|
||||
-- Only intended to be used for plugin development / debugging.
|
||||
log_runtime = false,
|
||||
-- Filetypes this plugin will run on.
|
||||
file_types = { "markdown", "gitcommit" },
|
||||
-- Takes buffer as input, if it returns true this plugin will not attach to the buffer
|
||||
ignore = function()
|
||||
return false
|
||||
end,
|
||||
-- Additional events that will trigger this plugin's render loop.
|
||||
change_events = {},
|
||||
injections = {
|
||||
-- Out of the box language injections for known filetypes that allow markdown to be interpreted
|
||||
-- in specified locations, see :h treesitter-language-injections.
|
||||
-- Set enabled to false in order to disable.
|
||||
|
||||
gitcommit = {
|
||||
enabled = true,
|
||||
query = [[
|
||||
((message) @injection.content
|
||||
(#set! injection.combined)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "markdown"))
|
||||
]],
|
||||
},
|
||||
},
|
||||
patterns = {
|
||||
-- Highlight patterns to disable for filetypes, i.e. lines concealed around code blocks
|
||||
|
||||
markdown = {
|
||||
disable = true,
|
||||
directives = {
|
||||
{ id = 17, name = "conceal_lines" },
|
||||
{ id = 18, name = "conceal_lines" },
|
||||
},
|
||||
},
|
||||
},
|
||||
anti_conceal = {
|
||||
-- This enables hiding any added text on the line the cursor is on.
|
||||
enabled = true,
|
||||
-- Modes to disable anti conceal feature.
|
||||
disabled_modes = false,
|
||||
-- Number of lines above cursor to show.
|
||||
above = 0,
|
||||
-- Number of lines below cursor to show.
|
||||
below = 0,
|
||||
-- Which elements to always show, ignoring anti conceal behavior. Values can either be
|
||||
-- booleans to fix the behavior or string lists representing modes where anti conceal
|
||||
-- behavior will be ignored. Valid values are:
|
||||
-- bullet
|
||||
-- callout
|
||||
-- check_icon, check_scope
|
||||
-- code_background, code_border, code_language
|
||||
-- dash
|
||||
-- head_background, head_border, head_icon
|
||||
-- indent
|
||||
-- link
|
||||
-- quote
|
||||
-- sign
|
||||
-- table_border
|
||||
-- virtual_lines
|
||||
ignore = {
|
||||
code_background = true,
|
||||
indent = true,
|
||||
sign = true,
|
||||
virtual_lines = true,
|
||||
},
|
||||
},
|
||||
padding = {
|
||||
-- Highlight to use when adding whitespace, should match background.
|
||||
highlight = "Normal",
|
||||
},
|
||||
latex = {
|
||||
-- Turn on / off latex rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render latex.
|
||||
render_modes = false,
|
||||
-- Executable used to convert latex formula to rendered unicode.
|
||||
converter = "latex2text",
|
||||
-- Highlight for latex blocks.
|
||||
highlight = "RenderMarkdownMath",
|
||||
-- Determines where latex formula is rendered relative to block.
|
||||
-- | above | above latex block |
|
||||
-- | below | below latex block |
|
||||
position = "above",
|
||||
-- Number of empty lines above latex blocks.
|
||||
top_pad = 0,
|
||||
-- Number of empty lines below latex blocks.
|
||||
bottom_pad = 0,
|
||||
},
|
||||
on = {
|
||||
-- Called when plugin initially attaches to a buffer.
|
||||
attach = function() end,
|
||||
-- Called before adding marks to the buffer for the first time.
|
||||
initial = function() end,
|
||||
-- Called after plugin renders a buffer.
|
||||
render = function() end,
|
||||
-- Called after plugin clears a buffer.
|
||||
clear = function() end,
|
||||
},
|
||||
completions = {
|
||||
-- Settings for blink.cmp completions source
|
||||
blink = { enabled = false },
|
||||
-- Settings for coq_nvim completions source
|
||||
coq = { enabled = false },
|
||||
-- Settings for in-process language server completions
|
||||
lsp = { enabled = false },
|
||||
filter = {
|
||||
callout = function()
|
||||
-- example to exclude obsidian callouts
|
||||
-- return value.category ~= 'obsidian'
|
||||
return true
|
||||
end,
|
||||
checkbox = function()
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
heading = {
|
||||
-- Useful context to have when evaluating values.
|
||||
-- | level | the number of '#' in the heading marker |
|
||||
-- | sections | for each level how deeply nested the heading is |
|
||||
|
||||
-- Turn on / off heading icon & background rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render headings.
|
||||
render_modes = false,
|
||||
-- Turn on / off atx heading rendering.
|
||||
atx = true,
|
||||
-- Turn on / off setext heading rendering.
|
||||
setext = true,
|
||||
-- Turn on / off any sign column related rendering.
|
||||
sign = true,
|
||||
-- Replaces '#+' of 'atx_h._marker'.
|
||||
-- Output is evaluated depending on the type.
|
||||
-- | function | `value(context)` |
|
||||
-- | string[] | `cycle(value, context.level)` |
|
||||
icons = { " ", " ", " ", " ", " ", " " },
|
||||
-- Determines how icons fill the available space.
|
||||
-- | right | '#'s are concealed and icon is appended to right side |
|
||||
-- | inline | '#'s are concealed and icon is inlined on left side |
|
||||
-- | overlay | icon is left padded with spaces and inserted on left hiding any additional '#' |
|
||||
position = "overlay",
|
||||
-- Added to the sign column if enabled.
|
||||
-- Output is evaluated by `cycle(value, context.level)`.
|
||||
signs = { " " },
|
||||
-- Width of the heading background.
|
||||
-- | block | width of the heading text |
|
||||
-- | full | full width of the window |
|
||||
-- Can also be a list of the above values evaluated by `clamp(value, context.level)`.
|
||||
width = "full",
|
||||
-- Amount of margin to add to the left of headings.
|
||||
-- Margin available space is computed after accounting for padding.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
-- Can also be a list of numbers evaluated by `clamp(value, context.level)`.
|
||||
left_margin = 0,
|
||||
-- Amount of padding to add to the left of headings.
|
||||
-- Output is evaluated using the same logic as 'left_margin'.
|
||||
left_pad = 0,
|
||||
-- Amount of padding to add to the right of headings when width is 'block'.
|
||||
-- Output is evaluated using the same logic as 'left_margin'.
|
||||
right_pad = 0,
|
||||
-- Minimum width to use for headings when width is 'block'.
|
||||
-- Can also be a list of integers evaluated by `clamp(value, context.level)`.
|
||||
min_width = 0,
|
||||
-- Determines if a border is added above and below headings.
|
||||
-- Can also be a list of booleans evaluated by `clamp(value, context.level)`.
|
||||
border = false,
|
||||
-- Always use virtual lines for heading borders instead of attempting to use empty lines.
|
||||
border_virtual = false,
|
||||
-- Highlight the start of the border using the foreground highlight.
|
||||
border_prefix = false,
|
||||
-- Used above heading for border.
|
||||
above = "▄",
|
||||
-- Used below heading for border.
|
||||
below = "▀",
|
||||
-- Highlight for the heading icon and extends through the entire line.
|
||||
-- Output is evaluated by `clamp(value, context.level)`.
|
||||
backgrounds = {
|
||||
"RenderMarkdownH1Bg",
|
||||
"RenderMarkdownH2Bg",
|
||||
"RenderMarkdownH3Bg",
|
||||
"RenderMarkdownH4Bg",
|
||||
"RenderMarkdownH5Bg",
|
||||
"RenderMarkdownH6Bg",
|
||||
},
|
||||
-- Highlight for the heading and sign icons.
|
||||
-- Output is evaluated using the same logic as 'backgrounds'.
|
||||
foregrounds = {
|
||||
"RenderMarkdownH1",
|
||||
"RenderMarkdownH2",
|
||||
"RenderMarkdownH3",
|
||||
"RenderMarkdownH4",
|
||||
"RenderMarkdownH5",
|
||||
"RenderMarkdownH6",
|
||||
},
|
||||
-- Define custom heading patterns which allow you to override various properties based on
|
||||
-- the contents of a heading.
|
||||
-- The key is for healthcheck and to allow users to change its values, value type below.
|
||||
-- | pattern | matched against the heading text @see :h lua-patterns |
|
||||
-- | icon | optional override for the icon |
|
||||
-- | background | optional override for the background |
|
||||
-- | foreground | optional override for the foreground |
|
||||
custom = {},
|
||||
},
|
||||
paragraph = {
|
||||
-- Useful context to have when evaluating values.
|
||||
-- | text | text value of the node |
|
||||
|
||||
-- Turn on / off paragraph rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render paragraphs.
|
||||
render_modes = false,
|
||||
-- Amount of margin to add to the left of paragraphs.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
-- Output is evaluated depending on the type.
|
||||
-- | function | `value(context)` |
|
||||
-- | number | `value` |
|
||||
left_margin = 0,
|
||||
-- Amount of padding to add to the first line of each paragraph.
|
||||
-- Output is evaluated using the same logic as 'left_margin'.
|
||||
indent = 0,
|
||||
-- Minimum width to use for paragraphs.
|
||||
min_width = 0,
|
||||
},
|
||||
code = {
|
||||
-- Turn on / off code block & inline code rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render code blocks.
|
||||
render_modes = false,
|
||||
-- Turn on / off any sign column related rendering.
|
||||
sign = true,
|
||||
-- Determines how code blocks & inline code are rendered.
|
||||
-- | none | disables all rendering |
|
||||
-- | normal | background highlighting + padding |
|
||||
-- | language | language heading with icon + sign column |
|
||||
-- | full | normal + language |
|
||||
style = "full",
|
||||
-- Whether to conceal nodes at the top and bottom of code blocks.
|
||||
conceal_delimiters = true,
|
||||
-- Turn on / off any language heading related rendering.
|
||||
language = true,
|
||||
-- Determines where language icon is rendered.
|
||||
-- | right | right side of code block |
|
||||
-- | left | left side of code block |
|
||||
position = "left",
|
||||
-- Whether to include the language icon above code blocks.
|
||||
language_icon = true,
|
||||
-- Whether to include the language name above code blocks.
|
||||
language_name = true,
|
||||
-- Whether to include the language info above code blocks.
|
||||
language_info = true,
|
||||
-- Amount of padding to add around the language.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
language_pad = 0,
|
||||
-- A list of language names for which background highlighting will be disabled.
|
||||
-- Likely because that language has background highlights itself.
|
||||
-- Use a boolean to make behavior apply to all languages.
|
||||
-- Borders above & below blocks will continue to be rendered.
|
||||
disable_background = { "diff" },
|
||||
-- Width of the code block background.
|
||||
-- | block | width of the code block |
|
||||
-- | full | full width of the window |
|
||||
width = "full",
|
||||
-- Amount of margin to add to the left of code blocks.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
-- Margin available space is computed after accounting for padding.
|
||||
left_margin = 0,
|
||||
-- Amount of padding to add to the left of code blocks.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
left_pad = 0,
|
||||
-- Amount of padding to add to the right of code blocks when width is 'block'.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
right_pad = 0,
|
||||
-- Minimum width to use for code blocks when width is 'block'.
|
||||
min_width = 0,
|
||||
-- Determines how the top / bottom of code block are rendered.
|
||||
-- | none | do not render a border |
|
||||
-- | thick | use the same highlight as the code body |
|
||||
-- | thin | when lines are empty overlay the above & below icons |
|
||||
-- | hide | conceal lines unless language name or icon is added |
|
||||
border = "hide",
|
||||
-- Used above code blocks to fill remaining space around language.
|
||||
language_border = "█",
|
||||
-- Added to the left of language.
|
||||
language_left = "",
|
||||
-- Added to the right of language.
|
||||
language_right = "",
|
||||
-- Used above code blocks for thin border.
|
||||
above = "▄",
|
||||
-- Used below code blocks for thin border.
|
||||
below = "▀",
|
||||
-- Icon to add to the left of inline code.
|
||||
inline_left = "",
|
||||
-- Icon to add to the right of inline code.
|
||||
inline_right = "",
|
||||
-- Padding to add to the left & right of inline code.
|
||||
inline_pad = 0,
|
||||
-- Highlight for code blocks.
|
||||
highlight = "RenderMarkdownCode",
|
||||
-- Highlight for code info section, after the language.
|
||||
highlight_info = "RenderMarkdownCodeInfo",
|
||||
-- Highlight for language, overrides icon provider value.
|
||||
highlight_language = nil,
|
||||
-- Highlight for border, use false to add no highlight.
|
||||
highlight_border = "RenderMarkdownCodeBorder",
|
||||
-- Highlight for language, used if icon provider does not have a value.
|
||||
highlight_fallback = "RenderMarkdownCodeFallback",
|
||||
-- Highlight for inline code.
|
||||
highlight_inline = "RenderMarkdownCodeInline",
|
||||
},
|
||||
dash = {
|
||||
-- Turn on / off thematic break rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render dash.
|
||||
render_modes = false,
|
||||
-- Replaces '---'|'***'|'___'|'* * *' of 'thematic_break'.
|
||||
-- The icon gets repeated across the window's width.
|
||||
icon = "─",
|
||||
-- Width of the generated line.
|
||||
-- | <number> | a hard coded width value |
|
||||
-- | full | full width of the window |
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
width = "full",
|
||||
-- Amount of margin to add to the left of dash.
|
||||
-- If a float < 1 is provided it is treated as a percentage of available window space.
|
||||
left_margin = 0,
|
||||
-- Highlight for the whole line generated from the icon.
|
||||
highlight = "RenderMarkdownDash",
|
||||
},
|
||||
document = {
|
||||
-- Turn on / off document rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render document.
|
||||
render_modes = false,
|
||||
-- Ability to conceal arbitrary ranges of text based on lua patterns, @see :h lua-patterns.
|
||||
-- Relies entirely on user to set patterns that handle their edge cases.
|
||||
conceal = {
|
||||
-- Matched ranges will be concealed using character level conceal.
|
||||
char_patterns = {},
|
||||
-- Matched ranges will be concealed using line level conceal.
|
||||
line_patterns = {},
|
||||
},
|
||||
},
|
||||
bullet = {
|
||||
-- Useful context to have when evaluating values.
|
||||
-- | level | how deeply nested the list is, 1-indexed |
|
||||
-- | index | how far down the item is at that level, 1-indexed |
|
||||
-- | value | text value of the marker node |
|
||||
|
||||
-- Turn on / off list bullet rendering
|
||||
enabled = true,
|
||||
-- Additional modes to render list bullets
|
||||
render_modes = false,
|
||||
-- Replaces '-'|'+'|'*' of 'list_item'.
|
||||
-- If the item is a 'checkbox' a conceal is used to hide the bullet instead.
|
||||
-- Output is evaluated depending on the type.
|
||||
-- | function | `value(context)` |
|
||||
-- | string | `value` |
|
||||
-- | string[] | `cycle(value, context.level)` |
|
||||
-- | string[][] | `clamp(cycle(value, context.level), context.index)` |
|
||||
icons = { "●", "○", "◆", "◇" },
|
||||
-- Replaces 'n.'|'n)' of 'list_item'.
|
||||
-- Output is evaluated using the same logic as 'icons'.
|
||||
ordered_icons = function(ctx)
|
||||
local value = vim.trim(ctx.value)
|
||||
local index = tonumber(value:sub(1, #value - 1))
|
||||
return ("%d."):format(index > 1 and index or ctx.index)
|
||||
end,
|
||||
-- Padding to add to the left of bullet point.
|
||||
-- Output is evaluated depending on the type.
|
||||
-- | function | `value(context)` |
|
||||
-- | integer | `value` |
|
||||
left_pad = 0,
|
||||
-- Padding to add to the right of bullet point.
|
||||
-- Output is evaluated using the same logic as 'left_pad'.
|
||||
right_pad = 0,
|
||||
-- Highlight for the bullet icon.
|
||||
-- Output is evaluated using the same logic as 'icons'.
|
||||
highlight = "RenderMarkdownBullet",
|
||||
-- Highlight for item associated with the bullet point.
|
||||
-- Output is evaluated using the same logic as 'icons'.
|
||||
scope_highlight = {},
|
||||
},
|
||||
checkbox = {
|
||||
-- Checkboxes are a special instance of a 'list_item' that start with a 'shortcut_link'.
|
||||
-- There are two special states for unchecked & checked defined in the markdown grammar.
|
||||
|
||||
-- Turn on / off checkbox state rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render checkboxes.
|
||||
render_modes = false,
|
||||
-- Render the bullet point before the checkbox.
|
||||
bullet = false,
|
||||
-- Padding to add to the right of checkboxes.
|
||||
right_pad = 1,
|
||||
unchecked = {
|
||||
-- Replaces '[ ]' of 'task_list_marker_unchecked'.
|
||||
icon = " ",
|
||||
-- Highlight for the unchecked icon.
|
||||
highlight = "RenderMarkdownUnchecked",
|
||||
-- Highlight for item associated with unchecked checkbox.
|
||||
scope_highlight = nil,
|
||||
},
|
||||
checked = {
|
||||
-- Replaces '[x]' of 'task_list_marker_checked'.
|
||||
icon = " ",
|
||||
-- Highlight for the checked icon.
|
||||
highlight = "RenderMarkdownChecked",
|
||||
-- Highlight for item associated with checked checkbox.
|
||||
scope_highlight = nil,
|
||||
},
|
||||
-- Define custom checkbox states, more involved, not part of the markdown grammar.
|
||||
-- As a result this requires neovim >= 0.10.0 since it relies on 'inline' extmarks.
|
||||
-- The key is for healthcheck and to allow users to change its values, value type below.
|
||||
-- | raw | matched against the raw text of a 'shortcut_link' |
|
||||
-- | rendered | replaces the 'raw' value when rendering |
|
||||
-- | highlight | highlight for the 'rendered' icon |
|
||||
-- | scope_highlight | optional highlight for item associated with custom checkbox |
|
||||
-- stylua: ignore
|
||||
custom = {
|
||||
todo = { raw = '[-]', rendered = ' ', highlight = 'RenderMarkdownTodo', scope_highlight = nil },
|
||||
},
|
||||
},
|
||||
quote = {
|
||||
-- Turn on / off block quote & callout rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render quotes.
|
||||
render_modes = false,
|
||||
-- Replaces '>' of 'block_quote'.
|
||||
icon = "▋",
|
||||
-- Whether to repeat icon on wrapped lines. Requires neovim >= 0.10. This will obscure text
|
||||
-- if incorrectly configured with :h 'showbreak', :h 'breakindent' and :h 'breakindentopt'.
|
||||
-- A combination of these that is likely to work follows.
|
||||
-- | showbreak | ' ' (2 spaces) |
|
||||
-- | breakindent | true |
|
||||
-- | breakindentopt | '' (empty string) |
|
||||
-- These are not validated by this plugin. If you want to avoid adding these to your main
|
||||
-- configuration then set them in win_options for this plugin.
|
||||
repeat_linebreak = false,
|
||||
-- Highlight for the quote icon.
|
||||
-- If a list is provided output is evaluated by `cycle(value, level)`.
|
||||
highlight = {
|
||||
"RenderMarkdownQuote1",
|
||||
"RenderMarkdownQuote2",
|
||||
"RenderMarkdownQuote3",
|
||||
"RenderMarkdownQuote4",
|
||||
"RenderMarkdownQuote5",
|
||||
"RenderMarkdownQuote6",
|
||||
},
|
||||
},
|
||||
pipe_table = {
|
||||
-- Turn on / off pipe table rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render pipe tables.
|
||||
render_modes = false,
|
||||
-- Pre configured settings largely for setting table border easier.
|
||||
-- | heavy | use thicker border characters |
|
||||
-- | double | use double line border characters |
|
||||
-- | round | use round border corners |
|
||||
-- | none | does nothing |
|
||||
preset = "none",
|
||||
-- Determines how the table as a whole is rendered.
|
||||
-- | none | disables all rendering |
|
||||
-- | normal | applies the 'cell' style rendering to each row of the table |
|
||||
-- | full | normal + a top & bottom line that fill out the table when lengths match |
|
||||
style = "full",
|
||||
-- Determines how individual cells of a table are rendered.
|
||||
-- | overlay | writes completely over the table, removing conceal behavior and highlights |
|
||||
-- | raw | replaces only the '|' characters in each row, leaving the cells unmodified |
|
||||
-- | padded | raw + cells are padded to maximum visual width for each column |
|
||||
-- | trimmed | padded except empty space is subtracted from visual width calculation |
|
||||
cell = "padded",
|
||||
-- Amount of space to put between cell contents and border.
|
||||
padding = 1,
|
||||
-- Minimum column width to use for padded or trimmed cell.
|
||||
min_width = 0,
|
||||
-- Characters used to replace table border.
|
||||
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal.
|
||||
-- stylua: ignore
|
||||
border = {
|
||||
'┌', '┬', '┐',
|
||||
'├', '┼', '┤',
|
||||
'└', '┴', '┘',
|
||||
'│', '─',
|
||||
},
|
||||
-- Always use virtual lines for table borders instead of attempting to use empty lines.
|
||||
-- Will be automatically enabled if indentation module is enabled.
|
||||
border_virtual = false,
|
||||
-- Gets placed in delimiter row for each column, position is based on alignment.
|
||||
alignment_indicator = "━",
|
||||
-- Highlight for table heading, delimiter, and the line above.
|
||||
head = "RenderMarkdownTableHead",
|
||||
-- Highlight for everything else, main table rows and the line below.
|
||||
row = "RenderMarkdownTableRow",
|
||||
-- Highlight for inline padding used to add back concealed space.
|
||||
filler = "RenderMarkdownTableFill",
|
||||
},
|
||||
callout = {
|
||||
-- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'.
|
||||
-- The key is for healthcheck and to allow users to change its values, value type below.
|
||||
-- | raw | matched against the raw text of a 'shortcut_link', case insensitive |
|
||||
-- | rendered | replaces the 'raw' value when rendering |
|
||||
-- | highlight | highlight for the 'rendered' text and quote markers |
|
||||
-- | quote_icon | optional override for quote.icon value for individual callout |
|
||||
-- | category | optional metadata useful for filtering |
|
||||
|
||||
note = {
|
||||
raw = "[!NOTE]",
|
||||
rendered = " Note",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "github",
|
||||
},
|
||||
tip = {
|
||||
raw = "[!TIP]",
|
||||
rendered = " Tip",
|
||||
highlight = "RenderMarkdownSuccess",
|
||||
category = "github",
|
||||
},
|
||||
important = {
|
||||
raw = "[!IMPORTANT]",
|
||||
rendered = " Important",
|
||||
highlight = "RenderMarkdownHint",
|
||||
category = "github",
|
||||
},
|
||||
warning = {
|
||||
raw = "[!WARNING]",
|
||||
rendered = " Warning",
|
||||
highlight = "RenderMarkdownWarn",
|
||||
category = "github",
|
||||
},
|
||||
caution = {
|
||||
raw = "[!CAUTION]",
|
||||
rendered = " Caution",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "github",
|
||||
},
|
||||
-- Obsidian: https://help.obsidian.md/Editing+and+formatting/Callouts
|
||||
abstract = {
|
||||
raw = "[!ABSTRACT]",
|
||||
rendered = " Abstract",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "obsidian",
|
||||
},
|
||||
summary = {
|
||||
raw = "[!SUMMARY]",
|
||||
rendered = " Summary",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "obsidian",
|
||||
},
|
||||
tldr = {
|
||||
raw = "[!TLDR]",
|
||||
rendered = " Tldr",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "obsidian",
|
||||
},
|
||||
info = {
|
||||
raw = "[!INFO]",
|
||||
rendered = " Info",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "obsidian",
|
||||
},
|
||||
todo = {
|
||||
raw = "[!TODO]",
|
||||
rendered = " Todo",
|
||||
highlight = "RenderMarkdownInfo",
|
||||
category = "obsidian",
|
||||
},
|
||||
hint = {
|
||||
raw = "[!HINT]",
|
||||
rendered = " Hint",
|
||||
highlight = "RenderMarkdownSuccess",
|
||||
category = "obsidian",
|
||||
},
|
||||
success = {
|
||||
raw = "[!SUCCESS]",
|
||||
rendered = " Success",
|
||||
highlight = "RenderMarkdownSuccess",
|
||||
category = "obsidian",
|
||||
},
|
||||
check = {
|
||||
raw = "[!CHECK]",
|
||||
rendered = " Check",
|
||||
highlight = "RenderMarkdownSuccess",
|
||||
category = "obsidian",
|
||||
},
|
||||
done = {
|
||||
raw = "[!DONE]",
|
||||
rendered = " Done",
|
||||
highlight = "RenderMarkdownSuccess",
|
||||
category = "obsidian",
|
||||
},
|
||||
question = {
|
||||
raw = "[!QUESTION]",
|
||||
rendered = " Question",
|
||||
highlight = "RenderMarkdownWarn",
|
||||
category = "obsidian",
|
||||
},
|
||||
help = {
|
||||
raw = "[!HELP]",
|
||||
rendered = " Help",
|
||||
highlight = "RenderMarkdownWarn",
|
||||
category = "obsidian",
|
||||
},
|
||||
faq = {
|
||||
raw = "[!FAQ]",
|
||||
rendered = " Faq",
|
||||
highlight = "RenderMarkdownWarn",
|
||||
category = "obsidian",
|
||||
},
|
||||
attention = {
|
||||
raw = "[!ATTENTION]",
|
||||
rendered = " Attention",
|
||||
highlight = "RenderMarkdownWarn",
|
||||
category = "obsidian",
|
||||
},
|
||||
failure = {
|
||||
raw = "[!FAILURE]",
|
||||
rendered = " Failure",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
fail = {
|
||||
raw = "[!FAIL]",
|
||||
rendered = " Fail",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
missing = {
|
||||
raw = "[!MISSING]",
|
||||
rendered = " Missing",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
danger = {
|
||||
raw = "[!DANGER]",
|
||||
rendered = " Danger",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
error = {
|
||||
raw = "[!ERROR]",
|
||||
rendered = " Error",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
bug = {
|
||||
raw = "[!BUG]",
|
||||
rendered = " Bug",
|
||||
highlight = "RenderMarkdownError",
|
||||
category = "obsidian",
|
||||
},
|
||||
example = {
|
||||
raw = "[!EXAMPLE]",
|
||||
rendered = " Example",
|
||||
highlight = "RenderMarkdownHint",
|
||||
category = "obsidian",
|
||||
},
|
||||
quote = {
|
||||
raw = "[!QUOTE]",
|
||||
rendered = " Quote",
|
||||
highlight = "RenderMarkdownQuote",
|
||||
category = "obsidian",
|
||||
},
|
||||
cite = {
|
||||
raw = "[!CITE]",
|
||||
rendered = " Cite",
|
||||
highlight = "RenderMarkdownQuote",
|
||||
category = "obsidian",
|
||||
},
|
||||
},
|
||||
link = {
|
||||
-- Turn on / off inline link icon rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render links.
|
||||
render_modes = false,
|
||||
-- How to handle footnote links, start with a '^'.
|
||||
footnote = {
|
||||
-- Turn on / off footnote rendering.
|
||||
enabled = true,
|
||||
-- Replace value with superscript equivalent.
|
||||
superscript = true,
|
||||
-- Added before link content.
|
||||
prefix = "",
|
||||
-- Added after link content.
|
||||
suffix = "",
|
||||
},
|
||||
-- Inlined with 'image' elements.
|
||||
image = " ",
|
||||
-- Inlined with 'email_autolink' elements.
|
||||
email = " ",
|
||||
-- Fallback icon for 'inline_link' and 'uri_autolink' elements.
|
||||
hyperlink = " ",
|
||||
-- Applies to the inlined icon as a fallback.
|
||||
highlight = "RenderMarkdownLink",
|
||||
-- Applies to WikiLink elements.
|
||||
wiki = {
|
||||
icon = " ",
|
||||
body = function()
|
||||
return nil
|
||||
end,
|
||||
highlight = "RenderMarkdownWikiLink",
|
||||
},
|
||||
-- Define custom destination patterns so icons can quickly inform you of what a link
|
||||
-- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
|
||||
-- patterns match a link the one with the longer pattern is used.
|
||||
-- The key is for healthcheck and to allow users to change its values, value type below.
|
||||
-- | pattern | matched against the destination text |
|
||||
-- | icon | gets inlined before the link text |
|
||||
-- | kind | optional determines how pattern is checked |
|
||||
-- | | pattern | @see :h lua-patterns, is the default if not set |
|
||||
-- | | suffix | @see :h vim.endswith() |
|
||||
-- | priority | optional used when multiple match, uses pattern length if empty |
|
||||
-- | highlight | optional highlight for 'icon', uses fallback highlight if empty |
|
||||
custom = {
|
||||
web = { pattern = "^http", icon = " " },
|
||||
discord = { pattern = "discord%.com", icon = " " },
|
||||
github = { pattern = "github%.com", icon = " " },
|
||||
gitlab = { pattern = "gitlab%.com", icon = " " },
|
||||
google = { pattern = "google%.com", icon = " " },
|
||||
neovim = { pattern = "neovim%.io", icon = " " },
|
||||
reddit = { pattern = "reddit%.com", icon = " " },
|
||||
stackoverflow = { pattern = "stackoverflow%.com", icon = " " },
|
||||
wikipedia = { pattern = "wikipedia%.org", icon = " " },
|
||||
youtube = { pattern = "youtube%.com", icon = " " },
|
||||
},
|
||||
},
|
||||
sign = {
|
||||
-- Turn on / off sign rendering.
|
||||
enabled = true,
|
||||
-- Applies to background of sign text.
|
||||
highlight = "RenderMarkdownSign",
|
||||
},
|
||||
inline_highlight = {
|
||||
-- Mimics Obsidian inline highlights when content is surrounded by double equals.
|
||||
-- The equals on both ends are concealed and the inner content is highlighted.
|
||||
|
||||
-- Turn on / off inline highlight rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render inline highlights.
|
||||
render_modes = false,
|
||||
-- Applies to background of surrounded text.
|
||||
highlight = "RenderMarkdownInlineHighlight",
|
||||
},
|
||||
indent = {
|
||||
-- Mimic org-indent-mode behavior by indenting everything under a heading based on the
|
||||
-- level of the heading. Indenting starts from level 2 headings onward by default.
|
||||
|
||||
-- Turn on / off org-indent-mode.
|
||||
enabled = false,
|
||||
-- Additional modes to render indents.
|
||||
render_modes = false,
|
||||
-- Amount of additional padding added for each heading level.
|
||||
per_level = 2,
|
||||
-- Heading levels <= this value will not be indented.
|
||||
-- Use 0 to begin indenting from the very first level.
|
||||
skip_level = 1,
|
||||
-- Do not indent heading titles, only the body.
|
||||
skip_heading = false,
|
||||
-- Prefix added when indenting, one per level.
|
||||
icon = "▎",
|
||||
-- Priority to assign to extmarks.
|
||||
priority = 0,
|
||||
-- Applied to icon.
|
||||
highlight = "RenderMarkdownIndent",
|
||||
},
|
||||
html = {
|
||||
-- Turn on / off all HTML rendering.
|
||||
enabled = true,
|
||||
-- Additional modes to render HTML.
|
||||
render_modes = false,
|
||||
comment = {
|
||||
-- Turn on / off HTML comment concealing.
|
||||
conceal = true,
|
||||
-- Optional text to inline before the concealed comment.
|
||||
text = nil,
|
||||
-- Highlight for the inlined text.
|
||||
highlight = "RenderMarkdownHtmlComment",
|
||||
},
|
||||
-- HTML tags whose start and end will be hidden and icon shown.
|
||||
-- The key is matched against the tag name, value type below.
|
||||
-- | icon | gets inlined at the start |
|
||||
-- | highlight | highlight for the icon |
|
||||
tag = {},
|
||||
},
|
||||
win_options = {
|
||||
-- Window options to use that change between rendered and raw view.
|
||||
|
||||
-- @see :h 'conceallevel'
|
||||
conceallevel = {
|
||||
-- Used when not being rendered, get user setting.
|
||||
default = vim.o.conceallevel,
|
||||
-- Used when being rendered, concealed text is completely hidden.
|
||||
rendered = 3,
|
||||
},
|
||||
-- @see :h 'concealcursor'
|
||||
concealcursor = {
|
||||
-- Used when not being rendered, get user setting.
|
||||
default = vim.o.concealcursor,
|
||||
-- Used when being rendered, show concealed text in all modes.
|
||||
rendered = "",
|
||||
},
|
||||
},
|
||||
overrides = {
|
||||
-- More granular configuration mechanism, allows different aspects of buffers to have their own
|
||||
-- behavior. Values default to the top level configuration if no override is provided. Supports
|
||||
-- the following fields:
|
||||
-- enabled, max_file_size, debounce, render_modes, anti_conceal, padding, heading, paragraph,
|
||||
-- code, dash, bullet, checkbox, quote, pipe_table, callout, link, sign, indent, latex, html,
|
||||
-- win_options
|
||||
|
||||
-- Override for different buflisted values, @see :h 'buflisted'.
|
||||
buflisted = {},
|
||||
-- Override for different buftype values, @see :h 'buftype'.
|
||||
buftype = {
|
||||
nofile = {
|
||||
render_modes = true,
|
||||
padding = { highlight = "NormalFloat" },
|
||||
sign = { enabled = false },
|
||||
},
|
||||
},
|
||||
-- Override for different filetype values, @see :h 'filetype'.
|
||||
filetype = {},
|
||||
},
|
||||
custom_handlers = {
|
||||
-- Mapping from treesitter language to user defined handlers.
|
||||
-- @see [Custom Handlers](doc/custom-handlers.md)
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
require "nvchad.mappings"
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||
map("n", "gD", "<cmd>Telescope lsp_definitions<CR>", { desc = "Go to Definitions" })
|
||||
map("n", "grr", "<cmd>Telescope lsp_references<CR>", { desc = "Go to references" })
|
||||
map("n", "<leader>da", ":lua vim.lsp.buf.code_action()<cr>", { desc = "Code actions", noremap = true, silent = true })
|
||||
map("n", "<leader>dh", ":lua vim.diagnostic.open_float()<CR>", { desc = "Show diagnostics" })
|
||||
map("n", "<leader>dj", function()
|
||||
vim.diagnostic.jump { count = 1, float = true }
|
||||
end, { desc = "Go to next" })
|
||||
map("n", "<leader>dk", function()
|
||||
vim.diagnostic.jump { count = -1, float = true }
|
||||
end, { desc = "Go to previous" })
|
||||
-- Telescope
|
||||
map("n", "<leader>fr", ":Telescope resume<CR>", { desc = "Resume last search" })
|
||||
map("n", "<leader>fs", ":Telescope grep_string<CR>", { desc = "Find selected string" })
|
||||
map("n", "<leader>fk", ":Telescope keymaps<CR>", { desc = "Find keymaps" })
|
||||
map("n", "<leader>fd", ":Telescope diagnostics<CR>", { desc = "Diagnostics" })
|
||||
-- Remaps
|
||||
map({ "n", "v" }, "x", '"_x', { desc = "Delete char without yanking" })
|
||||
map({ "n", "v" }, "c", '"_c', { desc = "Change without yanking" })
|
||||
@@ -0,0 +1,6 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
@@ -0,0 +1,87 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre", -- uncomment for format on save
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"printf",
|
||||
"html",
|
||||
"css",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"markdown",
|
||||
"scss",
|
||||
"svelte",
|
||||
"typst",
|
||||
"vue",
|
||||
"regex",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
ft = { "markdown", "gitcommit" },
|
||||
opts = function()
|
||||
return require "configs.render-markdown"
|
||||
end,
|
||||
},
|
||||
|
||||
-- snacks.indent (below) draws the indent guides — disable NvChad's indent-blankline
|
||||
-- so they don't render doubled
|
||||
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
|
||||
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = false },
|
||||
dashboard = { enabled = false },
|
||||
explorer = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
--
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- opts = {
|
||||
-- ensure_installed = {
|
||||
-- "vim", "lua", "vimdoc",
|
||||
-- "html", "css"
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
}
|
||||
Reference in New Issue
Block a user