From 2e1edb9f48d489240333b75a44c1b88e045fb720 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Fri, 20 Dec 2024 17:25:00 -0500 Subject: [PATCH] docs: initial vitepress --- LSP_TRACKER.md | 2 +- docs/.gitignore | 2 + docs/.prettierrc | 5 + docs/.vitepress/config.mts | 53 + docs/.vitepress/theme/index.ts | 14 + docs/.vitepress/theme/style.css | 9 + docs/configuration/appearance.md | 30 + docs/configuration/completion.md | 100 + docs/configuration/fuzzy.md | 30 + docs/configuration/general.md | 59 + docs/configuration/keymap.md | 125 + docs/configuration/recipes.md | 125 + docs/configuration/reference.md | 533 ++++ docs/configuration/signature.md | 13 + docs/configuration/snippets.md | 109 + docs/configuration/sources.md | 63 + docs/development/architecture.md | 9 + docs/development/writing-sources.md | 3 + docs/favicon.png | Bin 0 -> 103169 bytes docs/index.md | 20 + docs/installation.md | 132 + docs/package-lock.json | 2499 +++++++++++++++++++ docs/package.json | 12 + lua/blink/cmp/completion/trigger/init.lua | 9 +- lua/blink/cmp/config/completion/accept.lua | 2 +- lua/blink/cmp/config/completion/trigger.lua | 2 +- 26 files changed, 3956 insertions(+), 4 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/.prettierrc create mode 100644 docs/.vitepress/config.mts create mode 100644 docs/.vitepress/theme/index.ts create mode 100644 docs/.vitepress/theme/style.css create mode 100644 docs/configuration/appearance.md create mode 100644 docs/configuration/completion.md create mode 100644 docs/configuration/fuzzy.md create mode 100644 docs/configuration/general.md create mode 100644 docs/configuration/keymap.md create mode 100644 docs/configuration/recipes.md create mode 100644 docs/configuration/reference.md create mode 100644 docs/configuration/signature.md create mode 100644 docs/configuration/snippets.md create mode 100644 docs/configuration/sources.md create mode 100644 docs/development/architecture.md create mode 100644 docs/development/writing-sources.md create mode 100644 docs/favicon.png create mode 100644 docs/index.md create mode 100644 docs/installation.md create mode 100644 docs/package-lock.json create mode 100644 docs/package.json diff --git a/LSP_TRACKER.md b/LSP_TRACKER.md index a966487a..5f694170 100644 --- a/LSP_TRACKER.md +++ b/LSP_TRACKER.md @@ -56,7 +56,7 @@ - [x] `documentation` <- both string and markup content - [x] `deprecated` - [ ] `preselect` -- [ ] `sortText` +- [x] `sortText` - [x] `filterText` - [x] `insertText` - [x] `insertTextFormat` <- regular or snippet diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..e330f78c --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +node_modules +.vitepress/cache diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 00000000..31ba22d8 --- /dev/null +++ b/docs/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 00000000..30a681f5 --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,53 @@ +import { defineConfig } from 'vitepress' +import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: 'Blink Completion (blink.cmp)', + description: 'Performant, batteries-included completion plugin for Neovim', + base: '/cmp/', + sitemap: { hostname: 'https://blink.saghen.dev/cmp' }, + head: [['link', { rel: 'icon', href: '/favicon.png' }]], + themeConfig: { + sidebar: [ + { text: 'Introduction', link: '/' }, + { text: 'Installation', link: '/installation' }, + { + text: 'Configuration', + items: [ + { text: 'General', link: '/configuration/general' }, + { text: 'Appearance', link: '/configuration/appearance' }, + { text: 'Completion', link: '/configuration/completion' }, + { text: 'Keymap', link: '/configuration/keymap' }, + { text: 'Signature', link: '/configuration/signature' }, + { text: 'Sources', link: '/configuration/sources' }, + { text: 'Snippets', link: '/configuration/snippets' }, + { text: 'Reference', link: '/configuration/reference' }, + ], + }, + { + text: 'Development', + items: [ + { text: 'Architecture', link: '/development/architecture' }, + { text: 'Writing Sources', link: '/development/writing-sources' }, + ], + }, + ], + + socialLinks: [{ icon: 'github', link: 'https://github.com/saghen/blink.cmp' }], + + search: { + provider: 'local', + }, + }, + + markdown: { + theme: { + light: 'catppuccin-latte', + dark: 'catppuccin-mocha', + }, + config(md) { + md.use(tabsMarkdownPlugin) + }, + }, +}) diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 00000000..f13e9f9a --- /dev/null +++ b/docs/.vitepress/theme/index.ts @@ -0,0 +1,14 @@ +// https://vitepress.dev/guide/custom-theme +import DefaultTheme from 'vitepress/theme' +import type { Theme } from 'vitepress' +import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' + +import '@catppuccin/vitepress/theme/mocha/blue.css' +import './style.css' + +export default { + extends: DefaultTheme, + enhanceApp({ app }) { + enhanceAppWithTabs(app) + }, +} satisfies Theme diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css new file mode 100644 index 00000000..40354f4f --- /dev/null +++ b/docs/.vitepress/theme/style.css @@ -0,0 +1,9 @@ +/* Wrap text in code blocks */ +code { + white-space: pre-wrap !important; + word-break: break-word !important; +} + +.content-container { + max-width: 800px !important; +} diff --git a/docs/configuration/appearance.md b/docs/configuration/appearance.md new file mode 100644 index 00000000..4c626b12 --- /dev/null +++ b/docs/configuration/appearance.md @@ -0,0 +1,30 @@ +# Appearance + +If you're looking for how to change the appearance of the completion menu, check out the [menu draw configuration](./completion/menu/draw.md). + + +## Highlight groups + +| Group | Default | Description | +| ----- | ------- | ----------- | +| `BlinkCmpMenu` | Pmenu | The completion menu window | +| `BlinkCmpMenuBorder` | Pmenu | The completion menu window border | +| `BlinkCmpMenuSelection` | PmenuSel | The completion menu window selected item | +| `BlinkCmpScrollBarThumb` | PmenuThumb | The scrollbar thumb | +| `BlinkCmpScrollBarGutter` | PmenuSbar | The scrollbar gutter | +| `BlinkCmpLabel` | Pmenu | Label of the completion item | +| `BlinkCmpLabelDeprecated` | NonText | Deprecated label of the completion item | +| `BlinkCmpLabelMatch` | Pmenu | (Currently unused) Label of the completion item when it matches the query | +| `BlinkCmpLabelDetail` | NonText | Label description of the completion item | +| `BlinkCmpLabelDescription` | NonText | Label description of the completion item | +| `BlinkCmpKind` | Special | Kind icon/text of the completion item | +| `BlinkCmpKind` | Special | Kind icon/text of the completion item | +| `BlinkCmpSource` | NonText | Source of the completion item | +| `BlinkCmpGhostText` | NonText | Preview item with ghost text | +| `BlinkCmpDoc` | NormalFloat | The documentation window | +| `BlinkCmpDocBorder` | NormalFloat | The documentation window border | +| `BlinkCmpDocSeparator` | NormalFloat | The documentation separator between doc and detail | +| `BlinkCmpDocCursorLine` | Visual | The documentation window cursor line | +| `BlinkCmpSignatureHelp` | NormalFloat | The signature help window | +| `BlinkCmpSignatureHelpBorder` | NormalFloat | The signature help window border | +| `BlinkCmpSignatureHelpActiveParameter` | LspSignatureActiveParameter | Active parameter of the signature help | diff --git a/docs/configuration/completion.md b/docs/configuration/completion.md new file mode 100644 index 00000000..c44e637c --- /dev/null +++ b/docs/configuration/completion.md @@ -0,0 +1,100 @@ +# Completion + +Blink cmp has *a lot* of configuration options, the following document tries to highlight the ones you'll likely care the most about for each section. For all options, click on the "Go to default configuration" button next to each header. + +## Keyword + +Controls what the plugin considers to be a keyword, used for fuzzy matching and triggering completions. Most notably, the `range` option controls whether the keyword should match against the text before *and* after the cursor, or just before the cursor. + +:::tabs +== Prefix + +== Full + +::: + +## Trigger + +Controls when to request completion items from the sources and show the completion menu. The following options are available, excluding their `show_on` prefix: + +:::tabs +== Keyword +