Skip to content

Commit 3d68501

Browse files
committed
fix doc
1 parent b800450 commit 3d68501

File tree

2 files changed

+148
-106
lines changed

2 files changed

+148
-106
lines changed

doc/swoop.txt

Lines changed: 134 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,206 @@
1-
*swoop.txt* Grep and replace easily in multiple files being context aware
1+
*swoop.txt* Grep and replace easily in multiple files being context aware
22

33
Author : pelodelfuego <clement.crepy@gmail.com>
44
Version : 1.1.6
55
License : GNU license {{{
66

7-
Copyright (C) 2015 copyright Clément CREPY
7+
Copyright (C) 2015 copyright Clément CREPY
88

9-
This program is free software; you can redistribute it and/or modify
10-
it under the terms of the GNU General Public License as published by
11-
the Free Software Foundation; either version 2 of the License, or
12-
(at your option) any later version.
9+
This program is free software; you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation; either version 2 of the License, or
12+
(at your option) any later version.
1313

14-
This program is distributed in the hope that it will be useful,
15-
but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17-
GNU General Public License for more details.
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
1818

19-
You should have received a copy of the GNU General Public License
20-
along with this program; if not, see <http://www.gnu.org/licenses/>.
19+
You should have received a copy of the GNU General Public License
20+
along with this program; if not, see <http://www.gnu.org/licenses/>.
2121

2222
}}}
2323

2424
CONTENTS
2525

26+
Introduction |swoop-introduction|
27+
Usage |swoop-usage|
28+
Single buffer mode |swoop-usage-single-buffer-mode|
29+
Multi buffer mode |swoop-usage-multi-buffer-mode|
30+
Interaction |swoop-interaction|
31+
Key Mapping |swoop-interaction-keymap|
32+
Function |swoop-interaction-function|
33+
Command |swoop-interaction-command|
34+
Variable |swoop-variable|
35+
Behaviour |swoop-variable-behaviour|
36+
Visual |swoop-variable-visual|
37+
Tips |swoop-tips|
38+
39+
2640
==============================================================================
27-
INTRODUCTION
41+
INTRODUCTION *swoop-introduction*
2842

29-
Vim swoop is directly inspired from helm-swoop we can find as emacs' plugin.
30-
It allows you to find and replace occurences in many buffers being aware of the context.
43+
Vim swoop is directly inspired from helm-swoop we can find as emacs' plugin.
44+
It allows you to find and replace occurences in many buffers being aware of the context.
3145

32-
You can edit the swoopBuffer and the changes you applied will be save for all corresponding files by saving the buffer
46+
You can edit the swoopBuffer and the changes you applied will be save for all corresponding files by saving the buffer
47+
48+
Especially useful to refactor a name in multiple files and keep control on it...
3349

34-
Especially useful to refactor a name in multiple files and keep control on it...
3550

3651
==============================================================================
37-
USAGE *swoop-usage*
52+
USAGE *swoop-usage*
3853

39-
When you start vim-swoop (multi or single buffer mode) you get 2 windows.
54+
When you start vim-swoop (multi or single buffer mode) you get 2 windows.
4055

41-
First one contain context, the other is the swoop buffer. As you move the cursor to a match, the display windows will show the context.
56+
First one contain context, the other is the |swoop buffer|. As you move the cursor to a match, the display windows will show the context.
4257

43-
From the swoop buffer, you can:
44-
Interactivly edit your search
45-
Navigate in results (and context) by moving the cursor
46-
Edit and save Swoop Buffer.
47-
The changes will be repercuted on all files by saving the Swoop Buffer
48-
Select current result.
49-
Exit Swoop and go to the location of current match.
50-
Quit Swoop.
51-
Exit Swoop will abort modifications and bring you back to the initial buffer and position.*
52-
Toggle single and multi buffer mode
58+
From the |swoop buffer|, you can:
5359

54-
------------------------------------------------------------------------------
55-
SINGLE BUFFER MODE
56-
Start in insert mode, first line contains the search pattern.
57-
As you type the pattern, results will interactivly be displayed bellow.
60+
- Interactivly edit your search
5861

62+
- Navigate in results (and context) by moving the cursor
63+
64+
- Edit and save |swoop buffer|.
65+
The changes will be repercuted on all files by saving the |swoop buffer|
66+
67+
- Select current result.
68+
69+
- Exit Swoop and go to the location of current match.
70+
71+
- Quit Swoop.
72+
Exit Swoop will abort modifications and bring you back to the initial buffer and position.*
73+
74+
- Toggle single and multi buffer mode
5975

