Code Monkey home page Code Monkey logo

Comments (9)

nawordar avatar nawordar commented on August 29, 2024 5

Couldn't /upcase//downcase//capitalize be implemented first? It seems to be much easier to implement than Regex transformation support.

from vim-vsnip.

hrsh7th avatar hrsh7th commented on August 29, 2024 2

Sorry.
Currently, vsnip does not supported the transform feature.

transform feature is hard to implement because we should parse and translate javascript regexp.

from vim-vsnip.

hrsh7th avatar hrsh7th commented on August 29, 2024 1

Anyway, The parse failing does not expect so I've fixed it.

from vim-vsnip.

ahmedelgabri avatar ahmedelgabri commented on August 29, 2024 1

Anyway, The parse failing does not expect so I've fixed it.

Fixed, thanks

transform feature is hard to implement because we should parse and translate javascript regexp.

I understand that, but if the project goal is to support VSCode snippets format, IMO this is required. Otherwise, you can support vim regex instead but this will be breaking the interoperability with VSCode snippets then.

from vim-vsnip.

hrsh7th avatar hrsh7th commented on August 29, 2024 1

Yes. I planning and investigating to support it.

The feature is hard to support but I think the implementation is fun.

from vim-vsnip.

jandamm avatar jandamm commented on August 29, 2024 1

Since ${VIM:...} is supported, is there a way to use Regex this way? At least using Vims Regex (maybe \v by default).

from vim-vsnip.

hrsh7th avatar hrsh7th commented on August 29, 2024

Hm... we can't support [^\W] regex maybe...

from vim-vsnip.

jimcornmell avatar jimcornmell commented on August 29, 2024

As a workaround is it possible to pass variables into VIM/python, and then use python to manipulate them?

For example, note the first one works, the last 2 do not.

"${VIM:system('python -c \"import uuid, re, sys;sys.stdout.write(re.sub(r\\\"[^a-j]\\\",\\\"\\\",\\\"\\$USER\\\"))\"')}",
"${VIM:system('python -c \"import uuid, re, sys;sys.stdout.write(re.sub(r\\\"[^a-j]\\\",\\\"\\\",\\\"\\$TM_DIRECTORY\\\"))\"')}",
"${VIM:system('python -c \"import uuid, re, sys;sys.stdout.write(re.sub(r\\\"[^a-j]\\\",\\\"\\\",\\\"$TM_DIRECTORY\\\"))\"')}",

I know its not portable, but neither is $VIM....

Then we can use this: https://www.tutorialspoint.com/python/python_reg_expressions.htm

from vim-vsnip.

thorlucas avatar thorlucas commented on August 29, 2024

I agree that this is a very important thing to support. I believe UltiSnips manages to do it but they have the luxury of working with Python.

from vim-vsnip.

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.