XVim: Xcode9 cannot install XVim.

I installed Xcode9 beta today and tried to install XVim. But Xvim shows build error written above.

DVTTextSidebarViewHook.h: 11

DVTTextSidebarView.h file not found

Plz fix it.

Thx for your reading this issue.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 47
  • Comments: 124 (33 by maintainers)

Most upvoted comments

I successfully hooked keyDown method of the IDEPegususSourceEditor.SourceCodeEditorView. Unfortunately there are a lot of other changes XVim must adjust to new Xcode. I’m working on it.

The editor in Xcode 9.0 deosn’t use NSTextView. I have to migrate some NSTextView dependent code to fit to new Xcode 9.0’s class “_TtC12SourceEditor16SourceEditorView”. I already confirmed that I can move cursor with hjkl so it should work but still need some amount of time.

I will have a release (under XVim2 project) in a few days, covering most functions.

Sorry for waiting you long. For Xcode9 I think I have to rewrite, re-structure the XVim. Some main component (like calculating movements) can be reused but actual event handling will be rewritten. I think the first release of XVim would be with really limited features like movements, yank, paste.

Well it seems that I can call setSelectedTextRange on IDEPegasusSourceEditor.SourceCodeEditorView which inherits the SourceEditorView. I’m doing try and error and find methods I need now. I still need some methods(or property) to access so I’ll keep doing it. (But I feel its not too far to implement basic vim emulation.)

Sorry I have been so busy for this 2 months that I have to work on my main job in weekends too.

Everyone is thinking about how to implement vim feature into Xcode 9 but I feel it is not easy task (I mean there shouldn’t be easy way. Need effort and time). As some of you may already know I started to write XVim2 from scratch but I can’t spend time on it.

If some of you want to implement it by yourself, (apparently) you can use XVim code base freely.

Sorry again that I can’t help you guys much about this for now.

I’ve pushed to https://github.com/antmd/XVim2/tree/experiment, and raised a pull request. Please pull and start listing issues against XVim2!

I am seriously considering to quit iOS development if future versions of xCode don’t support vi mode 😦

Sorry for late response. Hm… I have to find a time to work on XVim more. I only have weekends to work on it now. I would love to assign some tasks but it is still difficult task because XVim is not a simple application. The main tasks are to find out which classes/objects we should hook and which methods can be usable for Vim emulation. I hope I can make it by the release of Xcode 9 GM.

While we’re waiting for @antmd, I made a fork from @pebble8888’s fork from XVim2 to add some basic functions that I’m using everyday:

  • gg, $, 0, o
  • y, p
  • :w to save

I’m trying to implement the search with / and ? right now, but not sure if I can finish it or not. And that’s the last one I will implement. No plan to continue or merge, since @antmd is already working on it.

For now, if you’d like to try, please feel free to use my fork.

@antmd Thanks. Yea I think there a a lot you can help but I think creating basic structure in my side and sharing it with others, approving PR would work better than explaining everything in text message. Xcode 9’s editor is completely different from the older one. So I think I have to make big change in the XVim classes. I might be misunderstanding Xcode9 classes because it seems Xcode9’s debugger itself is not still complete and not showing the information correctly. I’m still in studying relationships in the editor class and other related objects.

I’m so so so so looking forward to your fixing! @JugglerShu

@rudedogg I’ve integrated swiftneovim into the Xvim project, but I think it might be better to use NeoVimServer directly. image

I wish Apple understood how important this plugin is to developers.

Let’s be patient. I’m sure @JugglerShu will let us know when he’s made more progress with studying Xcode 9’s new editor. Also count me in if you need a hand.

I have been trying to re-write XVim for Xcode9 but I still need some time. Most difficult part of it is to know how _TtC12SourceEditor16SourceEditorView class works in Xcode9. For now I found a method to obtain its contents but I still not found a method(way) to set current insertion point.

