Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have a different first indent width (eg for litcoffee) #279

Open
hans-d opened this issue Dec 16, 2014 · 1 comment
Open

have a different first indent width (eg for litcoffee) #279

hans-d opened this issue Dec 16, 2014 · 1 comment

Comments

@hans-d
Copy link

hans-d commented Dec 16, 2014

AFAIK the current indent/tab width is the same for every level.

My normal indent is 2 spaces. When writing litcoffee, I would like to use as first indent 4 (or more) spaces, to make it more distinct from the markdown text.

@syohex
Copy link
Collaborator

syohex commented Dec 16, 2014

(defun my/coffee-indent-line ()
  (interactive)
  (if (zerop (current-column))
      (insert "    ")
    (call-interactively 'coffee-indent-line)))

(defun my/coffee-mode-hook ()
  (when (string-match-p "\\.litcoffee\\'" (buffer-name))
    (setq indent-line-function 'my/coffee-indent-line)))
(add-hook 'coffee-mode-hook 'my/coffee-mode-hook)
(add-to-list 'auto-mode-alist '("\\.litcoffee\\'" . coffee-mode))

I suppose we should discussion this topic at literate-coffee-mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants