Reindent file
for good or for bad. lets see.
This commit is contained in:
136
.emacs
136
.emacs
@@ -1,4 +1,3 @@
|
||||
;;(toggle-debug-on-error)
|
||||
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
||||
;;lsp performances
|
||||
(setq gc-cons-threshold (* 100 1024 1024));; 100MB
|
||||
@@ -32,6 +31,16 @@
|
||||
'(global-subword-mode t)
|
||||
'(gofmt-command "goimports")
|
||||
'(inhibit-startup-screen t)
|
||||
'(lisp-body-indent 4)
|
||||
'(lisp-indent-offset 4)
|
||||
'(lisp-lambda-list-keyword-alignment t)
|
||||
'(lisp-lambda-list-keyword-parameter-alignment t)
|
||||
'(lisp-lambda-list-keyword-parameter-indentation 4)
|
||||
'(lisp-loop-forms-indentation 4)
|
||||
'(lisp-loop-keyword-indentation 4)
|
||||
'(lisp-simple-loop-indentation 4)
|
||||
'(lisp-tag-body-indentation 4)
|
||||
'(lisp-tag-indentation 4)
|
||||
'(org-agenda-files '("~/org/1.TODO.org"))
|
||||
'(package-enable-at-startup nil)
|
||||
'(package-selected-packages
|
||||
@@ -46,17 +55,15 @@
|
||||
'(face trailing tabs lines-tail newline space-before-tab::tab space-before-tab::space space-before-tab tab-mark)))
|
||||
|
||||
(if (display-graphic-p)
|
||||
(progn
|
||||
(if (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
)
|
||||
(if (fboundp 'toggle-scroll-bar)
|
||||
(toggle-scroll-bar -1))
|
||||
(menu-bar-mode -1)
|
||||
(if (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
)
|
||||
)
|
||||
|
||||
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
||||
@@ -68,12 +75,12 @@
|
||||
("gnu" . "https://elpa.gnu.org/packages/")))
|
||||
(package-initialize)
|
||||
(eval-when-compile
|
||||
(unless (package-installed-p 'use-package)
|
||||
(unless (package-installed-p 'use-package)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
(package-install 'use-package)
|
||||
)
|
||||
(require 'use-package))
|
||||
(require 'use-package))
|
||||
|
||||
(require 'use-package)
|
||||
(require 'use-package-ensure)
|
||||
@@ -106,8 +113,8 @@
|
||||
;; Enable flashing mode-line on errors
|
||||
(doom-themes-visual-bell-config )
|
||||
;; or for treemacs users
|
||||
;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
|
||||
;(doom-themes-treemacs-config)
|
||||
;;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
|
||||
;;(doom-themes-treemacs-config)
|
||||
;; Corrects (and improves) org-mode's native fontification.
|
||||
(doom-themes-org-config)
|
||||
(defun atu/toggle-display-line-mode ()
|
||||
@@ -144,41 +151,44 @@
|
||||
:config
|
||||
(setq-default tab-width 4) ; or any other preferred value
|
||||
(setq cua-auto-tabify-rectangles nil)
|
||||
(defadvice indent-relative (around smart-tabs activate)
|
||||
(let ((indent-tabs-mode nil)) ad-do-it))
|
||||
(defadvice indent-according-to-mode (around smart-tabs activate)
|
||||
(let ((indent-tabs-mode indent-tabs-mode))
|
||||
(if (memq indent-line-function
|
||||
'(indent-relative
|
||||
indent-relative-maybe))
|
||||
(setq indent-tabs-mode nil))
|
||||
ad-do-it))
|
||||
(smart-tabs-advice c-indent-line c-basic-offset)
|
||||
(smart-tabs-advice c-indent-region c-basic-offset)
|
||||
|
||||
(smart-tabs-add-language-support cmake cmake-mode-hook
|
||||
(
|
||||
(cmake-indent . cmake-tab-width)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support protobuf protobuf-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support glsl glsl-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support opencl opencl-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
(smart-tabs-insinuate 'c 'c++ 'cmake 'nxml 'protobuf 'glsl)
|
||||
|
||||
(smart-tabs-add-language-support elisp emacs-lisp-mode-hook
|
||||
(
|
||||
(lisp-indent-line . lisp-indent-offset)
|
||||
(lisp-indent-region . lisp-indent-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-insinuate 'c 'c++ 'cmake 'nxml 'protobuf 'glsl 'elisp)
|
||||
)
|
||||
|
||||
(use-package aggressive-indent
|
||||
@@ -254,6 +264,16 @@
|
||||
(funcall fn checker property)))
|
||||
|
||||
(advice-add 'flycheck-checker-get :around 'atu/flycheck-checker-get)
|
||||
|
||||
(setq flycheck-indication-mode 'left-margin)
|
||||
|
||||
;; Adjust margins and fringe widths…
|
||||
(defun atu/set-flycheck-margins ()
|
||||
(setq left-fringe-width 8 right-fringe-width 8
|
||||
left-margin-width 1 right-margin-width 0)
|
||||
(flycheck-refresh-fringes-and-margins))
|
||||
:hook
|
||||
(flycheck-mode . atu/set-flycheck-margins)
|
||||
)
|
||||
|
||||
(use-package which-key
|
||||
@@ -461,10 +481,6 @@
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; C/C++
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . c-c++-header))
|
||||
|
||||
(defconst tuleu-cc-style
|
||||
@@ -482,82 +498,6 @@
|
||||
)
|
||||
(add-hook 'c-mode-common-hook 'my-c-common-hook)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; TeX/LaTeX
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (use-package auctex
|
||||
;; :hook (LaTeX-mode TeX-mode)
|
||||
;; )
|
||||
|
||||
;; (use-package auctex-latexmk
|
||||
;; :hook (LaTeX-mode TeX-mode)
|
||||
;; :bind (
|
||||
;; ("C-x f" . find-file-at-point)
|
||||
;; :map LaTeX-mode-map
|
||||
;; ([remap reftex-citation] . my-latex-insert-cite)
|
||||
;; ("M-q" . my-latex-fill-paragraph)
|
||||
;; )
|
||||
;; :config (
|
||||
;; (add-to-list 'TeX-command-list
|
||||
;; '("latexmk" "latexmk -pdf -interaction=nonstopmode -shell-escape %s" TeX-run-TeX nil t
|
||||
;; :help "Run latexmk on file"))
|
||||
;; (setq TeX-command-default "latexmk")
|
||||
;; (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
|
||||
;; (setq LaTeX-includegraphics-strip-extension-flag nil)
|
||||
;; (add-to-list 'LaTeX-includegraphics-extensions '"tikz")
|
||||
;; ;; use Okular as default pdf viewer
|
||||
;; (setq TeX-view-program-selection '((output-pdf "Okular PDF Viewer")))
|
||||
;; (add-to-list 'TeX-expand-list '("%(dir)" (lambda nil (expand-file-name (TeX-master-directory)))))
|
||||
;; (setq TeX-view-program-list
|
||||
;; '(("Okular PDF Viewer" "okular --unique %o#src:%n%(dir)./%b")))
|
||||
;; ;; (setq auctex-latexmk-inherit-TeX-PDF-mode t)
|
||||
;; ;; launch server if not launched
|
||||
;; (load "server")
|
||||
;; (unless (server-running-p) (server-start))
|
||||
;; (setq reftex-plug-into-AUCTeX t)
|
||||
|
||||
;; (turn-on-reftex)
|
||||
;; (setq TeX-parse-self t)
|
||||
;; (setq TeX-auto-save t)
|
||||
;; (TeX-PDF-mode)
|
||||
;; (setq reftex-ref-macro-prompt nil)
|
||||
;; (defun my-latex-insert-cite (&optional P)
|
||||
;; ""
|
||||
;; (interactive "P")
|
||||
;; (TeX-insert-macro "cite")
|
||||
;; )
|
||||
;; (setq-default TeX-master nil)
|
||||
;; (defun my-latex-fill-paragraph (&optional P)
|
||||
;; "When called with prefix argument call `fill-paragraph'.
|
||||
;; Otherwise split the current paragraph into one sentence per line."
|
||||
;; (interactive "P")
|
||||
;; (if (not P)
|
||||
;; (save-excursion
|
||||
;; (let ((fill-column 12345678)) ;; relies on dynamic binding
|
||||
;; (fill-paragraph) ;; this will not work correctly if the paragraph is
|
||||
;; ;; longer than 12345678 characters (in which case the
|
||||
;; ;; file must be at least 12MB long. This is unlikely.)
|
||||
;; (let ((end (save-excursion
|
||||
;; (forward-paragraph 1)
|
||||
;; (backward-sentence)
|
||||
;; (point-marker)))) ;; remember where to stop
|
||||
;; (beginning-of-line)
|
||||
;; (while (progn (forward-sentence)
|
||||
;; (<= (point) (marker-position end)))
|
||||
;; (just-one-space) ;; leaves only one space, point is after it
|
||||
;; (delete-char -1) ;; delete the space
|
||||
;; (insert " %");; insert a %
|
||||
;; (newline) ;; and insert a newline
|
||||
;; (LaTeX-indent-line) ;; I only use this in combination with late, so this makes sense
|
||||
;; ))))
|
||||
;; ;; otherwise do ordinary fill paragraph
|
||||
;; (fill-paragraph P))
|
||||
;; )
|
||||
;; )
|
||||
;; )
|
||||
|
||||
|
||||
(use-package markdown-mode)
|
||||
|
||||
(use-package go-mode
|
||||
|
||||
Reference in New Issue
Block a user