60-
------------------------------------------------------------------------------
61-
MULTIPLE BUFFER MODE
62-
Start in insert mode, first line contains the buffer pattern, no pattern means all buffers.
63-
Buffer will be displayed interactivly bellow
64-
Second line contains the search pattern just like in single buffer mode
6576

66-
==============================================================================
67-
INTERACTION
6877
------------------------------------------------------------------------------
69-
KEYMAP
70-
Default mapping to use vim-swoop are:
78+
SINGLE BUFFER MODE *swoop-usage-single-buffer-mode*
79+
80+
Start in insert mode, first line contains the search pattern.
81+
As you type the pattern, results will interactivly be displayed bellow.
7182

72-
Swoop current buffer
73-
nmap <Leader>l :call Swoop()<CR>
74-
vmap <Leader>l :call SwoopSelection()<CR>
7583

84+
------------------------------------------------------------------------------
85+
MULTIPLE BUFFER MODE *swoop-usage-multi-buffer-mode*
7686

77-
Swoop multi buffers
78-
nmap <Leader>ml :call SwoopMulti()<CR>
79-
vmap <Leader>ml :call SwoopMultiSelection()<CR>
87+
Start in insert mode, first line contains the buffer pattern, no pattern means all buffers.
88+
Buffer will be displayed interactivly bellow
8089

81-
NB: if you are in visual mode, you will land in normal mode
90+
Second line contains the search pattern just like in single buffer mode
8291

8392

84-
You can disabledefault mapping by:
85-
let g:swoopUseDefaultKeyMap = 0
93+
==============================================================================
94+
INTERACTION *swoop-interaction*
8695

8796

8897
------------------------------------------------------------------------------
89-
FUNCTION
90-
Those 2 action are also exposed by the following function:
98+
KEYMAP *swoop-interaction-keymap*
99+
100+
Default mapping to use vim-swoop are:
91101

92-
Current buffer function
93-
:call SwoopPattern(pattern)
102+
Swoop current buffer
103+
nmap <Leader>l :call Swoop()<CR>
104+
vmap <Leader>l :call SwoopSelection()<CR>
94105

95106

96-
Multi buffer function
97-
For all buffer
98-
:call SwoopMultiPattern(searchPattern)
107+
Swoop multi buffers
108+
nmap <Leader>ml :call SwoopMulti()<CR>
109+
vmap <Leader>ml :call SwoopMultiSelection()<CR>
99110

100-
For specific buffer
101-
:call SwoopMultiPattern(searchPattern, bufPattern)
111+
NB: if you are in visual mode, you will land in normal mode
112+
113+
You can disabledefault mapping by:
114+
let g:swoopUseDefaultKeyMap = 0
102115

103116

104117
------------------------------------------------------------------------------
105-
COMMAND
106-
A third way to acces Swoop is by a direct command:
118+
FUNCTION *swoop-interaction-function*
107119

108-
For single buffer mode
109-
:Swoop <pattern>
120+
Those 2 action are also exposed by the following function:
110121

111-
For all buffer mode
112-
:Swoop! <pattern>
122+
- Current buffer function
123+
:call SwoopPattern(pattern)
113124

114125

126+
- Multi buffer function
127+
- For all buffer
128+
:call SwoopMultiPattern(searchPattern)
129+
130+
- For specific buffer
131+
:call SwoopMultiPattern(searchPattern, bufPattern)
115132

116133

117-
==============================================================================
118-
GLOBAL vARIABLE
119134
------------------------------------------------------------------------------
120-
BEHAVIOR
121-
Set search case insensitive
122-
By default, smartcase is set, you can go to case insensitive search by:
123-
let g:swoopIgnoreCase = 1
135+
COMMAND *swoop-interaction-command*
136+
137+
A third way to acces Swoop is by a direct command:
124138

125-
Disable quick regex mode
126-
By default, typing ```<Space>``` in the search pattern is replaced by ```.*```. And to type an actual space, you will need to escape it ```\<Space>```.
127-
You can get classic mode by:
128-
let g:swoopPatternSpaceInsertsWildcard = 0
139+
- Single buffer mode
140+
:Swoop <pattern>
129141

130-
Disable auto insert mode for normal mode
131-
By default, you will start in insert mode, you can disable it by:
132-
let g:swoopAutoInserMode = 0
142+
- All buffer mode
143+
:Swoop! <pattern>
144+
145+
146+
==============================================================================
147+
VARIABLE *swoop-variable*
133148

134149

135150
------------------------------------------------------------------------------
136-
VISUAL
137-
Lazy Filetype Load
138-
By default, filetype are lazy loaded when itering over multiple.
139-
let g:swoopLazyLoadFileType = 0
151+
BEHAVIOR *swoop-variable-behaviour*
152+
153+
Set search case insensitive
154+
By default, smartcase is set, you can go to case insensitive search by:
155+
let g:swoopIgnoreCase = 1
140156

