You could use :%s/.{6}$//
to literally delete 6 characters off the end of each line.
The :
starts ex mode which lets you execute a command. %
is a range that specifies that this command should operate on the whole file. The s
stands for substitute and is followed by a pattern and replace string in the format s/pattern/replacement/
. Our pattern in this case is .{6}$
which means match any character (.
) exactly 6 times ({6}
) followed by the end of the line ($
) and replace it with our replacement string, which is nothing. Therefore, as I said above, this matches the last 6 characters of every line and replaces them with nothing.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…