Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
* master:
  Prepare 1.4.1 release
  Fix #245 ZZ and ZQ are broken again
  Fix #290 Commands that start with underscore should not be mappable
  Fix #289 :help should goto :{subject} if {subject} not found
  Documentation fixes
  README fixes
  • Loading branch information
gerardroche committed Nov 10, 2017
2 parents 2745e05 + 52d016b commit 80beb7b
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 58 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 1.4.1 - 2017-11-09

### Fixed

* Fixed [#245](https://github.com/NeoVintageous/NeoVintageous/issues/245): `ZZ` and `ZQ` are broken again
* Fixed [#290](https://github.com/NeoVintageous/NeoVintageous/issues/290): Commands that start with underscore should not be mappable
* Fixed [#289](https://github.com/NeoVintageous/NeoVintageous/issues/289): `:help {subject}` should goto `:{subject}` if `{subject}` not found

## 1.4.0 - 2017-11-06

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Command and input logging can be enabled from the console: `sublime.log_commands

Neovintageous debug messages are disabled by default. You can enable them by setting an environment variable named `SUBLIME_NEOVINTAGEOUS_DEBUG` to a non-blank value. See [set a Sublime Text environment variable](https://github.com/gerardroche/sublime-phpunit#debugging) for a step by step guide on how to set environment variables for Sublime Text. The debug log is located at `Packages/User/NeoVintageous.log`. Debug messages are also printed to the console: `Menu > View > Show Console`.

### Reverting to a freshly installed state
#### Reverting to a freshly installed state

* [Reverting to a freshly installed state](https://www.sublimetext.com/docs/3/revert.html) (Sublime Text Documentation)
* [Reverting Sublime Text to its default configuration](http://docs.sublimetext.info/en/latest/extensibility/packages.html?highlight=fresh#reverting-sublime-text-to-its-default-configuration) (Unofficial Sublime Text Documentation)

For Linux and OSX [this script](https://github.com/gerardroche/dotfiles/blob/7f7812393e26db7c0f8146f5b6db730197dfd103/src/bin/sublime-clean) can be used to clean caches, indexes, workspaces, sessions, etc. Note that cleaning and reverting are two different things, *reverting* will remove installed packages and configurations, wheras *cleaning* will only remove files generated by Sublime Text at runtime like caches, indexes, workspaces, sessions, etc.
For Linux and OSX [this script](https://github.com/gerardroche/dotfiles/blob/7f7812393e26db7c0f8146f5b6db730197dfd103/src/bin/sublime-clean) can be used to clean caches, indexes, workspaces, sessions, etc. Note that cleaning and reverting are two different things, *reverting* will remove installed packages and configurations, whereas *cleaning* will only remove files generated by Sublime Text at runtime like caches, indexes, workspaces, sessions, etc.

## Changelog

Expand Down
5 changes: 3 additions & 2 deletions lib/cmds/ex_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def run(self, command_line):
nvim.console_message('finished initializing help tags')

if subject not in self._tags:
return nvim.message('E149: Sorry, no help for %s' % subject)
subject = ':' + subject
if subject not in self._tags:
return nvim.message('E149: Sorry, no help for %s' % subject[1:])

tag = self._tags[subject]

Expand Down Expand Up @@ -1336,7 +1338,6 @@ def run(self, command_line=''):
class ExExit(ViWindowCommandBase):

def run(self, command_line=''):
assert command_line, 'expected non-empty command line'
if self._view.is_dirty():
self.window.run_command('save')

Expand Down
11 changes: 6 additions & 5 deletions lib/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,13 @@ def run(self, key, repeat_count=None, do_eval=True, check_user_mappings=True):

_logger.debug('@press_key running user mapping keys=%s, command=%s' % (new_keys, command))

# Support for basic Command-line mode mappings
# `:command<CR>` maps to ex command.
# `:UserCommand<CR>` maps to Sublime Text command (starts with uppercase).
# Support for basic Command-line mode mappings:
#
# `:Command<CR>` maps to Sublime Text command (starts with uppercase letter).
# `:command<CR>` maps to Command-line mode command.

if ':' in new_keys:
match = re.match('^\\:(?P<cmd_line_command>[a-zA-Z0-9_]+)\\<CR\\>', new_keys)
match = re.match('^\\:(?P<cmd_line_command>[a-zA-Z][a-zA-Z_]*)\\<CR\\>', new_keys)
if match:
cmd_line_command = match.group('cmd_line_command')
if cmd_line_command[0].isupper():
Expand All @@ -222,7 +223,7 @@ def _coerce_to_snakecase(string):
if ':' == new_keys:
return self.window.run_command('vi_colon_input')

return nvim.console_message('invalid command line mapping %s -> %s (only `:name<CR>` is supported)' % (command.head, command.mapping)) # noqa: E501
return nvim.console_message('invalid command line mapping %s -> %s (only `:[a-zA-Z][a-zA-Z_]*<CR>` is supported)' % (command.head, command.mapping)) # noqa: E501

self.window.run_command('process_notation', {'keys': new_keys, 'check_user_mappings': False})

Expand Down
25 changes: 2 additions & 23 deletions lib/vi/cmd_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,23 +1695,6 @@ def translate(self, state):
}


@keys.assign(seq=seqs.BIG_Z_BIG_Z, modes=_MODES_ACTION)
class ViQuit(ViOperatorDef):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.updates_xpos = True
self.scroll_into_view = True

def translate(self, state):
return {
'action': 'ex_quit',
'action_args': {
'forced': True,
'count': state.count
}
}


@keys.assign(seq=seqs.G_BIG_H, modes=_MODES_ACTION)
class ViEnterSelectModeForSearch(ViOperatorDef):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -2054,8 +2037,7 @@ def translate(self, state):
return {
'action': 'ex_quit',
'action_args': {
'forced': True,
'count': state.count
'command_line': 'q!'
}
}

Expand All @@ -2069,10 +2051,7 @@ def __init__(self, *args, **kwargs):
def translate(self, state):
return {
'action': 'ex_exit',
'action_args': {
'mode': state.mode,
'count': state.count
}
'action_args': {}
}


Expand Down
69 changes: 43 additions & 26 deletions res/doc/neovintageous.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,25 @@ Also see |vimrc-intro|.

The following |:map-special-keys| are supported:

|<leader>| |mapleader|
|<Leader>| |mapleader|

The following |:map-commands| are supported:

|:map|
|:nmap|
|:omap|
|:vmap|
|:noremap|
|:nnoremap|
|:onoremap|
|:vnoremap|
{lhs} means left-hand-side
{rhs} means right-hand-side

*Note that currently the remap commands are aliased to the map commands,
this is a known issue and hopefully will be fixed in the future.
:map {lhs} {rhs} |:map|
:nmap {lhs} {rhs} |:nmap|
:omap {lhs} {rhs} |:omap|
:vmap {lhs} {rhs} |:vmap|

:noremap {lhs} {rhs} |:noremap|
:nnoremap {lhs} {rhs} |:nnoremap|
:onoremap {lhs} {rhs} |:onoremap|
:vnoremap {lhs} {rhs} |:vnoremap|

Note: the remap commands are currently aliased to the map commands, this is a
known issue and hopefully will be fixed in the future.

Mapping to Command-line mode commands is supported for basic use-cases: >
:command<CR>
Expand Down Expand Up @@ -188,25 +192,30 @@ Here is an example |vintageousrc| file: >
nnoremap <C-k> <C-w>k

" Stop the highlighting
" The :nohlsearch ex command is currently not
" supported. Pressing Esc is workaround.
" The :nohlsearch command is currently not
" supported. Pressing Esc is a workaround.
nnoremap <C-l> <Esc>

" Select entire buffer
nnoremap <leader>vaa ggvGg_
nnoremap <leader>Vaa ggVG

" Sorting
nnoremap <leader>s vip<F9>o^<Esc>^8<C-y>
nnoremap <leader>va ggvGg_
nnoremap <leader>Va ggVG

" Open
" Open - <leader>o{char}
nnoremap <leader>oc :OpenCommandPalette<CR>
nnoremap <leader>op :OpenPreferences<CR>
nnoremap <leader>og :ShowGoto<CR>
nnoremap <leader>on :NeovintageousOpenMyRcFile<CR>
nnoremap <leader>op :OpenPreferences<CR>
nnoremap <leader>os :GotoSymbolInProject<CR>

" The :sort command is currently not
" supported. This mapping is a workaround.
nnoremap <leader>ss vip<F9>o^<Esc>^8<C-y>

" 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>
Expand All @@ -226,6 +235,12 @@ Two custom commands are used in the above mappings: >
'overlay': 'command_palette'
})

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

class OpenPreferencesCommand(sublime_plugin.WindowCommand):
def run(self):
Expand Down Expand Up @@ -267,6 +282,8 @@ to normal mode, etc. If you press Esc while in select mode, you will return to
normal mode, but multiple carets won't be destroyed. If you press Esc a second
time, you will be left with one single caret in normal mode.

==============================================================================

MODELINE *neovintageous-modeline*

A feature comparative to Vim |modeline|: a number of lines at the beginning and
Expand All @@ -285,7 +302,7 @@ PLUGINS OUT-OF-THE-BOX *neovintageous-plugins*
Summary of the plugins are provided out-of-the-box.

Some plugin features may only be partially supported and some features may
depend on third party plugins. Those details are indecated below.
depend on third party plugins. Those details are indicated below.

Please open issues about missing features that you would like too see
implemented.
Expand Down Expand Up @@ -347,13 +364,13 @@ OPTIONS *neovintageous-options*

1. Setting options *neovintageous-set-option*

Preferences > Settings: >
Menu > Preferences > Settings: >

{
"vintageous_use_ctrl_keys": true
}

Project > Edit Project: >
Menu > Project > Edit Project: >

{
"settings": {
Expand Down Expand Up @@ -385,7 +402,7 @@ terminal: >

4. Mapping jj, jk, CTRL-[, etc. to Esc *neovintageous-escape*

Preferences > Key Bindings: >
Menu > Preferences > Key Bindings: >

# jj -> Esc
{
Expand Down Expand Up @@ -562,13 +579,13 @@ Add as many of the following key bindings as you would like to disable: >

Then enable the custom setting used in the keymaps:

Preferences > Settings: >
Menu > Preferences > Settings: >

{
"neovintageous_disable_arrow_keys": true
}

Project > Edit Project: >
Menu > Project > Edit Project: >

{
"settings": {
Expand Down

0 comments on commit 80beb7b

Please sign in to comment.