Debian Codegraph @

vimode/README

raw
1 ======
2 Vimode
3 ======
4
5 .. contents::
6
7
8 About
9 =====
10
11 Vimode is a Vim-mode plugin for Geany written by a guy who does not use Vim.
12 Expect problems unexpected by a Vim user and, please, report them.
13
14 Despite the limited Vim knowledge of the author, the plugin tries to be a
15 reasonably complete Vim mode implementation featuring:
16
17 * normal mode, insert/replace mode, visual mode, line visual mode
18 * repeated commands (e.g. 10dd - delete 10 lines)
19 * "motion" commands (e.g. d10l - delete 10 characters to the right)
20 * "text object" commands (e.g. di( - delete inner contents of parentheses)
21 * visual mode commands (e.g. ~ to swap case of the selected text)
22 * basic ex mode commands like :s, including range specifications (e.g.
23 :5,8s/foo/bar/g - replace foo with bar on lines 5 through 8)
24 * most basic navigation, selection and text manipulation commands - see the end
25 of this file for the full list
26 * command repetition using "." and repeated insert
27
28 It should be relatively easy to add more (non-special) commands so if you run
29 into something you are missing, please let me know.
30
31 Setup and Configuration
32 =======================
33 The plugin can be enabled/disabled from the Plugin Manager of Geany. Once enabled,
34 it adds a new menu called Vim Mode under the Tools menu with the following items.
35
36 Enable Vim Mode
37 ---------------
38 Enables/disables the Vim mode. A keybinding can be assigned to this action so
39 you can for instance use Geany normally and enable/disable the Vim mode as
40 needed.
41
42 Insert Mode for Dummies
43 -----------------------
44 This makes the insert mode behave like normal Geany, only the escape key allows
45 you to switch to the Vim command mode. This is basically "Vim for the rest of us"
46 who want to use the editor in a standard (understand non-vim) way but who like
47 the idea of having access to Vim commands from time to time. Highly unintrusive
48 so you basically do not know about the Vim mode normally.
49
50 Start in Insert Mode
51 --------------------
52 By default, the plugin starts in the normal mode. If you enable the "dummies"
53 mode above, you might also want to enable this option so you do not have to
54 switch to the insert mode manually when the application starts.
55
56 Behavior
57 ========
58 Upon changing mode, the plugin writes the current mode in the status bar. The
59 caret shape also indicates the current mode:
60
61 * block, not blinking - normal mode
62 * vertical line, not blinking - visual mode
63 * blinking vertical line - insert mode
64 * blinking underscore - replace mode
65
66 When evaluating key presses, the plugin checks if the keypress is a Vim command
67 or a part of a command in which case the plugin consumes the key press event
68 and does not propagate it to Geany. When the keypress is not a Vim command,
69 the plugin sends it to Geany which processes it normally based in its internal
70 logic. This means that it is still possible to use normal Geany keybindings
71 with this plugin unless they conflict with a Vim command.
72
73 If autocompletion popups or tooltips are present in insert mode, escape closes
74 them first without entering the normal mode so you do not enter normal mode
75 by accident.
76
77 Limitations and Problems
78 ------------------------
79 I tried to implement a reasonable subset of Vim commands but please note that
80 the judgement what is a reasonable set of commands was made by a guy who does not
81 use Vim. So it is very probable I missed some totally fundamental behavior
82 of Vim every Vim user would expect to be present. Please report such problems.
83
84 This is an incomplete list of known limitations of the plugin:
85
86 * selection in visual mode does not behave the same way as in Vim - the reason is
87 that the editor component Geany uses (Scintilla) uses cursor which is always
88 between characters and not on characters (block cursor which appears to be
89 on top of a character behaves as if it were before the character). This may lead
90 to situations when the position of the cursor is off by one. This issue might
91 be fixed later but it will be tricky.
92 * undo does not preserve cursor position the same way Vim does - probably fixable
93 * block visual mode is not implemented - probably possible using Scintilla's
94 multiple selection feature
95 * select submode of insert mode is not implemented
96 * named registers and related commands are not implemented
97 * Ctrl+X mode is not implemented
98 * marks are not implemented
99 * many fold commands are not implemented
100 * most commands starting with "'", "z", and "g" are not implemented
101 * most ex mode commands are not implemented (excluding basic stuff like search,
102 replace, saving, etc.)
103 * despite being mentioned below, none of the commands for quitting (:q, ZZ, etc.)
104 work because the corresponding function is not in Geany API yet - everything is
105 ready in the plugin though
106 * only the 'g' flag is supported in the substitute command
107 * in search and substitute the regular expressions are based on Scintilla regular
108 expressions which differ from Vim. Check the Scintilla documentation at
109 https://www.scintilla.org/ScintillaDoc.html#Searching for more details.
110 In addition, \c is also supported to allow case-insensitive search.
111
112 FAQ
113 ===
114
115 Why does Vimode suck so much?
116 -----------------------------
117 Well, it simulates the Vim behavior - what did you expect?
118
119 No, stupid, I mean why does your implementation suck so much?
120 -------------------------------------------------------------
121 Ah, that's simple - I am not a Vim user. Before writing this plugin, I knew
122 about 5 Vim commands (after writing this plugin, my knowledge has nearly doubled).
123 Even though I kind of like the idea behind the editor, my poor brain isn't able
124 to remember in which mode I currently am and what keypresses I can use. This
125 means I don't really know how a typical user uses Vim and I probably miss
126 some very basic things Vim users take for granted. Please report such issues
127 so I can improve the plugin.
128
129 So why the hell did you write this plugin?
130 ------------------------------------------
131 It was the constant whining of Vim users at Prague and Chemnitz Linux Days which
132 made me write the plugin. And it turned out that writing a Vim editor is
133 quite a lot of fun - much more than using it.
134
135 Meh, even I could write a better Vim plugin
136 -------------------------------------------
137 Great! Submit patches! Fix bugs! All contributions are really welcome.
138
139 Help! I enabled your plugin together with others and the editor is really strange now!
140 --------------------------------------------------------------------------------------
141 This, my friend, is the world of Vim. Welcome! Fortunately, you can easily
142 disable it using Geany's Plugin Manager. Phew!
143
144 Help! I am a long-time Vim user and can't quit the editor, :q doesn't work!
145 ---------------------------------------------------------------------------
146 Geany currently doesn't allow plugins to quit the editor so you have to do
147 it in a non-vim way. This is where the tricky part starts for Vim users: with your
148 mouse navigate to the top-right corner of the window to the X button and click
149 it - behold, the window closes (I know, totally counter-intuitive for Vim users).
150
151 After building the plugin, I noticed a binary called viw, what is it?
152 ---------------------------------------------------------------------
153 After I started writing the plugin, I soon realized that in fact, I am writing
154 a new editor. I nearly didn't use any Geany calls and most of the code just
155 calls the Scintilla API. At this point I decided to separate the Geany plugin
156 part from the rest of the code which is completely Geany-independent. And now
157 I could write a simple editor which just uses Scintilla and GTK (well,
158 not exactly - the way it builds now it still uses Scintilla from libgeany
159 but the build could be easily modified to link against statically built
160 Scintilla without any Geany dependency). So yeah, I'm a real man now, have my own
161 editor - it only sucks it's a Vim clone. And in fact it turned out to be useful
162 for the development of the plugin because one can use the viw (Vi Worsened)
163 editor for testing instead of having to restart Geany all the time.
164
165 So does it mean I could use your code and add Vim support to another editor?
166 ----------------------------------------------------------------------------
167 Yes - as long as the editor is based on Scintilla and GTK. If it is, it should
168 be really simple - just check the "backends" directory how it is done for Geany
169 and viw. I believe it should still be quite simple to modify the code if
170 the editor uses Scintilla but doesn't use GTK - the amount of the used GTK code
171 is very small (most work will be with re-mapping the key event codes to the
172 other library). If your editor isn't Scintilla-based, you are more or less
173 doomed - most of the code deals with Scintilla and switching to a different
174 editor component basically means rewriting the plugin.
175
176 Contact
177 =======
178
179 Author
180 ------
181 Jiří Techet, <techet(at)gmail(dot)com>.
182
183 Bug Reports
184 -----------
185 Please direct all questions, bug reports and patches to the combined geany-plugins
186 project at https://github.com/geany/geany-plugins and open the corresponding
187 bug report or pull request there. To notify the author of this plugin about
188 your post, mention him using his github user name (@techee).
189
190 License
191 =======
192
193 Vimode is distributed under the terms of the GNU General Public License
194 as published by the Free Software Foundation; either version 2 of the
195 License, or (at your option) any later version. A copy of this license
196 can be found in the file COPYING included with the source code of this
197 program.
198
199 Downloads
200 =========
201
202 Vimode is part of the combined Geany Plugins release. For more information and
203 downloads, please visit https://plugins.geany.org/geany-plugins/
204
205 Source Code
206 ===========
207
208 The source code is available at::
209
210 git clone https://github.com/geany/geany-plugins.git
211
212 Implemented Commands
213 ====================
214 The rest of the file contains a list of Vim commands which have been at least
215 partially implemented in the plugin. This is taken from the index.txt Vim help
216 file which is also present in the root directory of the plugin. If you add
217 a new command, please do not forget to update the table below.::
218
219 ==============================================================================
220 1. Insert mode insert-index
221
222 tag char action in Insert mode
223 -----------------------------------------------------------------------
224 i_CTRL-@ CTRL-@ insert previously inserted text and stop
225 insert
226 i_CTRL-A CTRL-A insert previously inserted text
227 i_CTRL-C CTRL-C quit insert mode, without checking for
228 abbreviation, unless 'insertmode' set.
229 i_CTRL-D CTRL-D delete one shiftwidth of indent in the current
230 line
231 i_CTRL-E CTRL-E insert the character which is below the cursor
232 i_<BS> <BS> delete character before the cursor
233 i_CTRL-H CTRL-H same as <BS>
234 i_<Tab> <Tab> insert a <Tab> character
235 i_CTRL-I CTRL-I same as <Tab>
236 i_<NL> <NL> same as <CR>
237 i_CTRL-J CTRL-J same as <CR>
238 i_<CR> <CR> begin new line
239 i_CTRL-M CTRL-M same as <CR>
240 i_CTRL-O CTRL-O execute a single command and return to insert
241 mode
242 i_CTRL-T CTRL-T insert one shiftwidth of indent in current
243 line
244 i_CTRL-W CTRL-W delete word before the cursor
245 i_CTRL-Y CTRL-Y insert the character which is above the cursor
246 i_<Esc> <Esc> end insert mode (unless 'insertmode' set)
247 i_CTRL-[ CTRL-[ same as <Esc>
248 i_<Del> <Del> delete character under the cursor
249
250 i_<Left> <Left> cursor one character left
251 i_<S-Left> <S-Left> cursor one word left
252 i_<C-Left> <C-Left> cursor one word left
253 i_<Right> <Right> cursor one character right
254 i_<S-Right> <S-Right> cursor one word right
255 i_<C-Right> <C-Right> cursor one word right
256 i_<Up> <Up> cursor one line up
257 i_<S-Up> <S-Up> same as <PageUp>
258 i_<Down> <Down> cursor one line down
259 i_<S-Down> <S-Down> same as <PageDown>
260 i_<Home> <Home> cursor to start of line
261 i_<C-Home> <C-Home> cursor to start of file
262 i_<End> <End> cursor past end of line
263 i_<C-End> <C-End> cursor past end of file
264 i_<PageUp> <PageUp> one screenful backward
265 i_<PageDown> <PageDown> one screenful forward
266 i_<Insert> <Insert> toggle Insert/Replace mode
267
268 ==============================================================================
269 2. Normal mode normal-index
270
271 CHAR any non-blank character
272 WORD a sequence of non-blank characters
273 N a number entered before the command
274 {motion} a cursor movement command
275 Nmove the text that is moved over with a {motion}
276 SECTION a section that possibly starts with '}' instead of '{'
277
278 note: 1 = cursor movement command; 2 = can be undone/redone
279
280 tag char note action in Normal mode
281 ------------------------------------------------------------------------------
282 CTRL-B CTRL-B 1 scroll N screens Backwards
283 CTRL-D CTRL-D scroll Down N lines (default: half a screen)
284 CTRL-E CTRL-E scroll N lines upwards (N lines Extra)
285 CTRL-F CTRL-F 1 scroll N screens Forward
286 <BS> <BS> 1 same as "h"
287 CTRL-H CTRL-H 1 same as "h"
288 <NL> <NL> 1 same as "j"
289 CTRL-J CTRL-J 1 same as "j"
290 <CR> <CR> 1 cursor to the first CHAR N lines lower
291 CTRL-M CTRL-M 1 same as <CR>
292 CTRL-N CTRL-N 1 same as "j"
293 CTRL-P CTRL-P 1 same as "k"
294 CTRL-R CTRL-R 2 redo changes which were undone with 'u'
295 CTRL-U CTRL-U scroll N lines Upwards (default: half a
296 screen)
297 CTRL-Y CTRL-Y scroll N lines downwards
298
299 <Space> <Space> 1 same as "l"
300 # # 1 search backward for the Nth occurrence of
301 the ident under the cursor
302 $ $ 1 cursor to the end of Nth next line
303 % % 1 find the next (curly/square) bracket on
304 this line and go to its match, or go to
305 matching comment bracket, or go to matching
306 preprocessor directive.
307 N% {count}% 1 go to N percentage in the file
308 & & 2 repeat last :s
309 star * 1 search forward for the Nth occurrence of
310 the ident under the cursor
311 + + 1 same as <CR>
312 , , 1 repeat latest f, t, F or T in opposite
313 direction N times
314 - - 1 cursor to the first CHAR N lines higher
315 . . 2 repeat last change with count replaced with
316 N
317 / /{pattern}<CR> 1 search forward for the Nth occurrence of
318 {pattern}
319 /<CR> /<CR> 1 search forward for {pattern} of last search
320 count 0 1 cursor to the first char of the line
321 count 1 prepend to command to give a count
322 count 2 "
323 count 3 "
324 count 4 "
325 count 5 "
326 count 6 "
327 count 7 "
328 count 8 "
329 count 9 "
330 : : 1 start entering an Ex command
331 ; ; 1 repeat latest f, t, F or T N times
332 < <{motion} 2 shift Nmove lines one 'shiftwidth'
333 leftwards
334 << << 2 shift N lines one 'shiftwidth' leftwards
335 > >{motion} 2 shift Nmove lines one 'shiftwidth'
336 rightwards
337 >> >> 2 shift N lines one 'shiftwidth' rightwards
338 ? ?{pattern}<CR> 1 search backward for the Nth previous
339 occurrence of {pattern}
340 ?<CR> ?<CR> 1 search backward for {pattern} of last search
341 A A 2 append text after the end of the line N times
342 B B 1 cursor N WORDS backward
343 C ["x]C 2 change from the cursor position to the end
344 of the line, and N-1 more lines [into
345 register x]; synonym for "c$"
346 D ["x]D 2 delete the characters under the cursor
347 until the end of the line and N-1 more
348 lines [into register x]; synonym for "d$"
349 E E 1 cursor forward to the end of WORD N
350 F F{char} 1 cursor to the Nth occurrence of {char} to
351 the left
352 G G 1 cursor to line N, default last line
353 H H 1 cursor to line N from top of screen
354 I I 2 insert text before the first CHAR on the
355 line N times
356 J J 2 Join N lines; default is 2
357 L L 1 cursor to line N from bottom of screen
358 M M 1 cursor to middle line of screen
359 N N 1 repeat the latest '/' or '?' N times in
360 opposite direction
361 O O 2 begin a new line above the cursor and
362 insert text, repeat N times
363 P ["x]P 2 put the text [from register x] before the
364 cursor N times
365 R R 2 enter replace mode: overtype existing
366 characters, repeat the entered text N-1
367 times
368 S ["x]S 2 delete N lines [into register x] and start
369 insert; synonym for "cc".
370 T T{char} 1 cursor till after Nth occurrence of {char}
371 to the left
372 V V start linewise Visual mode
373 W W 1 cursor N WORDS forward
374 X ["x]X 2 delete N characters before the cursor [into
375 register x]
376 Y ["x]Y yank N lines [into register x]; synonym for
377 "yy"
378 ZZ ZZ store current file if modified, and exit
379 ZQ ZQ exit current file always
380 ^ ^ 1 cursor to the first CHAR of the line
381 _ _ 1 cursor to the first CHAR N - 1 lines lower
382 a a 2 append text after the cursor N times
383 b b 1 cursor N words backward
384 c ["x]c{motion} 2 delete Nmove text [into register x] and
385 start insert
386 cc ["x]cc 2 delete N lines [into register x] and start
387 insert
388 d ["x]d{motion} 2 delete Nmove text [into register x]
389 dd ["x]dd 2 delete N lines [into register x]
390 e e 1 cursor forward to the end of word N
391 f f{char} 1 cursor to Nth occurrence of {char} to the
392 right
393 g g{char} extended commands, see g below
394 h h 1 cursor N chars to the left
395 i i 2 insert text before the cursor N times
396 j j 1 cursor N lines downward
397 k k 1 cursor N lines upward
398 l l 1 cursor N chars to the right
399 n n 1 repeat the latest '/' or '?' N times
400 o o 2 begin a new line below the cursor and
401 insert text, repeat N times
402 p ["x]p 2 put the text [from register x] after the
403 cursor N times
404 r r{char} 2 replace N chars with {char}
405 s ["x]s 2 (substitute) delete N characters [into
406 register x] and start insert
407 t t{char} 1 cursor till before Nth occurrence of {char}
408 to the right
409 u u 2 undo changes
410 v v start characterwise Visual mode
411 w w 1 cursor N words forward
412 x ["x]x 2 delete N characters under and after the
413 cursor [into register x]
414 y ["x]y{motion} yank Nmove text [into register x]
415 yy ["x]yy yank N lines [into register x]
416 bar | 1 cursor to column N
417 ~ ~ 2 'tildeop' off: switch case of N characters
418 under cursor and move the cursor N
419 characters to the right
420 <C-End> <C-End> 1 same as "G"
421 <C-Home> <C-Home> 1 same as "gg"
422 <C-Left> <C-Left> 1 same as "b"
423 <C-Right> <C-Right> 1 same as "w"
424 <Del> ["x]<Del> 2 same as "x"
425 <Down> <Down> 1 same as "j"
426 <End> <End> 1 same as "$"
427 <Home> <Home> 1 same as "0"
428 <Insert> <Insert> 2 same as "i"
429 <Left> <Left> 1 same as "h"
430 <PageDown> <PageDown> same as CTRL-F
431 <PageUp> <PageUp> same as CTRL-B
432 <Right> <Right> 1 same as "l"
433 <S-Down> <S-Down> 1 same as CTRL-F
434 <S-Left> <S-Left> 1 same as "b"
435 <S-Right> <S-Right> 1 same as "w"
436 <S-Up> <S-Up> 1 same as CTRL-B
437 <Up> <Up> 1 same as "k"
438
439 ==============================================================================
440 2.1 Text objects objects
441
442 These can be used after an operator or in Visual mode to select an object.
443
444 tag command action in op-pending and Visual mode
445 ------------------------------------------------------------------------------
446 v_aquote a" double quoted string
447 v_a' a' single quoted string
448 v_a( a( same as ab
449 v_a) a) same as ab
450 v_a< a< "a <>" from '<' to the matching '>'
451 v_a> a> same as a<
452 v_aB aB "a Block" from "[{" to "]}" (with brackets)
453 v_aW aW "a WORD" (with white space)
454 v_a[ a[ "a []" from '[' to the matching ']'
455 v_a] a] same as a[
456 v_a` a` string in backticks
457 v_ab ab "a block" from "[(" to "])" (with braces)
458 v_aw aw "a word" (with white space)
459 v_a{ a{ same as aB
460 v_a} a} same as aB
461 v_iquote i" double quoted string without the quotes
462 v_i' i' single quoted string without the quotes
463 v_i( i( same as ib
464 v_i) i) same as ib
465 v_i< i< "inner <>" from '<' to the matching '>'
466 v_i> i> same as i<
467 v_iB iB "inner Block" from "[{" and "]}"
468 v_iW iW "inner WORD"
469 v_i[ i[ "inner []" from '[' to the matching ']'
470 v_i] i] same as i[
471 v_i` i` string in backticks without the backticks
472 v_ib ib "inner block" from "[(" to "])"
473 v_iw iw "inner word"
474 v_i{ i{ same as iB
475 v_i} i} same as iB
476
477 ==============================================================================
478 2.4 Commands starting with 'g' g
479
480 tag char note action in Normal mode
481 ------------------------------------------------------------------------------
482 gE gE 1 go backwards to the end of the previous
483 WORD
484 gU gU{motion} 2 make Nmove text uppercase
485 ge ge 1 go backwards to the end of the previous
486 word
487 gg gg 1 cursor to line N, default first line
488 gu gu{motion} 2 make Nmove text lowercase
489 g~ g~{motion} 2 swap case for Nmove text
490
491 ==============================================================================
492 2.5 Commands starting with 'z' z
493
494 tag char note action in Normal mode
495 ------------------------------------------------------------------------------
496 z<CR> z<CR> redraw, cursor line to top of window,
497 cursor on first non-blank
498 z+ z+ cursor on line N (default line below
499 window), otherwise like "z<CR>"
500 z- z- redraw, cursor line at bottom of window,
501 cursor on first non-blank
502 z. z. redraw, cursor line to center of window,
503 cursor on first non-blank
504 zA zA open a closed fold or close an open fold
505 recursively
506 zC zC close folds recursively
507 zM zM set 'foldlevel' to zero
508 zO zO open folds recursively
509 zR zR set 'foldlevel' to the deepest fold
510 za za open a closed fold, close an open fold
511 zb zb redraw, cursor line at bottom of window
512 zc zc close a fold
513 zo zo open fold
514 zt zt redraw, cursor line at top of window
515 zz zz redraw, cursor line at center of window
516
517 ==============================================================================
518 3. Visual mode visual-index
519
520 Most commands in Visual mode are the same as in Normal mode. The ones listed
521 here are those that are different.
522
523 tag command note action in Visual mode
524 ------------------------------------------------------------------------------
525 v_CTRL-C CTRL-C stop Visual mode
526 v_: : start a command-line with the highlighted
527 lines as a range
528 v_< < 2 shift the highlighted lines one
529 'shiftwidth' left
530 v_> > 2 shift the highlighted lines one
531 'shiftwidth' right
532 v_C C 2 delete the highlighted lines and start
533 insert
534 v_D D 2 delete the highlighted lines
535 v_J J 2 join the highlighted lines
536 v_O O Move horizontally to other corner of area.
537 v_R R 2 delete the highlighted lines and start
538 insert
539 v_S S 2 delete the highlighted lines and start
540 insert
541 v_U U 2 make highlighted area uppercase
542 v_V V make Visual mode linewise or stop Visual
543 mode
544 v_X X 2 delete the highlighted lines
545 v_Y Y yank the highlighted lines
546 v_c c 2 delete highlighted area and start insert
547 v_d d 2 delete highlighted area
548 v_o o move cursor to other corner of area
549 v_r r 2 delete highlighted area and start insert
550 v_s s 2 delete highlighted area and start insert
551 v_u u 2 make highlighted area lowercase
552 v_v v make Visual mode characterwise or stop
553 Visual mode
554 v_x x 2 delete the highlighted area
555 v_y y yank the highlighted area
556 v_~ ~ 2 swap case for the highlighted area
557
558 ==============================================================================
559 5. EX commands ex-cmd-index :index
560
561 This is a brief but complete listing of all the ":" commands, without
562 mentioning any arguments. The optional part of the command name is inside [].
563 The commands are sorted on the non-optional part of their name.
564
565 tag command action
566 ------------------------------------------------------------------------------
567 :& :& repeat last ":substitute"
568 :< :< shift lines one 'shiftwidth' left
569 :> :> shift lines one 'shiftwidth' right
570 :copy :co[py] copy lines
571 :cquit :cq[uit] quit Vim with an error code
572 :delete :d[elete] delete lines
573 :exit :exi[t] same as ":xit"
574 :join :j[oin] join lines
575 :move :m[ove] move lines
576 :put :pu[t] insert contents of register in the text
577 :quit :q[uit] quit current window (when one window quit Vim)
578 :quitall :quita[ll] quit Vim
579 :qall :qa[ll] quit Vim
580 :redo :red[o] redo one undone change
581 :substitute :s[ubstitute] find and replace text
582 :t :t same as ":copy"
583 :undo :u[ndo] undo last change(s)
584 :update :up[date] write buffer if modified
585 :write :w[rite] write to a file
586 :wall :wa[ll] write all (changed) buffers
587 :wq :wq write to a file and quit window or Vim
588 :wqall :wqa[ll] write all changed buffers and quit Vim
589 :xit :x[it] write if buffer changed and quit window or Vim
590 :xall :xa[ll] same as ":wqall"
591 :yank :y[ank] yank lines into a register
592 :~ :~ repeat last ":substitute"