-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscout.txt
226 lines (169 loc) · 8.06 KB
/
scout.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
*scout* *scout.txt* *scout.vim* Integration between neovim and scout fuzzy finder
____ ____ ___ _ _ _______ _____ __ __ ~
/ ___| / ___/ _ \| | | |_ _\ \ / /_ _| \/ |~
\___ \| | | | | | | | | | | \ \ / / | || |\/| |~
___) | |__| |_| | |_| | | |_ \ V / | || | | |~
|____/ \____\___/ \___/ |_(_) \_/ |___|_| |_|~
===============================================================================
TABLE OF CONTENTS *scout-toc*
INTRODUCTION ........................................ |scout-introduction|
DEPENDENCIES ........................................ |scout-dependencies|
USAGE ...................................................... |scout-usage|
COMMANDS ................................................ |scout-commands|
CONFIGURATION ...................................... |scout-configuration|
LICENSE .................................................. |scout-license|
CHANGELOG .............................................. |scout-changelog|
===============================================================================
INTRODUCTION *scout-introduction*
This plugin allows you to use the `scout` fuzzy finder to quickly search
for a file or buffer and open it.
You can find more info about `scout` in its main page:
*scout-main-page* https://github.com/jhbabon/scout
To do the integration, this plugin uses Neovim's built it |terminal-emulator|
===============================================================================
DEPENDENCIES *scout-dependencies*
You need to install `scout` in your system. Follow the installation
instructions in the |scout-main-page|
===============================================================================
USAGE *scout-usage*
You can start up `scout` at any moment by calling the command `:ScoutFiles`
(or `:ScoutBuffers`). This will bring up a new window with `scout` running
showing a list of files or buffers. Once you select a choice from the list,
you can hit enter and the file (or buffer) will open in the same window you
where before starting `scout`.
If you want to open your selection in a different window, instead of pressing
enter you can use one of the following mappings:
- Press <c-x> to open your selection in a horizontal split window.
- Press <c-v> to open your selection in a vertical split window.
- Press <c-t> to open your selection in a new tab.
You can map these commands so its faster to use them
>
nnoremap <leader>sf :ScoutFiles<cr>
nnoremap <leader>sb :ScoutBuffers<cr>
<
The commands `:ScoutFiles` and `:ScoutBuffers` accept an extra argument, a
string, which will be used as the initial search term for scout.
Example: starting `scout` with a default term to find buffers
>
:ScoutBuffers .jsx
<
You can pass |expand| wildcards and expressions as part of the term to search.
Example: starting `scout` in the current file directory
>
:ScoutFiles %:h
<
This allows you to create more useful mappings:
>
" search for files in current dir
nnoremap <leader>sfd :ScoutFiles %:h<cr>
" search for buffers for the current word
nnoremap <leader>sbc :ScoutBuffers <cword><cr>
<
===============================================================================
COMMANDS *scout-commands*
*:ScoutFiles*
Start `scout` in a new buffer with a list of files in your current directory.
The files are selected using the command defined in the
`g:scout_find_files_command` config variable.
If you pass a string to the command, it will be used as the initial search
term in `scout`. You can use regular |expand| wildcards and expressions in the
string.
*:ScoutBuffers*
Start `scout` in a new buffer with a list of buffers. The list of buffers is
the same as the one provided by the `:ls` command, with the same format.
If you pass a string to the command, it will be used as the initial search
term in `scout`. You can use regular |expand| wildcards and expressions in the
string.
*:ScoutVersion*
Show the current version of the plugin
===============================================================================
CONFIGURATION *scout-configuration*
*g:scout_find_files_command*
Command line tool used to list all the files. The output of this command will
be piped in to `scout`. Default: `"find * -type f"`
Example: using `ripgrep`
>
let g:scout_find_files_command = 'rg --files --hidden --follow --glob "!.git/*" 2>/dev/null'
<
*g:scout_command*
What is the command to execute as `scout`. Default: `"scout"`
If you have `scout` intalled in a custom path you can set up the command with
the whole path using this variable. You could even use a different tool that
works as `scout` if you want, like `selecta`.
Example: using a full path for `scout`
>
let g:scout_command = "/path/to/my/bin/scout"
<
Example: using a different tool
>
let g:scout_command = "selecta"
<
*g:scout_window_type*
Set the type of the `scout` window. It can be a split window or a floating
window if you use Neovim >= 0.4.
The values can be: `"split"` or `"floating"`.
By default it is `"split"`.
Example: using the floating window
>
let g:scout_window_type = "floating"
<
*g:scout_size*
Set the size of the `scout` split window. If nothing is set if will use half of the
window. By default it is the empty string: `""`.
Note: this option is only valid for the `"split"` value of the
`g:scout_window_type` option.
Example: using a small buffer
>
let g:scout_size = "20%"
<
===============================================================================
LICENSE *scout-license*
This plugin is under the MIT license.
===============================================================================
CHANGELOG *scout-changelog*
v2.1.1 - 2020-04-12~
Fixed:
- Use the |expand| function when defining Ex commands so the search option is
expanded correctly before calling the scout command. The previous expansion
done inside the scout plugin wasn't working properly.
v2.1.0 - 2019-10-11~
Added:
- Now you can start `scout` in a floating |window| in Neovim >= 0.4. You can
set the option `g:scout_window_type` to `floating` to enable this feature.
To keep the previous behavior, a split window, use the value `split`. This
is the default.
v2.0.1 - 2018-06-27~
Fixed:
- In neovim 0.3 how the output is sent to the job/terminal process has
changed and this change prevented the plugin to pass scout's output to
the internal functions that would open the file/buffer. Now the plugin will
collect scout's output all the time and get the final selection at scout's
exit. This works in neovim 0.3 and 0.2.
v2.0.0 - 2018-05-05~
Added:
- Now you can start the `scout` buffer with an initial search term. This term
can use the same wildcards and expressions as in |expand|.
Changed:
- The functions `scout#files#fun` and `scout#buffers#run` now accept a dict
with the key `'search'`. This is the initial term to search.
- The function `scout#open` changed its API. Now it accepts an `options` dict
which will hold the `'search'` term and the `'callbacks'`.
v1.2.0 - 2017-08-28~
Added:
- Set the size of the `scout` buffer with the new option `g:scout_size`.
Changed:
- The original sizes of the open windows are restored after closing the `scout`
buffer.
v1.1.0 - 2017-07-27~
Changed:
- Don't delete scout buffer, wipe it!
v1.0.1 - 2017-06-30~
Fixed:
- Add missing link to vim-plug to README
v1.0.0 - 2017-06-30~
Added:
- Full integration with `scout` to search for files or buffers to edit. `scout`
is launched in a terminal buffer that will handle the user interaction.
Once the user selects a file or buffer, this will be opened in a window.
The terminal buffer will be removed once is closed.
vim:fo=:ts=8:sw=4:et:tw=78:norl:nosta:nosr:ft=help