Sublime Forum

NeoVintageous 1.4.0 released ⚡ KAPOW

#1

The two main highlights of this release are:

Vim documentation out-of-the-box via the :help command

You can now lookup vim help via :help {subject}. For Vim and Neovintageous differences see :help neovintageous

Jumptags also work (tags are indicated via |bars|). To jump to a tag, position the cursor on the tag and hit CTRL-].

Jump backward and jump forward work too via CTRL-O and CTRL-I.

I recommended taking a few minutes reading the main help file: :help. It explains things like how to find commands e.g. to look up what the gc command does in visual mode, prefix it with v_ i.e. :help v_gc. Also the format of commands is consistent e.g. ctrl-w_c. i.e. ctrl-[a-z]_[a-z]. Options are wrapped in quotes e.g. :help 'vintageous_use_ctrl_keys'.

Keep in mind that feature-parity with Vim is an ongoing effort. The Vim docs are provided in full without modifications, :help neovintageous documents Neovintageous specific features.

Mapping to Command-line mode and Sublime Text commands

The other big feature is ability to map to Sublime Text and custom commands aswell as the Command-line mode commands.

Note that currently mapping to commands only works in basic form.

Mapping to Command-line mode commands is supported for basic use-cases: :command<CR>

Mapping to Sublime Text commands is supported for basic use-cases. The command
must start an Uppercase letter to avoid confusion with built-in Command-line
mode commands. The command is converted to snake_case. For example to map to
the Sublime Text command “toggle_side_bar”: :ToggleSideBar<CR>

Example vintageousrc file:

let mapleader=,

" map mm to ex command :w
nnoremap mm :w<CR>

" map ,d to the built-in Sublime Text "toggle_side_bar" command
nnoremap <leader>d :ToggleSideBar<CR>

" map ,op to custom command
nnoremap <leader>op :OpenPreferences<CR>

To create the custom “OpenPreferences” command, create a user plugin with:

import os

import sublime
import sublime_plugin

class OpenPreferencesCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.run_command('open_file', {
            'file': os.path.join(
                sublime.packages_path(),
                'User',
                'Preferences.sublime-settings'
            )
        })

Full Changelog

Added

  • Added: ds(, ds{, ds[, and ds< now also trims contained whitespace (Surround plugin)
  • Added: dsb alias for ds) delete surrounding () (Surround plugin)
  • Added: dsB alias for ds} delete surrounding {} (Surround plugin)
  • Added: dsr alias for ds] delete surrounding [] (Surround plugin)
  • Added: dsa alias for ds> delete surrounding <> (Surround plugin)
  • Added: ds< delete surrounding <> (Surround plugin)
  • Added: ds> delete surrounding <> (Surround plugin)
  • Added: dst delete surrounding pair of HTML or XML tags (Surround plugin)
  • Added: ds followed by a target that is not one of the punctuation pairs, ()[]{}<>, are now only searched for on the current line (Surround plugin)
  • Added: ds{target} cursor position is now moves to the start of first target (Surround plugin)
  • Added: cs{target} followed by one of ])} now inserts an inner whitespace character (Surround plugin)
  • Added: cs>{replacement} now replaces surround tag characters <> with replacement (Surround plugin)
  • Added: cs{target} folowed by > now replaces target with replacement surroundings <> (Surround plugin)
  • Added: cs{target}{replacement} cursor position is now moves to the start of first target (Surround plugin)
  • Added: :h[elp] {subject} like “:help”, additionally jump to the tag {subject}
  • Added: :h[elp] open a view and display the help file
  • Added: gx open url under cursor in browser
  • Added: Support for :UserCommand<CR> .vintageousrc mappings
  • Added: Support for :excommand<CR> .vintageousrc mappings
  • Added: :snoremap command
  • Added: :smap command
  • Added: cot toggle sidebar command (Unimpaired plugin)
  • Added: [ot toggle sidebar on command (Unimpaired plugin)
  • Added: ]ot toggle sidebar off command (Unimpaired plugin)
  • Added: com toggle minimap command (Unimpaired plugin)
  • Added: [om toggle minimap on command (Unimpaired plugin)
  • Added: ]om toggle minimap off command (Unimpaired plugin)
  • Added: Documentation command
  • Added: Edit Settings command
  • Added: How to map jk to Esc (documentation)

Changed

  • Changed: ds< no longer deletes surrounding tag; use dst instead (Surround plugin)
  • Changed: ds> no longer deletes surrounding tag; use dst instead (Surround plugin)
  • Changed: Modeline vintageous_modeline is disabled by default
  • Changed: “Open Changelog” command caption changed to “Changelog”

Removed

  • Removed: vintageous_surround_spaces setting
  • Removed: Unimplemented tabopen ex command
  • Removed: Deprecated neovintageous_toggle_use_ctrl_keys command
  • Removed: Deprecated neovintageous_reset command
  • Removed: Deprecated neovintageous_exit_from_command_mode command
  • Removed: Deprecated toggle_mode command

Fixed

  • Fixed #213: No command accepts characters in a keybinding
  • Fixed #167: Allow .vintageousrc to map any keybinds
  • Fixed #152: f<key> doesn’t jump to <key> if there is a mapping for <key>
  • Fixed #97: Mapping commands
  • Fixed #81: ct<leader> or cf<leader> doesn’t work; need ct<leader><leader>
  • Fixed #282: Surround doesn’t work as expected on first symbol
  • Fixed: Several .vintageousrc syntax highlighting bugs
  • Fixed: Lots of Command-line mode syntax highlighting bugs
6 Likes

NeoVintageous 1.5.0 released :zap: KAPOW
#2

This is brilliant, mapping commands is incredibly useful :smiley:

1 Like

#3

Wow this package is great. I’m going to put a deprecation message on this and point to your package. :slight_smile:

1 Like

#4

I think you need to check the link in that deprecation message

1 Like

#5

Hey thanks for that. I got too excited too quickly. :wink:

1 Like

#6

Here are some more examples of useful mappings:

    nnoremap <leader>og :ShowGoto<CR>
    nnoremap <leader>os :GotoSymbolInProject<CR>

Goto symbol and (one I’m finding incredibly useful) Goto Symbol in Project. The Goto Symbol in Project is available from the default Sublime Text packages. The ShowGoto needs a custom command:

Create a user plugin:

from sublime_plugin import WindowCommand

class ShowGotoCommand(WindowCommand):
    def run(self):
        self.window.run_command('show_overlay', {
            'overlay': 'goto',
            'text': '@'
        })

AceJump plugin mappings

You can map to any Sublime Text command, which means commands provided by plugins too. AceJump is an emacs style version of EasyMotion. The intention is to provide a EasyMotion plugin out-of-the-box, but you can AceJump by creating some mappings. AceJump provides a nice clean api of commands that make it straight forward to create mappings, here’s some example mappings:

" AceJump plugin
" https://packagecontrol.io/packages/AceJump
nnoremap <leader><leader>a :AceJumpAfter<CR>
nnoremap <leader><leader>c :AceJumpChar<CR>
nnoremap <leader><leader>d :AceJumpAddCursor<CR>
nnoremap <leader><leader>i :AceJumpWithinLine<CR>
nnoremap <leader><leader>l :AceJumpLine<CR>
nnoremap <leader><leader>s :AceJumpSelect<CR>
nnoremap <leader><leader>w :AceJumpWord<CR>

Test plugin mapping

Currently supports PHPUnit, ColorSchemeUnit, and UnitTesting plugins:

" Test plugin
" https://github.com/gerardroche/sublime-test
" https://github.com/gerardroche/sublime-phpunit
" https://github.com/gerardroche/sublime-color-scheme-unit
" https://github.com/randy3k/UnitTesting
nnoremap <leader>t :TestNearest<CR>
nnoremap <leader>T :TestFile<CR>
nnoremap <leader>a :TestSuite<CR>
nnoremap <leader>l :TestLast<CR>
nnoremap <leader>g :TestVisit<CR>
3 Likes

#7

Great work :slight_smile: I love this!

2 Likes

#8

1.4.1 - 2017-11-09

Fixed

  • Fixed #245: ZZ and ZQ are broken again
  • Fixed #290: Commands that start with underscore should not be mappable
  • Fixed #289: :help {subject} should goto :{subject} if {subject} not found
1 Like

#9

@gerry

Is it possible to add a mapping to something like this which has arguments.

class TravelToPaneCommand(PaneCommand, WithSettings):
def run(self, direction, create_new_if_necessary=None):
	if create_new_if_necessary is None:
		create_new_if_necessary = self.settings().get('create_new_pane_if_necessary')
	self.travel_to_pane(direction, create_new_if_necessary)

If it helps this is how a key binding would look

 { "keys": ["super+k", "up"], "command": "travel_to_pane", "args": {"direction": "up"} },

So I could do something like this

nnoremap <leader>k :TravelToPane up<CR>

Thanks :slight_smile:

2 Likes

#10

It’s currently not possible to pass arguments to commands. I don’t know what is best way to implement that and I don’t want to rush in a implement something that I will need to change change later.

The workaround for now is to create a “proxy” command that doesn’t need the argument. In your example:

Create a user plugin:

from sublime_plugin import WindowCommand

class TravelToPaneUpCommand(WindowCommand):
    def run(self):
        self.window.run_command('travel_to_pane', {'direction': 'up'})

Then

nnoremap <leader>k :TravelToPaneUp<CR>

I guess there are two main cases for arguments:

Something like (simple case) (where “True” and “False” are converted to boolean):

:Command(\s[a-z-A-Z0-9]+)*<CR>

Then we need named arguments so something along the lines of:

:Command(\s[a-z-A-Z0-9]+=[a-z-A-Z0-9]+)*<CR>
2 Likes

#11

That’s exactly what I was thinking, using the proxy will be sufficient until you find a good solution.

Thank you for your work this is definitely my favourite plugin :slight_smile:

2 Likes

#12

@gerry

Would it be possible to add something like this?

I know :ls works but having it appear at the bottom, when there are lots of files, especially if we could have them numbered to open them with something like :b[N] would be amazing.

2 Likes

#13

Yes, this is something I’d like too. At the moment it’s a little down the list of priorities. I opened a issue for it: https://github.com/NeoVintageous/NeoVintageous/issues/294.

2 Likes

#14

Fantastic news :slight_smile:

Very excited for this release, i’ll be sure to check back regularly :heart:

2 Likes

#15

1.4.2 and 1.4.3 have been released since my last update.

Several fixes for mappings.

Tip: If you prefer not to enable the ctrl-keys you can map window commands to your leader key. Essentially instead using the ctrl key, you use your leader key (note the bar (|) key needs to be escaped in mappings):

let mapleader=,

" Some window command aliases. This is especially useful if you don't like to
" enable ctrl-key key bindings ('vintageous_use_ctrl_keys' setting).
nnoremap <leader>_ <C-w>_
nnoremap <leader>\| <C-w>\|
nnoremap <leader>= <C-w>=
nnoremap <leader>. <C-w>_<C-w>\|

The Changelog since my last update:

1.4.2 - 2017-12-19

Fixed

  • Fixed #238: Simply search & replace not working for me
  • Fixed #111: Bad command
  • Fixed: “Traling characters” Status message typo
  • Fixed: :s[ubstitute] No previous substitute error message is incorrect
  • Fixed: #226: Mouse does not reset cursor column
  • Fixed: C-w _ (set current group height as high as possible) doesn’t always work correctly
  • Fixed: C-w | (set current group width as wide as possible) doesn’t always work correctly
  • Fixed: C-w = (resize all groups equally) doesn’t always work correctly
  • Fixed: gJ
  • Fixed: gx should ignore trailing full stops
  • Fixed: gx doesn’t work on markdown links
  • Fixed: vintageousrc mapping should not accept unescaped pipe characters
  • Fixed: Help syntax fixes
  • Fixed: Unimpaired toggles (documentation)

1.4.3 - 2017-12-22

Fixed

  • Fixed #297: An occurred trying load NeoVintageous
2 Likes

#16

1.4.4 - 2018-01-07

  • Fixed: Error trying to Open My Rc File first time
  • Fixed: Help files shouldn’t display rulers or indent guides
  • Fixed: CTRL-a and CTRL-x doesn’t work in column one or between lines
  • Fixed: Update to latest vimdocs
  • Fixed: :map doesn’t work in visual block or visual line mode
  • Fixed: Remove unused setting
  • Fixed: Settings should be erased when cleaning up views
  • Fixed: gx in quoted urls
  • Fixed: gg and G jump history forwards CTRL-i and backwards CTRL-o
  • Fixed #298: gd can’t jump back with CTRL-o
  • Fixed #241: Leaving Insert mode still shows as being in Insert mode
  • Fixed #129: Failing tests when ST hasn’t got focus
1 Like