blink.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. return {
  2. 'saghen/blink.cmp',
  3. -- optional: provides snippets for the snippet source
  4. dependencies = { 'rafamadriz/friendly-snippets' },
  5. -- use a release tag to download pre-built binaries
  6. version = '1.*',
  7. -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
  8. -- build = 'cargo build --release',
  9. -- If you use nix, you can build from source using latest nightly rust with:
  10. -- build = 'nix run .#build-plugin',
  11. ---@module 'blink.cmp'
  12. ---@type blink.cmp.Config
  13. opts = {
  14. -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
  15. -- 'super-tab' for mappings similar to vscode (tab to accept)
  16. -- 'enter' for enter to accept
  17. -- 'none' for no mappings
  18. --
  19. -- All presets have the following mappings:
  20. -- C-space: Open menu or open docs if already open
  21. -- C-n/C-p or Up/Down: Select next/previous item
  22. -- C-e: Hide menu
  23. -- C-k: Toggle signature help (if signature.enabled = true)
  24. --
  25. -- See :h blink-cmp-config-keymap for defining your own keymap
  26. keymap = {
  27. preset = 'default',
  28. ['<C-z>'] = { 'accept', 'fallback' },
  29. },
  30. appearance = {
  31. -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
  32. -- Adjusts spacing to ensure icons are aligned
  33. nerd_font_variant = 'mono'
  34. },
  35. -- (Default) Only show the documentation popup when manually triggered
  36. completion = {
  37. documentation = { auto_show = false },
  38. ghost_text = { enabled = true },
  39. menu = { auto_show = false },
  40. },
  41. -- Default list of enabled providers defined so that you can extend it
  42. -- elsewhere in your config, without redefining it, due to `opts_extend`
  43. sources = {
  44. default = { 'lsp', 'path', 'snippets', 'buffer' },
  45. },
  46. -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
  47. -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
  48. -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
  49. --
  50. -- See the fuzzy documentation for more information
  51. fuzzy = { implementation = "prefer_rust_with_warning" }
  52. },
  53. opts_extend = { "sources.default" }
  54. }