English 中文(简体)
插入空格直到列
原标题:Insert space until column
  • 时间:2011-02-10 03:17:22
  •  标签:
  • emacs

我必须以以下格式输入。。。

A          B          C
D          E          F
[]

I use indent-relative to jump from one column to another. But is there a way to jump to column number? And if so, is there a way to insert spaces until that column?

最佳回答

也许缩进到列对您有用。

indent-to-column is an alias for `indent-to .

(indent-to-column COLUMN &optional MINIMUM)

Indent from point with tabs and spaces until COLUMN is reached.
Optional second argument MINIMUM says always do at least MINIMUM spaces
even if that goes past COLUMN; by default, MINIMUM is zero.

The return value is COLUMN.

它也会进入选项卡,但您可以在使用untabify命令后清除这些选项卡。

问题回答

您可以使用移动到制表符和自定义制表符列表变量来表示您的列。您可以使用M-x编辑选项卡停止RET以可视化方式配置此变量。

您还可以使用M-x标尺模式RET1M-x标尺模式切换显示制表位RET来查看制表位。

对于跳转多列,移动到制表符不会使用前缀arg重复,但如果您定义了一个调用它的键盘宏,则可以使用prefx arg根据需要重复多次:

Record macro:
F3 M-x move-to-tab-stop RET F4

Either bind to key temporarily:
C-x C-k b (key)

Or name it and ask Emacs to provide you with the elisp to put in your init file:
C-x C-k n (name) RET
M-x insert-kbd-macro RET (name) RET
(global-set-key (kbd "key") name) (for the appropriate key and name)

You can enter a numeric prefix arg with any of:
C-u number(s)
M- number(s)
C- number(s)

例如,如果您已将宏绑定到C-i,则M-412C-i将向前移动四十二个制表位,231也将向前移动

缩进制表符模式变量设置为nil以防止插入制表符。





相关问题
suppress additional braces in emacs electric mode

I started using ruby-electric-mode. I like it except that I am used to closing open brackets myself (the other pairing are still useful to me). How can I make emacs suppress additional brackets when ...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything ...

Emacs Setting which-function-mode

I would like to have which-function-mode on by default when I open up Emacs. I ve added the following lines to my .emacs file. (setq which-func-mode t) (setq which-function-mode t) When I open ...

Enabling go mode for emacs

I don t seem to be able to enable a go mode for emacs. C mode doesn t work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn t require ...

Custom Emacs key bindings are not working

The key bindings I ve defined in my .emacs file aren t working. Here s the file: ;init modes (menu-bar-mode 0) (tool-bar-mode 0) (cua-mode) (column-number-mode) (fset perl-mode cperl-mode) (cperl-...

eval during emacs lisp macro expansion

How can I fix the simple macro foo in (elisp)Eval During Expansion? None of the followings work: (defmacro foo1 (a) `(setq (eval ,a) t)) (defmacro foo2 (a) `(setq ,(eval a) t)) (defmacro foo3 (...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签