【发布时间】:2018-07-20 12:16:49
【问题描述】:
你有一个很长的列表,你想用逗号缩进它,这样值就不会在中间打断,更易读。
indent = ['11111_1111111111111111','11111_111111111111111111','11111_1111','11111_111111111111111','11111_1111111111111111',\ #Indentation should look something like this, preferably to width of the editor.
'11111_111111111111111','11111_111111111111','11111_1111111111111111111111','11111_111111111111111111111111','11111_1111111111111111111111111',\
'1111_12_11111_1111111111111111111_11111_1111111111111111','1111_12_11111_1111111111111111111_11111_111111111111111111',\
'1111_12_11111_1111111111111111111_11111_1111','1111_12_11111_1111111111111111111_11111_111111111111111','1111_12_11111_1111111111111111111_11111_1111111111111111',\
'1111_12_11111_1111111111111111111_11111_111111111111111','1111_12_11111_1111111111111111111_11111_111111111111','1111_12_11111_1111111111111111_11111_1111111111111111111',\
'1111_12_11111_1111111111111111_11111_111111111111111111','1111_12_11111_1111111111111111_11111_1111','1111_12_11111_1111111111111111_11111_111111111111111',\
'1111_12_11111_1111111111111111_11111_1111111111111111','1111_12_11111_1111111111111111_11111_111111111111111','1111_12_11111_1111111111111111_11111_111111111111',\
'1111_13_11111_1111111111111111111_11111_1111111111111111','1111_13_11111_1111111111111111111_11111_111111111111111111','1111_13_11111_1111111111111111111_11111_1111',\
'1111_13_11111_1111111111111111111_11111_111111111111111','1111_13_11111_1111111111111111111_11111_1111111111111111','1111_13_11111_1111111111111111111_11111_111111111111111',\
'1111_13_11111_1111111111111111111_11111_111111111111','1111_13_11111_1111111111111111_11111_1111111111111111111','1111_13_11111_1111111111111111_11111_111111111111111111',\
'1111_13_11111_1111111111111111_11111_1111','1111_13_11111_1111111111111111_11111_111111111111111','1111_13_11111_1111111111111111_11111_1111111111111111',\
'1111_13_11111_1111111111111111_11111_111111111111111','1111_13_11111_1111111111111111_11111_111111111111','1111_14_11111_1111111111111111111_11111_1111111111111111',\
'1111_14_11111_1111111111111111111_11111_111111111111111111','1111_14_11111_1111111111111111111_11111_1111','1111_14_11111_1111111111111111111_11111_111111111111111',\
'1111_14_11111_1111111111111111111_11111_1111111111111111','1111_14_11111_1111111111111111111_11111_111111111111111','1111_14_11111_1111111111111111111_11111_111111111111',\ #HOW TO INDENT the following like the above?
'1111_14_11111_1111111111111111_11111_1111111111111111111','1111_14_11111_1111111111111111_11111_111111111111111111','1111_14_11111_1111111111111111_11111_1111','1111_14_11111_1111111111111111_11111_111111111111111','1111_14_11111_1111111111111111_11111_1111111111111111','1111_14_11111_1111111111111111_11111_111111111111111','1111_14_11111_1111111111111111_11111_111111111111','11141_11111_111111111111111','11141_11111_111111111111111111','11141_11111_1111111111111111111','11141_11111_111111111111','11141_11111_1111111111111111','11141_11111_1111','11141_11111_111111111111111','11141_11111_1111111111111111','11141_11111_11111111_71111','11141_11111_11111111_141111','11141_11111_11111111_211111','11141_11111_11111111_11111111111111111','11141_11111_111111111111111','11141_11111_111111111111111111','11141_11111_1111111111111111111','11141_11111_111111111111','11141_11111_1111111111111111','11141_11111_1111','11141_11111_111111111111111','11141_11111_1111111111111111','11141_11111_11111111_71111','11141_11111_11111111_141111','11141_11111_11111111_211111','11141_11111_11111111_11111111111111111','11181_11111_111111111111111','11181_11111_111111111111111111','11181_11111_1111111111111111111','11181_11111_111111111111','11181_11111_1111111111111111','11181_11111_1111','11181_11111_111111111111111','11181_11111_1111111111111111','11181_11111_11111111_71111','11181_11111_11111111_141111','11181_11111_11111111_211111','11181_11111_11111111_11111111111111111','11181_11111_111111111111111','11181_11111_111111111111111111','11181_11111_1111111111111111111','11181_11111_111111111111','11181_11111_1111111111111111','11181_11111_1111','11181_11111_111111111111111','11181_11111_1111111111111111','11181_11111_11111111_71111','11181_11111_11111111_141111','11181_11111_11111111_211111','11181_11111_11111111_11111111111111111','111161_11111_111111111111111','111161_11111_111111111111111111','111161_11111_1111111111111111111','111161_11111_111111111111','111161_11111_1111111111111111','111161_11111_1111','111161_11111_111111111111111','111161_11111_1111111111111111','111161_11111_11111111_71111','111161_11111_11111111_141111','111161_11111_11111111_211111','111161_11111_11111111_11111111111111111','111161_11111_111111111111111','111161_11111_111111111111111111','111161_11111_1111111111111111111','111161_11111_111111111111','111161_11111_1111111111111111','111161_11111_1111','111161_11111_111111111111111','111161_11111_1111111111111111','111161_11111_11111111_71111','111161_11111_11111111_141111','111161_11111_11111111_211111','111161_11111_11111111_11111111111111111']
如何在 Vim 中的非引号逗号上缩进长行?
【问题讨论】:
-
像
%s/\v('\w+',){4}\zs/\r /g这样的东西需要一些清理,但工作几乎完成
标签: vim indentation