A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jonarrien/telescope-cmdline.nvim below:

GitHub - jonarrien/telescope-cmdline.nvim: Telescope cmdline

Telescope extension to use command line in a floating window, rather than in bottom-left corner. Allows using fuzzy search to filter neovim commands and command history simultaneously.

Warning

Make sure to load the cmdline extension after telescope, otherwise Telescope cmdline command won't be available.

Using Packer
use { 'jonarrien/telescope-cmdline.nvim' }
require("telescope").setup({})
require("telescope").load_extension('cmdline')
Using Lazy

Install package as telescope dependency

{
  "nvim-telescope/telescope.nvim",
  tag = "0.1.5",
  dependencies = {
    'nvim-lua/plenary.nvim',
    'jonarrien/telescope-cmdline.nvim',
  },
  keys = {
    { 'Q', '<cmd>Telescope cmdline<cr>', desc = 'Cmdline' }
    { '<leader><leader>', '<cmd>Telescope cmdline<cr>', desc = 'Cmdline' }
  },
  opts = {
    ...
    extensions = {
      cmdline = {
        ... plugin settings ...
      },
    }
    ...
  }, 
  config = function(_, opts)
    require("telescope").setup(opts)
    require("telescope").load_extension('cmdline')
  end,
}

You can customise cmdline settings in telescope configuration.

require("telescope").setup({
  -- ...
  extensions = {
    cmdline = {
      -- Adjust telescope picker size and layout
      picker = {
        layout_config = {
          width  = 120,
          height = 25,
        }
      },
      -- Adjust your mappings 
      mappings    = {
        complete      = '<Tab>',
        run_selection = '<C-CR>',
        run_input     = '<CR>',
      },
      -- Triggers any shell command using overseer.nvim (`:!`)
      overseer    = {
        enabled = true,
      },
    },
  }
  -- ...
})

Default configuration can be found in lua/cmdline/config.lua file.

Caution

Neovim's built-in cmdline is triggered with : and overriding this mapping can have a severe impact in your setup. Therefore it is completely discouraged.

Tip

The recommended mapping is Q, normally used for :Ex mode. It's out of use in modern setups and is easily reachable as :. Alternatively, you could use double leader. Please, use the one that suits best for you:

vim.api.nvim_set_keymap('n', 'Q', ':Telescope cmdline<CR>', { noremap = true, desc = "Cmdline" })
vim.api.nvim_set_keymap('n', '<leader><leader>', ':Telescope cmdline<CR>', { noremap = true, desc = "Cmdline" })

Picker mappings

Key Descrition <CR> Triggers the selected command in telescope results <C-CR> Triggers user input from prompt, ignoring selected result. <TAB> Expand selected row into prompt for editing

Caution

This is an alpha version done in relative short time. May need further improvements or customizations, but it's working pretty well for me and thought sharing with community.

Feel free to create an issue/PR if you want to see anything else implemented, but please read CONTRIBUTING.md before opening a PR.

We enjoy this awesome plugin thanks to these wonderful people:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4