vim中的宏和normal命令

 

看内容:

vim
gdb
cmake
blender
avidemux
fontforge
gimp
digikam
inkscape
pdftricks
kontact
kodi
openshot
pitivi
smplayer
simplescreenrecorder
deepin
ardour
audacity
easytag
minuet
luppp
musescore
deepin
basket
chromium
kmail
kmymoney
kile
lokalize
pdfmixtool
retext
texstudio
texmaker
falkon
krdc
krfb
putty
gnuradio
ktouch
kturtle
rocs
r
step
wesnoth
chromium
extremetuxracer
ksudoku
supertux
sqlitebrowser
kalarm
knotes
okteta
qstardict
smb4k
terminator
zanshin
kcachegrind
kdbg
kdevelop
kdiff3
kde
qcachegrind
valgrind
indent
widelands
qtcreator
scratch
umbrello
gitg
ttf
qt5
qt5
sl
rawtherapee
cool
sakura
terminology
tilda
cowsay
cmatrix
wqy
kicad
kicad
kicad
opencv
opencv

想将以上片段变成markdown中顺序列表的形式,可以应用vim的normal命令和宏录制等,具体操作为:

1、准备变量:

  :let i = 1

2、开始录制宏

  qa

3、操作

  I<C-r>=i<CR>. <Esc>

4、变量增加

  :let  i += 1

5、停止录制宏

  q

6、跳转到行

  gg

7、选择范围

  jVG

8、应用所选范围

  normal  @a

结果为:

1. vim
2. gdb
3. cmake
4. blender
5. avidemux
6. fontforge
7. gimp
8. digikam
9. inkscape
10. pdftricks
11. kontact
12. kodi
13. openshot
14. pitivi
15. smplayer
16. simplescreenrecorder
17. deepin
18. ardour
19. audacity
20. easytag
21. minuet
22. luppp
23. musescore
24. deepin
25. basket
26. chromium
27. kmail
28. kmymoney
29. kile
30. lokalize
31. pdfmixtool
32. retext
33. texstudio
34. texmaker
35. falkon
36. krdc
37. krfb
38. putty
39. gnuradio
40. ktouch
41. kturtle
42. rocs
43. r
44. step
45. wesnoth
46. chromium
47. extremetuxracer
48. ksudoku
49. supertux
50. sqlitebrowser
51. kalarm
52. knotes
53. okteta
54. qstardict
55. smb4k
56. terminator
57. zanshin
58. kcachegrind
59. kdbg
60. kdevelop
61. kdiff3
62. kde
63. qcachegrind
64. valgrind
65. indent
66. widelands
67. qtcreator
68. scratch
69. umbrello
70. gitg
71. ttf
72. qt5
73. qt5
74. sl
75. rawtherapee
76. cool
77. sakura
78. terminology
79. tilda
80. cowsay
81. cmatrix
82. wqy
83. kicad
84. kicad
85. kicad
86. opencv
87. opencv

 

上一篇:dpdk 网卡顺序


下一篇:DPDK Hash Library原理(学习笔记)