Created
          August 11, 2011 19:29 
        
      - 
      
 - 
        
Save tizoc/1140530 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | (defun smart-tab () | |
| "If mark is active, indents region. Else if point is at the end of a symbol, | |
| expands it. Else indents the current line. Acts as normal in minibuffer." | |
| (interactive) | |
| (cond (mark-active (indent-region (region-beginning) (region-end))) | |
| ((and (looking-at "\\_>") (not (looking-at "end"))) | |
| (hippie-expand nil)) | |
| (t (indent-for-tab-command)))) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment