6

In sublime text, we can press P to bring up the command palette. Are there any similar tools for vim?

I’ve been trying vim-ctrlp-cmdpalette, and although it works relatively well (there are some small issues), it depends on ctrlp (not a huge problem), and it looks like it won’t see much development (it has 14 commits over the course of 3 days, 5 months ago, for an “Initial experimental version”), so I was wondering if there are any known alternatives, since searching for “vim command palette” is a bit limiting; maybe there are some other terms more appropriate for this.

4 Answers 4

2

The Command Palette holds infrequently used functionality, like sorting, changing the syntax and changing the indentation settings. With just a few keystrokes, you can search for what you want, without ever having to navigate through the menus or remember obscure key bindings.

This is exactly what Vim's command-line is for. The only difference is that you don't get the cool but ultimately unnecessary fuzzy search you get in ST.

:e<C-d>
:e<Tab>

In combination with wildmenu, your favorite wildoptions and a touch of wildignore and wildignorecase you have got a pretty useful mechanism, there.

If you want to go down the plugin road, it's probable that you'll find what you want for unite or you could try Paradigm's SkyBison.

But my advice is to stick with the normal command-line.

3
  • 7
    “cool but ultimately unnecessary fuzzy search”; that’s where our opinions differ. Many times I only remember part of a command, and not the start, so fuzzy searching is not useless to me. Also, in addition to the fuzzy search, it also gives a short command descriptions, which is very useful to understand new plugin options.
    – user137369
    Nov 8, 2013 at 16:40
  • Hmm. New plugins options are explained in the plugin's documentation. Also I said "unnecessary", not "useless". There's no direct equivalent of that command palette in vim. You'll have to adapt or convince ctrlp's developer to add the features you want.
    – romainl
    Nov 8, 2013 at 17:50
  • “Also I said "unnecessary", not "useless"”. You’re correct, and I apologise, my mistake.
    – user137369
    Nov 8, 2013 at 18:18
4

If you don't mind installing plugins, there are fzf and fzf.vim. You can use them to fuzzy search VIM commands (and other things like lines, files, buffers, tags).

After installing both plugins, type: :Commands+Enter and you will see this window:

Image: searching for "dele" using fzf.vim

IMG:

Now, you can type your fuzzy search term, select items with up/down arrows and execute selected command with Enter.


There is another plugin called fuzzymenu, which provides a bit improved commands search and also allows you to interactively search-and-build normal-mode commands (like ciw, gUgU and so on).

But I had no experience with it myself.

0

It would help if you elaborated on what you meant by a command palette. I am guessing you mean this:

http://www.pixhost.org/show/3984/19384689_vi_history.jpeg

In order to access this you press

q: 

http://vim.wikia.com/wiki/Using_command-line_history

1
  • 1
    For anyone unfamiliar with the concept of a command palette, here's an overview: "Early text editors like Vim took the command line approach, with commands such as :wq to save your work and quit the program. They’re fast to use once you learn them—but you have to learn them in the first place. Thus the genius of the command palette in Sublime Text—and its early predecessor in the Mac’s help menu search. You don’t have to learn what to press or even know what to look for. Just type and get the feature you need." source: capiche.com/e/consumer-dev-tools-command-palette Dec 14, 2021 at 18:33
0

I wrote a conmand palette plugin for neovim:

https://github.com/LinArcX/telescope-command-palette.nvim

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 24, 2021 at 19:19
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Mureinik
    Dec 24, 2021 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .