2011-04-19 85 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' 
    }); 
} 

我能爲這個問題做些什麼?

回答