Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using VimScript functions inside Xvim?? #1077

Open
ghost opened this issue Jun 19, 2017 · 0 comments
Open

Using VimScript functions inside Xvim?? #1077

ghost opened this issue Jun 19, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 19, 2017

Description

Trying to use a vim function (located inside my .xvimrc)
Function Constr(cs)
if a:cs == "cx"
return "centerXAnchor"
"etc. etc.
endif
endfunction

Operation

So I hate typing up constraints. It kills me every single day.

  1. So lets say I have two characters that represent "centerXAnchor" with "cx"
  2. in EX mode, I do this ":s/ .\+ /=Constr(submatch(0))/g"

Note: Constr(cs) is a vimscript function (inside .xvimrc) that takes two character strings, goes through if-else statements to return the appropriate NSLayoutConstraint variable. So "ta" return "topAnchor"

Expected behaviour

Nothing happens when I run this. Ex command goes blank, and the text isn't changed.

Environments

  • Xcode Version [ 8.3.2 ]
  • XVim branch and revision [ developer i think? ]
  • Keyboard Language [ QWERTY ]
  • Input source language [ what... ]

Is it possible to add this functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants