NeoVi18nt extends NeoVintageous plugin for Sublime Text by adding:
-
User events on mode change
- set your "exit Insert mode" command to hold 🠿i to avoid typo-prone or inconvenient key sequences by setting an
isNVⓘ
variable to1
via Karabiner Elements (macOS), and sending ⎋ when it's1
on 🠿i - alternatively (on Windows) set up a windows message listener in AutoHotkey and get message notifications on mode changes with the numeric code of the new mode
- requires manual installation of the Pywin32 dependency after adding this repo to the Package Control (couldn't get the new Package Control Libraries channel with dependencies work for Pywin32)
- to get the numeric code of all modes, run in Sublime Text's console:
from NeoVintageous.nv.modes import M_EVENT, M_ANY, Mode as M, text_to_modes, mode_names_rev,mode_clean_names_rev print(f"integer values for NeoVintageous modes") for m in M_ANY: print(f"{m} = {m+0}")
- For a basic AutoHotkey example see listen_WinMsg
- set your "exit Insert mode" command to hold 🠿i to avoid typo-prone or inconvenient key sequences by setting an
-
Internationalization support of:
- ✨ non-QWERTY/non-Latin layouts based on custom user
keymap
dictionary inUser/NeoVintageous.kdl
(see example config). Requires manually runningNeoVintageous: Generate non-QWERTY keymap
command to convert default NeoVintageous keybinds to use this keymap - ✨ non-Latin keybinds, e.g.,
noremap ц b
(or(n)ц b
) to move back by word when a Cyrillic layout is on (does not work with modifier keys since Sublime Text doesn't report non-Latin keys in key combos, see this ST issue)
- ✨ non-QWERTY/non-Latin layouts based on custom user
-
✨ better configuration file format
NeoVintageous.kdl
(see example) with:- Fewer useless quotes:
plugin { surround { punctuation_marks ‘ = ‘’ “ = “” ‹ = ‹› « = «» }} "plugin" : { "surround" : { "punctuation_marks":{"‘":"‘’", "“":"“”", "‹":"‹›","«":"«»"}} },
- Inline comments:
punctuation-alias clear/*clear defaults d=")" B="}" r="]" a=">" }*/\ d="(" f="[" g=‘ h=“
- Support for raw strings so you don't need to escape anything:
upper #"l;'\" "upper" : "l;'\\",
- Shorter general config option names without the
neovintageous_
prefix (default_mode normal
instead of"vintageous_default_mode" : "normal",
- BUT automatic reload on file change isn't supported, use
NeoVintageous: Reload config
command manually
- Fewer useless quotes:
- ✨ support for importing other config files
import (keybind)NeoVintageous.key.kdl /*↑import file name ↑ relative to this main config file or an absolute '/'-prefixed path since this calls pathlib's 'Path(main_config_folder, import_value)' docs.python.org/3/library/pathlib.html group values↑ in ‘keybind{}’, so the file itself can include only top-level ‘key command’ lines */
- ✨ human-readable format for setting keyboard shortcuts
(nv)d MoveByWordsBackward // understandable command name
instead of.neovintageousrc
's
nnoremap d b
why do you need to remember thatb
moves by words backwards if you never use it?
vnoremap d b "b=MoveByWordsBackward
oh, and you can't even add a comment on the same line to clarify it
And the wholenoremap
doesn't need to be repeated on every single line-
command repeat count in keybinds:
(Ⓝ)d (⋅4)MoveByBigWordsBackward
(or№
⌗
c
n
×
⋅
prefix) will move by 4 Words -
list of commands is executed as a single chain without the need to specify
chain
command:(Ⓝ)q MoveByBigWords MoveByBigWords
-
chain
argument to add node children as a sequence of commands for the same keybind (in case they need to set their own properties)(Ⓝ)q MoveByBigWords chain { ↓/*node names are ignored*/ MoveByBigWords - #":"command":"move","args":{"by":"words","forward":true,"extend":true}<CR>"# }
-
template variables to, e.g., import the same keybind with a single modifier variation per mode to make them toggle relative lines with [ in Normal mode and ⎈[ in Insert mode
NeoVintageous.keyB.kdl
file (‘’
are default template variable pre/pos delimiters)(‘m’)"‘ipre’[‘ipos’" ":set invrnu<CR>"
NeoVintageous.key.kdl
file that will import ↑import NeoVintageous.keyB.kdl m=(var)Ⓝ ipre=(var)"" ipos=(var)"" // (Ⓝ)[ import NeoVintageous.keyB.kdl m=(var)ⓘ ipre=(var)<C- ipos=(var)> // (ⓘ)<C-[>
(or
$
instead ofvar
likeipre=($)""
) Can also pass variables through to subsequent imports via thevarpass
tag, e.g.:- @
NeoVintageous.kdl
:import cfgA.kd m=(var)Ⓝ
(or($)Ⓝ
) defines variablem
as a normal mode - @
cfgA.kdl
:import cfgB.kd m=(varpass)""
(or($→)""
) passes the value ofm
further - @
cfgB.kdl
:(‘m’)a MoveToEol
will getⓃ
as the value ofm
- @
-
group keybinds under a single mode without having to repeat mode's name in each keybind
(Ⓝ)my_normal_group { d "MoveByBigWordsBackward" f "MoveByBigWords" }
-
execute Sublime Text commands by writing arguments in a
prop=value
format(Ⓝ)r (subl)move by=words forward=#true extend=#false //- #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"# // ! but this is NOT suitable for chains since prop=val in KDL do not maintain position vs. arguments, so to execute multiple Sublime Text commands with arguments you'd still need to "chain them" (Ⓝ)t "chain" { - (⋅5subl)move by=words forward=#true extend=#false - (⋅5subl)move by=words forward=#true extend=#true } // ! also, this doesn't work for nested arguments, those still require pasting the full json snippet
-
- Support nicer configuration even in the old format:
- ✨ support for raw Sublime Text commands in user config without having to convert their names or arguments (or just the command names by adding extra
:
prefix) - ✨ rudimentary foundations to support custom key symbols in user config, e.g.,
noremap ⇟ w
to move by word with a ⇟PageDown key - ✨ use
Ⓝ
ⓘ
icons (instead ofvi_command_mode_aware
) as mode limits on Sublime Text native keybinds (defined in.sublime-keymap
files), e.g., to delete a word with AltX, but only in Insert mode:
{"keys":["alt+x"],"command":"delete_word","context":[{"key":"ⓘ"}]},
- ✨ support for raw Sublime Text commands in user config without having to convert their names or arguments (or just the command names by adding extra
- Improved aesthetics:
- (user configurable) status icons for command indicators: if you use r to record a macro, it doesn't make sense to see
q
in the statusbar just because the default keybind is q. Instead you see a recording symbol ⏺ or can add your own in thei="⏺"
keybind field - ✨ show a popup with a count indicator
before after - ✨ allow user to set values of various indicators:
- for
macros
recording, e.g., short bright🔴w
instead of the long grayrecording @w
- for
ls
command, e.g., replace+
modified file mark with🖉
similar to how a modified tab is marked - for
registers
command, e.g., replacel
for linewise with━
- for
- (user configurable) status icons for command indicators: if you use r to record a macro, it doesn't make sense to see
- Extended user configuration:
- ✨ surround: allow users to configure marks, mark aliases, when to append an extra space
- ✨ surround: option to not seek the next set brackets if current text isn't enclosed in one —
⎀a(b)
with surround delete will result in:⎀a(b)
ifseek_forward
isfalse
(default)⎀ab
ifseek_forward
istrue
- ✨ surround: option to maintain cursor position on text edits, e.g., adding
'
tomy_⎀word
(⎀ denotes cursor position) will leave cursor at the same spot in the new'my_⎀word'
while previously it moved it to the first inserted punctuation⎀'my_word'
- ✨ surround: option to customize function prefix (
f
F
) - ✨ abolish: allow users to configure case coercion aliases
- ✨ abolish: option to maintain cursor position on case changes, e.g., converting
se⎀View⎀Sel_⎀Reverse
to upper case (⎀ denotes cursor position) will leave cursor at the same spot in the newSE_⎀VIEW_⎀SEL_⎀REVERSE
while previously it moved it to the beginning of the wordSE_VIEW_SEL_REVERSE
- ✨ marks: option to customize back aliases:
'
` - ✨ UnImpaired: option to customize option aliases
GotoTargetPrev
/GotoTargetNext
commands to allow using the brackets as arguments instead of as names
(Ⓝ)gdd" "GotoTargetPrev" "‹"
vs
(Ⓝ)gdd" "GotoTargetPrevWhateverThatBracketIsNamed"
- More keybinds:
- support for rebinding Ctrl/Win/Alt key combos in Insert mode (they're still ignored by default unless explicitly enabled via the
handle_keys
config to not break all of the default Sublime Text's combos with these modifiers, also AltF1... function key combos are ignored by default)
- support for rebinding Ctrl/Win/Alt key combos in Insert mode (they're still ignored by default unless explicitly enabled via the
- ⎈,/\ are bindable
- and other changes:
- support for text object pairs as targets for the goto command
- ✨ nowrap alternative to tab switch Ex commands (
tabnextnowrap
/tabpreviousnowrap
) - ✨ add a
MoveHalfScreenHorizontally
command to move to the visual line's middle (helful with wrapped lines) - enabled a bunch of command to work in Insert mode (this limitation should be part of keybindings, not command functions)
- ✨ support for count to the screen top/bottom movement commands, e.g., can move to line 5 from the visible top
- ✨ search command for an unbounded string under cursor matches g#/* vim commands
MoveByWordEndsNoSep
,MoveByWordEndsBackwardNoSep
command to move to word's end ignoring punctuation old:wordA, wordB
would stop atA
,
B
new:wordA, wordB
would stop atA
B
- Requires Sublime Text 4050 13 November 2019 to use the newer Python version
Preferences and initialization vimrc
commands are consolidated into a single new config file: run Command Palette
→ Preferences: NeoVintageous New Settings (KDL)
to open
- your
NeoVintageous.kdl
consolidated config and - a
NeoVintageous.help.kdl
helper file with the list of supported settings
Reload with NeoVintageous: Reload config
on changes (autoreload is not supported)
Or open only NeoVintageous.kdl
: run NeoVintageous: Open new config file (KDL)
Or open only NeoVintageous.help.kdl
: run NeoVintageous: Open new config file example (KDL)
)
The old .neovintageousrc
config continues to work as is, just that the new config is loaded later and overrides its options
If you're using the old KDL v1 config version, set "nv_kdl_v":1,
in your Preferences.sublime-settings
to avoid console log error spam from KDL v2 default parser trying to load v1 config first
NeoVintageous is the Vim engine for Sublime Text, designed to be fast, reliable, and zero configuration required. A fork of Vintageous, it is the ideal drop-in replacement.
To check out docs, visit neovintageous.github.io.
The contribution guide can be found in the NeoVintageous documentation.
See CHANGELOG.md.
Released under the GPL-3.0-or-later License.