GithubHelp home page GithubHelp logo

Add case insesitivity about switch.vim HOT 2 CLOSED

andrewradev avatar andrewradev commented on June 18, 2024
Add case insesitivity

from switch.vim.

Comments (2)

AndrewRadev avatar AndrewRadev commented on June 18, 2024

Would this functionality work for your use cases?

switch.vim/doc/switch.txt

Lines 187 to 201 in ec2b710

You might want this to work for different capitalizations, like with `true`
and `True` and `TRUE`. While you could use the more complicated dict
definition, a simple way to tackle this is to use the `switch#NormalizedCase`
helper:
>
let g:switch_custom_definitions =
\ [
\ switch#NormalizedCase(['one', 'two'])
\ ]
<
This would switch between "one" and "two", between "One" and "Two", and
between "ONE" and "TWO". This is not the default, since you might want to
change casing in your switches. See |switch-internals| for some information on
the underlying data format if you'd like to use a different method to
generate definitions (like, say, loading JSON).

For longer explanations on casing, take a look at #28 and/or #1 (comment)

from switch.vim.

wsistyrud avatar wsistyrud commented on June 18, 2024

That was exactly what I was looking for. Thank you!

from switch.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.