Skip to content

Commit 12e6248

Browse files
committed
Updated README and added proper documentation.
1 parent 0a4b199 commit 12e6248

2 files changed

Lines changed: 212 additions & 69 deletions

File tree

README.md

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -24,86 +24,21 @@ Use your favorite plugin manager or dump the files below in their standard locat
2424
# Unix-like systems
2525
~/.vim/after/ftplugin/qf.vim
2626
~/.vim/autoload/qf.vim
27+
~/.vim/doc/qf.txt
2728
~/.vim/plugin/qf.vim
2829

2930
# Windows
3031
%userprofile%\vimfiles\after\ftplugin\qf.vim
3132
%userprofile%\vimfiles\autoload\qf.vim
33+
%userprofile%\vimfiles\doc\qf.txt
3234
%userprofile%\vimfiles\plugin\qf.vim
3335

34-
## Usage
36+
Don't forget to index the documentation with:
3537

36-
The following commands are available when the location/quickfix window is focused:
37-
38-
:Filter " Without argument, removes every item not found
39-
" in the file of the current item.
40-
:Filter foo " Removes every item that doesn't match with the
41-
" supplied argument, either in the filename or
42-
" in the description.
43-
:Restore " Restores the list to its original state.
44-
:Doline command " Executes 'command' on every line in the current list.
45-
:Dofile command " Executes 'command' on every file in the current list.
46-
47-
## Configuration
48-
49-
### Mappings available everywhere
50-
51-
Go up and down the quickfix list and wrap around
52-
53-
<Plug>QfCprevious
54-
<Plug>QfCnext
55-
56-
Go up and down the location list and wrap around
57-
58-
<Plug>QfLprevious
59-
<Plug>QfLnext
60-
61-
Jump to and from the location/quickfix window
62-
63-
<Plug>QfSwitch
64-
65-
Here is how you would map `<leader>n` to jump to the next error in the quickfix list:
66-
67-
nmap <leader>n <Plug>QfCnext
68-
69-
### Ack.vim-inspired mappings available only in the quickfix window
70-
71-
s - open entry in a new horizontal window
72-
v - open entry in a new vertical window.
73-
t - open entry in a new tab.
74-
o - open entry and come back
75-
O - open entry and close the location/quickfix window.
76-
77-
Add the line below to your `vimrc` to enable that feature:
78-
79-
let g:qf_mapping_ack_style = 1
80-
81-
### Statusline customization
82-
83-
It is possible to define what comes before and after the default information displayed in the statusline. Feel free to play with the options below.
84-
85-
let g:qf_statusline = {}
86-
let g:qf_statusline.before = '%<\ '
87-
let g:qf_statusline.after = '\ %f%=%l\/%-6L\ \ \ \ \ '
88-
89-
## AKNOWLEDGEMENTS
90-
91-
The "Ack.vim-inspired mappings" come from [Ack.vim](https://github.com/mileszs/ack.vim), obviously.
92-
93-
`:Doline` and `:Dofile` are inspired by these online resources:
94-
95-
* http://vimcasts.org/episodes/project-wide-find-and-replace/
96-
* https://github.com/nelstrom/vim-qargs
97-
* https://github.com/henrik/vim-qargs
98-
* http://stackoverflow.com/questions/4792561/how-to-do-search-replace-with-ack-in-vim/4793316#4793316
99-
* http://stackoverflow.com/a/5686810/546861
100-
* and another one I can't find right now.
101-
102-
`:Filter` is adapted from the answers to [this question](http://stackoverflow.com/questions/15406138/is-it-possible-to-grep-vim%CA%BCs-quickfix).
38+
:helptags /path/to/vim-qf/doc/
10339

10440
## TODO
10541

106-
* Write a proper `help` file.
10742
* Ask #vim's opinion.
10843
* Export more options?
10944
* Add a gifcast to the README?
@@ -112,3 +47,4 @@ The "Ack.vim-inspired mappings" come from [Ack.vim](https://github.com/mileszs/a
11247

11348
* Use `<Plug>` mappings.
11449
* Add proper attribution for a few features.
50+
* Write a proper `help` file.

doc/qf.txt

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
*qf.txt* A plugin to make working with the quickfix list/window smoother.
2+
3+
4+
VIM-QF DOCUMENTATION by Romain Lafourcade
5+
6+
7+
Help on using vim-qf *qf* *vim-qf*
8+
9+
1. Introduction ............................... |qf-intro|
10+
2. Installation ............................... |qf-installation|
11+
3. Configuration .............................. |qf-configuration|
12+
4. Usage ...................................... |qf-usage|
13+
5. Aknowledgements ............................ |qf-aknowledgements|
14+
6. TODO ....................................... |qf-todo|
15+
7. DONE ....................................... |qf-done|
16+
17+
==============================================================================
18+
1. INTRODUCTION *qf-intro*
19+
20+
vim-qf – short for "vim-quickfix" – is a small collection of settings,
21+
commands and mappings put together to make working with the quickfix
22+
list/window smoother.
23+
24+
Here is a list of the features provided by this plugin:
25+
26+
- no soft-wrapping,
27+
- no relative numbers,
28+
- quickfix buffers hidden from |:ls| and buffer navigation,
29+
- Ack.vim-inspired mappings,
30+
- wrapping mappings for |:cnext|, |:cprevious|, |:lnext|, |:lprevious|,
31+
- jump to and from the location/quickfix window with a single mapping
32+
- filter/restore the list
33+
- perform commands on each line in the list
34+
- perform commands on each file in the list
35+
- open the location/quickfix window automatically after |:make|, |:grep|,
36+
|:lvimgrep| and friends if there are valid locations/errors
37+
- quit Vim if the last window is a location/quickfix window
38+
39+
==============================================================================
40+
2. INSTALLATION *qf-installation*
41+
42+
Use your favorite plugin manager or dump the files below in their
43+
standard location:
44+
45+
on Unix-like systems... >
46+
47+
~/.vim/after/ftplugin/qf.vim
48+
~/.vim/autoload/qf.vim
49+
~/.vim/doc/qf.txt
50+
~/.vim/plugin/qf.vim
51+
<
52+
on Windows... >
53+
54+
%userprofile%\vimfiles\after\ftplugin\qf.vim
55+
%userprofile%\vimfiles\autoload\qf.vim
56+
%userprofile%\vimfiles\doc\qf.txt
57+
%userprofile%\vimfiles\plugin\qf.vim
58+
<
59+
Don't forget to execute the following command to make the documentation
60+
globally available: >
61+
62+
:helptags /path/to/doc/
63+
<
64+
==============================================================================
65+
3. CONFIGURATION *qf-configuration*
66+
67+
Available mappings:
68+
69+
<Plug>QfCprevious ............................. |QfCprevious|
70+
<Plug>QfCnext ................................. |QfCnext|
71+
<Plug>QfLprevious ............................. |QfLprevious|
72+
<Plug>QfLnext ................................. |QfLnext|
73+
<Plug>QfSwitch ................................ |QfSwitch|
74+
75+
Available options:
76+
77+
qf_mapping_ack_style .......................... |qf_mapping_ack_style|
78+
qf_statusline ................................. |qf_statusline|
79+
80+
------------------------------------------------------------------------------
81+
*QfCprevious*
82+
*QfCnext*
83+
Go up and down the quickfix list and wrap around.
84+
85+
Example: >
86+
87+
nnoremap <Home> <Plug>QfCprevious
88+
nnoremap <End> <Plug>QfCnext
89+
<
90+
------------------------------------------------------------------------------
91+
*QfLprevious*
92+
*QfLnext*
93+
Go up and down the location list and wrap around.
94+
95+
Example: >
96+
97+
nnoremap <C-Home> <Plug>QfLprevious
98+
nnoremap <C-End> <Plug>QfLnext
99+
<
100+
------------------------------------------------------------------------------
101+
*QfSwitch*
102+
Jump to and from the location/quickfix window.
103+
104+
Example: >
105+
106+
<Plug>QfSwitch
107+
<
108+
------------------------------------------------------------------------------
109+
*'qf_mapping_ack_style'*
110+
Value: numeric ~
111+
Default: 0 ~
112+
113+
Ack.vim-inspired mappings available only in the quickfix window:
114+
115+
s - open entry in a new horizontal window
116+
v - open entry in a new vertical window.
117+
t - open entry in a new tab.
118+
o - open entry and come back
119+
O - open entry and close the location/quickfix window.
120+
121+
Add the line below to your vimrc to enable that feature: >
122+
123+
let g:qf_mapping_ack_style = 1
124+
<
125+
------------------------------------------------------------------------------
126+
*'qf_statusline'*
127+
Value: dictionary ~
128+
Default: {} ~
129+
130+
It is possible to define what comes before and after the default information
131+
displayed in the |'statusline'|.
132+
133+
Example: >
134+
135+
let g:qf_statusline = {}
136+
let g:qf_statusline.before = '%<\ '
137+
let g:qf_statusline.after = '\ %f%=%l\/%-6L\ \ \ \ \ '
138+
<
139+
==============================================================================
140+
4. USAGE *qf-usage*
141+
142+
The following commands are available when the location/quickfix window
143+
is focused:
144+
145+
*:Filter*
146+
147+
Removes every item that doesn't match with the supplied argument,
148+
either in the filename or in the description.
149+
150+
Example: >
151+
152+
:Filter model
153+
>
154+
*:Restore*
155+
156+
Restores the list to its original state.
157+
158+
*:Doline*
159+
160+
Executes an Ex command on every line in the current list.
161+
162+
Example: >
163+
164+
:Doline s/^/--
165+
<
166+
*:Dofile*
167+
168+
Executes an Ex command on every file in the current list.
169+
170+
Example: >
171+
172+
:Dofile norm @q
173+
<
174+
==============================================================================
175+
5. AKNOWLEGEMENTS *qf-aknowledgements*
176+
177+
The "Ack.vim-inspired mappings" are adapted from Ack.vim:
178+
179+
- https://github.com/mileszs/ack.vim
180+
181+
|:Doline| and |:Dofile| are inspired by these online resources:
182+
183+
- http://vimcasts.org/episodes/project-wide-find-and-replace/
184+
- https://github.com/nelstrom/vim-qargs
185+
- https://github.com/henrik/vim-qargs
186+
- http://stackoverflow.com/a/4793316/546861
187+
- http://stackoverflow.com/a/5686810/546861
188+
189+
|:Filter| is adapted from the answers in this thread:
190+
191+
- http://stackoverflow.com/q/15406138/546861
192+
193+
==============================================================================
194+
6. TODO *qf-todo*
195+
196+
- Ask #vim's opinion.
197+
- Export more options?
198+
- Add a gifcast to the README?
199+
200+
==============================================================================
201+
7. DONE *qf-done*
202+
203+
- Use <Plug> mappings.
204+
- Add proper attribution for a few features.
205+
- Write a proper help file.
206+
207+
vim:tw=78:ts=8:ft=help:norl:

0 commit comments

Comments
 (0)