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({
widt开发者_StackOverflowh: 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?
Does nxml mode (config snippets here) give you satisfactory results ?
精彩评论