If some of you are familiar with swift class/object debugging, please try it. ( I found something like SourceEditor.SourceEditor.SourceEditorView.selection.setter : Swift.Optional<SourceEditor.SourceEditorSelection> (from lldb autocompletion) but I don’t know how to invoke it from objective-c source code. (It is totally ok to implement it in swift but it seems I need .swiftmodule file for SourceEditor if I want to use it from swift correctly…)

Very much appreciate the work @JugglerShu. Just backed the bounty for this issue.

In case anyone’s not following the bounty it’s up to $540. WOW!

You can run xcrun swift-demangle SYMBOL to see what it translates to:

$ xcrun swift-demangle _TtC22IDEPegasusSourceEditor20SourceCodeEditorView
_TtC22IDEPegasusSourceEditor20SourceCodeEditorView ---> IDEPegasusSourceEditor.SourceCodeEditorView

Here’s a rundown of the “magic” characters though: https://mikeash.com/pyblog/friday-qa-2014-08-15-swift-name-mangling.html

@keith Thanks!

This is unsurprising since the new source editor is said to be written from the ground up. This will likely require a decent amount of investigation since the class hierarchy that XVim is hooking in to will have changed 100%.

It would be helpful if you (or anyone else) could start looking in to this so we can understand the scope of changes that need to be made!

Omygoodness it’s $800 now

I’m filing radars for vim mode since Xcode 4 and getting ‘closed: duplicate’ since that time, too. But it seems they don’t get enough radars to take this serious. 😦

So more radars, please. 😃

I’m putting my vote in for a NeoVim solution, which seems like the best solution by far in the long term. Frankly I think no barrier is too great for the sake of getting NeoVim integration working. … but we’re all busy aren’t we? 😞

@JugglerShu Thanks for your work and for updating us. I am more than happy and I think others would certainly agree, to just have features like movements, yank, paste. This is 90% of XVim to me anyway and 100% percent better than no XVim at all.

very uncomfortable without XVim. 😂

@JugglerShu Thanks a lot! I’m so looking forward to your fixing!

It’s working 🎉 Thanks for everyone’s work on this. I’d been holding off on using Xcode 9 because it’s pretty painful without Xvim. Glad to have it back.

On Thu, Oct 12, 2017 at 9:26 AM baek-jinoo notifications@github.com wrote:

I’ve tried using nolink branch, but I’m still getting an error when doing make:

The following build commands failed: Ld build/Release/XVim2.xcplugin/

Contents/MacOS/XVim2 normal x86_64 GenerateDSYMFile build/Release/XVim2.xcplugin.dSYM build/Release/XVim2.xcplugin/Contents/MacOS/XVim2 (2 failures) make: *** [release] Error 65

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/XVimProject/XVim/issues/1074#issuecomment-335976811, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaVqXZxMzEc2ls6_tZRPd1EYFZAHhFYks5srU7BgaJpZM4Nxbkg .

@basketwang @ober01 had the same issue and you have to try the debug build : make debug

Works fine with basic keystrokes, it seems easy to extend with more shortcuts and I guess it can make us wait for a more complete solution from @JugglerShu or @antmd

I’m not sure how much of the difficulty comes from implementing the Vim-specific part, but I wonder if using headless neovim is a better way to go? See https://github.com/qvacua/vimr/blob/169e1fafeb13eddb28319bbeade4991f1682f3f0/SwiftNeoVim/NeoVimViewDelegate.swift for some of the API.

I included the SwiftNeoVim framework in a plugin, but got stuck on importing the interfaces and Swizzling from Swift. If someone can show an example of calling something on the new source editor through Swift I’d like to see it!

Edit: Here’s the repo, I made it public - https://github.com/rudedogg/XNeovim. It took me awhile to get SwiftNeoVim compiled and imported as a static library, so hopefully it helps someone. I’m sure going this route is full of a different set of issues, but I think it’s worth considering.

@daiki1003 File a radar.

Assign us work @JugglerShu if you need the help. We’re willing and able bodies and minds.

Big Thank You - nolink branch is working now for me - I love it - thank You thank You - now I can swithc to xcode 9

I haven’t had any show-stopper issues raised on XVim2, so I’m closing this issue now. Please move further feature requests and discussion to XVim2. See you there!

One thing we can all agree on is XVim is an important tool we all love. Dozens of us have contributed to the bounty which at $901 just keeps growing, not to mention the countless dev hours contributed.

JugglerShu started something incredible years ago when he originally created XVim, now it’s up to all of us to Make XVim Great Again!

I’d say it’s time to talk MVP, what is the minimum feature set we would need to have something of value? Is it feasible to just get motions working with just normal/insert modes available? Is it time to do a full Swift rewrite? Can we shut down large portions of the app and retreat to a stable place?

I would happily see this issue closed and the bounty awarded to the group of devs who could get us an MVP.

@michaelnew I think so too. Or I strongly hope Apple will implement vim like editing mode.

@JugglerShu If there’s any conversion work which I can help with, let me know. I’d rather have vim key bindings instead of ‘ultra smooth scrolling’ in Pegasus.

XVim is the only Xcode plugin indispensable for me. Thank you @antmd and @JugglerSh, thank you for your work.

@JugglerShu thanks. I have merged back to master. I also added back some more functions (xvimrc, proper vim-like search, etc.). New issues should be raised here: https://github.com/XVimProject/XVim2/issues

@sagesse-cn I was thinking we could use neovim headless/SwiftNeoVim to handle all the vim hotkeys behind the scenes, and use the new source editor in Xcode 9 for display. We’d pass all inputs into neovim, and it would send back any changes that need to happen to the text/UI.

MVP for me would be the above plus dd yy p cw

@channguyen His work is here: https://github.com/XVimProject/XVim2. Not sure how updated it is though.

We can’t talk much about the state of it internally, but I can say it doesn’t look promising 😕 Our best bet would be for JugglerShu to be hired by Apple :p

Thanks for the update Juggler, we all understand that XVim for version 9 will have limited functionality. That’s ok, we’ll improve it as things progress, we have an active community ready to help. Looking forward to it.

Any progress @JugglerShu ? Looks like people are eager to help if you can delegate some work? Looking forward to getting it to work on XCode 9 😃

XVim2 works 🎉 Thanks @antmd @JugglerShu 💚

This is awesome - thanks so much @antmd and every contributors!!

Thank you @squarefrog and @basketwang! I changed my app name to Xcode.app, updated the xcode-select and also fixed a silly bug(where I have two Applications folder, and I put it in the wrong one initially, lol). And now it works! Cheers~

@sagesse-cn: this looks really promising, but I’m personally less familiar with neovim. Is what you’re doing useable now, and if so, how? Thanks.

I would say that having neovim as a backend would be a win. xvim, as good as it is, still crashes on me occasionally because xcode is crap. An other benefit of neovim as a backend is that it’s full vim in the background will all that can do like plugins and all that jazz. Not sure how well it would integrate into xcode but it’s worth a look.

An MVP in my book would be movement commands wb hjkl and and a few insert substitute commands.

@antmd @JugglerShu There is good news, there is a OC version of the method, you can set the insertion point.

// self is SourceEditor.SourceEditor.view
// contentView is SourceEditor.SourceEditorContentView
self.contentView.setAccessibilitySelectedTextRange(.init(location: 0, length: 0))

@daiki1003 He means you can file a bug report with Apple and tell them you want it. It’s not really designed for feature requests, but it’s one of the only ways of actually communicating with Apple. Unfortunately you won’t get any feedback or correspondence with Apple after you file it and it’s hard to say how effective it is.

If anyone wants to start looking at this, I think IDEPegasusSourceEditor.ideplugin would be a good place to start.

I’m assuming (but obviously haven’t checked) that much of the logic will still live in classes inheriting from NSObject. Which, depending on which Swift version their using, might mean enough of it is exposed that this will work. If they’re using the new @objc behavior, it might be more difficult.