分页: 1 / 1
在emacs下写c++代码自动动齐怎么做?
发表于 : 2009-10-12 15:59
由 koalaundead
有时候在网上拷的代码,格式乱了,我想选中后让它自动对齐,怎么做呢?
就象visual c++中的alt+F8或是eclipse下的ctrl+shift+F那么功能
Re: 在emacs下写c++代码自动动齐怎么做?
发表于 : 2009-10-15 2:44
由 yznan
C-shift-space, 设置mark
C-M-\ 格式化
Re: 在emacs下写c++代码自动动齐怎么做?
发表于 : 2009-10-16 15:11
由 kane_yj
代码: 全选
;;格式为规定代码缩进
(defun iwb ()
"indent whole buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil))
代码: 全选
(global-set-key [f8] 'iwb) ;; 格式为规定代码缩进
Re: 在emacs下写c++代码自动动齐怎么做?
发表于 : 2009-10-16 15:13
由 kane_yj
忘记签名了,
Re: 在emacs下写c++代码自动动齐怎么做?
发表于 : 2009-10-16 15:17
由 kane_yj