hrsh7th / vim-vsnip

Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
MIT License
876 stars 37 forks source link

Support whole word transform on tabstop and variable #232

Closed MunifTanjim closed 2 years ago

MunifTanjim commented 2 years ago

Related to: https://github.com/hrsh7th/vim-vsnip/issues/83#issuecomment-856075164 https://github.com/hrsh7th/vim-vsnip/issues/209

This helps with my React.js snippet;

{
  "useState": {
    "prefix": "us",
    "body": "const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initial${1/(.*)/${1:/capitalize}/}})$0",
    "description": "hook: useState"
  }
}
hrsh7th commented 2 years ago

This approach is good to me. I'll review it.

hrsh7th commented 2 years ago

LGTM! Do you have remaining todo for this?

MunifTanjim commented 2 years ago

Do you have remaining todo for this?

Nope, that's it for now.

hrsh7th commented 2 years ago

Thank you for your contribution!