Sublime Forum

Vintageous - New Vi/Vim Emulation for Sublime Text 3

#1

With any luck, this must be the first S3 package ever. If there’s a prize for that, I rightfully
claim it now! :wink:

Overview

Vintageous is a rewrite of Vintage, with a much more ambitious goal. While Sublime Text isn’t
Vim, I think many Vim features can work better than they do today through Vintage.

Vintageous owes a great deal of its current design to previous work done by dlo.

Status

Vintageous is functional. I don’t know how it fares compared to Vintage in terms of available
features, but I’d say it’s almost there. My impression, if a little biased, is that existing
features normally work better than they do in Vintage.

If that’s not the case for you, please report an issue and I’ll try to fix it.

How to Get It

Please head over to the GitHub repository.

(FWIW, I had some trouble getting it to work with the latest build, but ignoring and re-enabling the package fixed it.)

Feedback always welcome!

0 Likes

How do I turn on Vintage Command mode?
ST3: Vintage mode?
#2

What about Ex mode? I miss it from ST2 :´(

0 Likes

#3

Congrats!

0 Likes

#4

That one will probably come next. I miss it too. In the long run, I want both to converge into one single package. As far as I can remember, VintageEx should be fairly easy to port to python 3.3.

0 Likes

#5

Thanks! :smiley:

0 Likes

#6

[quote=“C0D312”]

Congrats![/quote]

I ported two last night but they both have issues waiting on jon :smile:

0 Likes

#7

Ha,ha. I’ll see you in court, then :smiley: And I raise your issues too!

0 Likes

#8

Great work! Works flawlessly with build 3007 :smile:

Could you implement “R” (shift + r) which replaces chars beginning from the current one until you end typing (and press esc)?

One thing that is not working (but iirc it’s an original feature of vi(m)):
Pressing “^” in command mode should take you to the first character in the current line (it ignores whitespaces and tabs in front of it).

Thanks for breathing some new life into vi(m) emulation!

0 Likes

#9

Thanks for the feedback!

Adding aliases and synonyms isn’t too hard, but I’m focusing on ironing out edge cases neglected by Vintage so the core becomes more reliable. I haven’t had to change it much to support complex commands, so I’m optimistic about quick progress in the near future. Complex commands make for good testing, because they uncover shortcomings in the current code.

So while I’m giving priority to larger design issues, I’ll be able to sneak in more tangible features along the way.

Also, I want to add some documentation for contributors. Adding new commands isn’t too difficult, but some instructions are in order.

But that’s long-winded way of saying: I recommend you report issues on GitHub, as I’m more likely to check them regularly:

github.com/guillermooo/Vintageous/issues

0 Likes

#10

How funny I was just trying to look into fix one of the gripes I currently have with Vintage and ST3, and come across this post.

So I’ve been giving Vintageous a try. Must say I miss having the INSERT/COMMAND mode displayed in the status bar. Also, it seems like INSERT mode is on by default, which is annoying. Don’t know if there is a setting for that, as there is for Vintage.

And about the issue I was having with Vintage, it strangely doesn’t work with Vintageous either: when using the t or f motion to get to the next occurence of a specific character in the line, using ; should allow repeating that, and go to the next occurence, and , should to the same, only in reverse.

It doesn’t work, I can use f_ to go to the first underscore, but pressing ; won’t get me to the next one…

0 Likes

#11

Most of that is missing, I’m afraid. Please report an issue in GitHub and I’ll look into it. I have my own todo, but I don’t need to follow any specific order except for a couple of issues, so if your request is easy, I’ll try to do that first.

0 Likes

#12

OK so after spending a few minutes with it, it seems / doesn’t allow me to search, and *, # or n don’t work as expected for searching…

Kind of a deal breaker for me, but keep up the good work!

0 Likes

#13

I was pretty proud of * up until now :), but I’ll check against Vim again.

Reverse searches won’t be landing any time soon until I know whether an API for that will be made available instead of rolling my own.

0 Likes

#14

By the way, / is one of the big features I want to look into soon.

0 Likes

#15

The way * works in vim is that it basically sets up a search for the word under the cursor for you. So you can then press n and go to the next occurrence.

It’s also how it works with Vintage, it integrates with Sublime’s search feature, and n does basically the same as F3.

In Vintageous, it seems you have to press * again to go to the next occurrence, which also works in vim, but it’s not the only way. Even if you move your cursor, you should still be able to use n.

0 Likes

#16

Anyway it’s nice to see an alternative vim emulation for ST, and congrats on bringing on the first ST3 plugin!

0 Likes

#17

Ok, so it seems your problem is with “n”, not “" itself. And you are right, “n” doesn’t work at all now. "” may not work ok in visual mode, but it should behave as Vim in normal mode.

Thanks for your feedback, it’s really appreciated!

0 Likes

#18

Well my problem isn’t only with n, but with the fact that you implemented * as if its purpose was “bring me to the next occurrence of the word under the cursor”. In that regard, it works well, but it’s not correct regarding the vim definition:

*                       Search forward for the [count]'th occurrence of the      
                        word nearest to the cursor.  The word used for the       
                        search is the first of:                                  
                                1. the keyword under the cursor 'iskeyword'      
                                2. the first keyword after the cursor, in the    
                                   current line                                  
                                3. the non-blank word under the cursor           
                                4. the first non-blank word after the cursor,    
                                   in the current line                           
                        Only whole keywords are searched for, like with the                                                          
                        command "/\<keyword\>".  exclusive  {not in Vi}          
                        'ignorecase' is used, 'smartcase' is not.  

As you can see, * isn’t just a motion key, but a quick way to trigger a search, coupled to a motion :smile:

It should ideally even accept a count parameter, so typing 3* would bring you to the third occurrence. But don’t worry, Vintage doesn’t support that either :smile:

0 Likes

#19

Well, I said I was proud of * for a reason. It should support counts now! It’s working for me in normal mode, but maybe there’s a glitch with other modes.

I don’t think it’s 100% Vim-certified behavior, but counts in normal mode should definitely work. Maybe you’re trying to use it with a corner case like a one-letter word, punctuation or something like that. I haven’t tested many scenarios yet.

0 Likes

#20

The count part is nice! I must say I didn’t try it before, kudos for that!

So you’re basically only missing the quick-search part, which is quite similar to the default “CTRL-F3 / Quick Find” binding (except * does a whole word match, regardless of the current find settings)

0 Likes