From 43b356933766807cff3cce9dda6955469f4df49c Mon Sep 17 00:00:00 2001 From: gxlin Date: Tue, 6 Jul 2021 22:00:15 +0800 Subject: Reorganized emacs config --- .aliases | 5 +- .emacs.d/.gitignore | 6 ++ .emacs.d/init-mu4e.el | Bin 2519 -> 0 bytes .emacs.d/init.el | 107 +++++-------------------------- .emacs.d/lisp/init-evil.el | 28 +++++++++ .emacs.d/lisp/init-lang.el | 33 ++++++++++ .emacs.d/lisp/init-misc.el | 52 ++++++++++++++++ .emacs.d/lisp/init-mu4e.el | Bin 0 -> 2610 bytes .emacs.d/lisp/init-org.el | 128 ++++++++++++++++++++++++++++++++++++++ .emacs.d/lisp/init-package.el | 14 +++++ .emacs.d/modes/init-evil-mode.el | 28 --------- .emacs.d/modes/init-lsp-mode.el | 13 ---- .emacs.d/modes/init-org-mode.el | 128 -------------------------------------- .emacs.d/site-lisp/load-config.el | 6 -- .gitattributes | 2 +- .vim/init.vim | 5 -- bootstrap.sh | 5 ++ install.sh | 52 ---------------- 18 files changed, 286 insertions(+), 326 deletions(-) create mode 100644 .emacs.d/.gitignore delete mode 100644 .emacs.d/init-mu4e.el create mode 100644 .emacs.d/lisp/init-evil.el create mode 100644 .emacs.d/lisp/init-lang.el create mode 100644 .emacs.d/lisp/init-misc.el create mode 100644 .emacs.d/lisp/init-mu4e.el create mode 100644 .emacs.d/lisp/init-org.el create mode 100644 .emacs.d/lisp/init-package.el delete mode 100644 .emacs.d/modes/init-evil-mode.el delete mode 100644 .emacs.d/modes/init-lsp-mode.el delete mode 100644 .emacs.d/modes/init-org-mode.el delete mode 100644 .emacs.d/site-lisp/load-config.el create mode 100755 bootstrap.sh delete mode 100644 install.sh diff --git a/.aliases b/.aliases index f07c9b8..8375dc3 100644 --- a/.aliases +++ b/.aliases @@ -1,4 +1,5 @@ #!/usr/bin/env bash -alias mu4e='emacs -f mu4e' -alias todo='emacs ~/notes/todo.org' +alias emacs='emacs -nw' +alias mu4e='emacs -nw -f mu4e' +alias todo='emacs -nw ~/notes/todo.org' diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore new file mode 100644 index 0000000..d01fcd1 --- /dev/null +++ b/.emacs.d/.gitignore @@ -0,0 +1,6 @@ +auto-save-list +recentf +backups +custom.el +elpa +*.eld diff --git a/.emacs.d/init-mu4e.el b/.emacs.d/init-mu4e.el deleted file mode 100644 index bf72115..0000000 Binary files a/.emacs.d/init-mu4e.el and /dev/null differ diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4f08fd7..4c4f865 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,17 +1,17 @@ +;; -*- coding: utf-8; lexical-binding: t; -*- + ;; Make startup faster by reducing frequency of garbage collection. (setq gc-cons-percentage 0.6) (setq gc-cons-threshold most-positive-fixnum) ;; Make gc pauses faster by decreasing the threhold to 8 MiB (default is ;; 800kB) (add-hook 'emacs-startup-hook - (lambda () - (setq gc-cons-threshold (expt 2 23)))) + (lambda () (setq gc-cons-threshold (expt 2 23)))) + +(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) + +(defconst *is-a-mac* (eq system-type 'darwin)) -;; Set up package.el to work with MELPA -(require 'package) -(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/"))) -(package-initialize) (when (version<= "26.0.50" emacs-version) (global-display-line-numbers-mode)) (setq vc-follow-symlinks t) @@ -19,19 +19,9 @@ `(("." . ,(concat user-emacs-directory "backups")))) (setq-default fill-column 72) (menu-bar-mode -1) - -(setq recentf-max-saved-items 100) - -(dolist (package '(use-package)) - (unless (package-installed-p package) - (package-refresh-contents) - (package-install package))) -(require 'use-package) -(setq use-package-always-ensure t) - (xterm-mouse-mode 1) ;; Enable mouse -(add-to-list 'load-path "~/.dotfiles/.emacs.d/") -(add-to-list 'load-path "~/.dotfiles/.emacs.d/modes/") + +(require 'init-package) (use-package atom-one-dark-theme :config @@ -47,78 +37,13 @@ :config (global-undo-tree-mode)) -(require 'init-evil-mode) -(require 'init-org-mode) -(require 'init-lsp-mode) +(require 'init-evil) +(require 'init-org) (require 'init-mu4e) +(require 'init-lang) -(use-package ledger-mode - :mode (("\\.journal$" . ledger-mode)) - :config - (add-hook 'ledger-mode-hook - (setq-local tab-always-indent 'complete) - (setq-local completion-cycle-threshold t))) - -;; Company Mode -(use-package company - :init - (setq company-global-modes - '(emacs-lisp-mode go-mode ledger-mode)) - :hook ((after-init . global-company-mode))) - -;; Projectile -(use-package projectile - :init - (evil-define-key 'normal projectile-mode-map - (kbd "p") 'projectile-command-map) - :config - (setq projectile-cache-file (expand-file-name ".cache/projectile" user-emacs-directory)) - (projectile-mode 1)) - -(use-package counsel - :after evil - :init - (evil-define-key 'normal ivy-mode-map - (kbd "fb") 'ivy-switch-buffer - (kbd "fm") 'counsel-recentf) - :config - (ivy-mode 1) - (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) ") - (setq ivy-re-builders-alist - '((read-file-name-internal . ivy--regex-fuzzy) - (t . ivy--regex-plus)))) - -(use-package vterm - :commands (vterm) - :config - (setq vterm-kill-buffer-on-exit t)) - -(use-package markdown-mode - :ensure t - :commands (markdown-mode gfm-mode) - :mode (("README\\.md\\'" . gfm-mode) - ("\\.md\\'" . markdown-mode) - ("\\.markdown\\'" . markdown-mode)) - :init - (evil-define-key 'normal markdown-mode-map - (kbd "") 'markdown-follow-link-at-point) - (setq markdown-command "multimarkdown")) - -(use-package exec-path-from-shell - :if (memq window-system '(mac ns)) - :ensure t - :config - (exec-path-from-shell-initialize)) - -(use-package go-mode - :ensure t - :commands (go-mode) - :mode (("\\.go\\'" . go-mode)) - :hook ((go-mode . (lambda () (setq tab-width 4))))) - -(use-package avy) +(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +(when (file-exists-p custom-file) + (load custom-file)) -(use-package esup - :ensure t - :pin melpa) +(require 'init-local nil t) diff --git a/.emacs.d/lisp/init-evil.el b/.emacs.d/lisp/init-evil.el new file mode 100644 index 0000000..6e4a95c --- /dev/null +++ b/.emacs.d/lisp/init-evil.el @@ -0,0 +1,28 @@ +(use-package evil + :ensure t + :hook ((evil-org-mode . (lambda () (setq evil-want-C-i-jump nil))) + (after-init . (lambda () (evil-mode 1)))) + :init + (setq evil-want-integration t + evil-want-C-u-scroll t + evil-wannt-fine-undo t + evil-want-keybinding nil + evil-disable-insert-state-bindings t) + :config + (evil-set-leader 'normal ",") + (evil-set-undo-system 'undo-tree)) + +(use-package evil-collection + :after evil + :ensure t +; :custom (evil-collection-setup-minibuffer t) + :config + (evil-collection-init)) + +(use-package evil-easymotion + :ensure t + :after (evil avy) + :config + (evilem-default-keybindings "SPC")) + +(provide 'init-evil) diff --git a/.emacs.d/lisp/init-lang.el b/.emacs.d/lisp/init-lang.el new file mode 100644 index 0000000..f8e96b6 --- /dev/null +++ b/.emacs.d/lisp/init-lang.el @@ -0,0 +1,33 @@ +(use-package ledger-mode + :mode (("\\.journal$" . ledger-mode))) + +(use-package markdown-mode + :ensure t + :commands (markdown-mode gfm-mode) + :mode (("README\\.md\\'" . gfm-mode) + ("\\.md\\'" . markdown-mode) + ("\\.markdown\\'" . markdown-mode)) + :init + (evil-define-key 'normal markdown-mode-map + (kbd "") 'markdown-follow-link-at-point) + (setq markdown-command "multimarkdown")) + +(use-package go-mode + :ensure t + :commands (go-mode) + :mode (("\\.go\\'" . go-mode)) + :hook ((go-mode . (lambda () (setq tab-width 4))))) + +(use-package lsp-mode + :ensure t + :hook + ((go-mode . lsp-deferred) + (lsp-mode . lsp-enable-which-key-integration)) + :commands (lsp lsp-deferred) + :config + (evil-define-key 'normal lsp-mode-map + (kbd "gd") 'lsp-find-definition + (kbd "gr") 'lsp-find-references) + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.git\\'")) + +(provide 'init-lang) diff --git a/.emacs.d/lisp/init-misc.el b/.emacs.d/lisp/init-misc.el new file mode 100644 index 0000000..07eef14 --- /dev/null +++ b/.emacs.d/lisp/init-misc.el @@ -0,0 +1,52 @@ +(setq tab-always-indent 'complete + completion-cycle-threshold t) + +(use-package recentf + :ensure nil + :config + (add-hook 'after-init-hook 'recentf-mode) + (setq-default + recentf-max-saved-items 1024 + recentf-exclude `("/tmp/"))) + +(use-package counsel + :after evil + :init + (evil-define-key 'normal ivy-mode-map + (kbd "fb") 'ivy-switch-buffer + (kbd "fm") 'counsel-recentf) + :config + (ivy-mode 1) + (setq ivy-use-virtual-buffers t) + (setq ivy-count-format "(%d/%d) ") + (setq ivy-re-builders-alist + '((read-file-name-internal . ivy--regex-fuzzy) + (t . ivy--regex-plus)))) + +(use-package vterm + :commands (vterm) + :config + (setq vterm-kill-buffer-on-exit t)) + +(use-package exec-path-from-shell + :if (memq window-system '(mac ns)) + :ensure t + :config + (exec-path-from-shell-initialize)) + +(use-package avy + :ensure t) + +(use-package company + :init + (setq company-global-modes + '(emacs-lisp-mode go-mode ledger-mode)) + :hook ((after-init . global-company-mode))) + +(use-package projectile + :init + (evil-define-key 'normal projectile-mode-map + (kbd "p") 'projectile-command-map) + :config + (setq projectile-cache-file (expand-file-name ".cache/projectile" user-emacs-directory)) + (projectile-mode 1)) diff --git a/.emacs.d/lisp/init-mu4e.el b/.emacs.d/lisp/init-mu4e.el new file mode 100644 index 0000000..8a2c5a6 Binary files /dev/null and b/.emacs.d/lisp/init-mu4e.el differ diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el new file mode 100644 index 0000000..caadeec --- /dev/null +++ b/.emacs.d/lisp/init-org.el @@ -0,0 +1,128 @@ +(use-package org + :ensure t + :after evil + :commands (org-mode org-agenda org-store-link org-capture) + :mode (("\\.org$" . org-mode)) + :hook ((org-mode . (lambda () (setq tab-width 4)))) + :init + (setq org-src-tab-acts-natively t) + (evil-define-key 'normal 'global + (kbd "a") 'org-agenda + (kbd "l") 'org-store-link + (kbd "c") 'org-capture) + :config + (require 'org-tempo) + (setq org-directory "~/notes/") + (setq org-default-notes-file (concat org-directory "/inbox.org")) + (setq org-capture-templates + '(("t" "TODO" entry (file+headline org-default-notes-file "Tasks") + "* TODO %?\nCaptured on %U\n %i\n %a") + ("j" "Journal" entry (file+datetree org-default-notes-file) + "* %?\nCaptured on %U\n %i\n %a"))) + (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil))) + (setq org-agenda-start-on-weekday 0) + (setq org-adapt-indentation nil) + (setq org-descriptive-links nil) + (evil-define-key 'normal org-mode-map + (kbd "TAB") 'org-cycle + (kbd "RET") 'org-open-at-point + (kbd "os") 'org-schedule + (kbd "od") 'org-deadline + (kbd "or") 'org-refile + (kbd "oil") 'org-insert-link + (kbd "oih") 'org-insert-heading + (kbd "oci") 'org-clock-in + (kbd "oco") 'org-clock-out + (kbd "sp") 'org-set-property) + (setq org-tags-exclude-from-inheritance + '("PROJECT")) + + ;; refile + (setq org-refile-targets '((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9)) + org-outline-path-complete-in-steps nil + org-refile-use-outline-path 'file) + + (setq org-stuck-projects + '("+PROJECT/-SOMEDAY-DONE-MAYBE" ("NEXT") ("@shop") + "\\")) + + ;; todo + (setq org-todo-keywords + '((sequence "TODO(t)" ; to do later + "NEXT" ; doing now or to do soon + "WAITING(w)" "SOMEDAY(s)" + "|" "DONE(d)" "CANCELED(c)"))) + (setq org-log-done t) + + ;; tags + (setq org-tag-alist '((:startgroup . nil) + ("@work" . ?w) ("@home" . ?h) ("errants" . ?e) + (:endgroup . nil) + ("phone" . ?p) + ("FLAGGED" . ?f) + ("URGENT" . ?u) + ("PROJECT" . ?p))) + + ;; org babel + (org-babel-do-load-languages + 'org-babel-load-languages + '((shell . t))) + + ;; org-habit + (add-to-list 'org-modules 'org-habit t)) + +(use-package org-agenda + :ensure nil + :after (org) + :commands (org-agenda) + :init + (setq org-agenda-dim-blocked-tasks nil) + (setq org-agenda-skip-deadline-prewarning-if-scheduled t) + + + (setq org-deadline-warning-days 10) + (setq org-agenda-compact-blocks t) + (setq org-agenda-custom-commands + '(("D" "Daily agenda and all TODOs" + ((agenda "" ((org-agenda-span 1))) + (tags-todo "+PRIORITY=\"A\"") + (tags-todo "computer|@office|phone") + (tags "PROJECT+CATEGORY=\"elephants\"") + (todo "WAITING")) + ((org-agenda-compact-blocks t))) + ("W" "Weekly Review" + ((agenda "" ((org-agenda-ndays-to-span 7))) + (stuck "") ; review stuck porjects as designated by org-stuck-projects + (todo "NEXT") + (todo "WAITING"))) + ("d" "Upcoming deadlines" agenda "" + ((org-agenda-time-grid nil) + (org-deadline-warning-days 365) + (org-agenda-entry-types '(:deadline)))) + ("c" "Weekly schedule" agenda "" + ((org-agenda-span 7) + (org-agenda-repeating-timestamp-show-all t) + (org-agenda-entry-types '(:deadline :scheduled)))) + ("g" . "GTD contexts") + ("gh" "Home" tags-todo "home") + ("p" . "Priorities") + ("pa" "A items" tags-todo "+PRIORITIES=\"A\"") + ("pb" "B items" tags-todo "+PRIORITIES=\"B\"") + ("pc" "C items" tags-todo "+PRIORITIES=\"C\"")))) + +(use-package evil-org + :ensure t + :after (org evil) + :hook (org-mode . (lambda () (evil-org-mode))) + :config + (evil-org-set-key-theme '(navigation insert textobjects additional calendar todo)) + (require 'evil-org-agenda) + (evil-org-agenda-set-keys) + (evil-define-key 'motion org-agenda-mode-map + (kbd "q") (lambda () + (interactive) + (org-save-all-org-buffers) + (org-agenda-quit)))) + +(provide 'init-org) diff --git a/.emacs.d/lisp/init-package.el b/.emacs.d/lisp/init-package.el new file mode 100644 index 0000000..5e6a0c7 --- /dev/null +++ b/.emacs.d/lisp/init-package.el @@ -0,0 +1,14 @@ +(require 'package) +(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/"))) +(setq package-enable-at-startup nil) +(package-initialize) + +(dolist (package '(use-package)) + (unless (package-installed-p package) + (package-refresh-contents) + (package-install package))) +(require 'use-package) +(setq use-package-always-ensure t) + +(provide 'init-package) diff --git a/.emacs.d/modes/init-evil-mode.el b/.emacs.d/modes/init-evil-mode.el deleted file mode 100644 index c15e403..0000000 --- a/.emacs.d/modes/init-evil-mode.el +++ /dev/null @@ -1,28 +0,0 @@ -(use-package evil - :ensure t - :hook ((evil-org-mode . (lambda () (setq evil-want-C-i-jump nil))) - (after-init . (lambda () (evil-mode 1)))) - :init - (setq evil-want-integration t - evil-want-C-u-scroll t - evil-wannt-fine-undo t - evil-want-keybinding nil - evil-disable-insert-state-bindings t) - :config - (evil-set-leader 'normal ",") - (evil-set-undo-system 'undo-tree)) - -(use-package evil-collection - :after evil - :ensure t -; :custom (evil-collection-setup-minibuffer t) - :config - (evil-collection-init)) - -(use-package evil-easymotion - :ensure t - :after (evil avy) - :config - (evilem-default-keybindings "SPC")) - -(provide 'init-evil-mode) diff --git a/.emacs.d/modes/init-lsp-mode.el b/.emacs.d/modes/init-lsp-mode.el deleted file mode 100644 index a44c722..0000000 --- a/.emacs.d/modes/init-lsp-mode.el +++ /dev/null @@ -1,13 +0,0 @@ -(use-package lsp-mode - :ensure t - :hook - ((go-mode . lsp-deferred) - (lsp-mode . lsp-enable-which-key-integration)) - :commands (lsp lsp-deferred) - :config - (evil-define-key 'normal lsp-mode-map - (kbd "gd") 'lsp-find-definition - (kbd "gr") 'lsp-find-references) - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.git\\'")) - -(provide 'init-lsp-mode) diff --git a/.emacs.d/modes/init-org-mode.el b/.emacs.d/modes/init-org-mode.el deleted file mode 100644 index 32bdc4f..0000000 --- a/.emacs.d/modes/init-org-mode.el +++ /dev/null @@ -1,128 +0,0 @@ -(use-package org - :ensure t - :after evil - :commands (org-mode org-agenda org-store-link org-capture) - :mode (("\\.org$" . org-mode)) - :hook ((org-mode . (lambda () (setq tab-width 4)))) - :init - (setq org-src-tab-acts-natively t) - (evil-define-key 'normal 'global - (kbd "a") 'org-agenda - (kbd "l") 'org-store-link - (kbd "c") 'org-capture) - :config - (require 'org-tempo) - (setq org-directory "~/notes/") - (setq org-default-notes-file (concat org-directory "/inbox.org")) - (setq org-capture-templates - '(("t" "TODO" entry (file+headline org-default-notes-file "Tasks") - "* TODO %?\nCaptured on %U\n %i\n %a") - ("j" "Journal" entry (file+datetree org-default-notes-file) - "* %?\nCaptured on %U\n %i\n %a"))) - (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil))) - (setq org-agenda-start-on-weekday 0) - (setq org-adapt-indentation nil) - (setq org-return-follows-link t) - (setq org-descriptive-links nil) - (evil-define-key 'normal org-mode-map - (kbd "TAB") 'org-cycle - (kbd "RET") 'org-open-at-point - (kbd "os") 'org-schedule - (kbd "od") 'org-deadline - (kbd "or") 'org-refile - (kbd "oil") 'org-insert-link - (kbd "oih") 'org-insert-heading - (kbd "oci") 'org-clock-in - (kbd "oco") 'org-clock-out) - (setq org-tags-exclude-from-inheritance - '("PROJECT")) - - ;; refile - (setq org-refile-targets '((nil :maxlevel . 9) - (org-agenda-files :maxlevel . 9)) - org-outline-path-complete-in-steps nil - org-refile-use-outline-path 'file) - - (setq org-stuck-projects - '("+PROJECT/-SOMEDAY-DONE-MAYBE" ("NEXT") ("@shop") - "\\")) - - ;; todo - (setq org-todo-keywords - '((sequence "TODO(t)" ; to do later - "NEXT" ; doing now or to do soon - "WAITING(w)" "SOMEDAY(s)" - "|" "DONE(d)" "CANCELED(c)"))) - (setq org-log-done t) - - ;; tags - (setq org-tag-alist '((:startgroup . nil) - ("@work" . ?w) ("@home" . ?h) ("errants" . ?e) - (:endgroup . nil) - ("phone" . ?p) - ("FLAGGED" . ?f) - ("URGENT" . ?u) - ("PROJECT" . ?p))) - - ;; org babel - (org-babel-do-load-languages - 'org-babel-load-languages - '((shell . t))) - - ;; org-habit - (add-to-list 'org-modules 'org-habit t)) - -(use-package org-agenda - :ensure nil - :after (org) - :commands (org-agenda) - :init - (setq org-agenda-dim-blocked-tasks nil) - (setq org-agenda-skip-deadline-prewarning-if-scheduled t) - - - (setq org-deadline-warning-days 10) - (setq org-agenda-compact-blocks t) - (setq org-agenda-custom-commands - '(("D" "Daily agenda and all TODOs" - ((agenda "" ((org-agenda-span 1))) - (tags-todo "+PRIORITY=\"A\"") - (tags-todo "computer|@office|phone") - (tags "PROJECT+CATEGORY=\"elephants\"") - (todo "WAITING")) - ((org-agenda-compact-blocks t))) - ("W" "Weekly Review" - ((agenda "" ((org-agenda-ndays-to-span 7))) - (stuck "") ; review stuck porjects as designated by org-stuck-projects - (todo "NEXT") - (todo "WAITING"))) - ("d" "Upcoming deadlines" agenda "" - ((org-agenda-time-grid nil) - (org-deadline-warning-days 365) - (org-agenda-entry-types '(:deadline)))) - ("c" "Weekly schedule" agenda "" - ((org-agenda-span 7) - (org-agenda-repeating-timestamp-show-all t) - (org-agenda-entry-types '(:deadline :scheduled)))) - ("g" . "GTD contexts") - ("gh" "Home" tags-todo "home") - ("p" . "Priorities") - ("pa" "A items" tags-todo "+PRIORITIES=\"A\"") - ("pb" "B items" tags-todo "+PRIORITIES=\"B\"") - ("pc" "C items" tags-todo "+PRIORITIES=\"C\"")))) - -(use-package evil-org - :ensure t - :after (org evil) - :hook (org-mode . (lambda () (evil-org-mode))) - :config - (evil-org-set-key-theme '(navigation insert textobjects additional calendar todo)) - (require 'evil-org-agenda) - (evil-org-agenda-set-keys) - (evil-define-key 'motion org-agenda-mode-map - (kbd "q") (lambda () - (interactive) - (org-save-all-org-buffers) - (org-agenda-quit)))) - -(provide 'init-org-mode) diff --git a/.emacs.d/site-lisp/load-config.el b/.emacs.d/site-lisp/load-config.el deleted file mode 100644 index 02f9113..0000000 --- a/.emacs.d/site-lisp/load-config.el +++ /dev/null @@ -1,6 +0,0 @@ -(defun load-config (filename &optional dirname) - (unless dirname (setq dirname "~/.dotfiles/.emacs.d/")) - (load (concat dirname (symbol-name filename)) 'noerror)) - -(defun load-mode (modename) - (load-config modename "~/.dotfiles/.emacs.d/modes/")) diff --git a/.gitattributes b/.gitattributes index b9aae35..0da544c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -.emacs.d/init-mu4e.el filter=git-crypt diff=git-crypt +.emacs.d/lisp/init-mu4e.el filter=git-crypt diff=git-crypt offlineimap/.offlineimaprc filter=git-crypt diff=git-crypt .mutt/muttrc filter=git-crypt diff=git-crypt .mutt/mailboxes filter=git-crypt diff=git-crypt diff --git a/.vim/init.vim b/.vim/init.vim index 275e838..73c025b 100644 --- a/.vim/init.vim +++ b/.vim/init.vim @@ -94,11 +94,6 @@ set tags=./.tags;,.tags " mapping let mapleader=',' " change the key -inoremap jk -nnoremap [w h -nnoremap [ww k -nnoremap ]w :wincmd l -nnoremap ]ww :wincmd j nnoremap cd :cd %:p:h :pwd source ~/.dotfiles/.vim/plugins/init.vim diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..ca2e734 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +dotfiles_dir=$(cd -- "$(dirname ${BASH_SOURCE})" > /dev/null 2>&1; pwd -P) + +ln -s $dotfiles_dir/.emacs.d $HOME/.emacs.d diff --git a/install.sh b/install.sh deleted file mode 100644 index e4a5761..0000000 --- a/install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -# install.sh - -check_is_sudo() { - if [ "$EUID" -ne 0 ]; then - echo "Please run as root." - exit - fi -} - -usage() { - echo "Usage: sudo bash install.sh [OPTION]" - echo " dotfiles - link all dotfiles" - echo " all - install all things listed above" -} - -get_dotfiles() { - # create subshell - ( - echo "--------- Get Dotfiles Now ---------" - - - cd "$HOME" - - rm -rf .vimrc .tmux.conf .bashrc .zshrc .i3/config .emacs.d/init.el .gitconfig - ln -s ~/.dotfiles/.tmux.conf .tmux.conf - ln -s ~/.dotfiles/.bashrc .bashrc - ln -s ~/.dotfiles/.zshrc .zshrc - ln -s ~/.dotfiles/.emacs.d/init.el .emacs.d/init.el - ln -s ~/.dotfiles/.i3/config .i3/config - ln -s ~/.dotfiles/.gitconfig .gitconfig - echo "source ~/.dotfiles/.vim/init.vim" > ~/.vimrc - ) -} - -main() { - local cmd=$1 - - if [[ -z "$cmd" ]]; then - usage - exit 1 - fi - - check_is_sudo - - if [[ $cmd == all ]]; then - get_dotfiles - fi -} - -main "$@" -- cgit v1.2.3