Skip to content
Discussion options

You must be logged in to vote

Dumb

Why don't you just return an object from your file that contains all the blink.cmp keymaps? You can import this file from any part of your code.

If you don't want to deal with imports, you can also simply assign a global variable:

-- keymaps.lua

vim.g.blink_keymaps = {
  default = {
    preset = 'none',
    ['<Down>'] = { 'select_next', 'fallback' },
    ['<Up>'] = { 'select_prev', 'fallback' },
    -- ...
  },
  cmdline = {
    preset = 'none',
    -- ...
  },
}
-- blink.lua

return {
  'saghen/blink.cmp',
  -- please test on `main` if possible
  -- otherwise, remove this line and set `version = '*'`
  build = 'cargo build --release',
  opts = {
    keymap = vim.g.blink_keymaps.def…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Qwyntex
Comment options

Answer selected by Qwyntex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1691 on April 29, 2025 16:49.