cleanup
This commit is contained in:
parent
15d9eb0088
commit
b6cd82e48f
|
@ -1,159 +1,159 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Packages related
|
; Packages related
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
||||||
;(package-initialize) ; this goes in chemacs2 init -- DO NOT UNCOMMENT
|
;(package-initialize) ; this goes in chemacs2 init -- DO NOT UNCOMMENT
|
||||||
(add-to-list 'package-selected-packages
|
(add-to-list 'package-selected-packages
|
||||||
'(helpful dired-rainbow dired-collapse dired-ranger dired-single all-the-icons-dired ido-completing-read+ diminish persp-mode modus-themes transpose-frame use-package)
|
'(helpful dired-rainbow dired-collapse dired-ranger dired-single all-the-icons-dired ido-completing-read+ diminish persp-mode modus-themes transpose-frame use-package)
|
||||||
)
|
)
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(require 'diminish)
|
(require 'diminish)
|
||||||
(diminish 'rainbow-mode) ; Hide lighter from mode-line
|
(diminish 'rainbow-mode) ; Hide lighter from mode-line
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Setup global keys
|
; Setup global keys
|
||||||
(cua-mode 1)
|
(cua-mode 1)
|
||||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||||
(global-set-key (kbd "C-c m") 'menu-bar-open)
|
(global-set-key (kbd "C-c m") 'menu-bar-open)
|
||||||
(global-set-key (kbd "C-c .") 'rotate-frame-clockwise)
|
(global-set-key (kbd "C-c .") 'rotate-frame-clockwise)
|
||||||
(global-set-key (kbd "C-c ,") 'rotate-frame-anticlockwise)
|
(global-set-key (kbd "C-c ,") 'rotate-frame-anticlockwise)
|
||||||
(global-set-key (kbd "C-c u") 'toggle-truncate-lines)
|
(global-set-key (kbd "C-c u") 'toggle-truncate-lines)
|
||||||
(global-set-key (kbd "<M-f4>") 'delete-frame)
|
(global-set-key (kbd "<M-f4>") 'delete-frame)
|
||||||
(global-set-key (kbd "C-x C-z") nil)
|
(global-set-key (kbd "C-x C-z") nil)
|
||||||
|
|
||||||
;; Lookup the current symbol at point. C-c C-d is a common keybinding
|
;; Lookup the current symbol at point. C-c C-d is a common keybinding
|
||||||
;; for this in lisp modes.
|
;; for this in lisp modes.
|
||||||
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
|
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Set some global config
|
; Set some global config
|
||||||
(setq inhibit-splash-screen t) ; why do you need to tell me things i know by default
|
(setq inhibit-splash-screen t) ; why do you need to tell me things i know by default
|
||||||
; Turn on ido mode (useful for buffer swaps and find file completion)
|
; Turn on ido mode (useful for buffer swaps and find file completion)
|
||||||
(require 'ido-completing-read+)
|
(require 'ido-completing-read+)
|
||||||
(ido-ubiquitous-mode 1)
|
(ido-ubiquitous-mode 1)
|
||||||
(setq ido-enable-flex-matching t)
|
(setq ido-enable-flex-matching t)
|
||||||
(setq ido-everywhere t)
|
(setq ido-everywhere t)
|
||||||
(ido-mode 1)
|
(ido-mode 1)
|
||||||
(setq-default tab-width 4) ; sanity!
|
(setq-default tab-width 4) ; sanity!
|
||||||
(electric-indent-mode 0) ; return should NOT fuck with the indentation of the previous line
|
(electric-indent-mode 0) ; return should NOT fuck with the indentation of the previous line
|
||||||
(setq backup-directory-alist `(("." . "~/.emacs.d/saves"))) ; Move the auto backups to a dedicated 'zone'
|
(setq backup-directory-alist `(("." . "~/.emacs.d/saves"))) ; Move the auto backups to a dedicated 'zone'
|
||||||
(setq backup-by-copying t) ; safest form of backup file creation
|
(setq backup-by-copying t) ; safest form of backup file creation
|
||||||
; Config backups so we have *more*, not less
|
; Config backups so we have *more*, not less
|
||||||
(setq delete-old-versions t
|
(setq delete-old-versions t
|
||||||
kept-new-versions 1
|
kept-new-versions 1
|
||||||
kept-old-versions 3
|
kept-old-versions 3
|
||||||
version-control t
|
version-control t
|
||||||
)
|
)
|
||||||
;; make typing delete/overwrites selected text
|
;; make typing delete/overwrites selected text
|
||||||
(delete-selection-mode 1)
|
(delete-selection-mode 1)
|
||||||
;; UTF-8 as default encoding
|
;; UTF-8 as default encoding
|
||||||
(set-default-coding-systems 'utf-8)
|
(set-default-coding-systems 'utf-8)
|
||||||
(set-language-environment "UTF-8")
|
(set-language-environment "UTF-8")
|
||||||
(set-default-coding-systems 'utf-8-unix)
|
(set-default-coding-systems 'utf-8-unix)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; set font for emoji -- DOES NOT WORK ON MOBILE
|
;; set font for emoji -- DOES NOT WORK ON MOBILE
|
||||||
(when (eq system-type 'windows-nt)
|
(when (eq system-type 'windows-nt)
|
||||||
(set-fontset-font
|
(set-fontset-font
|
||||||
t
|
t
|
||||||
'(#x1f300 . #x1fad0)
|
'(#x1f300 . #x1fad0)
|
||||||
(cond
|
(cond
|
||||||
((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji")
|
((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji")
|
||||||
((member "Noto Emoji" (font-family-list)) "Noto Emoji")
|
((member "Noto Emoji" (font-family-list)) "Noto Emoji")
|
||||||
((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji")
|
((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji")
|
||||||
((member "Symbola" (font-family-list)) "Symbola")
|
((member "Symbola" (font-family-list)) "Symbola")
|
||||||
((member "Apple Color Emoji" (font-family-list)) "Apple Color Emoji"))
|
((member "Apple Color Emoji" (font-family-list)) "Apple Color Emoji"))
|
||||||
;; Apple Color Emoji should be before Symbola, but Richard Stallman skum disabled it.
|
;; Apple Color Emoji should be before Symbola, but Richard Stallman skum disabled it.
|
||||||
;; GNU Emacs Removes Color Emoji Support on the Mac
|
;; GNU Emacs Removes Color Emoji Support on the Mac
|
||||||
;; http://ergoemacs.org/misc/emacs_macos_emoji.html
|
;; http://ergoemacs.org/misc/emacs_macos_emoji.html
|
||||||
;;
|
;;
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; line numbers
|
; line numbers
|
||||||
; find major mode : M-x eval-expression [enter] major-mode
|
; find major mode : M-x eval-expression [enter] major-mode
|
||||||
(require 'display-line-numbers)
|
(require 'display-line-numbers)
|
||||||
(defcustom display-line-numbers-exempt-modes '(org-mode org-agenda-mode)
|
(defcustom display-line-numbers-exempt-modes '(org-mode org-agenda-mode)
|
||||||
"Major modes on which to disable the linum mode, exempts them from global requirement"
|
"Major modes on which to disable the linum mode, exempts them from global requirement"
|
||||||
:group 'display-line-numbers
|
:group 'display-line-numbers
|
||||||
:type 'list
|
:type 'list
|
||||||
:version "green")
|
:version "green")
|
||||||
(defun display-line-numbers--turn-on ()
|
(defun display-line-numbers--turn-on ()
|
||||||
"turn on line numbers but excempting certain majore modes defined in `display-line-numbers-exempt-modes'"
|
"turn on line numbers but excempting certain majore modes defined in `display-line-numbers-exempt-modes'"
|
||||||
(if (and
|
(if (and
|
||||||
(not (member major-mode display-line-numbers-exempt-modes))
|
(not (member major-mode display-line-numbers-exempt-modes))
|
||||||
(not (minibufferp)))
|
(not (minibufferp)))
|
||||||
(display-line-numbers-mode)))
|
(display-line-numbers-mode)))
|
||||||
(global-display-line-numbers-mode)
|
(global-display-line-numbers-mode)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; modus-themes setup and enable
|
; modus-themes setup and enable
|
||||||
(use-package modus-themes
|
(use-package modus-themes
|
||||||
:ensure
|
:ensure
|
||||||
:init
|
:init
|
||||||
(setq modus-themes-region '(no-extend)
|
(setq modus-themes-region '(no-extend)
|
||||||
modus-themes-fringes 'subtle
|
modus-themes-fringes 'subtle
|
||||||
modus-themes-scale-headings t
|
modus-themes-scale-headings t
|
||||||
)
|
)
|
||||||
|
|
||||||
(modus-themes-load-themes)
|
(modus-themes-load-themes)
|
||||||
:config
|
:config
|
||||||
(modus-themes-load-vivendi)
|
(modus-themes-load-vivendi)
|
||||||
)
|
)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; persp-mode
|
; persp-mode
|
||||||
(with-eval-after-load "persp-mode-autoloads"
|
(with-eval-after-load "persp-mode-autoloads"
|
||||||
(setq wg-morph-on nil) ;; switch off animation
|
(setq wg-morph-on nil) ;; switch off animation
|
||||||
(setq persp-autokill-buffer-on-remove 'kill-weak)
|
(setq persp-autokill-buffer-on-remove 'kill-weak)
|
||||||
(add-hook 'window-setup-hook #'(lambda () (persp-mode 1))))
|
(add-hook 'window-setup-hook #'(lambda () (persp-mode 1))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; better dired behaviors
|
; better dired behaviors
|
||||||
(setq dired-listing-switches "-agho --group-directories-first"
|
(setq dired-listing-switches "-agho --group-directories-first"
|
||||||
dired-omit-files "^\\.[^.].*"
|
dired-omit-files "^\\.[^.].*"
|
||||||
dired-omit-verbose nil
|
dired-omit-verbose nil
|
||||||
dired-hide-details-hide-symlink-targets nil)
|
dired-hide-details-hide-symlink-targets nil)
|
||||||
|
|
||||||
(autoload 'dired-omit-mode "dired-x")
|
(autoload 'dired-omit-mode "dired-x")
|
||||||
|
|
||||||
(require 'dired-collapse)
|
(require 'dired-collapse)
|
||||||
(add-hook 'dired-load-hook
|
(add-hook 'dired-load-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(dired-collapse)))
|
(dired-collapse)))
|
||||||
|
|
||||||
(add-hook 'dired-mode-hook
|
(add-hook 'dired-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(dired-omit-mode 1)
|
(dired-omit-mode 1)
|
||||||
(dired-hide-details-mode 1)
|
(dired-hide-details-mode 1)
|
||||||
(hl-line-mode 1)))
|
(hl-line-mode 1)))
|
||||||
|
|
||||||
(use-package dired-rainbow
|
(use-package dired-rainbow
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(dired-rainbow-define-chmod directory "#6cb2eb" "d.*")
|
(dired-rainbow-define-chmod directory "#6cb2eb" "d.*")
|
||||||
(dired-rainbow-define html "#eb5286" ("css" "less" "sass" "scss" "htm" "html" "jhtm" "mht" "eml" "mustache" "xhtml"))
|
(dired-rainbow-define html "#eb5286" ("css" "less" "sass" "scss" "htm" "html" "jhtm" "mht" "eml" "mustache" "xhtml"))
|
||||||
(dired-rainbow-define xml "#f2d024" ("xml" "xsd" "xsl" "xslt" "wsdl" "bib" "json" "msg" "pgn" "rss" "yaml" "yml" "rdata"))
|
(dired-rainbow-define xml "#f2d024" ("xml" "xsd" "xsl" "xslt" "wsdl" "bib" "json" "msg" "pgn" "rss" "yaml" "yml" "rdata"))
|
||||||
(dired-rainbow-define document "#9561e2" ("docm" "doc" "docx" "odb" "odt" "pdb" "pdf" "ps" "rtf" "djvu" "epub" "odp" "ppt" "pptx"))
|
(dired-rainbow-define document "#9561e2" ("docm" "doc" "docx" "odb" "odt" "pdb" "pdf" "ps" "rtf" "djvu" "epub" "odp" "ppt" "pptx"))
|
||||||
(dired-rainbow-define markdown "#ffed4a" ("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "textfile" "txt"))
|
(dired-rainbow-define markdown "#ffed4a" ("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "textfile" "txt"))
|
||||||
(dired-rainbow-define database "#6574cd" ("xlsx" "xls" "csv" "accdb" "db" "mdb" "sqlite" "nc"))
|
(dired-rainbow-define database "#6574cd" ("xlsx" "xls" "csv" "accdb" "db" "mdb" "sqlite" "nc"))
|
||||||
(dired-rainbow-define media "#de751f" ("mp3" "mp4" "mkv" "MP3" "MP4" "avi" "mpeg" "mpg" "flv" "ogg" "mov" "mid" "midi" "wav" "aiff" "flac"))
|
(dired-rainbow-define media "#de751f" ("mp3" "mp4" "mkv" "MP3" "MP4" "avi" "mpeg" "mpg" "flv" "ogg" "mov" "mid" "midi" "wav" "aiff" "flac"))
|
||||||
(dired-rainbow-define image "#f66d9b" ("tiff" "tif" "cdr" "gif" "ico" "jpeg" "jpg" "png" "psd" "eps" "svg"))
|
(dired-rainbow-define image "#f66d9b" ("tiff" "tif" "cdr" "gif" "ico" "jpeg" "jpg" "png" "psd" "eps" "svg"))
|
||||||
(dired-rainbow-define log "#c17d11" ("log"))
|
(dired-rainbow-define log "#c17d11" ("log"))
|
||||||
(dired-rainbow-define shell "#f6993f" ("awk" "bash" "bat" "sed" "sh" "zsh" "vim"))
|
(dired-rainbow-define shell "#f6993f" ("awk" "bash" "bat" "sed" "sh" "zsh" "vim"))
|
||||||
(dired-rainbow-define interpreted "#38c172" ("py" "ipynb" "rb" "pl" "t" "msql" "mysql" "pgsql" "sql" "r" "clj" "cljs" "scala" "js"))
|
(dired-rainbow-define interpreted "#38c172" ("py" "ipynb" "rb" "pl" "t" "msql" "mysql" "pgsql" "sql" "r" "clj" "cljs" "scala" "js"))
|
||||||
(dired-rainbow-define compiled "#4dc0b5" ("asm" "cl" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc" "cs" "cp" "cpp" "go" "f" "for" "ftn" "f90" "f95" "f03" "f08" "s" "rs" "hi" "hs" "pyc" ".java"))
|
(dired-rainbow-define compiled "#4dc0b5" ("asm" "cl" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc" "cs" "cp" "cpp" "go" "f" "for" "ftn" "f90" "f95" "f03" "f08" "s" "rs" "hi" "hs" "pyc" ".java"))
|
||||||
(dired-rainbow-define executable "#8cc4ff" ("exe" "msi"))
|
(dired-rainbow-define executable "#8cc4ff" ("exe" "msi"))
|
||||||
(dired-rainbow-define compressed "#51d88a" ("7z" "zip" "bz2" "tgz" "txz" "gz" "xz" "z" "Z" "jar" "war" "ear" "rar" "sar" "xpi" "apk" "xz" "tar"))
|
(dired-rainbow-define compressed "#51d88a" ("7z" "zip" "bz2" "tgz" "txz" "gz" "xz" "z" "Z" "jar" "war" "ear" "rar" "sar" "xpi" "apk" "xz" "tar"))
|
||||||
(dired-rainbow-define packaged "#faad63" ("deb" "rpm" "apk" "jad" "jar" "cab" "pak" "pk3" "vdf" "vpk" "bsp"))
|
(dired-rainbow-define packaged "#faad63" ("deb" "rpm" "apk" "jad" "jar" "cab" "pak" "pk3" "vdf" "vpk" "bsp"))
|
||||||
(dired-rainbow-define encrypted "#ffed4a" ("gpg" "pgp" "asc" "bfe" "enc" "signature" "sig" "p12" "pem"))
|
(dired-rainbow-define encrypted "#ffed4a" ("gpg" "pgp" "asc" "bfe" "enc" "signature" "sig" "p12" "pem"))
|
||||||
(dired-rainbow-define fonts "#6cb2eb" ("afm" "fon" "fnt" "pfb" "pfm" "ttf" "otf"))
|
(dired-rainbow-define fonts "#6cb2eb" ("afm" "fon" "fnt" "pfb" "pfm" "ttf" "otf"))
|
||||||
(dired-rainbow-define partition "#e3342f" ("dmg" "iso" "bin" "nrg" "qcow" "toast" "vcd" "vmdk" "bak"))
|
(dired-rainbow-define partition "#e3342f" ("dmg" "iso" "bin" "nrg" "qcow" "toast" "vcd" "vmdk" "bak"))
|
||||||
(dired-rainbow-define vc "#0074d9" ("git" "gitignore" "gitattributes" "gitmodules"))
|
(dired-rainbow-define vc "#0074d9" ("git" "gitignore" "gitattributes" "gitmodules"))
|
||||||
(dired-rainbow-define-chmod executable-unix "#38c172" "-.*x.*")
|
(dired-rainbow-define-chmod executable-unix "#38c172" "-.*x.*")
|
||||||
))
|
))
|
||||||
|
|
196
emacs.md
196
emacs.md
|
@ -1,98 +1,98 @@
|
||||||
git clone https://github.com/plexus/chemacs2.git ~/.emacs.d (%appdata% on windows)
|
git clone https://github.com/plexus/chemacs2.git ~/.emacs.d (%appdata% on windows)
|
||||||
|
|
||||||
M-x describe-variable RET user-init-file RET
|
M-x describe-variable RET user-init-file RET
|
||||||
|
|
||||||
uncomment the package init line in the appropriate init file(s)
|
uncomment the package init line in the appropriate init file(s)
|
||||||
|
|
||||||
cat > ~/.emacs-profiles.el <<EOF
|
cat > ~/.emacs-profiles.el <<EOF
|
||||||
(("default" . ((user-emacs-directory . "~/.emacs.d.profiles/code")))
|
(("default" . ((user-emacs-directory . "~/.emacs.d.profiles/code")))
|
||||||
("code" . ((user-emacs-directory . "~/.emacs.d.profiles/code")))
|
("code" . ((user-emacs-directory . "~/.emacs.d.profiles/code")))
|
||||||
("org" . ((user-emacs-directory . "~/.emacs.d.profiles/org")))
|
("org" . ((user-emacs-directory . "~/.emacs.d.profiles/org")))
|
||||||
("beancount" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
("beancount" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
||||||
("ledger" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
("ledger" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
||||||
("accounting" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
("accounting" . ((user-emacs-directory . "~/.emacs.d.profiles/accounting")))
|
||||||
)
|
)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
; emacs --with-profile my-profile
|
; emacs --with-profile my-profile
|
||||||
; emacs --with-profile '((user-emacs-directory . "/path/to/config"))'
|
; emacs --with-profile '((user-emacs-directory . "/path/to/config"))'
|
||||||
; add option to shortcut to runemacs.exe if needed
|
; add option to shortcut to runemacs.exe if needed
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
cat > ~/.emacs.d.profiles/[profile]/init.el<<EOF
|
cat > ~/.emacs.d.profiles/[profile]/init.el<<EOF
|
||||||
;; -*- lexical-binding: t; -*-
|
;; -*- lexical-binding: t; -*-
|
||||||
;; TURN ON IN INIT FILE!!!!!
|
;; TURN ON IN INIT FILE!!!!!
|
||||||
|
|
||||||
;; Make gc pauses faster by decreasing the threshold.
|
;; Make gc pauses faster by decreasing the threshold.
|
||||||
(setq gc-cons-threshold (* 2 1000 1000))
|
(setq gc-cons-threshold (* 2 1000 1000))
|
||||||
|
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
(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`
|
;; 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.
|
;; 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)
|
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
||||||
(unless (package-installed-p 'use-package)
|
(unless (package-installed-p 'use-package)
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install 'use-package))
|
(package-install 'use-package))
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cd [profile_path]
|
cd [profile_path]
|
||||||
git clone https://github.com/beancount/beancount-mode.git
|
git clone https://github.com/beancount/beancount-mode.git
|
||||||
|
|
||||||
open scratch buffer. paste below into it as the contents then do `M-x ev-b RET`
|
open scratch buffer. paste below into it as the contents then do `M-x ev-b RET`
|
||||||
|
|
||||||
``` elisp
|
``` elisp
|
||||||
|
|
||||||
; if get failures on pkg command, run contents of init.el from above first
|
; if get failures on pkg command, run contents of init.el from above first
|
||||||
|
|
||||||
; code
|
; code
|
||||||
(defvar packages-code '(markdown-mode
|
(defvar packages-code '(markdown-mode
|
||||||
rainbow-mode
|
rainbow-mode
|
||||||
rainbow-delimiters
|
rainbow-delimiters
|
||||||
lua-mode
|
lua-mode
|
||||||
dockerfile-mode
|
dockerfile-mode
|
||||||
yaml-mode
|
yaml-mode
|
||||||
go-mode
|
go-mode
|
||||||
origami
|
origami
|
||||||
rust-mode
|
rust-mode
|
||||||
powershell
|
powershell
|
||||||
python-mode
|
python-mode
|
||||||
json-mode)
|
json-mode)
|
||||||
"Code packages")
|
"Code packages")
|
||||||
|
|
||||||
; accounting
|
; accounting
|
||||||
(defvar packages-accounting '(
|
(defvar packages-accounting '(
|
||||||
ledger-mode)
|
ledger-mode)
|
||||||
"Accounting packages")
|
"Accounting packages")
|
||||||
|
|
||||||
(defvar packages-default '(transpose-frame
|
(defvar packages-default '(
|
||||||
modus-themes
|
modus-themes
|
||||||
persp-mode
|
persp-mode
|
||||||
diminish
|
diminish
|
||||||
ido-completing-read+
|
ido-completing-read+
|
||||||
all-the-icons-dired
|
all-the-icons-dired
|
||||||
dired-single
|
dired-single
|
||||||
dired-ranger
|
dired-ranger
|
||||||
dired-collapse
|
dired-collapse
|
||||||
dired-rainbow
|
dired-rainbow
|
||||||
helpful)
|
helpful)
|
||||||
"Default packages")
|
"Default packages")
|
||||||
|
|
||||||
(defun kmn-packages-installed-p ()
|
(defun kmn-packages-installed-p ()
|
||||||
(cl-loop for p in packages-default
|
(cl-loop for p in packages-default
|
||||||
when (not (package-installed-p p)) do (cl-return nil)
|
when (not (package-installed-p p)) do (cl-return nil)
|
||||||
finally (cl-return t)))
|
finally (cl-return t)))
|
||||||
|
|
||||||
(unless (kmn-packages-installed-p)
|
(unless (kmn-packages-installed-p)
|
||||||
;; check for new packages (package versions)
|
;; check for new packages (package versions)
|
||||||
(message "%s" "Emacs is now refreshing its package database...")
|
(message "%s" "Emacs is now refreshing its package database...")
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(message "%s" " done.")
|
(message "%s" " done.")
|
||||||
;; install the missing packages
|
;; install the missing packages
|
||||||
(dolist (p packages-default)
|
(dolist (p packages-default)
|
||||||
(when (not (package-installed-p p))
|
(when (not (package-installed-p p))
|
||||||
(package-install p))))
|
(package-install p))))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
Reference in a new issue