From b77413ff8f59f380612074f0c9bd49093d8db695 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Sun, 19 Jan 2025 13:52:52 +0100 Subject: Squashed 'mut/neovim/pack/plugins/start/blink.cmp/' content from commit 1cc3b1a git-subtree-dir: mut/neovim/pack/plugins/start/blink.cmp git-subtree-split: 1cc3b1a908fbcfd15451c4772759549724f38524 --- docs/.gitignore | 3 + docs/.prettierrc | 5 + docs/.vitepress/config.mts | 68 + docs/.vitepress/theme/index.ts | 14 + docs/.vitepress/theme/style.css | 14 + docs/configuration/appearance.md | 29 + docs/configuration/completion.md | 170 +++ docs/configuration/fuzzy.md | 30 + docs/configuration/general.md | 66 + docs/configuration/keymap.md | 145 ++ docs/configuration/reference.md | 547 ++++++++ docs/configuration/signature.md | 13 + docs/configuration/snippets.md | 116 ++ docs/configuration/sources.md | 65 + docs/development/architecture.md | 9 + docs/development/lsp-tracker.md | 69 + docs/development/writing-sources.md | 3 + docs/index.md | 47 + docs/installation.md | 135 ++ docs/package-lock.json | 2525 +++++++++++++++++++++++++++++++++++ docs/package.json | 15 + docs/public/favicon.png | Bin 0 -> 103169 bytes docs/recipes.md | 241 ++++ 23 files changed, 4329 insertions(+) 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/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/lsp-tracker.md create mode 100644 docs/development/writing-sources.md 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 create mode 100644 docs/public/favicon.png create mode 100644 docs/recipes.md (limited to 'docs') diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..5506568 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +node_modules +.vitepress/cache +.vitepress/dist diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 0000000..31ba22d --- /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 0000000..d7fadcc --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,68 @@ +import { defineConfig } from 'vitepress' +import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' +import taskLists from 'markdown-it-task-lists' +import { execSync } from 'node:child_process' + +const isMain = process.env.IS_RELEASE !== 'true' +const version = execSync('git describe --tags --abbrev=0', { encoding: 'utf-8' }).trim() + +const siteUrl = isMain ? 'https://main.cmp.saghen.dev' : 'https://cmp.saghen.dev' +const otherSiteUrl = isMain ? 'https://cmp.saghen.dev' : 'https://main.cmp.saghen.dev' + +const title = isMain ? 'Main' : version +const otherTitle = isMain ? version : 'Main' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: 'Blink Completion (blink.cmp)', + description: 'Performant, batteries-included completion plugin for Neovim', + sitemap: { hostname: siteUrl }, + head: [['link', { rel: 'icon', href: '/favicon.png' }]], + themeConfig: { + nav: [{ text: `Version: ${title}`, items: [{ text: otherTitle, link: otherSiteUrl }] }], + sidebar: [ + { text: 'Introduction', link: '/' }, + { text: 'Installation', link: '/installation' }, + { text: 'Recipes', link: '/recipes' }, + { + text: 'Configuration', + items: [ + { text: 'General', link: '/configuration/general' }, + { text: 'Appearance', link: '/configuration/appearance' }, + { text: 'Completion', link: '/configuration/completion' }, + { text: 'Fuzzy', link: '/configuration/fuzzy' }, + { 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' }, + { text: 'LSP Tracker', link: '/development/lsp-tracker' }, + ], + }, + ], + + 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) + md.use(taskLists) + }, + }, +}) diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 0000000..f13e9f9 --- /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 0000000..05ce570 --- /dev/null +++ b/docs/.vitepress/theme/style.css @@ -0,0 +1,14 @@ +/* Wrap text in code blocks */ +code { + white-space: pre-wrap !important; + word-break: break-word !important; +} + +.content-container { + max-width: 800px !important; +} + +.VPBadge > a { + text-decoration: none !important; + color: inherit !important; +} diff --git a/docs/configuration/appearance.md b/docs/configuration/appearance.md new file mode 100644 index 0000000..9d13913 --- /dev/null +++ b/docs/configuration/appearance.md @@ -0,0 +1,29 @@ +# Appearance Go to default configuration + +If you're looking for how to change the appearance of the completion menu, check out the [menu draw configuration](./completion#completion-menu-draw). + +## 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 0000000..be8ec1a --- /dev/null +++ b/docs/configuration/completion.md @@ -0,0 +1,170 @@ +# 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 Go to default configuration + +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 Go to default configuration + +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 +Shows after typing a keyword, typically an alphanumeric character, `-` or `_` + +```lua +completion.trigger.show_on_keyword = true +``` + +