【发布时间】:2011-04-19 05:31:30
【问题描述】:
我在 html 和 js 模式下遇到 emacs 缩进的问题。 我想要更好的模式或功能以获得更好的缩进
我也看到Smart Tab 并创建这样的代码
(require 'smarttabs)
(define-key read-expression-map [tab] 'hippie-expand)
(define-key read-expression-map [backtab] 'unexpand)
(smart-tabs-advice js2-indent-line js2-basic-offset)
(smart-tabs-advice python-indent-line-1 python-indent)
(add-hook 'python-mode-hook
(lambda ()
(setq indent-tabs-mode t)
(setq tab-width (default-value 'tab-width))))
(smart-tabs-advice html-indent-line html-basic-offset)
但也有问题,在js2mode、html-mode、nxhtml模式下我有很多这样的问题
<div>
<table>
<tr>
<td>
test
</td>
</tr>
</table>
</div>
- 它的所有空间,我想要标签(与 具体尺寸)
- 有时我想使用
tab和shift tab来获得更多或更少的制表符,但不起作用......只有这个缩进是可以接受的:D
或者为 javascript js2mode 创建类似这样的东西
function preview(img, selection) {
var scaleX = 64 / (selection.width || 1);
var scaleY = 64 / (selection.height || 1);
$('#preview').css({
width: Math.round(scaleX * img.width) + 'px',
height: Math.round(scaleY * img.height) + 'px',
marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px',
marginTop: '-' + Math.round(scaleY * selection.y1) + 'px'
});
}
但我想要这个
function preview(img, selection) {
var scaleX = 64 / (selection.width || 1);
var scaleY = 64 / (selection.height || 1);
$('#preview').css({
width: Math.round(scaleX * img.width) + 'px',
height: Math.round(scaleY * img.height) + 'px',
marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px',
marginTop: '-' + Math.round(scaleY * selection.y1) + 'px'
});
}
我能为这个问题做些什么?
【问题讨论】:
标签: emacs indentation