2011-04-19 84 views
3

我在html和js模式下emacs缩进问题。 我想要更好的方式和功能更好地缩进html缩进的CSS,emacs中的html

我也看到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模式,nxhtml模式我有很多问题,像这

<div> 
    <table> 
    <tr> 
     <td> 
     test 
     </td> 
    </tr> 
    </table> 
</div> 
  • 所有的空间,我想片(带 具体尺寸)
  • 有时我想使用更多选项卡或更少tabshift 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' 
    }); 
} 

我能为这个问题做些什么?

回答