1

I would like to use case-ignoring completion in the file arguments I pass to (n)vim in the internal command prompt:

  1. For example, :edit case<tab> should suggest caselower.txt and Caseupper.txt.

  2. Or :edit some-<tab> should offer completions including some_underscore.txt in addition to some-dash.txt)

I'm calling this completion suggestions in the prompt line (I'm not sure what else to search for in (n)vim :help, :com[mands] is not quite right.) I would like behavior equivalently to setting completion-ignore-case and completion-map-case in bash/readline. (bash: bind '[set ... on]' .inputrc: set [...] on).

Can I set up this completion ignore & map case in vim? If so, how? (Interested for vi/vim/Neovim)

4
  • Could you tell us which OS your are using (Windows, MacOS, Linux)? Jan 21 at 8:06
  • On Windows the completion is case insensitive like the file system is. But - and _ are treated as different characters. Could I ask you why you would like completion to be case insensitive? Are you looking for some kind of fuzzy completion like in (CtrlP, FZF or Clap)? Jan 21 at 9:31
  • I use macOS & Linux.
    – mcint
    Jan 22 at 4:22
  • 1
    It seems - and _ are not case-insensitive matches in vim/nvim.
    – mcint
    Jan 22 at 4:23

2 Answers 2

2

Vim provides file completion based on the filesystem characteristics (i.e. case sensitive for Linux, case insensitive for Windows).

As Matt mention you can force case insensitiveness using:

set wildignorecase

It also provide completion based on wildcard (e.g. ?, *)

But it doesn't provide fuzzy completion.

:help wildoption

Currently fuzzy matching based completion
is not supported for file and directory names and
instead wildcard expansion is used.

There are a number of plugin that helps user to find their files using some fuzzy logic the most famous are:

2
  • Thanks for the more extensive clarification of the limitations! :)
    – mcint
    Jan 22 at 4:24
  • Welcome to Vim :-) Thanks for the feedback, @Matt also clarifed the wildignorecase flag. Jan 22 at 5:10
2

Can I set up this completion ignore & map case in vim? If so, how?

Yes, :set wildignorecase

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.