-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
executable file
·231 lines (175 loc) · 9.33 KB
/
README
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
227
228
229
230
231
*ft_improved.txt* - Better f/t command for Vim
Author: Christian Brabandt <[email protected]>
Version: 0.9 Thu, 15 Jan 2015 21:40:10 +0100
Copyright: (c) 2009-2013 by Christian Brabandt
The VIM LICENSE applies to improved_ft.vim and improved_ft.txt
(see |copyright|) except use improved_ft instead of "Vim".
NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK.
==============================================================================
1. Contents *improvedft-ft*
1. Contents...................................: |improvedft-ft|
2. Manual.....................................: |improvedft-manual|
2.1 Enable...................................: |improvedft-Enable|
2.2 Disable..................................: |improvedft-Disable|
2.3 Tips.....................................: |improvedft-Tips|
2.3.1 Using the YankRing.......................: |improvedft-YankRing|
2.3.2 Ignoring case............................: |improvedft-ignorecase|
2.3.3 Searching for more chars.................: |improvedft-multichars|
2.3.4 Consistent ,/; keys......................: |improvedft-consistent_comma|
2.4 Mapping..................................: |improvedft-Mapping|
2.5 Bugs.....................................: |improvedft-Bugs|
3. Feedback...................................: |improvedft-feedback|
4. History....................................: |improvedft-history|
==============================================================================
2. Improved ft command Manual *improvedft-manual*
Functionality
This plugin tries to improve the existing behaviour of the |f|, |F|, |t| and
|T| command by letting them move the cursor not only inside the current line,
but move to whatever line, where the character is found. Also the |,| and |;|
command should consistently by default, but can be enabled to work as usual
(see |improvedft-consistent_comma|).
It does consider counts given and should work simply as a user would be
expecting.
It basically does that, by remapping the f,F,t and T command to issue a search
for the character that is entered and moving the cursor there.
2.1 Enable *improvedft-Enable*
----------
By default the new f,F,t,T commands should simply work. If you have disabled
the plugin (see |improvedft-Disable|), use the command >
:EnableImprovedFT
<
2.2 Disable *improvedft-Disable*
-----------
If for any reason, you want to disable the plugin, use >
:DisableImprovedFT
<
2.3 Tips *improvedft-Tips*
--------
*improvedft-YankRing*
2.3.1 YankRing and the improved ft plugin
------------------------------------------
Both plugins map the ',', ';', 'f', 'F', 't' and 'T' key, so they don't work
together very well. The improved ft plugin tries to work around that by
setting a YankRing option that prevents mapping those keys and reloading the
YankRing plugin.
The following YankRing variables are set by the improved ft plugin: >
let g:yankring_zap_keys = "/ ?"
let g:yankring_o_keys = 'b B w W e E d h j k l H M L y G ^ 0 $'
let g:yankring_o_keys .= ' g_ g^ gm g$ gk gj gg ge gE - + _ '
let g:yankring_o_keys .= ' iw iW aw aW as is ap ip a] a[ i] i['
let g:yankring_o_keys .= ' a) a( ab i) i( ib a> a< i> i< at it'
let g:yankring_o_keys .= ' a} a{ aB i} i{ iB a" a'' a` i" i'' i`'
<
If those variables have been customized in your .vimrc, the plugin detects it
and removes the ',', ';', 'f', 'F', 't' and 'T' from them.
The drawback of doing this is, that the YankRing possibly doesn't immediately
catch up in the YankRing itself and possibly will not be caught at all.
*improvedft-ignorecase*
2.3.2 Ignoring case when searching
----------------------------------
ft_improved tries to mimic the existing behaviour of the |f| |F| |t| |T| |,| |;|
commands as closely as possible. However, you might wish to search for the
character while ignoring case, so that fT will also jump to either the next
't' or 'T' character, whichever appears first.
To enable this, simply set this variable in your |.vimrc| >
:let g:ft_improved_ignorecase = 1
<
To disable either |unlet| that variable, or set it to zero.
*improvedft-multichars*
2.3.3 Searching for more characters
-----------------------------------
ft_improved tries to mimic the existing behaviour of the |f| |F| |t| |T| |,| |;|
commands as closely as possible. However, you might wish to search for more
character to better find your position and not only allow one single char with
it.
To enable this, simply set this variable in your |.vimrc| >
:let g:ft_improved_multichars = 1
<
As you type, the matching positions will be highlighted.
(Set g:ft_improved_nohighlight = 1 if you don't want the highlighting).
To disable either |unlet| that variable, or set it to zero.
If you have enabled it this way, you need to press enter, after having entered
the characters to search for, so that the plugin knows, when not to wait for more
characters and to start searching. Alternatively, if the entered characters
precisely only match one position in the current screen (excluding folds), it
will simply drop you there.
Note: This is highly experimental and basically turns your |f| |F| |t| |T| |,|
|;| keys to use a literal search function.
*improvedft-consistent_comma*
2.3.4 Consistent ,/; keys
-------------------------
By default, the |,| will always search into the opposite direction of your
last |f|/|F|/|t|/|T| command, while the ';' will always search in the same
direciton.
If you rather like to have that the |;| will always search forward and the |,|
always backwards you can set the variable g:ft_improved_consistent_comma
variable like this in your |.vimrc| >
:let g:ft_improved_consistent_comma = 1
2.4 Mapping *improvedft-Mapping*
-----------
By default the keys |f| |F| |t| |T| |;| and |,| are mapped to a function that
performs the work. If for one reason, you do not want any of those keys to be
remapped, simply set the variable g:ft_improved_nomap_<key> to one where <key>
corresponds to any of the above keys (but use "comma" for "," and semicolon
for ";"). Say you do not want to have the ',' remapped, you would in your
|.vimrc| set: >
:let g:ft_improved_nomap_comma = 1
2.5 Bugs *improvedft-Bugs*
--------
- When using T as operator and the match is the last character of a previous
line, the motion will become inclusive and you will incorrectly also change
that character. (also when ',' or ';' are searching backwards) That seems to
be a bug within Vim. See also |exclusive|
==============================================================================
3. Feedback *improvedft-feedback*
Feedback is always welcome. If you like the plugin, please rate it at the
vim-page:
http://www.vim.org/scripts/script.php?script_id=3877
You can also follow the development of the plugin at github:
http://github.com/chrisbra/improvedft
Please don't hesitate to report any bugs to the maintainer, mentioned in the
third line of this document.
==============================================================================
4. History *improvedft-history*
0.10: (unreleased) "{{{
- Make |,| and |;| work as documented (reported by JonnyRa in
https://github.com/chrisbra/improvedft/issues/5, thanks!)
0.9: Jan 15, 2015 "{{{
- do not mess up highlighting for |;| and |,| commands
- make count work correctly with multi-highlight match, so that only the
count'th occurence gets highlighted.
- allow to disable mappings selectively |improvedft-Mapping|
(issue https://github.com/chrisbra/improvedft/issues/4 reported by Maiko
Cezar, thanks!)
- make the plugin not unneccessarily source the autoload script
- document |improvedft-consistent_comma|
0.8: Mar 27, 2014 "{{{1
- handle keys like <Enter>, <Tab> literally
- escape '/' correctly for |t| commands.
0.7: Aug 14, 2013 "{{{1
- small bugfixes
- correctly handle ignorecase setting |improvedft-ignorecase|
- escape '
- make ; work correctly when using backwards motion.
0.6: Mar 16, 2013 "{{{1
- |improvedft-multichars|
- save and restore search-history in all modes correctly
0.5: Feb 16, 2013 "{{{1
- ignorecase when searching, when g:ft_improved_ignorecase is set
0.4: Sep 09, 2012 "{{{1
- special handling of pattern / and ?
0.3: Aug 20, 2012 "{{{1
- fix issue https://github.com/chrisbra/improvedft/issues/1
by disallowing the Yankring to map the keys f F t and T
- Better mapping of ';' key (patch by Marcin Szamotulski, thanks!)
0.2: Jan 13, 2012 {{{1
- disable debug mode
- enable |GLVS|
0.1: Jan 12, 2012 {{{1
- Initial upload
- development versions are available at the github repository
- put plugin on a public repository (http://github.com/chrisbra/improvedft)
}}}
==============================================================================
Modeline:
vim:tw=78:ts=8:ft=help:et:fdm=marker:fdl=0:norl