Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add numbered registers like in Vim #181

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 22 additions & 2 deletions Default.sublime-keymap
Expand Up @@ -108,7 +108,7 @@
},

{ "keys": ["o"], "command": "enter_insert_mode", "args":
{"insert_command": "run_macro_file", "insert_args": {"file": "Packages/Default/Add Line.sublime-macro"} },
{"insert_command": "run_macro_file", "insert_args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["o"], "command": "vi_reverse_selections_direction",
Expand All @@ -120,7 +120,7 @@
},

{ "keys": ["O"], "command": "enter_insert_mode", "args":
{"insert_command": "run_macro_file", "insert_args": {"file": "Packages/Default/Add Line Before.sublime-macro"} },
{"insert_command": "run_macro_file", "insert_args": {"file": "res://Packages/Default/Add Line Before.sublime-macro"} },
"context": [{"key": "setting.command_mode"}]
},

Expand Down Expand Up @@ -609,13 +609,33 @@
"linewise": true },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["j"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "line_begin": true, "forward": true, "extend": true },
"linewise": true },
"context":
[
{"key": "setting.command_mode"},
{"key": "vi_motion_mode", "operand": "line"}
]
},

{ "keys": ["k"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "lines", "forward": false, "extend": true },
"linewise": true },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["k"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "line_begin": true, "forward": false, "extend": true },
"linewise": true },
"context":
[
{"key": "setting.command_mode"},
{"key": "vi_motion_mode", "operand": "line"}
]
},

{ "keys": ["G"], "command": "set_motion", "args": {
"motion": "vi_goto_line",
Expand Down
32 changes: 32 additions & 0 deletions README.TXT
@@ -0,0 +1,32 @@
Overview:
--------

Vintage is a vi editing package for Sublime Text. It's not quite a faithful recreation, and not all details match up. On the other hand, you do get multiple selections.


Enabling Vintage:
--------

Vintage is disabled by default, via the ignored_packages global setting. If you remove "Vintage" from the list of ignored packages, you'll be able to edit with vi keys.

Vintage starts in insert mode by default. This can be changed by adding:

"vintage_start_in_command_mode": true

to your User File Settings.


Major Differences From vi:
--------

Insert mode is plain Sublime Text editing, with the usual Sublime Text key bindings: vi insert mode key bindings are not emulated.

Ex commands are not implemented, apart from :w and :e, which work via the command palette.


Extending Vintage:
--------

Vintage is implemented entirely in Python. Extending it, for example, to add additional motions, is a matter of writing the relevant plugin (see vintage_motions.py for the existing ones), and adding a key binding for it.

Motions are normal commands that work by selecting the range of text that they move over. The end of the selection (.b), is considered the active end. Motions are either inclusive, or exclusive (the default). Exclusive motions will move the caret to the right of the last selected character, inclusive motions will move it to the left. Motions are considered inclusive if the inclusive flag is passed to the set_motion command.
47 changes: 0 additions & 47 deletions README.rst

This file was deleted.