Skip to content

Commit

Permalink
A nice custom setup to Vintageous
Browse files Browse the repository at this point in the history
1. ctrl+a, w, s, n, f stick to sublime defaults.
2. "vintageous_use_ctrl_keys": true,
3. "vintageous_use_sys_clipboard": true,
4. "vintageous_reset_mode_when_switching_tabs": false,
5. Pasting over a current selection does not copy, like is normally done in vim.
  • Loading branch information
theicfire committed Feb 10, 2015
1 parent 43cf37a commit 19ff631
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{"keys": ["{"], "command": "press_key", "args": {"key": "{"}, "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["]"], "command": "press_key", "args": {"key": "]"}, "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["["], "command": "press_key", "args": {"key": "["}, "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["tab"], "command": "press_key", "args": {"key": "<tab>"}, "context": [{"key": "vi_command_mode_aware"}]},
//{"keys": ["tab"], "command": "press_key", "args": {"key": "<tab>"}, "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["backspace"], "command": "press_key", "args": {"key": "<bs>"}, "context": [{"key": "vi_command_mode_aware"}]},

{"keys": ["up"], "command": "press_key", "args": {"key": "<up>"}, "context": [{"key": "vi_command_mode_aware"}]},
Expand Down Expand Up @@ -108,30 +108,30 @@
{"keys": ["Ç"], "command": "press_key", "args": {"key": "Ç"}, "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["Ñ"], "command": "press_key", "args": {"key": "Ñ"}, "context": [{"key": "vi_command_mode_aware"}]},

{"keys": ["ctrl+a"], "command": "press_key", "args": {"key": "<C-a>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
//{"keys": ["ctrl+a"], "command": "press_key", "args": {"key": "<C-a>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+b"], "command": "press_key", "args": {"key": "<C-b>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+c"], "command": "press_key", "args": {"key": "<C-c>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+d"], "command": "press_key", "args": {"key": "<C-d>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+e"], "command": "press_key", "args": {"key": "<C-e>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+f"], "command": "press_key", "args": {"key": "<C-f>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
//{"keys": ["ctrl+f"], "command": "press_key", "args": {"key": "<C-f>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+g"], "command": "press_key", "args": {"key": "<C-g>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+h"], "command": "press_key", "args": {"key": "<C-h>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+i"], "command": "press_key", "args": {"key": "<C-i>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+j"], "command": "press_key", "args": {"key": "<C-j>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+k"], "command": "press_key", "args": {"key": "<C-k>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+l"], "command": "press_key", "args": {"key": "<C-l>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+m"], "command": "press_key", "args": {"key": "<C-m>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+n"], "command": "press_key", "args": {"key": "<C-n>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
//{"keys": ["ctrl+n"], "command": "press_key", "args": {"key": "<C-n>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+o"], "command": "press_key", "args": {"key": "<C-o>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+p"], "command": "press_key", "args": {"key": "<C-p>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+r"], "command": "press_key", "args": {"key": "<C-r>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+q"], "command": "press_key", "args": {"key": "<C-q>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+r"], "command": "press_key", "args": {"key": "<C-r>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+s"], "command": "press_key", "args": {"key": "<C-s>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
//{"keys": ["ctrl+s"], "command": "press_key", "args": {"key": "<C-s>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+t"], "command": "press_key", "args": {"key": "<C-t>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+u"], "command": "press_key", "args": {"key": "<C-u>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+v"], "command": "press_key", "args": {"key": "<C-v>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+w"], "command": "press_key", "args": {"key": "<C-w>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
//{"keys": ["ctrl+w"], "command": "press_key", "args": {"key": "<C-w>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+x"], "command": "press_key", "args": {"key": "<C-x>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+y"], "command": "press_key", "args": {"key": "<C-y>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
{"keys": ["ctrl+z"], "command": "press_key", "args": {"key": "<C-z>"}, "context": [{"key": "vi_command_mode_aware"}, {"key": "vi_use_ctrl_keys"}]},
Expand Down
8 changes: 4 additions & 4 deletions Preferences.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// If true, some key bindings prefaced by the CTRL modifier will override default Sublime Text
// key bindings.
"vintageous_use_ctrl_keys": false,
"vintageous_use_ctrl_keys": true,

// If true, search occurrences will be highlighted in '/', '?', etc.
// (Disabled.)
Expand All @@ -18,14 +18,14 @@
"vintageous_enable_cmdline_mode": true,

// If true, the current mode will be reset to normal mode when a tab gets activated.
"vintageous_reset_mode_when_switching_tabs": true,
"vintageous_reset_mode_when_switching_tabs": false,

// If true, some commands will take the current indentation level into account.
// (Disabled.)
"vintageous_autoindent": true,

// If true, copy actions will always propagate to the system clipboard.
"vintageous_use_sys_clipboard": false,
"vintageous_use_sys_clipboard": true,

// If true, / and ? will use regular expressions.
// If false, smart case will be used instead: the pattern will be interpreted literally and, if
Expand All @@ -39,4 +39,4 @@
// values are 'debug', 'info', 'error', 'critical'. Most users should
// not need to modify the default value.
"vintageous_log_level": "error"
}
}
16 changes: 8 additions & 8 deletions xactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1806,8 +1806,8 @@ def __init__(self, *args, **kwargs):
def run(self, edit, register=None, count=1, mode=None):
state = self.state

if state.mode == modes.VISUAL:
prev_text = state.registers.get_selected_text(self)
#if state.mode == modes.VISUAL:
#prev_text = state.registers.get_selected_text(self)

if register:
fragments = state.registers[register]
Expand All @@ -1816,9 +1816,9 @@ def run(self, edit, register=None, count=1, mode=None):
# register's content.
fragments = state.registers['"']

if state.mode == modes.VISUAL:
# Populate registers with the text we're about to paste.
state.registers['"'] = prev_text
#if state.mode == modes.VISUAL:
## Populate registers with the text we're about to paste.
#state.registers['"'] = prev_text

# TODO: Enable pasting to multiple selections.
sel = list(self.view.sel())[0]
Expand Down Expand Up @@ -1885,9 +1885,9 @@ def run(self, edit, register=None, count=1, mode=None):
print("Vintageous: Nothing in register \".")
return

if state.mode == modes.VISUAL:
prev_text = state.registers.get_selected_text(self)
state.registers['"'] = prev_text
#if state.mode == modes.VISUAL:
#prev_text = state.registers.get_selected_text(self)
#state.registers['"'] = prev_text

sels = list(self.view.sel())
# If we have the same number of pastes and selections, map 1:1. Otherwise paste paste[0]
Expand Down

0 comments on commit 19ff631

Please sign in to comment.