157+
Disable quick regex mode
158+
By default, typing <Space>` in the search pattern is replaced by `.*`. And to type an actual space, you will need to escape it <Space>.
159+
You can get classic mode by:
160+
let g:swoopPatternSpaceInsertsWildcard = 0
141161

142-
Edit default HightLight
143-
If default highlight is not relevant with your colorscheme, you can edit it by editing g:swoopHighlight variable.
144-
let g:swoopHighlight = ["hi! link SwoopBufferLineHi Warning", "hi! link SwoopPatternHi Error"]
162+
Disable auto insert mode for normal mode
163+
By default, you will start in insert mode, you can disable it by:
164+
let g:swoopAutoInserMode = 0
145165

146-
Change default layout
147-
By default, layout will be horizontal, you can set it vertical by:
148-
let g:swoopWindowsVerticalLayout = 1
149166

150-
Default SwoopWindowSize
151-
You can force default size for the swoop window with:
152-
let g:defaultWinSwoopWidth = 12
153-
let g:defaultWinSwoopHeight = 15
167+
------------------------------------------------------------------------------
168+
VISUAL *swoop-variable-visual*
154169

170+
Lazy Filetype Load
171+
By default, filetype are lazy loaded when itering over multiple.
172+
let g:swoopLazyLoadFileType = 0
155173

156174

157-
==============================================================================
158-
TIPS AND TRICKS
159-
* Toggle mode
175+
Edit default HightLight
176+
If default highlight is not relevant with your colorscheme, you can edit it by editing g:swoopHighlight variable.
177+
let g:swoopHighlight = ["hi! link SwoopBufferLineHi Warning", "hi! link SwoopPatternHi Error"]
160178

161-
You can toggle single and multi buffer mode, your Pattern will stay the same.
179+
Change default layout
180+
By default, layout will be horizontal, you can set it vertical by:
181+
let g:swoopWindowsVerticalLayout = 1
162182

163-
Calling again a mode while your already in will reset the search pattern.
183+
Default SwoopWindowSize
184+
You can force default size for the swoop window with:
185+
let g:defaultWinSwoopWidth = 12
186+
let g:defaultWinSwoopHeight = 15
164187

165188

166-
* Search in swoop buffer
167-
Since the context display depends of the cursor movement, you can lauch a search inside the search buffer.
168189

190+
==============================================================================
191+
TIPS *swoop-tips*
192+
Toggle mode
193+
You can toggle single and multi buffer mode, your Pattern will stay the same.
194+
Calling again a mode while your already in will reset the search pattern.
169195

170-
* Use VisualMode in the swoop Buffer
171-
When you use visual mode in the swoopBuffer, the context will freeze if you select more than 2 lines.
172-
But it is really usefull on refactoring session: you can keep only the lines you want to refactor and execute global replace.
196+
Search in |swoop buffer|
197+
Since the context display depends of the cursor movement, you can lauch a search inside the search buffer.
173198

199+
Use VisualMode in the |swoop buffer|
200+
When you use visual mode in the swoopBuffer, the context will freeze if you select more than 2 lines.
201+
But it is really usefull on refactoring session: you can keep only the lines you want to refactor and execute global replace.
174202

175-
* Use last search
176-
When you start swoop (either the mode) and don't enter any pattern, search result will be your last search.
203+
Use last search
204+
When you start swoop (either the mode) and don't enter any pattern, search result will be your last search.
177205

178206

doc/tags

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
11
swoop.txt swoop.txt /*swoop.txt*
2+
vim-swoop.txt swoop.txt /*swoop.txt*
3+
swoop-introduction swoop.txt /*swoop-introduction*
4+
swoop-usage swoop.txt /*swoop-usage*
5+
swoop-usage-single-buffer-mode swoop.txt /*swoop-usage-single-buffer-mode*
6+
swoop-usage-multi-buffer-mode swoop.txt /*swoop-usage-multi-buffer-mode*
7+
swoop-interaction swoop.txt /*swoop-interaction*
8+
swoop-interaction-keymap swoop.txt /*swoop-interaction-keymap*
9+
swoop-interaction-function swoop.txt /*swoop-interaction-function*
10+
swoop-interaction-command swoop.txt /*swoop-interaction-command*
11+
swoop-variable swoop.txt /*swoop-variable*
12+
swoop-variable-behaviour swoop.txt /*swoop-variable-behaviour*
13+
swoop-variable-visual swoop.txt /*swoop-variable-visual*
14+
swoop-tips swoop.txt /*swoop-tips*
15+

0 commit comments

Comments
 (0)