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.
:vsplit
or :tabnew
and press <Space>
to see folders and filenames.DiffviewOpen
and press <Space>
to show git branch names.lsprest
and use <Tab>
to expand LspRestart
dvo
can filter DiffviewOpen
command.gipure
can filter a previously executed Git pull --rebase
command.:!...
)Warning
Make sure to load the cmdline
extension after telescope, otherwise Telescope cmdline
command won't be available.
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
q
or quit
from the standard command line when there are unsaved changes returns multiple errors, the second and subsequent errors tell which buffers have unsaved changes, but the first error, the only one available to telescope-cmdline.nvim
, just says "No write since last change".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