css 的 html 缩进,emacs 中的 html
我在 html 和 js 模式下遇到 emacs 缩进问题。 我想要更好的模式或功能以获得更好的缩进
我还看到 智能选项卡 并创建这样的代码
(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 create类似这样的东西
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'
});
}
我能为这个问题做什么?
I have problem with emacs indentation in html and js mode .
i want better mode or function for better indention
I also see Smart Tab and create code like this
(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)
but there is problem too, in js2mode, html-mode, nxhtml mode i have many problem like this
<div>
<table>
<tr>
<td>
test
</td>
</tr>
</table>
</div>
- its all space and i want tab ( with
specific size ) - sometimes i want use
tab
andshift tab
for more tab or less but doesn't work ... only this indentation is acceptable :D
or for javascript js2mode create somethings like this
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'
});
}
but i want this
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'
});
}
what i can do for this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否nxml模式(配置片段这里) 给你满意的结果?
Does nxml mode (config snippets here) give you satisfactory results ?