nixos-config/hosts/dell-5590/home-manager/configs/init.el-bak

219 lines
8.2 KiB
Plaintext

;; Keyboard-centric user interface
(setq inhibit-startup-message t)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
(column-number-mode 't) ; show current column in status bar
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(set-fringe-mode 10)
;; Use 4 spaces for one tab visually.
(setq tab-width 4)
(show-paren-mode t) ; highlight matching open and close parentheses
(global-hl-line-mode) ; highlight current line
(global-visual-line-mode t) ; wrap long lines
(setq split-window-preferred-function
'visual-fill-column-split-window-sensibly) ; wrap at window boundary
(global-whitespace-mode) ; enable whitespace handling by default
(setq
whitespace-style ; see (apropos 'whitespace-style)
'(face ; viz via faces
trailing ; trailing blanks visualized
lines-tail ; lines beyond whitespace-line-column visualized
space-before-tab
space-after-tab
newline ; lines with only blanks visualized
indentation ; spaces used for indent when config wants tabs
empty ; empty lines at beginning or end or buffer
)
whitespace-line-column 150) ; column at which whitespace-mode says the line is too long
;;(set-face-attribute 'default nil :font "JetBrains Mono" :height 150)
;; themes
(use-package doom-themes
:init (load-theme 'doom-nord t)
:init (doom-themes-org-config))
(setq disabled-command-function nil)
(setq inhibit-startup-screen t)
(setq visible-bell t)
;; Only y/n answers
(defalias 'yes-or-no-p 'y-or-n-p)
;; Save what you enter into minibuffer prompts
(setq history-length 25)
(savehist-mode 1)
;; Remember and restore the last cursor location of opened files
(save-place-mode 1)
;; Backup
(setq version-control t ;; Use version numbers for backups.
kept-new-versions 10 ;; Number of newest versions to keep.
kept-old-versions 0 ;; Number of oldest versions to keep.
delete-old-versions t ;; Don't ask to delete excess backup versions.
backup-by-copying t) ;; Copy all files, don't rename them.
(setq vc-make-backup-files t)
(setq backup-directory-alist '(("" . "~/.emacs.d/backup")))
(defvar emacs-autosave-directory
(concat user-emacs-directory "autosaves/")
"This variable dictates where to put auto saves. It is set to a
directory called autosaves located wherever your .emacs.d/ is
located.")
;; Sets all files to be backed up and auto saved in a single directory.
(setq backup-directory-alist
`((".*" . ,emacs-autosave-directory))
auto-save-file-name-transforms
`((".*" ,emacs-autosave-directory t)))
(setq calendar-week-start-day 1)
;; keybinding
(global-set-key "\C-cnj" 'org-journal-new-entry)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-c g" 'gtd)
(use-package nix-mode
:mode ("\\.nix\\'" . nix-mode)
:hook (nix-mode . lsp-deferred))
(use-package magit)
(setq magit-fetch-modules-jobs 16); fetch 16 modules in parallel
(use-package which-key
:init (which-key-mode)
:config (setq which-key-idle-delay 0.5))
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist
'("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode))
(autoload 'gfm-mode "markdown-mode"
"Major mode for editing GitHub Flavored Markdown files" t)
(add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))
;; org-mode
(require 'org)
(require 'org-mouse)
(setq org-startup-folded t
org-pretty-entities t
org-hide-emphasis-markers t
org-startup-with-inline-images t
org-agenda-include-deadlines t
org-image-actual-width '(300))
;; files with ".org" open in org-mode
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(setq org-agenda-files '("/home/alexandre/Nextcloud/PRIVE/13_Org/backlog.org" "/home/alexandre/Nextcloud/PRIVE/13_Org/notes" "/home/alexandre/Nextcloud/PRIVE/13_Org/journal"))
(setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/13_Org/notes"))
(setq org-default-notes-file "~/Nextcloud/PRIVE/13_Org/backlog.org")
;;(setq org-capture-templates
;; '(("b" "Ajouter au backlog" entry
;; (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
;; "* TODO %?" :empty-lines 1))
(setq org-capture-templates
'(("t" "TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %? %^G \n %U" :empty-lines 1)
("s" "Scheduled TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %? %^G \nSCHEDULED: %^t\n %U" :empty-lines 1)
("l" "Link" entry (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %a %? %^G\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")
("n" "Note" entry (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* %? %^G\n%U" :empty-lines 1)
("j" "Journal" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* %? %^G\nEntered on %U\n")))
;; Org-Roam basic configuration
(use-package org-roam
:after org
:init (setq org-roam-v2-ack t) ;; Acknowledge V2 upgrade
:custom
(org-roam-directory (file-truename org-directory))
:config
(org-roam-setup)
(org-roam-db-autosync-mode)
:bind (("C-c n f" . org-roam-node-find)
("C-c n r" . org-roam-node-random)
("C-c n o" . org-open-at-point)
("C-c n i" . org-roam-node-insert)
;; (:map org-mode-map
;; (("C-c n i" . org-roam-node-insert)
;; ("C-c n t" . org-roam-tag-add)
;; ("C-c n a" . org-roam-alias-add)
;; ("C-c n l" . org-roam-buffer-toggle)
;; ("C-c n o" . org-open-at-point)
;; ("C-c n d" . org-roam-dailies-capture-today)
;; ("C-c n T" . org-roam-dailies-goto-today)
;; ("C-M-i" . completion-at-point))))
)
;; (:map org-roam-dailies-map
;; (map!
;; "\C-c n T" 'org-roam-dailies-goto-today
;; "\C-c n d" 'org-roam-dailies-capture-today))
(setq org-roam-dailies-capture-templates
'(("d" "default" entry
"* %?"
:target (file+head "journal-%<%Y>.org" "#+TITLE: %<%Y-%m-%d>\n"))))
;; one file org
(defvar org-gtd-file "~/Nextcloud/PRIVE/13_Org/DRI.org")
;; Open DRI.org when I hit C-c g
(defun gtd ()
"Open the GTD file."
(interactive)
(find-file org-gtd-file))
;; This seems like a good basic set of keywords to start out with:
(setq org-todo-keywords '((type "TODO" "En cours" "WAIT" "CANCELED" "DONE")))
(setf org-todo-keyword-faces '(("TODO" . (:foreground "cyan" :background "steelblue" :bold t :weight bold))
("En cours" . (:foreground "yellow" :background "red" :bold t :weight bold))
("En attente de réponse" . (:foreground "yellow" :background "magenta2" :bold t :weight bold))
("CANCELED" . (:foreground "gray" :background "dime grey" :bold t :weight bold))
("DONE" . (:foreground "gray50" :background "gray30"))))
;; tags
(setq org-tag-alist '(("DEVIS" . ?d) ("PROJETS" . ?p) ("CLIENT" . ?c) ("PROSPECT" . ?o) ("INTERNE" . ?i) ("AO" . ?a) ("PJ" . ?z) ("AVV" . ?v) ("PERSO" . ?z)))
(setq org-tag-faces
'(
("DEVIS" . (:foreground "OrangeRed" :weight bold))
("PJ" . (:foreground "brightyellow" :weight bold))
("PROJET" . (:foreground "IndianRed1" :weight bold))
("INTERNE" . (:foreground "LimeGreen" :weight bold))
("CLIENT" . (:foreground "Orange" :weight bold))
("PROSPECT" . (:foreground "MediumPurple3" :weight bold))
("AO" . (:foreground "HotPink2" :weight bold))
("PERSO" . (:foreground "firebrick" :weight bold))
)
)
;;; Org-journal
;; https://github.com/bastibe/org-journal
;; C-c C-j
;;(require 'org-journal)
;;(setq org-journal-date-prefix "#+TITLE: "
;; org-journal-carryover-items "-TODO=\"DONE\""
;; org-journal-time-prefix "* "
;; org-journal-date-format "%a, %Y-%m-%d"
;; org-journal-file-format "%Y-%m-%d-journal.org"
;; org-journal-dir "/home/alexandre/Nextcloud/PRIVE/13_Org/journal/")