Sublime Forum

NeoVintageous 1.5.0 released ⚡ KAPOW

#1

NeoVintageous 1.5.0 is now available (also see the 1.4.0 release announcement).

The main highlights of this release are:

Support for super-keys

You can now map super-keys via <D-...>, also known as command-keys on OSX, and window-keys on Windows.

Suppose, for example, you wanted to map <D-i> to Goto Symbol in Project. That command is available out-of-the-box in Sublime Text via goto_symbol_in_project, and in NeoVintageous we can map to any command by camel casing it, upper-casing the first letter, and appending <CR>. We can create the map in our vintageousrc file:

nnoremap <D-i> :GotoSymbolInProject<CR>

For more details on the vintageousrc file, see the help docs via the help command :h vintageousrc.

Remember to enable the super-keys when you want use them. Menu > Preferences > Settings:

{
    "vintageous_use_super_keys": true
}

Note: currently only a-zA-Z super keys are implemented e.g. <D-i>, <D-I>, <D-o>, etc.

Note: operating systems make extensive use of the super-keys for desktop commands. If you find a super-key is not working in Sublime Text, then it’s probably bound to a desktop command, and if that’s the case then ST won’t receive the key event. You can check if ST is receiving the key event by running sublime.log_input(True) in the console (Menu > View > Show Console). If it’s not receiving the key, then you need to clear whatever desktop command the key is bound to. If you use Ubuntu here is some help on managing Ubuntu keymaps.

Command-line editing and search history

Search history for / and ? has been added (currently only supports current session). Use the arrow keys <Up> and <Down> to recall recent and older history.

Various Command-line editing commands have been added, including <C-b>, <C-e>, <C-h>, <C-n>, <C-p>, <C-u>, and <C-w>. Also a popular request: CTRL-c and CTRL-[ now exit Command-line mode.

Toggle Side Bar

A toggle side bar command is now provided out-of-the-box (NeovintageousToggleSideBar). When you use a toggle side bar mapping it’s recommended to use this command, because it will receive fixes and tweaks tuned for NeoVintageous.

Suppose, for example, you wanted to map ,d to toggle the sidebar when you’re in normal mode (where we’ll use a comma leader key). Create the mapping in your vintageousrc file:

let mapleader=,

" Toggle the side bar.
nnoremap <leader>d :NeovintageousToggleSideBar<CR>

Next, you’ll need to create a keybinding in Sublime Text to enable the ability to toggle the side bar with ,d when the side bar has focus. Menu > Preferences > Key Bindings:

{
    {
        "keys": [",", "d"],
        "command": "neovintageous_toggle_side_bar",
        "context": [
            { "key": "control", "operand": "sidebar_tree" }
        ]
    }
}

Done! Now you can toggle the side bar open and closed with ,d.

For more details on the vintageousrc file, see the help docs via the help command :h vintageousrc.

Full Changelog

Added

  • Added: :edit {file} command
  • Added #288: Command-line editing commands: <C-b>, <C-e>, <C-h>, <C-n>, <C-p>, <C-u>, and <C-w>
  • Added #279: CTRL-c and CTRL-[ should exit Command-line mode
  • Added #12: Command-line search history with / and ? (current session only)
  • Added: Selections are now cleared when leaving a the current view (UX)
  • Added: NeovintageousToggleSideBar command
  • Added #286: Support for super-keys <D-...> (known as command-keys on OSX, and window-keys on Windows) (disabled by default)
  • Added: highlighted.yank scope to highlighted yank regions to allow color scheme customisation
  • Added: Switching windows using windowing commands no longer suddenly scrolls view (UX)
  • Added: :sunm[ap] command
  • Added: :help {subject} command now uses basic heuristics to find a relevant help topic if a subject is not found
  • Added: Support for 'vintageous_modelines' option (defaults to 5)
  • Added #254: :sp[lit] [file] command
  • Added: Unimpaired status bar toggle coe (also toggle on [oe, and toggle off ]oe)
  • Added: Unimpaired menu toggle coa (also toggle on [oa, and toggle off ]oa)
  • Added: Support for the new SublimeLinter API using the Unimpaired goto to error commands ]l and [l
  • Added: Support for the new GitGutter API using the Unimpaired goto change commands ]c and [c
  • Added: vintageousrc (documentation)
  • Added: Default vim options (documentation)

Removed

  • Removed: Recursive mappings commands :map, :nmap, :omap, :smap, :vmap. Use the non recursive commands instead.

    The recursive mappings were removed because they were not implemented as recursive mappings, and removing them now in preference of the non-recursive may prevent some potential problems in the future if the recursive mapping commands are ever implemented.

    Here is a table of the recursive, which have been removed, and the non recursive mapping commands that you can use instead:

    Recursive command Non recursive command
    map [no]remap
    nmap [nn]oremap
    omap [ono]remap
    smap [snor]emap
    vmap [vn]oremap
  • Removed: Unused vintageous_enable_cmdline_mode setting

Fixed

  • Fixed: Visual ex mode commands should enter normal mode after operation
  • Fixed: Ex mode shell command error (Windows)
  • Fixed: Unmap commands don’t unmap visual mappings
  • Fixed: Can’t unmap mappings with special keys e.g. <leader>
  • Fixed: Running tests shouldn’t resets user vintageousrc mappings
  • Fixed #156: SHIFT-v then CTRL-b doesn’t work
  • Fixed: Help views should be read only
  • Fixed: Unknown registers raise an exception
  • Fixed: gc{motion} leaves cursor at wrong place
  • Fixed: gcc leaves cursor at wrong place
  • Fixed: Repeat searches (n/N) should scroll and show surrounds
  • Fixed: Goto next/prev change cursor position after motion (Unimpaired)
  • Fixed #285: Page down CTRL-f does not work correctly in Visual Line mode
  • Fixed #296: de leaves cursor at wrong place
  • Fixed #295: df{char} leaves cursor at wrong place
  • Fixed: df$ leaves cursor at wrong place
  • Fixed: gq cursor position after operation
  • Fixed: Mapping command status messages
  • Fixed: Error message typos and grammar
  • Fixed #254: :vs[plit] [file] raises a TypeError
3 Likes

#2

1.5.1 - 2018-02-20

Fixed

  • Fixed #305: Surround multiple selections leave cursor in wrong position
  • Fixed: Edge-case infinite loop when special key is set with no default value
  • Fixed #304: :s/$/foo/gc causes infinite loop
  • Fixed #210: :%s/$/,/ not working as expected
  • Fixed: :shell error
2 Likes

#3

For anyone wanting to get more of a vim feel I made a plugin which replaces the long Saved + path string with the word written.

One downside which I haven’t managed to figure out yet if you save the file any other way other than :w the default message will flash up for a fraction of a second, but saving with :w it works exactly like vim.

nnoremap mm :w<CR> also shows it flash up so you would have to save it using :w manually.

Before

After

import sublime
import sublime_plugin


class EventListener(sublime_plugin.EventListener):
    def on_post_save(self, view):
        def hide():
            sublime.status_message('written')

        sublime.set_timeout(hide, 0)
1 Like

#4

I’ve opened an issue about the status line message when saving https://github.com/NeoVintageous/NeoVintageous/issues/313.

In your second screenshot the file name is on the left of the status bar, by default ST doesn’t show the file name, do you have a plugin installed for that?

You’d need to override the other ways of saving e.g. if you use CTRL-s to save you’d setup a mapping:

nnoremap <C-s> :w<CR>

Overriding the command palette commands and the context menu commands is much harder and probably not worth doing.

0 Likes

#5

1.5.2 - 2018-03-03

Fixed

  • Fixed: :registers should display ^J to indicate newlines
  • Fixed: :registers should truncate long lines
  • Fixed: Add missing delete surround punctuation marks ;:@#~*\\/ e.g. ds@, ds*, etc.
  • Fixed #307: Change surround tag cst<{tagname}>
  • Fixed #307: Change surround tag cstt{tagname}> (“t” an alias for “<”)
  • Fixed #307: Change surround tag cst{replacement}
  • Fixed #307: Change surround tag cs{target}<{tagname}>
  • Fixed #307: Change surround tag cs{target}t{tagname}> (“t” is alias for “<”)
  • Fixed #136: Saving to named register with D doesn’t work
  • Fixed #306: Triple-clicking doesn’t select a line
1 Like

#6

Yeah I made a plugin for the file name in the left of the status bar, it’s not the best but it works for my needs :slight_smile:

Using this mapping below to trigger my plugin which overrides the default saved message still flashes the saved + path before displaying the word written.

nnoremap <C-s> :w<CR>

But if I use this below and save the file using :w my plugin works as i’d like it to without seeing the default message flash up before showing the written string I set.

" Enter command line mode. nnoremap <space> :

No idea why one works differently over the other. Any ideas?

Try it for yourself, this is the plugin I created to override the default saved message in the status bar.

import sublime
import sublime_plugin


class EventListener(sublime_plugin.EventListener):
    def on_post_save(self, view):
        def hide():
            sublime.status_message('written')

        sublime.set_timeout(hide, 0)
0 Likes

#7

This is what i’m talking about, notice how the first time I save the file using the nnoremap command the second time I do it manually and it doesn’t flash up.

https://imgur.com/a/n03T7

0 Likes

#8

What do you mean by manually? I can’t see from the gif.

If you run save from the menu, Menu > File > Save, that will invoke ST’s save command i.e. it bypasses the command run by :w. Similarly, if you run save from the command palette, or a context menu the same will happen i.e. it will bypass the command run by :w. Nonetheless, your event should still be triggered on post save.

Your plugin event is running after the original message is display, and overwrites it. There is always going to be some time between the original message showing, and overwriting it with your custom message. So, you will sometimes see a flash of the orignal message. There’s no way around that. Neovintageous needs to solve this in the core, or provide an way for users to customise the message (which is probably not worth it once the correct message is fixed). But even if Neovintageous solves this for ex commands like :w, it will not display the same for save commands run via Menu’s or the command palette.

0 Likes

#9

When I say manually I mean opening command line mode using : and then typing w and hitting return, although the mapping nnoremap mm :w<CR> is technically the same thing with fewer button presses they both work differently.

In the gif you notice when I save the file the first time using the mm mapping the original message displays for a fraction of a second but the second time I manually open command line mode and then type w and press return and the original message never displays eliminating the flash.

I’m not sure why they work differently but i’m happy to save the file the second way as this never shows me the original message.

0 Likes

#10

1.5.3 - 2018-03-24

Fixed

  • Fixed #36 * and # jump history doesn’t work
  • Fixed #51: Can’t map umlauts
  • Fixed #144: Can’t repeat macros
  • Fixed #170: < text object not finding the opening bracket correctly
1 Like

#11

It’s a race condition between the time of the original status message to the time you overwrite it with your event. On my desktop it always flashes the original message first (but it’s a very old system), on my laptop it still flashes it ~65% of the time.

1 Like

#12

They should update their API to allow people to override default messages.

0 Likes