如何在emacs中缩进n个空格? [英] How do I indent n spaces in emacs?
本文介绍了如何在emacs中缩进n个空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想缩进整个区域左右的n个空格。我可以在某些模式下使用Cc> Cc<
I want to indent and entire region n spaces to the right or left. I can do this in some modes with C-c > and C-c <, but I'd like to do this in general.
如果我需要更改我的.emacs为了使这个效率(使用上面的键盘快捷键)很好。
If I need to change my .emacs in order to make this efficient (with a keyboard shortcut like that above) that's fine.
推荐答案
对我有用的是:select region然后 Cu<空格数> Cx TAB
What works for me is: select region and then C-u <number of spaces> C-x TAB
更新
@Eric我们可以定义一个功能并绑定到键盘快捷键,例如 C-x C-TAB
。尝试将其添加到您的emacs配置。
@Eric We could define a function and bind to a keyboard short cut, e.g. C-x C-TAB
. Try adding this to your emacs config.
(defun insert-tabs (n)
"Inserts N number of tabs"
(interactive "nNumber of tabs: ")
(dotimes (i n)
(indent-for-tab-command)))
(global-set-key [?\C-x \C-tab] 'insert-tabs)
这篇关于如何在emacs中缩进n个空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文