Skip to content

Commit d6ff2a2

Browse files
committed
Small bugfix & minor README.md changes
1 parent 9864da1 commit d6ff2a2

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

README.md

+29-23
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ one-hand usage. Forget about `<C-f>`, `<C-d>`, and `G`. You don't need to keep
66
holding modifier keys anymore — everything can be done with single-key
77
mappings!
88

9-
New key mappings available in the scroll mode:
9+
New key mappings available in the Scroll mode:
1010

1111
- `j` / `k` — scroll 5 lines down / up
1212
- `l` / `h` — scroll page down / up
1313
- `b` — scroll to the ending of the buffer (bottom)
1414
- `u` — scroll to the beginning of the buffer (up)
15-
- `;` — quit the scroll mode
16-
- `-` — quit the scroll mode and delete the buffer
15+
- `;` — quit the Scroll mode
16+
- `-` — quit the Scroll mode and delete the buffer
1717

1818
With these mappings, you can quickly look around, walk through several screens
1919
of text, and when you are in the right place return back to normal mode for
@@ -22,7 +22,7 @@ more accurate text manipulations.
2222
![Demo](https://github.com/GeneZharov/vim-scrollmode/blob/master/demo.gif?raw=true)
2323

2424
For example, compare this scenario of a scrolling session in normal mode and in
25-
scroll mode.
25+
Scroll mode.
2626

2727
| | Normal Mode | Scroll Mode |
2828
| --- | ------------------------------- | ------------------------ |
@@ -32,28 +32,34 @@ scroll mode.
3232
| 4. | `k` `k` `k` `k` `k` `k` `k` `k` | `j` `j` |
3333
| | 13 keys (including 3 modifiers) | 5 keys, all for one hand |
3434

35-
Since scroll mode is in fact just a wrapper around normal mode, all keys, that
36-
are not remapped by scroll mode continue to be available: searching (`/`, `?`,
35+
Since Scroll mode is in fact just a wrapper around normal mode, all keys, that
36+
are not remapped by Scroll mode continue to be available: searching (`/`, `?`,
3737
`n`, `N`), window managing (`<C-w>`), etc.
3838

39+
If you enter another mode (Command mode, Insert mode, etc.) while Scroll mode
40+
is active, then it will be implicitly automatically finished, all Normal mode
41+
mappings will be restored, and you will be able to proceed in the mode of your
42+
choice.
43+
3944
## Installation
4045

4146
| Plugin Manager | Command |
4247
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
4348
| [vim-plug](https://github.com/junegunn/vim-plug) | `Plug 'GeneZharov/vim-scrollmode'` |
4449
| [Vundle](https://github.com/VundleVim/Vundle.vim) | `Plugin 'GeneZharov/vim-scrollmode'` |
45-
| [pathogen.vim](https://github.com/tpope/vim-pathogen/) | `git clone 'git@github.com:GeneZharov/vim-scrollmode.git ~/.vim/bundle/vim-scrollmode'` |
50+
| [pathogen.vim](https://github.com/tpope/vim-pathogen/) | `git clone 'git@github.com:GeneZharov/vim-scrollmode.git' ~/.vim/bundle/vim-scrollmode` |
4651
| native pack | `git clone 'git@github.com:GeneZharov/vim-scrollmode.git' ~/.vim/pack/dist/start/vim-scrollmode` |
4752

48-
Set a preferred shortcut to enter the scroll mode:
53+
Set a preferred shortcut to enter the Scroll mode:
4954

5055
```vim
5156
nmap <Leader>; <Plug>ScrollMode
5257
```
5358

54-
I prefer to use `<Space>` as a `<Leader>` key:
59+
I prefer to use Scroll mode with a `<Space>` as my `<Leader>` key:
5560

5661
```vim
62+
" Place it before all the <Leader> mappings
5763
map <SPACE> <Nop>
5864
let mapleader = "\<Space>"
5965
```
@@ -64,7 +70,7 @@ let mapleader = "\<Space>"
6470

6571
- **`g:scrollmode_actions`**
6672

67-
This option allows to configure default scroll mode key mappings. These
73+
This option allows to configure default Scroll mode key mappings. These
6874
key mappings are internally set with the following dictionary.
6975

7076
```vim
@@ -83,36 +89,36 @@ let mapleader = "\<Space>"
8389
You can specify any subset of this dictionary as a value for this option in
8490
order to override default mappings.
8591

86-
For example, to add `<Esc>` key to the keys that exit the scroll mode:
92+
For example, to add `<Esc>` key to the keys that exit the Scroll mode:
8793

8894
```vim
8995
let g:scrollmode_actions = {
9096
\ "exit": [";", "<Esc>"],
9197
\ }
9298
```
9399

94-
_I didn't make `<Esc>` to quit the scroll mode as default behavior, because
100+
_I didn't make `<Esc>` to quit the Scroll mode as default behavior, because
95101
in the terminal Vim (but not Neovim) it can break some complex keys like
96-
`<Up>` and `<Down>` while the scroll mode is active. If you are not going
97-
to use these keys in the scroll mode or if you use a different Vim version
102+
`<Up>` and `<Down>` while the Scroll mode is active. If you are not going
103+
to use these keys in the Scroll mode or if you use a different Vim version
98104
(GVim, Neovim), then you are welcome to use the config from the example
99105
above._
100106

101107
- **`g:scrollmode_mappings`**
102108

103-
With this option, you can specify new mappings available in the scroll
109+
With this option, you can specify new mappings available in the Scroll
104110
mode. This option has precedence over `g:scrollmode_actions`, so you can
105111
rebind a default action with any custom command.
106112

107113
For example, let's add a custom command for buffer deletion:
108114

109115
```vim
110-
let g:scroll_mode_mappings = {
116+
let g:scrollmode_mappings = {
111117
\ ":Bdelete<CR>": ["-", "c"]
112118
\ }
113119
```
114120

115-
When the scroll mode is activated, this code will internally result to:
121+
When the Scroll mode is activated, this code will internally result to:
116122

117123
```vim
118124
nnoremap <silent> <buffer> - :Bdelete<CR>
@@ -130,7 +136,7 @@ let mapleader = "\<Space>"
130136

131137
- **`g:scrollmode_cmdline_indicator`**
132138

133-
Enables or disables the scroll mode indicator in the command line. The
139+
Enables or disables the Scroll mode indicator in the command line. The
134140
indicator looks similar to other indicators for built-in modes and looks
135141
like this:
136142

@@ -142,14 +148,14 @@ let mapleader = "\<Space>"
142148

143149
- **`g:scrollmode_statusline_highlight`**
144150

145-
Enables or disables StatusLine highlighting, when the scroll mode is
151+
Enables or disables StatusLine highlighting, when the Scroll mode is
146152
activated. Has no effect with plugins that replace the status line
147153
([Airline](https://github.com/vim-airline/vim-airline),
148154
[Powerline](https://github.com/powerline/powerline),
149155
[Lightline](https://github.com/itchyny/lightline.vim)).
150156

151157
_I am not fully satisfied with how this feature works, so it is disabled by
152-
default. But if you need scroll mode to be more noticeable and colorful,
158+
default. But if you need Scroll mode to be more noticeable and colorful,
153159
then you can enable this option. See the options below for color
154160
customization._
155161

@@ -162,14 +168,14 @@ Options for status line color customization. Only have effect if
162168

163169
- **`g:scrollmode_statusline_group`**
164170

165-
Highlight group that is used for `StatusLine` when the scroll mode
171+
Highlight group that is used for `StatusLine` when the Scroll mode
166172
is active.
167173

168174
_Default:_ `"DiffAdd"`
169175

170176
- **`g:scrollmode_statusline_group_edge`**
171177

172-
Highlight group that is used for `StatusLine` when the scroll mode is
178+
Highlight group that is used for `StatusLine` when the Scroll mode is
173179
active and the top/bottom edge of the buffer is reached. The color helps to
174180
notice that you can't scroll in that direction anymore. Specify `v:null` if
175181
you don't need this behavior.
@@ -180,7 +186,7 @@ Options for status line color customization. Only have effect if
180186

181187
- **`g:ScrollmodeOnQuit`**
182188

183-
Funcref that is called after you exit the scroll mode.
189+
Funcref that is called after you exit the Scroll mode.
184190

185191
```vim
186192
function! s:fn() abort

autoload/scrollmode/enable.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endfunction
2222
function! s:highlight(new_state) abort
2323
if a:new_state != w:scrollmode_state
2424
if a:new_state == g:scrollmode#const#state_middle
25-
\ || g:scroll_mode_statusline_group_edge == v:null
25+
\ || g:scrollmode_statusline_group_edge == v:null
2626
exe "highlight! link StatusLine" g:scrollmode_statusline_group
2727
else
2828
exe "highlight! link StatusLine" g:scrollmode_statusline_group_edge

0 commit comments

Comments
 (0)