Automatic
This commit is contained in:
parent
5c30bcc18e
commit
3b9a52afbe
1 changed files with 95 additions and 28 deletions
101
README.org
101
README.org
|
@ -40,11 +40,11 @@ starts doing its work.
|
||||||
Some users on the internet said that this snippet speeded up the boot.
|
Some users on the internet said that this snippet speeded up the boot.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(let* ((normal-gc-cons-threshold (* 20 1024 1024))
|
;; (let* ((normal-gc-cons-threshold (* 20 1024 1024))
|
||||||
(init-gc-cons-threshold (* 128 1024 1024)))
|
;; (init-gc-cons-threshold (* 128 1024 1024)))
|
||||||
(setq gc-cons-threshold init-gc-cons-threshold)
|
;; (setq gc-cons-threshold init-gc-cons-threshold)
|
||||||
(add-hook 'emacs-startup-hook
|
;; (add-hook 'emacs-startup-hook
|
||||||
(lambda () (setq gc-cons-threshold normal-gc-cons-threshold))))
|
;; (lambda () (setq gc-cons-threshold normal-gc-cons-threshold))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** use-package
|
** use-package
|
||||||
|
@ -63,8 +63,9 @@ better.
|
||||||
Hopefully, in a future, this section won't exist anymore.
|
Hopefully, in a future, this section won't exist anymore.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(setq create-lockfiles nil)
|
||||||
(setq backup-directory-alist `(("." . "~/.emacs-saves")))
|
(setq backup-directory-alist '((".*" . "~/.emacs-saves/")))
|
||||||
|
(setq auto-save-file-name-transforms '((".*" "~/.emacs-saves/" t)))
|
||||||
(setq backup-by-copying t)
|
(setq backup-by-copying t)
|
||||||
(setq delete-old-versions t
|
(setq delete-old-versions t
|
||||||
kept-new-versions 6
|
kept-new-versions 6
|
||||||
|
@ -119,6 +120,15 @@ Hopefully, in a future, this section won't exist anymore.
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
'((python . t)))
|
'((python . t)))
|
||||||
|
|
||||||
|
(setq safe-local-variable-values '((eval add-hook 'after-save-hook 'org-icalendar-export-to-ics nil t)))
|
||||||
|
|
||||||
|
(setq org-agenda-files '("~/nas/syncthing/orgzly/Agenda.org" "~/nas/syncthing/orgzly/Lavoro.org"))
|
||||||
|
|
||||||
|
;; (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.6))
|
||||||
|
;; (use-package org-fragtog
|
||||||
|
;; :hook (org-mode org-fragtog)
|
||||||
|
;; )
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Theming
|
** Theming
|
||||||
|
@ -459,7 +469,6 @@ This package allows to edit a textbox in a browser (with the related
|
||||||
extension installed) using an Emacs buffer.
|
extension installed) using an Emacs buffer.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package edit-server
|
(use-package edit-server
|
||||||
:ensure t
|
|
||||||
:commands edit-server-start
|
:commands edit-server-start
|
||||||
:init (if after-init-time
|
:init (if after-init-time
|
||||||
(edit-server-start)
|
(edit-server-start)
|
||||||
|
@ -491,16 +500,74 @@ windows in order to mantain specifit ratios, e.g. the golden ratio.
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Dired+
|
** Dired+
|
||||||
#+begin_src emacs-lisp
|
|
||||||
Installed directly from a script fetched on emacswiki, it adds new
|
Installed directly from a script fetched on emacswiki, it adds new
|
||||||
features to Dired.
|
features to Dired.
|
||||||
(use-package dired+
|
#+begin_src emacs-lisp
|
||||||
:quelpa (dired+ :fetcher url :url "https://www.emacswiki.org/emacs/download/dired+.el")
|
;; (use-package dired+
|
||||||
:defer 1
|
;; :quelpa (dired+ :fetcher url :url "https://www.emacswiki.org/emacs/download/dired+.el")
|
||||||
:init
|
;; :defer 1
|
||||||
(setq diredp-hide-details-initially-flag nil)
|
;; :init
|
||||||
(setq diredp-hide-details-propagate-flag nil)
|
;; (setq diredp-hide-details-initially-flag nil)
|
||||||
|
;; (setq diredp-hide-details-propagate-flag nil)
|
||||||
|
|
||||||
:config
|
;; :config
|
||||||
(diredp-toggle-find-file-reuse-dir 1))
|
;; (diredp-toggle-find-file-reuse-dir 1))
|
||||||
|
#+end_src
|
||||||
|
** Working with React
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package typescript-mode)
|
||||||
|
|
||||||
|
(use-package rjsx-mode)
|
||||||
|
|
||||||
|
(use-package tide
|
||||||
|
:ensure t
|
||||||
|
:after (typescript-mode company flycheck)
|
||||||
|
:hook ((typescript-mode . tide-setup)
|
||||||
|
(typescript-mode . tide-hl-identifier-mode)
|
||||||
|
(before-save . tide-format-before-save))
|
||||||
|
:config (progn
|
||||||
|
(defun setup-tide-mode ()
|
||||||
|
(interactive)
|
||||||
|
(tide-setup)
|
||||||
|
(flycheck-mode +1)
|
||||||
|
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
||||||
|
(eldoc-mode +1)
|
||||||
|
(tide-hl-identifier-mode +1)
|
||||||
|
;; company is an optional dependency. You have to
|
||||||
|
;; install it separately via package-install
|
||||||
|
;; `M-x package-install [ret] company`
|
||||||
|
(company-mode +1))
|
||||||
|
|
||||||
|
;; aligns annotation to the right hand side
|
||||||
|
(setq company-tooltip-align-annotations t)
|
||||||
|
|
||||||
|
;; formats the buffer before saving
|
||||||
|
(add-hook 'before-save-hook 'tide-format-before-save)
|
||||||
|
(add-hook 'typescript-mode-hook #'setup-tide-mode)
|
||||||
|
|
||||||
|
;; to manage tsx files
|
||||||
|
(require 'web-mode)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
|
||||||
|
(add-hook 'web-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(when (string-equal "tsx" (file-name-extension buffer-file-name))
|
||||||
|
(setup-tide-mode))))
|
||||||
|
;; enable typescript-tslint checker
|
||||||
|
(flycheck-add-mode 'typescript-tslint 'web-mode)))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
** Journal
|
||||||
|
I keep a journal with my notes, when I save an entry it's
|
||||||
|
automatically committed and pushed on a remote repository.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package org-journal
|
||||||
|
:init (progn
|
||||||
|
(add-hook 'after-save-hook (lambda () (async-shell-command "git add * && git commit -m 'Automatic' && git push origin master")))
|
||||||
|
;; Change default prefix key; needs to be set before loading org-journal
|
||||||
|
(setq org-journal-prefix-key "C-x j"))
|
||||||
|
:config
|
||||||
|
(setq org-journal-dir "~/journal/"
|
||||||
|
org-journal-date-format "%A, %d %B %Y"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
Reference in a new issue