tabs don't belong in Lisp

ご主人様
not manx 5 years ago
parent 4accec9268
commit da4a856b80
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

@ -61,11 +61,12 @@
(use-package htmlize) (use-package htmlize)
(use-package spaceline (use-package spaceline
:custom (powerline-default-seperator (quote arrow))
:init :init
(require 'spaceline-config) (require 'spaceline-config)
(spaceline-spacemacs-theme) (spaceline-spacemacs-theme)
:config (spaceline-toggle-buffer-size-off)) :config
(spaceline-toggle-buffer-size-off)
(setq powerline-default-seperator (quote arrow)))
(use-package dashboard (use-package dashboard
:diminish (dashboard-mode page-break-lines-mode) :diminish (dashboard-mode page-break-lines-mode)
@ -145,6 +146,9 @@
(add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC")) (add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
(setq org-src-tab-acts-natively t
org-edit-src-content-indentation 0)
(setq org-html-doctype "html5") (setq org-html-doctype "html5")
(definteractive manx/save-org-to-html() (definteractive manx/save-org-to-html()
@ -156,7 +160,7 @@
(local-keybind "C-c s h" manx/save-org-to-html)) (local-keybind "C-c s h" manx/save-org-to-html))
(definteractive manx/delete-org-link () (definteractive manx/delete-org-link ()
(if (org-in-regexp org-bracket-link-regexp 1) (when (org-in-regexp org-bracket-link-regexp 1)
(apply 'delete-region (list (match-beginning 0) (match-end 0))))) (apply 'delete-region (list (match-beginning 0) (match-end 0)))))
(add-hook 'org-mode-hook (local-keybind "C-c o l" manx/delete-org-link)) (add-hook 'org-mode-hook (local-keybind "C-c o l" manx/delete-org-link))
@ -209,9 +213,10 @@
(global-set-key (kbd "C-x 2") (lambdainteractive () (manx/split-and-follow (split-window-horizontally)))) (global-set-key (kbd "C-x 2") (lambdainteractive () (manx/split-and-follow (split-window-horizontally))))
(defun unix-line-ends () (defun unix-line-ends ()
(let ((coding-str (symbol-name buffer-file-coding-system))) (when (string-match
(when (string-match "-\\(?:dos\\|mac\\)$" coding-str) "-\\(?:dos\\|mac\\)$"
(set-buffer-file-coding-system 'unix)))) (symbol-name buffer-file-coding-system))
(set-buffer-file-coding-system 'unix)))
(add-hook 'find-file-hooks 'unix-line-ends) (add-hook 'find-file-hooks 'unix-line-ends)
@ -246,6 +251,9 @@
(setq-default tab-width 2 (setq-default tab-width 2
indent-tabs-mode t) indent-tabs-mode t)
(add-hook 'lisp-mode-hook (lambda () (setq indent-tabs-mode nil)))
(add-hook 'emacs-lisp-mode-hook (lambda () (setq indent-tabs-mode nil)))
(defvaralias 'css-indent-offset 'tab-width) (defvaralias 'css-indent-offset 'tab-width)
(defvaralias 'js-indent-level 'tab-width) (defvaralias 'js-indent-level 'tab-width)

@ -96,11 +96,12 @@ sbcl is in a werid place on Gentoo.
** spaceline ** spaceline
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package spaceline (use-package spaceline
:custom (powerline-default-seperator (quote arrow))
:init :init
(require 'spaceline-config) (require 'spaceline-config)
(spaceline-spacemacs-theme) (spaceline-spacemacs-theme)
:config (spaceline-toggle-buffer-size-off)) :config
(spaceline-toggle-buffer-size-off)
(setq powerline-default-seperator (quote arrow)))
#+END_SRC #+END_SRC
** dashboard ** dashboard
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -204,6 +205,9 @@ Also saves config if open.
(eval-after-load "org-mode" (local-set-key (kbd "s-i") nil)) (eval-after-load "org-mode" (local-set-key (kbd "s-i") nil))
(add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC")) (add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
(setq org-src-tab-acts-natively t
org-edit-src-content-indentation 0)
#+END_SRC #+END_SRC
** html export ** html export
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -220,7 +224,7 @@ Also saves config if open.
** Links ** Links
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(definteractive manx/delete-org-link () (definteractive manx/delete-org-link ()
(if (org-in-regexp org-bracket-link-regexp 1) (when (org-in-regexp org-bracket-link-regexp 1)
(apply 'delete-region (list (match-beginning 0) (match-end 0))))) (apply 'delete-region (list (match-beginning 0) (match-end 0)))))
(add-hook 'org-mode-hook (local-keybind "C-c o l" manx/delete-org-link)) (add-hook 'org-mode-hook (local-keybind "C-c o l" manx/delete-org-link))
@ -288,9 +292,10 @@ Also saves config if open.
** unix line endings ** unix line endings
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun unix-line-ends () (defun unix-line-ends ()
(let ((coding-str (symbol-name buffer-file-coding-system))) (when (string-match
(when (string-match "-\\(?:dos\\|mac\\)$" coding-str) "-\\(?:dos\\|mac\\)$"
(set-buffer-file-coding-system 'unix)))) (symbol-name buffer-file-coding-system))
(set-buffer-file-coding-system 'unix)))
(add-hook 'find-file-hooks 'unix-line-ends) (add-hook 'find-file-hooks 'unix-line-ends)
#+END_SRC #+END_SRC
@ -330,10 +335,13 @@ parens.
(global-unset-key (kbd "C-z")) ;; Fuck unix (global-unset-key (kbd "C-z")) ;; Fuck unix
#+END_SRC #+END_SRC
** indentation ** indentation
tabs > spaces. tabs > spaces. Except in Lisp.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default tab-width 2 (setq-default tab-width 2
indent-tabs-mode t) indent-tabs-mode t)
(add-hook 'lisp-mode-hook (lambda () (setq indent-tabs-mode nil)))
(add-hook 'emacs-lisp-mode-hook (lambda () (setq indent-tabs-mode nil)))
(defvaralias 'css-indent-offset 'tab-width) (defvaralias 'css-indent-offset 'tab-width)
(defvaralias 'js-indent-level 'tab-width) (defvaralias 'js-indent-level 'tab-width)
#+END_SRC #+END_SRC

Loading…
Cancel
Save