문제

Is it possible to delete specific columns of text (i.e., particular column numbers) in Emacs/XEmacs using only the keyboard? I know that it is possible to select a rectangle of text using the mouse (or the arrow keys), but for a 1 million line text file, this can be quite time consuming.

Thanks!

도움이 되었습니까?

해결책

You can delete a rectangle with delete-rectangle (C-x r d) or kill-rectangle (C-x r k). Either one will kill the rectangle with corners defined by the point and the mark. kill-rectangle will also save it for yanking with yank-rectangle.

다른 팁

If you have sed or awk on your system, you can conveniently use C-u M-|.

From the documentation:

M-| runs the command shell-command-on-region [...]

Execute string COMMAND in inferior shell with region as input. Normally display output (if any) in temp buffer `Shell Command Output'; Prefix arg means replace the region with it. Return the exit code of COMMAND. [...]

Note the bit about the prefix arg (C-u).

Tip: C-x h will set the region to your whole buffer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top