VonHeikemen / fine-cmdline.nvim

Enter ex-commands in a nice floating input.
MIT License
445 stars 7 forks source link

Maching in file <filename>? #27

Closed tmpm697 closed 1 year ago

tmpm697 commented 1 year ago

whenever i press : and use ctrl-n/p to surf through command-line history, it always echoes matching in file <filename> at bottom of nvim window, why?

I don't want any mesg when surfing the history.

i have map vim.api.nvim_set_keymap('n', ':', '<cmd>FineCmdline<CR>', {silent = true})

VonHeikemen commented 1 year ago

The input is a floating window with a buffer, so my guess is ctrl-n/p do whatever default behavior they have in insert mode.

You might want to try this.

require('fine-cmdline').setup({
  after_mount = function(input)
    local fn = require('fine-cmdline').fn
    local opts = {buffer = input.bufnr, silent = true}

    vim.keymap.set('i', '<C-p>', fn.up_history, opts)
    vim.keymap.set('i', '<C-n>', fn.down_history, opts)
  end
})