diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-18 15:42:54 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-18 15:42:54 +0200 |
commit | c0e718bf92781fcb8f53c8292d8d1a836431361d (patch) | |
tree | b207dab32f3a986d9da8231d4eceda1fdcfa7cf6 | |
parent | ZSH org config update (diff) | |
download | dotfiles-bsd-c0e718bf92781fcb8f53c8292d8d1a836431361d.tar.gz dotfiles-bsd-c0e718bf92781fcb8f53c8292d8d1a836431361d.tar.bz2 dotfiles-bsd-c0e718bf92781fcb8f53c8292d8d1a836431361d.tar.xz dotfiles-bsd-c0e718bf92781fcb8f53c8292d8d1a836431361d.tar.zst dotfiles-bsd-c0e718bf92781fcb8f53c8292d8d1a836431361d.zip |
Added emacs config
-rw-r--r-- | .emacs | 78 | ||||
-rw-r--r-- | .emacs.d/org/config.el | 718 | ||||
-rw-r--r-- | .emacs.d/org/config.org | 830 | ||||
-rw-r--r-- | .emacs.d/org/elfeed/elfeed.org | 48 | ||||
-rw-r--r-- | .gitignore | 2 |
5 files changed, 1676 insertions, 0 deletions
@@ -0,0 +1,78 @@ +(require 'org) +(org-babel-load-file + (expand-file-name "org/config.org" + user-emacs-directory)) +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(ansi-color-faces-vector + [default default default italic underline success warning error]) + '(ansi-color-names-vector + ["#282828" "#fb4934" "#8ec07c" "#fabd2f" "#268bd2" "#fb2874" "#83a598" "#ebdbb2"]) + '(custom-safe-themes + (quote + ("6a0d7f41968908e25b2f56fa7b4d188e3fc9a158c39ef680b349dccffc42d1c8" "3577ee091e1d318c49889574a31175970472f6f182a9789f1a3e9e4513641d86" "d71aabbbd692b54b6263bfe016607f93553ea214bc1435d17de98894a5c3a086" "a92e9da0fab90cbec4af4a2035602208cebf3d071ea547157b2bfc5d9bd4d48d" "79278310dd6cacf2d2f491063c4ab8b129fee2a498e4c25912ddaa6c3c5b621e" "c499bf4e774b34e784ef5a104347b81c56220416d56d5fd3fd85df8704260aad" "c0fef082e36bb01efb44c8becead9f1d56234d61d84a849370195ca26d09cfa0" "10845272b6fa47a6cdfc49816748bdb1dc1cb9be647801c25c054a8e6a27ef72" "1623aa627fecd5877246f48199b8e2856647c99c6acdab506173f9bb8b0a41ac" "76bfa9318742342233d8b0b42e824130b3a50dcc732866ff8e47366aed69de11" "3c2f28c6ba2ad7373ea4c43f28fcf2eed14818ec9f0659b1c97d4e89c99e091e" "7d708f0168f54b90fc91692811263c995bebb9f68b8b7525d0e2200da9bc903c" "54cf3f8314ce89c4d7e20ae52f7ff0739efb458f4326a2ca075bf34bc0b4f499" "c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" "2a749c20af891c16571527d07976bbcf2bf31819fa7d322942b73386019f4d58" "9b272154fb77a926f52f2756ed5872877ad8d73d018a426d44c6083d1ed972b1" "bc836bf29eab22d7e5b4c142d201bcce351806b7c1f94955ccafab8ce5b20208" "fe94e2e42ccaa9714dd0f83a5aa1efeef819e22c5774115a9984293af609fce7" "9efb2d10bfb38fe7cd4586afb3e644d082cbcdb7435f3d1e8dd9413cbe5e61fc" "71e5acf6053215f553036482f3340a5445aee364fb2e292c70d9175fb0cc8af7" "d74c5485d42ca4b7f3092e50db687600d0e16006d8fa335c69cf4f379dbd0eee" "be9645aaa8c11f76a10bcf36aaf83f54f4587ced1b9b679b55639c87404e2499" "6c3b5f4391572c4176908bb30eddc1718344b8eaff50e162e36f271f6de015ca" "123a8dabd1a0eff6e0c48a03dc6fb2c5e03ebc7062ba531543dfbce587e86f2a" "e1d09f1b2afc2fed6feb1d672be5ec6ae61f84e058cb757689edb669be926896" "a06658a45f043cd95549d6845454ad1c1d6e24a99271676ae56157619952394a" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "9f9450547564423166a7d2de976c9ca712293170415ec78ed98d198748b44a90" "bf387180109d222aee6bb089db48ed38403a1e330c9ec69fe1f52460a8936b66" "82360e5f96244ce8cc6e765eeebe7788c2c5f3aeb96c1a765629c5c7937c0b5b" "8e7728f26552444601c5caf8c1b5f1c4c4fd0ab4d6572b9979771576efa4077b" "3d3807f1070bb91a68d6638a708ee09e63c0825ad21809c87138e676a60bda5d" "34b3219ae11acd81b2bb7f3f360505019f17d7a486deb8bb9c1b6d13c6616d2e" "b89ae2d35d2e18e4286c8be8aaecb41022c1a306070f64a66fd114310ade88aa" "2cdc13ef8c76a22daa0f46370011f54e79bae00d5736340a5ddfe656a767fddf" "2f1518e906a8b60fac943d02ad415f1d8b3933a5a7f75e307e6e9a26ef5bf570" "9089d25e2a77e6044b4a97a2b9fe0c82351a19fdd3e68a885f40f86bbe3b3900" "7e5d400035eea68343be6830f3de7b8ce5e75f7ac7b8337b5df492d023ee8483" "bb28b083fe1c61848c10c049be076afc572ea9bee6e1f8dc2631c5ee4f7388c8" "c1c459af570241993823db87096bc775506c378aa02c9c6cd9ccaa8247056b96" "8ce796252a78d1a69e008c39d7b84a9545022b64609caac98dc7980d76ae34e3" "e2acbf379aa541e07373395b977a99c878c30f20c3761aac23e9223345526bcc" "939ea070fb0141cd035608b2baabc4bd50d8ecc86af8528df9d41f4d83664c6a" "4cf9ed30ea575fb0ca3cff6ef34b1b87192965245776afa9e9e20c17d115f3fb" "aded61687237d1dff6325edb492bde536f40b048eab7246c61d5c6643c696b7f" "15ba8081651869ec689c9004288bed79003de5b4ee9c51a9d4a208d9e3439706" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "k84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "8d5f22f7dfd3b2e4fc2f2da46ee71065a9474d0ac726b98f647bc3c7e39f2819" "b6f06081b007b57be61b82fb53f27315e2cf38fa690be50d6d63d2b62a408636" "d8a7a7d2cffbc55ec5efbeb5d14a5477f588ee18c5cddd7560918f9674032727" "a11043406c7c4233bfd66498e83600f4109c83420714a2bd0cd131f81cbbacea" "67b11ee5d10f1b5f7638035d1a38f77bca5797b5f5b21d16a20b5f0452cbeb46" "4c8372c68b3eab14516b6ab8233de2f9e0ecac01aaa859e547f902d27310c0c3" "b8c5adfc0230bd8e8d73450c2cd4044ad7ba1d24458e37b6dec65607fc392980" "b5cff93c3c6ed12d09ce827231b0f5d4925cfda018c9dcf93a2517ce3739e7f1" "cdc2a7ba4ecf0910f13ba207cce7080b58d9ed2234032113b8846a4e44597e41" "72c530c9c8f3561b5ab3bf5cda948cd917de23f48d9825b7a781fe1c0d737f2f" "780c67d3b58b524aa485a146ad9e837051918b722fd32fd1b7e50ec36d413e70" "73a13a70fd111a6cd47f3d4be2260b1e4b717dbf635a9caee6442c949fad41cd" "da538070dddb68d64ef6743271a26efd47fbc17b52cc6526d932b9793f92b718" "9b1c580339183a8661a84f5864a6c363260c80136bd20ac9f00d7e1d662e936a" "1b27e3b3fce73b72725f3f7f040fd03081b576b1ce8bbdfcb0212920aec190ad" default))) + '(fci-rule-color "#555556") + '(hl-todo-keyword-faces + (quote + (("TODO" . "#dc752f") + ("NEXT" . "#dc752f") + ("THEM" . "#2aa198") + ("PROG" . "#268bd2") + ("OKAY" . "#268bd2") + ("DONT" . "#d70000") + ("FAIL" . "#d70000") + ("DONE" . "#86dc2f") + ("NOTE" . "#875f00") + ("KLUDGE" . "#875f00") + ("HACK" . "#875f00") + ("TEMP" . "#875f00") + ("FIXME" . "#dc752f") + ("XXX+" . "#dc752f") + ("\\?\\?\\?+" . "#dc752f")))) + '(inhibit-startup-screen t) + '(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#fabd2f")) + '(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#8ec07c")) + '(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#555556")) + '(objed-cursor-color "#fb4934") + '(package-selected-packages + (quote + (toc-org evil-org org-bullets yaml-mode twittering-mode helm-slime helm-w3m helm-mu htmlize babel org-pdftools shell-pop which-key golden-ratio elfeed-org elfeed dmenu mingus lua-mode dionysos helm-c-yasnippet helm-emms emms font-lock-cl restart-emacs w3m string-utils go-mode major-mode-icons dired-icon mode-icons evil-collection sed-mode zones kaolin-themes gruvbox-theme helm-themes yasnippet-classic-snippets yasnippet-snippets auto-yasnippet php-auto-yasnippets el-autoyas yasnippet cargo evil-ediff windresize helm-make spacemacs-theme centaur-tabs evil-mu4e evil-magit dashboard slime ssh sudo-ext dockerfile-mode docker frame-local ov dash-functional helm-addressbook org-mime flyspell-correct pdf-tools websocket request emojify-logos emojify oauth2 circe mu4e-alert web-mode doom-themes doom-modeline all-the-icons-dired all-the-icons-gnus all-the-icons html5-schema phps-mode org-babel-eval-in-repl rust-mode smart-mode-line-powerline-theme eshell-prompt-extras eshell-fixed-prompt pyenv-mode s realgud-lldb neotree ranger ## color-theme-modern auto-complete-c-headers command-log-mode auto-complete magit smart-tabs-mode airline-themes paredit autopair tabbar-ruler tabbar use-package-el-get color-theme-approximate diminish rainbow-delimiters color-identifiers-mode use-package helm evil-visual-mark-mode))) + '(pdf-view-midnight-colors (cons "#282828" "#ebdbb2")) + '(pos-tip-background-color "#2E2A29") + '(pos-tip-foreground-color "#d4d4d6") + '(rustic-ansi-faces + ["#1c1e26" "#e95678" "#09f7a0" "#fab795" "#21bfc2" "#6c6f93" "#59e3e3" "#c7c9cb"]) + '(send-mail-function (quote smtpmail-send-it)) + '(tabbar-separator (quote (0.2))) + '(vc-annotate-background "#282828") + '(vc-annotate-color-map + (list + (cons 20 "#8ec07c") + (cons 40 "#b2bf62") + (cons 60 "#d5be48") + (cons 80 "#fabd2f") + (cons 100 "#fba827") + (cons 120 "#fc9420") + (cons 140 "#fe8019") + (cons 160 "#fd6237") + (cons 180 "#fb4555") + (cons 200 "#fb2874") + (cons 220 "#fb335e") + (cons 240 "#fa3e49") + (cons 260 "#fb4934") + (cons 280 "#d14c3c") + (cons 300 "#a84f45") + (cons 320 "#7e514d") + (cons 340 "#555556") + (cons 360 "#555556"))) + '(vc-annotate-very-old-color nil)) +(load-theme 'doom-palenight) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/.emacs.d/org/config.el b/.emacs.d/org/config.el new file mode 100644 index 0000000..ecaf1da --- /dev/null +++ b/.emacs.d/org/config.el @@ -0,0 +1,718 @@ +(setq x-alt-keysym 'meta) +(set-keyboard-coding-system 'utf-8) + +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) +(blink-cursor-mode 0) + +(set-frame-font "mononoki Nerd Font:pixelsize=15" nil t) +(add-hook 'prog-mode-hook 'display-line-numbers-mode) +(add-hook 'text-mode-hook 'display-line-numbers-mode) + +(setq scroll-step 5) +(setq scroll-margin 3) +(setq echo-keystrokes 0.1) +(setq initial-scratch-message nil) +(defalias 'yes-or-no-p 'y-or-n-p) + +(setq backup-directory-alist '(("." . "~/.emacs.d/backup")) + backup-by-copying t + version-control t + delete-old-versions t + kept-new-versions 20 + kept-old-versions 5) + +(require 'package) +(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/1")) + +(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") +(autoload 'mu4e "mu4e" "Launch mu4e and show the main window" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/sunrise-commander/") +(autoload 'sunrise "sunrise.el" "qweqwe" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/font-lock+") +(add-to-list 'load-path "/home/jozan/.emacs.d/all-the-icons/") +(add-to-list 'load-path "/home/jozan/.emacs.d/all-the-icons-dired/") +(add-to-list 'load-path "/home/jozan/.emacs.d/icons-in-terminal.el/") +(add-to-list 'load-path "/home/jozan/.emacs.d/gas-mode/") +(autoload 'gas-mode "gas-mode" "AT&T syntax for assembly code" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/monk-8/") +(autoload 'monk "monk" "Cool CD player" t) + +(setq package-enable-at-startup nil) +(setq package-check-signature nil) +(package-initialize) + +;; set key for agenda +(require 'org) +(global-set-key (kbd "C-c a") 'org-agenda) + +;;file to save todo items +(setq org-agenda-files (quote ("~/.emacs.d/org/todo/todo.org"))) + +;;set priority range from A to C with default A +(setq org-highest-priority ?A) +(setq org-lowest-priority ?C) +(setq org-default-priority ?A) + +;;set colours for priorities +(setq org-priority-faces '((?A . (:foreground "#F0DFAF" :weight bold)) + (?B . (:foreground "LightSteelBlue")) + (?C . (:foreground "OliveDrab")))) + +;;open agenda in current window +(setq org-agenda-window-setup (quote current-window)) + +;;capture todo items using C-c C-t t +(define-key global-map (kbd "C-c C-t") 'org-capture) +(setq org-capture-templates + '(("t" "todo" entry (file+headline "/home/jozan/.emacs.d/org/todo/todo.org" "Tasks") + "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n"))) + +;;open agenda in current window +(setq org-agenda-window-setup (quote current-window)) +;;warn me of any deadlines in next 7 days +(setq org-deadline-warning-days 7) +;;show me tasks scheduled or due in next fortnight +(setq org-agenda-span (quote fortnight)) +;;don't show tasks as scheduled if they are already shown as a deadline +(setq org-agenda-skip-scheduled-if-deadline-is-shown t) +;;don't give awarning colour to tasks with impending deadlines +;;if they are scheduled to be done +(setq org-agenda-skip-deadline-prewarning-if-scheduled (quote pre-scheduled)) +;;don't show tasks that are scheduled or have deadlines in the +;;normal todo list +(setq org-agenda-todo-ignore-deadlines (quote all)) +(setq org-agenda-todo-ignore-scheduled (quote all)) +;;sort tasks in order of when they are due and then by priority +(setq org-agenda-sorting-strategy + (quote + ((agenda deadline-up priority-down) + (todo priority-down category-keep) + (tags priority-down category-keep) + (search category-keep)))) + +(org-babel-do-load-languages + 'org-babel-load-languages '((C . t ))) +(org-babel-do-load-languages + 'org-babel-load-languages '((lisp . t))) + +(setq evil-want-integration t) ;; This is optional since it's already set to t by default. +(setq evil-want-keybinding nil) +(setq evil-want-C-u-scroll t) +(require 'evil) +(require 'evil-org) +(require 'evil-magit) +(require 'evil-mu4e) +(require 'evil-collection) +(evil-mode t) +;; (evil-collection-init) + + +(setq evil-emacs-state-cursor '("#b16286" box)) +(setq evil-normal-state-cursor '("#d79921" box)) +(setq evil-visual-state-cursor '("#b16286" box)) +(setq evil-insert-state-cursor '("#d79921" bar)) +(setq evil-replace-state-cursor '("#cc241d" hbar)) +(setq evil-operator-state-cursor '("#d79921" hbar)) + + +(evil-define-key 'insert global-map (kbd "C-o") 'delete-other-windows) +(evil-define-key 'insert global-map (kbd "C-k") 'windmove-up) +(evil-define-key 'insert global-map (kbd "C-j") 'windmove-down) +(evil-define-key 'insert global-map (kbd "C-h") 'windmove-left) +(evil-define-key 'insert global-map (kbd "C-l") 'windmove-right) +(evil-define-key 'normal global-map (kbd "C-o") 'delete-other-windows) +(evil-define-key 'normal global-map (kbd "C-k") 'windmove-up) +(evil-define-key 'normal global-map (kbd "C-j") 'windmove-down) +(evil-define-key 'normal global-map (kbd "C-h") 'windmove-left) +(evil-define-key 'normal global-map (kbd "C-l") 'windmove-right) + +(global-evil-leader-mode) +(evil-leader/set-leader ",") +(setq evil-leader/in-all-states 1) + +(require 'evil-search-highlight-persist) +(global-evil-search-highlight-persist 1) + +(evil-leader/set-key "SPC" 'evil-search-highlight-persist-remove-all) + +(require 'centaur-tabs) +(centaur-tabs-mode t) +(centaur-tabs-group-by-projectile-project) + +(evil-define-key 'insert global-map (kbd "M-k") 'centaur-tabs-backward) +(evil-define-key 'insert global-map (kbd "M-j") 'centaur-tabs-forward) +(evil-define-key 'normal global-map (kbd "M-k") 'centaur-tabs-backward) +(evil-define-key 'normal global-map (kbd "M-j") 'centaur-tabs-forward) +(global-set-key (kbd "M-k") 'centaur-tabs-backward) +(global-set-key (kbd "M-j") 'centaur-tabs-forward) + +(setq centaur-tabs-set-icons t + centaur-tabs-gray-out-icons 'buffer + centaur-tabs-set-close-button nil + centaur-tabs-set-modified-marker t + centaur-tabs-modified-marker "[+]" + centaur-tabs-height 24 + centaur-tabs-style "bar" + centaur-tabs-set-bar 'left) + +(defun centaur-tabs-hide-tab (x) + (let ((name (format "%s" x))) + (or + (string-prefix-p "*epc" name) + (string-prefix-p "*helm" name) + (string-prefix-p "*Helm" name) + (string-prefix-p "*Compile-Log*" name) + (string-prefix-p "*lsp" name) + (string-prefix-p "*elfeed-log*" name) + (string-prefix-p "*scratch*" name) + (string-prefix-p "*Messages*" name) + (string-prefix-p "todo.org" name) + (and (string-prefix-p "magit" name) + (not (file-name-extension name)))))) + +(add-hook 'dashboard-mode-hook #'centaur-tabs-local-mode) +(add-hook 'neotree-mode-hook #'centaur-tabs-local-mode) +(add-hook 'calendar-mode-hook #'centaur-tabs-local-mode) +(add-hook 'org-agenda-mode-hook #'centaur-tabs-local-mode) +(add-hook 'helpful-mode-hook #'centaur-tabs-local-mode) +(add-hook 'term-mode-hook #'centaur-tabs-local-mode) + +(require 'dashboard) +(dashboard-setup-startup-hook) + +(setq dashboard-banner-logo-title "Welcome back to Emacs, partner!" + dashboard-startup-banner 'official + dashboard-set-init-info nil + dashboard-set-footer nil + dashboard-center-content t + dashboard-show-shortcuts nil + dashboard-set-heading-icons t + dashboard-set-file-icons nil + dashboard-set-navigator t + show-week-agenda-p t) + +(setq dashboard-items '((projects . 10) + (recents . 15) + (agenda . 5))) + +(add-to-list 'evil-emacs-state-modes 'dashboard-mode) + +(require 'golden-ratio) +(golden-ratio-mode 1) +(setq golden-ratio-adjust-factor .9 + golden-ratio-wide-adjust-factor .9) + +(require 'org-mime) +(require 'mu4e) +(require 'cl) + +(setq mu4e-maildir (expand-file-name "/home/jozan/Maildir")) + +(setq mu4e-get-mail-command "/usr/local/bin/mbsync -c /home/jozan/.emacs.d/mu4e/.mbsyncrc -a") +(setq mu4e-update-interval 300) +(setq mu4e-index-update-in-background t) +(setq mu4e-headers-auto-update t) +(setq mu4e-index-update-error-warning t) +(setq mu4e-compose-signature-auto-include nil) +(setq mu4e-compose-format-flowed t) +(setq mu4e-view-prefer-html t) +(add-to-list 'mu4e-view-actions + '("ViewInBrowser" . mu4e-action-view-in-browser) t) + +;; enable inline images +(setq mu4e-view-show-images t) + +;; use imagemagick, if available +(when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) + +;; every new email composition gets its own frame! +(setq mu4e-compose-in-new-frame t) + +;; don't save message to Sent Messages, IMAP takes care of this +(setq mu4e-sent-messages-behavior 'delete) + +(add-hook 'mu4e-view-mode-hook #'visual-line-mode) + +;; <tab> to navigate to links, <RET> to open them in browser +(add-hook 'mu4e-view-mode-hook + (lambda() + ;; try to emulate some of the eww key-bindings + (local-set-key (kbd "<RET>") 'mu4e~view-browse-url-from-binding) + (local-set-key (kbd "<tab>") 'shr-next-link) + (local-set-key (kbd "<backtab>") 'shr-previous-link))) + +;; from https://www.reddit.com/r/emacs/comments/bfsck6/mu4e_for_dummies/elgoumx +(add-hook 'mu4e-headers-mode-hook + (defun my/mu4e-change-headers () + (interactive) + (setq mu4e-headers-fields + `((:human-date . 25) ;; alternatively, use :date + (:flags . 6) + (:from . 22) + (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject + (:size . 7))))) + +;; spell check +(add-hook 'mu4e-compose-mode-hook + (defun my-do-compose-stuff () + "My settings for message composition." + (visual-line-mode) + (org-mu4e-compose-org-mode) + (use-hard-newlines -1) + (flyspell-mode))) + +(require 'smtpmail) + +;;rename files when moving +;;NEEDED FOR MBSYNC +(setq mu4e-change-filenames-when-moving t) + +;;set up queue for offline email +;;use mu mkdir ~/Maildir/acc/queue to set up first +(setq smtpmail-queue-mail nil) ;; start in normal mode + +;;from the info manual +(setq mu4e-attachment-dir "/home/jozan/Downloads") + +(setq message-kill-buffer-on-exit t) +(setq mu4e-compose-dont-reply-to-self t) +(setq mu4e-completing-read-function 'completing-read) + +;; (require 'org-mu4e) + +;; convert org mode to HTML automatically +;; (setq org-mu4e-convert-to-html t) + +;;from vxlabs config +;; show full addresses in view message (instead of just names) +;; toggle per name with M-RET +(setq mu4e-view-show-addresses 't) + +;; don't ask when quitting +(setq mu4e-confirm-quit nil) + +;; mu4e-context +(setq mu4e-context-policy 'pick-first) +(setq mu4e-compose-context-policy 'always-ask) +(setq mu4e-contexts + (list + (make-mu4e-context + :name "work" ;;for acc1-gmail + :enter-func (lambda () (mu4e-message "Entering context work")) + :leave-func (lambda () (mu4e-message "Leaving context work")) + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches + msg '(:from :to :cc :bcc) "bousset.rudy@gmail.com"))) + :vars '((user-mail-address . "bousset.rudy@gmail.com") + (user-full-name . "Rudy Bousset") + (mu4e-sent-folder . "/acc1-gmail/[acc1].Sent Mail") + (mu4e-drafts-folder . "/acc1-gmail/[acc1].drafts") + (mu4e-trash-folder . "/acc1-gmail/[acc1].Trash") + (mu4e-compose-signature . (concat "Formal Signature\n" " ")) + (mu4e-compose-format-flowed . t) + (smtpmail-queue-dir . "~/Maildir/acc1-gmail/queue/cur") + ;; (message-send-mail-function . smtpmail-send-it) + (smtpmail-smtp-user . "bousset.rudy") + ;; (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil))) + ;; (smtpmail-auth-credentials . (expand-file-name "~/.authinfo.gpg")) + (smtpmail-default-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-service . 587) + (smtpmail-debug-info . t) + (smtpmail-debug-verbose . t) + (mu4e-maildir-shortcuts . ( ("/acc1-gmail/INBOX" . ?i) + ("/acc1-gmail/[acc1].Sent Mail" . ?s) + ("/acc1-gmail/[acc1].Trash" . ?t) + ("/acc1-gmail/[acc1].All Mail" . ?a) + ("/acc1-gmail/[acc1].Starred" . ?r) + ("/acc1-gmail/[acc1].drafts" . ?d) + )))))) + +(require 'mu4e-alert) +(mu4e-alert-set-default-style 'libnotify) +(add-hook 'after-init-hook #'mu4e-alert-enable-notifications) +(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display) + +(require 'w3m-load) +(setq w3m-home-page "https://start.duckduckgo.com/") +(setq w3m-default-display-inline-images t) + +(require 'origami) +(add-hook 'prog-mode-hook 'origami-mode) + +(require 'neotree) +(setq neo-vc-integration '(face)) +(evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) +(evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-quick-look) +(evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) +(evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) +(evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) +(evil-define-key 'normal neotree-mode-map (kbd "n") 'neotree-next-line) +(evil-define-key 'normal neotree-mode-map (kbd "p") 'neotree-previous-line) +(evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) +(evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) +(evil-define-key 'normal neotree-mode-map (kbd "|") 'neotree-enter-vertical-split) +(evil-define-key 'normal neotree-mode-map (kbd "S") 'neotree-enter-vertical-split) +(evil-define-key 'normal neotree-mode-map (kbd "/") 'neotree-enter-horizontal-split) +(evil-define-key 'normal neotree-mode-map (kbd "s") 'neotree-enter-horizontal-split) + +(require 'helm-config) +(require 'helm-misc) +(require 'helm-projectile) +(require 'helm-locate) + +(global-set-key (kbd "M-x") 'helm-M-x) +(global-set-key (kbd "C-x C-f") #'helm-find-files) +(global-set-key (kbd "M-p") #'helm-projectile-switch-project) +(global-set-key (kbd "C-x C-b") #'helm-buffers-list) +(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) +(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) +(define-key helm-map (kbd "C-z") 'helm-select-action) + +(setq helm-quick-update t + helm-bookmark-show-location t + helm-buffers-fuzzy-matching t + helm-make-executable "/usr/local/bin/gmake" + helm-make-nproc 5 + helm-split-window-in-side-p t) + +(defun helm-my-buffers () + (interactive) + (let ((helm-ff-transformer-show-only-basename nil)) + (helm-other-buffer '(helm-c-source-buffers-list + helm-c-source-elscreen + helm-c-source-projectile-files-list + helm-c-source-ctags + helm-c-source-recentf + helm-c-source-locate) + "*helm-my-buffers*"))) + +(helm-mode 1) +(projectile-mode +1) + +(setq display-time-string-forms + '((propertize (concat " " 24-hours ":" minutes " ")))) + +(require 'doom-modeline) +(doom-modeline-mode 1) +(setq doom-modeline-height 1) +(setq doom-modeline-project-detection 'projectile) +(setq doom-modeline-buffer-file-name-style 'truncate-upto-project) +(setq doom-modeline-icon (display-graphic-p)) +(setq doom-modeline-major-mode-icon t) +(setq doom-modeline-major-mode-color-icon t) +(setq doom-modeline-buffer-state-icon t) +(setq doom-modeline-buffer-modification-icon t) +(setq doom-modeline-unicode-fallback t) +(setq doom-modeline-enable-word-count nil) +(setq doom-modeline-buffer-encoding nil) +(setq doom-modeline-indent-info nil) +(setq doom-modeline-checker-simple-format t) +(setq doom-modeline-number-limit 99) +(setq doom-modeline-vcs-max-length 12) +(setq doom-modeline-persp-name t) +(setq doom-modeline-lsp t) +(setq doom-modeline-github nil) +(setq doom-modeline-github-interval (* 30 60)) +(setq doom-modeline-modal-icon t) +(setq doom-modeline-mu4e t) +(setq doom-modeline-gnus nil) +(setq doom-modeline-irc t) +(setq doom-modeline-irc-stylize 'identity) +(setq doom-modeline-env-version t) +(setq doom-modeline-env-python-executable "python-shell-interpreter") +(setq doom-modeline-env-ruby-executable "ruby") +(setq doom-modeline-env-perl-executable "perl") +(setq doom-modeline-env-go-executable "go") +(setq doom-modeline-env-elixir-executable "iex") +(setq doom-modeline-env-rust-executable "rustc") +(setq doom-modeline-env-load-string "...") +(setq doom-modeline-before-update-env-hook nil) +(setq doom-modeline-after-update-env-hook nil) +;; (display-battery-mode) +(column-number-mode) +(display-time) +(doom-themes-neotree-config) + +(require 'color-identifiers-mode) +(global-color-identifiers-mode) + +(require 'rainbow-delimiters) +(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) + +(require 'auto-complete) + +(require 'auto-complete-config) +(ac-config-default) + +(setq c-default-style "bsd") + +(require 'autopair) +(autopair-global-mode) + +(require 'paredit) +(defadvice paredit-mode (around disable-autopairs-around (arg)) + ad-do-it + (if (null ad-return-value) + (autopair-mode 1) + (autopair-mode -1) +)) +(ad-activate 'paredit-mode) + +(require 'magit) + +(defun my/magit-kill-buffers () + "Restore window configuration and kill all Magit buffers. +Attribution: URL `https://manuel-uberti.github.io/emacs/2018/02/17/magit-bury-buffer/'" + (interactive) + (let ((buffers (magit-mode-get-buffers))) + (magit-restore-window-configuration) + (mapc #'kill-buffer buffers))) + +(bind-key "q" #'my/magit-kill-buffers magit-status-mode-map) +(evil-define-key 'insert magit-status-mode-map (kbd "q") #'my/magit-kill-buffers) +(evil-define-key 'normal magit-status-mode-map (kbd "q") #'my/magit-kill-buffers) + +(require 'ranger) +(ranger-override-dired-mode t) +(add-hook 'dired-mode-hook 'auto-revert-mode) + +(require 'realgud-lldb) + +(defun my/toggle-window-dedicated () + "Control whether or not Emacs is allowed to display another +buffer in current window." + (interactive) + (message + (if (let (window (get-buffer-window (current-buffer))) + (set-window-dedicated-p window (not (window-dedicated-p window)))) + "%s: locked" + "%s is up for grabs") + (current-buffer))) + +(global-set-key (kbd "C-c t") 'my/toggle-window-dedicated) + +(require 'evil-nerd-commenter) +(evilnc-default-hotkeys) + +(require 'cargo) +(add-hook 'rust-mode-hook 'cargo-minor-mode) + +(require 'yasnippet) +(require 'yasnippet-snippets) +(require 'yasnippet-classic-snippets) +(require 'helm-c-yasnippet) +(yas-reload-all) +(add-hook 'prog-mode-hook #'yas-minor-mode) + +(defun minibuffer-keyboard-quit () + "Abort recursive edit. +In Delete Selection mode, if the mark is active, just deactivate it; +then it takes a second \\[keyboard-quit] to abort the minibuffer." + (interactive) + (if (and delete-selection-mode transient-mark-mode mark-active) + (setq deactivate-mark t) + (when (get-buffer "*Completions*") (delete-windows-on "*Completions*")) + (abort-recursive-edit))) +(define-key evil-normal-state-map [escape] 'keyboard-quit) +(define-key evil-visual-state-map [escape] 'keyboard-quit) +(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit) +(global-set-key [escape] 'evil-exit-emacs-state) + +(defun my/insert-tab-char () + "Insert a tab char. (ASCII 9, \t)" + (interactive) + (insert "\t")) + +(define-key evil-insert-state-map [tab] 'my/insert-tab-char) +(setq-default indent-tabs-mode t) +(setq tab-always-indent 'complete) +(setq-default tab-width 4) +(setq tab-width 4) +(defvaralias 'c-basic-offset 'tab-width) +(defvaralias 'cperl-indent-level 'tab-width) + +(require 'font-lock) +(require 'font-lock+) +(require 'all-the-icons) +(load "all-the-icons-dired.el") +(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) + +(require 'mingus) +(add-to-list 'evil-emacs-state-modes 'mingus-help-mode) +(add-to-list 'evil-emacs-state-modes 'mingus-playlist-mode) +(add-to-list 'evil-emacs-state-modes 'mingus-browse-mode) + +(require 'url) +(require 'elfeed) +(require 'elfeed-org) +(elfeed-org) +(setq rmh-elfeed-org-files (list "~/.emacs.d/org/elfeed/elfeed.org")) + +(defun my/elfeed-show-all () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-all")) + +(defun my/elfeed-show-news () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-news")) + +(defun my/elfeed-show-youtube () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-youtube")) + +(defun my/elfeed-load-db-and-open () + (interactive) + (elfeed-db-load) + (elfeed) + (elfeed-search-update--force)) + +(defun my/elfeed-save-db-and-bury () + (interactive) + (elfeed-db-save) + (kill-buffer "*elfeed-log*") + (kill-buffer "*elfeed-search*") + (kill-buffer "elfeed.org")) + +(defun my/elfeed-v-mpv (url) + "Watch a video from URL in MPV" + (setq quality (completing-read "Max height resolution (0 for unlimited): " '("0" "360" "480" "720" "1080"))) + (setq fmt (if (= 0 (string-to-number quality)) "" (format "--ytdl-format=bestvideo[height<=?%s]+bestaudio/best" quality))) + (async-shell-command (format "mpv \"%s\" \"%s\"" fmt url))) + + +(defun my/elfeed-view-mpv (&optional use-generic-p) + "Youtube-feed link" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (my/elfeed-v-mpv it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + +(defun my/elfeed-d-download (url) + "Download media links" + (async-shell-command (format "cd ~/Downloads && curl -O \"%s\"" url))) + +(defun my/elfeed-download-link (&optional use-generic-p) + "Download media links" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (my/elfeed-d-download it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + +(define-key elfeed-search-mode-map (kbd "q") 'my/elfeed-save-db-and-bury) +(define-key elfeed-search-mode-map (kbd "A") 'my/elfeed-show-all) +(define-key elfeed-search-mode-map (kbd "N") 'my/elfeed-show-news) +(define-key elfeed-search-mode-map (kbd "Y") 'my/elfeed-show-youtube) +(define-key elfeed-search-mode-map (kbd "v") 'my/elfeed-view-mpv) +(define-key elfeed-search-mode-map (kbd "d") 'my/elfeed-download-link) +(define-key elfeed-search-mode-map (kbd "h") 'backward-char) +(define-key elfeed-search-mode-map (kbd "j") 'forward-line) +(define-key elfeed-search-mode-map (kbd "k") 'previous-line) +(define-key elfeed-search-mode-map (kbd "l") 'forward-char) + +(add-to-list 'evil-emacs-state-modes 'elfeed-search-mode) +(add-to-list 'evil-emacs-state-modes 'elfeed-show-mode) + +(require 'which-key) +(which-key-mode) + +(require 'shell-pop) +(setq my/shell-pop-shell-type + (quote + ("ansi-term" "*ansi-term*" + (lambda nil + (ansi-term shell-pop-term-shell))))) + +(setq shell-pop-term-shell "/usr/local/bin/zsh") + +(require 'org-bullets) +(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) + +(require 'toc-org) +(add-hook 'org-mode-hook 'toc-org-mode) +;; enable in markdown, too +(add-hook 'markdown-mode-hook 'toc-org-mode) +(define-key markdown-mode-map (kbd "\C-c\C-o") 'toc-org-markdown-follow-thing-at-point) + +(setq compilation-finish-function +(lambda (buf str) + (if (null (string-match ".*exited abnormally.*" str)) + ;;no errors, make the compilation window go away in a few seconds + (progn + (run-at-time + "0.5 sec" nil 'delete-windows-on + (get-buffer-create "*compilation*")) + (message ""))))) + +;; (defvar my/cargo-f5-minor-mode-map +;; (let ((map (make-sparse-keymap))) +;; (define-key map [f5] 'cargo-process-run) +;; map) +;; "my/cargo-f5-minor-mode keymap") + +;; (define-minor-mode my/cargo-f5-minor-mode +;; "A minor mode to execute cargo run with F5 in rust-mode only" +;; :init-value t +;; :lighter " my/cargo") + +;; (my/cargo-f5-minor-mode 0) + +;; (defun my/roff-comp () +;; ;; (interactive) +;; (defvar name) +;; (defvar ext) +;; (defvar exec) +;; (setq name (file-name-sans-extension buffer-file-name)) +;; (setq ext (file-name-extension buffer-file-name)) +;; (if (string-match "ms" ext) +;; (setq exec (format "%s%s%s%s%s%s%s" "nroff -ms " name "." ext " -Tpdf -Kutf8 -Wall > " name ".pdf"))) +;; (if (string-match "ms" ext) +;; (shell-command exec))) + +;; (add-hook 'after-save-hook 'my/roff-comp) + +(defun my/exec-f5 () + (interactive) + (defvar make) + (setq make "gmake -j5 asan") + (save-buffer) + (compile make) + (compilation-finish-function)) + +(defun my/exec-f6 () + (interactive) + (defvar exec) + (setq exec "./a.out; ret=$?; echo \"\e[1;35m~>\"; if [ $ret -ne 0 ]; then echo -n \"\e[1;31m$ret\"; if [ $ret -eq 127 ]; then echo \" - Missing a.out, comipler error! \"; exit; elif [ $ret -eq 134 ]; then echo \" - Abort! \"; elif [ $ret -eq 138 ]; then echo \" - Bus error! \"; elif [ $ret -eq 139 ]; then echo \" - Segmentation fault! \"; fi; fi; echo \"\e[1;35m\n\n.emacs v1.5 Tilde Edition by Joe\"") + (async-shell-command exec)) + +(global-set-key [f1] 'shell-pop) +(global-set-key [f2] 'neotree-toggle) +(global-set-key [f4] 'helm-make-projectile) +(global-set-key [f5] 'my/exec-f5) +(global-set-key [f6] 'my/exec-f6) +(global-set-key (kbd "C-x d") 'ranger) +(global-set-key (kbd "M-1") 'ranger) +;; (add-hook 'rust-mode-hook 'my/cargo-f5-minor-mode) + +(shell-pop--set-shell-type 'my/shell-pop-shell-type my/shell-pop-shell-type) diff --git a/.emacs.d/org/config.org b/.emacs.d/org/config.org new file mode 100644 index 0000000..d83109a --- /dev/null +++ b/.emacs.d/org/config.org @@ -0,0 +1,830 @@ +* My emacs config +** Basic configs +#+BEGIN_SRC emacs-lisp +(setq x-alt-keysym 'meta) +(set-keyboard-coding-system 'utf-8) + +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) +(blink-cursor-mode 0) + +(set-frame-font "mononoki Nerd Font:pixelsize=15" nil t) +(add-hook 'prog-mode-hook 'display-line-numbers-mode) +(add-hook 'text-mode-hook 'display-line-numbers-mode) + +(setq scroll-step 5) +(setq scroll-margin 3) +(setq echo-keystrokes 0.1) +(setq initial-scratch-message nil) +(defalias 'yes-or-no-p 'y-or-n-p) + +(setq backup-directory-alist '(("." . "~/.emacs.d/backup")) + backup-by-copying t + version-control t + delete-old-versions t + kept-new-versions 20 + kept-old-versions 5) +#+END_SRC + +** MELPA and non-MELPA +#+BEGIN_SRC emacs-lisp +(require 'package) +(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/1")) + +(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") +(autoload 'mu4e "mu4e" "Launch mu4e and show the main window" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/sunrise-commander/") +(autoload 'sunrise "sunrise.el" "qweqwe" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/font-lock+") +(add-to-list 'load-path "/home/jozan/.emacs.d/all-the-icons/") +(add-to-list 'load-path "/home/jozan/.emacs.d/all-the-icons-dired/") +(add-to-list 'load-path "/home/jozan/.emacs.d/icons-in-terminal.el/") +(add-to-list 'load-path "/home/jozan/.emacs.d/gas-mode/") +(autoload 'gas-mode "gas-mode" "AT&T syntax for assembly code" t) +(add-to-list 'load-path "/home/jozan/.emacs.d/monk-8/") +(autoload 'monk "monk" "Cool CD player" t) + +(setq package-enable-at-startup nil) +(setq package-check-signature nil) +(package-initialize) +#+END_SRC + +** Some org +#+BEGIN_SRC emacs-lisp +;; set key for agenda +(require 'org) +(global-set-key (kbd "C-c a") 'org-agenda) + +;;file to save todo items +(setq org-agenda-files (quote ("~/.emacs.d/org/todo/todo.org"))) + +;;set priority range from A to C with default A +(setq org-highest-priority ?A) +(setq org-lowest-priority ?C) +(setq org-default-priority ?A) + +;;set colours for priorities +(setq org-priority-faces '((?A . (:foreground "#F0DFAF" :weight bold)) + (?B . (:foreground "LightSteelBlue")) + (?C . (:foreground "OliveDrab")))) + +;;open agenda in current window +(setq org-agenda-window-setup (quote current-window)) + +;;capture todo items using C-c C-t t +(define-key global-map (kbd "C-c C-t") 'org-capture) +(setq org-capture-templates + '(("t" "todo" entry (file+headline "/home/jozan/.emacs.d/org/todo/todo.org" "Tasks") + "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n"))) + +;;open agenda in current window +(setq org-agenda-window-setup (quote current-window)) +;;warn me of any deadlines in next 7 days +(setq org-deadline-warning-days 7) +;;show me tasks scheduled or due in next fortnight +(setq org-agenda-span (quote fortnight)) +;;don't show tasks as scheduled if they are already shown as a deadline +(setq org-agenda-skip-scheduled-if-deadline-is-shown t) +;;don't give awarning colour to tasks with impending deadlines +;;if they are scheduled to be done +(setq org-agenda-skip-deadline-prewarning-if-scheduled (quote pre-scheduled)) +;;don't show tasks that are scheduled or have deadlines in the +;;normal todo list +(setq org-agenda-todo-ignore-deadlines (quote all)) +(setq org-agenda-todo-ignore-scheduled (quote all)) +;;sort tasks in order of when they are due and then by priority +(setq org-agenda-sorting-strategy + (quote + ((agenda deadline-up priority-down) + (todo priority-down category-keep) + (tags priority-down category-keep) + (search category-keep)))) + +(org-babel-do-load-languages + 'org-babel-load-languages '((C . t ))) +(org-babel-do-load-languages + 'org-babel-load-languages '((lisp . t))) +#+END_SRC + +** Core packages +*** Evil mode +#+BEGIN_SRC emacs-lisp +(setq evil-want-integration t) ;; This is optional since it's already set to t by default. +(setq evil-want-keybinding nil) +(setq evil-want-C-u-scroll t) +(require 'evil) +(require 'evil-org) +(require 'evil-magit) +(require 'evil-mu4e) +(require 'evil-collection) +(evil-mode t) +;; (evil-collection-init) + + +(setq evil-emacs-state-cursor '("#b16286" box)) +(setq evil-normal-state-cursor '("#d79921" box)) +(setq evil-visual-state-cursor '("#b16286" box)) +(setq evil-insert-state-cursor '("#d79921" bar)) +(setq evil-replace-state-cursor '("#cc241d" hbar)) +(setq evil-operator-state-cursor '("#d79921" hbar)) + + +(evil-define-key 'insert global-map (kbd "C-o") 'delete-other-windows) +(evil-define-key 'insert global-map (kbd "C-k") 'windmove-up) +(evil-define-key 'insert global-map (kbd "C-j") 'windmove-down) +(evil-define-key 'insert global-map (kbd "C-h") 'windmove-left) +(evil-define-key 'insert global-map (kbd "C-l") 'windmove-right) +(evil-define-key 'normal global-map (kbd "C-o") 'delete-other-windows) +(evil-define-key 'normal global-map (kbd "C-k") 'windmove-up) +(evil-define-key 'normal global-map (kbd "C-j") 'windmove-down) +(evil-define-key 'normal global-map (kbd "C-h") 'windmove-left) +(evil-define-key 'normal global-map (kbd "C-l") 'windmove-right) + +(global-evil-leader-mode) +(evil-leader/set-leader ",") +(setq evil-leader/in-all-states 1) + +(require 'evil-search-highlight-persist) +(global-evil-search-highlight-persist 1) + +(evil-leader/set-key "SPC" 'evil-search-highlight-persist-remove-all) +#+END_SRC + +*** Centaur tabs +#+BEGIN_SRC emacs-lisp +(require 'centaur-tabs) +(centaur-tabs-mode t) +(centaur-tabs-group-by-projectile-project) + +(evil-define-key 'insert global-map (kbd "M-k") 'centaur-tabs-backward) +(evil-define-key 'insert global-map (kbd "M-j") 'centaur-tabs-forward) +(evil-define-key 'normal global-map (kbd "M-k") 'centaur-tabs-backward) +(evil-define-key 'normal global-map (kbd "M-j") 'centaur-tabs-forward) +(global-set-key (kbd "M-k") 'centaur-tabs-backward) +(global-set-key (kbd "M-j") 'centaur-tabs-forward) + +(setq centaur-tabs-set-icons t + centaur-tabs-gray-out-icons 'buffer + centaur-tabs-set-close-button nil + centaur-tabs-set-modified-marker t + centaur-tabs-modified-marker "[+]" + centaur-tabs-height 24 + centaur-tabs-style "bar" + centaur-tabs-set-bar 'left) + +(defun centaur-tabs-hide-tab (x) + (let ((name (format "%s" x))) + (or + (string-prefix-p "*epc" name) + (string-prefix-p "*helm" name) + (string-prefix-p "*Helm" name) + (string-prefix-p "*Compile-Log*" name) + (string-prefix-p "*lsp" name) + (string-prefix-p "*elfeed-log*" name) + (string-prefix-p "*scratch*" name) + (string-prefix-p "*Messages*" name) + (string-prefix-p "todo.org" name) + (and (string-prefix-p "magit" name) + (not (file-name-extension name)))))) + +(add-hook 'dashboard-mode-hook #'centaur-tabs-local-mode) +(add-hook 'neotree-mode-hook #'centaur-tabs-local-mode) +(add-hook 'calendar-mode-hook #'centaur-tabs-local-mode) +(add-hook 'org-agenda-mode-hook #'centaur-tabs-local-mode) +(add-hook 'helpful-mode-hook #'centaur-tabs-local-mode) +(add-hook 'term-mode-hook #'centaur-tabs-local-mode) +#+END_SRC + +*** Dashboard +#+BEGIN_SRC emacs-lisp +(require 'dashboard) +(dashboard-setup-startup-hook) + +(setq dashboard-banner-logo-title "Welcome back to Emacs, partner!" + dashboard-startup-banner 'official + dashboard-set-init-info nil + dashboard-set-footer nil + dashboard-center-content t + dashboard-show-shortcuts nil + dashboard-set-heading-icons t + dashboard-set-file-icons nil + dashboard-set-navigator t + show-week-agenda-p t) + +(setq dashboard-items '((projects . 10) + (recents . 15) + (agenda . 5))) + +(add-to-list 'evil-emacs-state-modes 'dashboard-mode) +#+END_SRC + +*** Golden ratio +#+BEGIN_SRC emacs-lisp +(require 'golden-ratio) +(golden-ratio-mode 1) +(setq golden-ratio-adjust-factor .9 + golden-ratio-wide-adjust-factor .9) +#+END_SRC + +*** mu4e +#+BEGIN_SRC emacs-lisp +(require 'org-mime) +(require 'mu4e) +(require 'cl) + +(setq mu4e-maildir (expand-file-name "/home/jozan/Maildir")) + +(setq mu4e-get-mail-command "/usr/local/bin/mbsync -c /home/jozan/.emacs.d/mu4e/.mbsyncrc -a") +(setq mu4e-update-interval 300) +(setq mu4e-index-update-in-background t) +(setq mu4e-headers-auto-update t) +(setq mu4e-index-update-error-warning t) +(setq mu4e-compose-signature-auto-include nil) +(setq mu4e-compose-format-flowed t) +(setq mu4e-view-prefer-html t) +(add-to-list 'mu4e-view-actions + '("ViewInBrowser" . mu4e-action-view-in-browser) t) + +;; enable inline images +(setq mu4e-view-show-images t) + +;; use imagemagick, if available +(when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) + +;; every new email composition gets its own frame! +(setq mu4e-compose-in-new-frame t) + +;; don't save message to Sent Messages, IMAP takes care of this +(setq mu4e-sent-messages-behavior 'delete) + +(add-hook 'mu4e-view-mode-hook #'visual-line-mode) + +;; <tab> to navigate to links, <RET> to open them in browser +(add-hook 'mu4e-view-mode-hook + (lambda() + ;; try to emulate some of the eww key-bindings + (local-set-key (kbd "<RET>") 'mu4e~view-browse-url-from-binding) + (local-set-key (kbd "<tab>") 'shr-next-link) + (local-set-key (kbd "<backtab>") 'shr-previous-link))) + +;; from https://www.reddit.com/r/emacs/comments/bfsck6/mu4e_for_dummies/elgoumx +(add-hook 'mu4e-headers-mode-hook + (defun my/mu4e-change-headers () + (interactive) + (setq mu4e-headers-fields + `((:human-date . 25) ;; alternatively, use :date + (:flags . 6) + (:from . 22) + (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject + (:size . 7))))) + +;; spell check +(add-hook 'mu4e-compose-mode-hook + (defun my-do-compose-stuff () + "My settings for message composition." + (visual-line-mode) + (org-mu4e-compose-org-mode) + (use-hard-newlines -1) + (flyspell-mode))) + +(require 'smtpmail) + +;;rename files when moving +;;NEEDED FOR MBSYNC +(setq mu4e-change-filenames-when-moving t) + +;;set up queue for offline email +;;use mu mkdir ~/Maildir/acc/queue to set up first +(setq smtpmail-queue-mail nil) ;; start in normal mode + +;;from the info manual +(setq mu4e-attachment-dir "/home/jozan/Downloads") + +(setq message-kill-buffer-on-exit t) +(setq mu4e-compose-dont-reply-to-self t) +(setq mu4e-completing-read-function 'completing-read) + +;; (require 'org-mu4e) + +;; convert org mode to HTML automatically +;; (setq org-mu4e-convert-to-html t) + +;;from vxlabs config +;; show full addresses in view message (instead of just names) +;; toggle per name with M-RET +(setq mu4e-view-show-addresses 't) + +;; don't ask when quitting +(setq mu4e-confirm-quit nil) + +;; mu4e-context +(setq mu4e-context-policy 'pick-first) +(setq mu4e-compose-context-policy 'always-ask) +(setq mu4e-contexts + (list + (make-mu4e-context + :name "work" ;;for acc1-gmail + :enter-func (lambda () (mu4e-message "Entering context work")) + :leave-func (lambda () (mu4e-message "Leaving context work")) + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches + msg '(:from :to :cc :bcc) "bousset.rudy@gmail.com"))) + :vars '((user-mail-address . "bousset.rudy@gmail.com") + (user-full-name . "Rudy Bousset") + (mu4e-sent-folder . "/acc1-gmail/[acc1].Sent Mail") + (mu4e-drafts-folder . "/acc1-gmail/[acc1].drafts") + (mu4e-trash-folder . "/acc1-gmail/[acc1].Trash") + (mu4e-compose-signature . (concat "Formal Signature\n" " ")) + (mu4e-compose-format-flowed . t) + (smtpmail-queue-dir . "~/Maildir/acc1-gmail/queue/cur") + ;; (message-send-mail-function . smtpmail-send-it) + (smtpmail-smtp-user . "bousset.rudy") + ;; (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil))) + ;; (smtpmail-auth-credentials . (expand-file-name "~/.authinfo.gpg")) + (smtpmail-default-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-service . 587) + (smtpmail-debug-info . t) + (smtpmail-debug-verbose . t) + (mu4e-maildir-shortcuts . ( ("/acc1-gmail/INBOX" . ?i) + ("/acc1-gmail/[acc1].Sent Mail" . ?s) + ("/acc1-gmail/[acc1].Trash" . ?t) + ("/acc1-gmail/[acc1].All Mail" . ?a) + ("/acc1-gmail/[acc1].Starred" . ?r) + ("/acc1-gmail/[acc1].drafts" . ?d) + )))))) + +(require 'mu4e-alert) +(mu4e-alert-set-default-style 'libnotify) +(add-hook 'after-init-hook #'mu4e-alert-enable-notifications) +(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display) +#+END_SRC + +*** w3m +#+BEGIN_SRC emacs-lisp +(require 'w3m-load) +(setq w3m-home-page "https://start.duckduckgo.com/") +(setq w3m-default-display-inline-images t) +#+END_SRC + +*** Origami mode +#+BEGIN_SRC emacs-lisp +(require 'origami) +(add-hook 'prog-mode-hook 'origami-mode) +#+END_SRC + +*** NeoTree +#+BEGIN_SRC emacs-lisp +(require 'neotree) +(setq neo-vc-integration '(face)) +(evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) +(evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-quick-look) +(evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) +(evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) +(evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) +(evil-define-key 'normal neotree-mode-map (kbd "n") 'neotree-next-line) +(evil-define-key 'normal neotree-mode-map (kbd "p") 'neotree-previous-line) +(evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) +(evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) +(evil-define-key 'normal neotree-mode-map (kbd "|") 'neotree-enter-vertical-split) +(evil-define-key 'normal neotree-mode-map (kbd "S") 'neotree-enter-vertical-split) +(evil-define-key 'normal neotree-mode-map (kbd "/") 'neotree-enter-horizontal-split) +(evil-define-key 'normal neotree-mode-map (kbd "s") 'neotree-enter-horizontal-split) +#+END_SRC + +*** Helm, projectile +#+BEGIN_SRC emacs-lisp +(require 'helm-config) +(require 'helm-misc) +(require 'helm-projectile) +(require 'helm-locate) + +(global-set-key (kbd "M-x") 'helm-M-x) +(global-set-key (kbd "C-x C-f") #'helm-find-files) +(global-set-key (kbd "M-p") #'helm-projectile-switch-project) +(global-set-key (kbd "C-x C-b") #'helm-buffers-list) +(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) +(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) +(define-key helm-map (kbd "C-z") 'helm-select-action) + +(setq helm-quick-update t + helm-bookmark-show-location t + helm-buffers-fuzzy-matching t + helm-make-executable "/usr/local/bin/gmake" + helm-make-nproc 5 + helm-split-window-in-side-p t) + +(defun helm-my-buffers () + (interactive) + (let ((helm-ff-transformer-show-only-basename nil)) + (helm-other-buffer '(helm-c-source-buffers-list + helm-c-source-elscreen + helm-c-source-projectile-files-list + helm-c-source-ctags + helm-c-source-recentf + helm-c-source-locate) + "*helm-my-buffers*"))) + +(helm-mode 1) +(projectile-mode +1) +#+END_SRC + +*** DOOM Modeline +#+BEGIN_SRC emacs-lisp +(setq display-time-string-forms + '((propertize (concat " " 24-hours ":" minutes " ")))) + +(require 'doom-modeline) +(doom-modeline-mode 1) +(setq doom-modeline-height 1) +(setq doom-modeline-project-detection 'projectile) +(setq doom-modeline-buffer-file-name-style 'truncate-upto-project) +(setq doom-modeline-icon (display-graphic-p)) +(setq doom-modeline-major-mode-icon t) +(setq doom-modeline-major-mode-color-icon t) +(setq doom-modeline-buffer-state-icon t) +(setq doom-modeline-buffer-modification-icon t) +(setq doom-modeline-unicode-fallback t) +(setq doom-modeline-enable-word-count nil) +(setq doom-modeline-buffer-encoding nil) +(setq doom-modeline-indent-info nil) +(setq doom-modeline-checker-simple-format t) +(setq doom-modeline-number-limit 99) +(setq doom-modeline-vcs-max-length 12) +(setq doom-modeline-persp-name t) +(setq doom-modeline-lsp t) +(setq doom-modeline-github nil) +(setq doom-modeline-github-interval (* 30 60)) +(setq doom-modeline-modal-icon t) +(setq doom-modeline-mu4e t) +(setq doom-modeline-gnus nil) +(setq doom-modeline-irc t) +(setq doom-modeline-irc-stylize 'identity) +(setq doom-modeline-env-version t) +(setq doom-modeline-env-python-executable "python-shell-interpreter") +(setq doom-modeline-env-ruby-executable "ruby") +(setq doom-modeline-env-perl-executable "perl") +(setq doom-modeline-env-go-executable "go") +(setq doom-modeline-env-elixir-executable "iex") +(setq doom-modeline-env-rust-executable "rustc") +(setq doom-modeline-env-load-string "...") +(setq doom-modeline-before-update-env-hook nil) +(setq doom-modeline-after-update-env-hook nil) +;; (display-battery-mode) +(column-number-mode) +(display-time) +(doom-themes-neotree-config) +#+END_SRC + +*** Colors and rainbows +#+BEGIN_SRC emacs-lisp +(require 'color-identifiers-mode) +(global-color-identifiers-mode) + +(require 'rainbow-delimiters) +(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) +#+END_SRC + +*** Auto-complete +#+BEGIN_SRC emacs-lisp +(require 'auto-complete) + +(require 'auto-complete-config) +(ac-config-default) +#+END_SRC + +*** C default style +#+BEGIN_SRC emacs-lisp +(setq c-default-style "bsd") +#+END_SRC + +*** Autopair +#+BEGIN_SRC emacs-lisp +(require 'autopair) +(autopair-global-mode) +#+END_SRC + +*** Paredit +#+BEGIN_SRC emacs-lisp +(require 'paredit) +(defadvice paredit-mode (around disable-autopairs-around (arg)) + ad-do-it + (if (null ad-return-value) + (autopair-mode 1) + (autopair-mode -1) +)) +(ad-activate 'paredit-mode) +#+END_SRC + +*** Magit +#+BEGIN_SRC emacs-lisp +(require 'magit) + +(defun my/magit-kill-buffers () + "Restore window configuration and kill all Magit buffers. +Attribution: URL `https://manuel-uberti.github.io/emacs/2018/02/17/magit-bury-buffer/'" + (interactive) + (let ((buffers (magit-mode-get-buffers))) + (magit-restore-window-configuration) + (mapc #'kill-buffer buffers))) + +(bind-key "q" #'my/magit-kill-buffers magit-status-mode-map) +(evil-define-key 'insert magit-status-mode-map (kbd "q") #'my/magit-kill-buffers) +(evil-define-key 'normal magit-status-mode-map (kbd "q") #'my/magit-kill-buffers) +#+END_SRC + +*** Ranger +#+BEGIN_SRC emacs-lisp +(require 'ranger) +(ranger-override-dired-mode t) +(add-hook 'dired-mode-hook 'auto-revert-mode) +#+END_SRC + +*** lldb +#+BEGIN_SRC emacs-lisp +(require 'realgud-lldb) +#+END_SRC + +*** Lock windows +#+BEGIN_SRC emacs-lisp +(defun my/toggle-window-dedicated () + "Control whether or not Emacs is allowed to display another +buffer in current window." + (interactive) + (message + (if (let (window (get-buffer-window (current-buffer))) + (set-window-dedicated-p window (not (window-dedicated-p window)))) + "%s: locked" + "%s is up for grabs") + (current-buffer))) + +(global-set-key (kbd "C-c t") 'my/toggle-window-dedicated) +#+END_SRC + +*** evil nerd commenter +#+BEGIN_SRC emacs-lisp +(require 'evil-nerd-commenter) +(evilnc-default-hotkeys) +#+END_SRC + +*** cargo +#+BEGIN_SRC emacs-lisp +(require 'cargo) +(add-hook 'rust-mode-hook 'cargo-minor-mode) +#+END_SRC + +*** yasnippet +#+BEGIN_SRC emacs-lisp +(require 'yasnippet) +(require 'yasnippet-snippets) +(require 'yasnippet-classic-snippets) +(require 'helm-c-yasnippet) +(yas-reload-all) +(add-hook 'prog-mode-hook #'yas-minor-mode) +#+END_SRC + +*** Tabs and stuff +#+BEGIN_SRC emacs-lisp +(defun minibuffer-keyboard-quit () + "Abort recursive edit. +In Delete Selection mode, if the mark is active, just deactivate it; +then it takes a second \\[keyboard-quit] to abort the minibuffer." + (interactive) + (if (and delete-selection-mode transient-mark-mode mark-active) + (setq deactivate-mark t) + (when (get-buffer "*Completions*") (delete-windows-on "*Completions*")) + (abort-recursive-edit))) +(define-key evil-normal-state-map [escape] 'keyboard-quit) +(define-key evil-visual-state-map [escape] 'keyboard-quit) +(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) +(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit) +(global-set-key [escape] 'evil-exit-emacs-state) + +(defun my/insert-tab-char () + "Insert a tab char. (ASCII 9, \t)" + (interactive) + (insert "\t")) + +(define-key evil-insert-state-map [tab] 'my/insert-tab-char) +(setq-default indent-tabs-mode t) +(setq tab-always-indent 'complete) +(setq-default tab-width 4) +(setq tab-width 4) +(defvaralias 'c-basic-offset 'tab-width) +(defvaralias 'cperl-indent-level 'tab-width) +#+END_SRC + +*** all the icons +#+BEGIN_SRC emacs-lisp +(require 'font-lock) +(require 'font-lock+) +(require 'all-the-icons) +(load "all-the-icons-dired.el") +(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) +#+END_SRC + +*** minugs +#+BEGIN_SRC emacs-lisp +(require 'mingus) +(add-to-list 'evil-emacs-state-modes 'mingus-help-mode) +(add-to-list 'evil-emacs-state-modes 'mingus-playlist-mode) +(add-to-list 'evil-emacs-state-modes 'mingus-browse-mode) +#+END_SRC + +*** elfeed +#+BEGIN_SRC emacs-lisp +(require 'url) +(require 'elfeed) +(require 'elfeed-org) +(elfeed-org) +(setq rmh-elfeed-org-files (list "~/.emacs.d/org/elfeed/elfeed.org")) + +(defun my/elfeed-show-all () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-all")) + +(defun my/elfeed-show-news () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-news")) + +(defun my/elfeed-show-youtube () + (interactive) + (bookmark-maybe-load-default-file) + (bookmark-jump "elfeed-youtube")) + +(defun my/elfeed-load-db-and-open () + (interactive) + (elfeed-db-load) + (elfeed) + (elfeed-search-update--force)) + +(defun my/elfeed-save-db-and-bury () + (interactive) + (elfeed-db-save) + (kill-buffer "*elfeed-log*") + (kill-buffer "*elfeed-search*") + (kill-buffer "elfeed.org")) + +(defun my/elfeed-v-mpv (url) + "Watch a video from URL in MPV" + (setq quality (completing-read "Max height resolution (0 for unlimited): " '("0" "360" "480" "720" "1080"))) + (setq fmt (if (= 0 (string-to-number quality)) "" (format "--ytdl-format=bestvideo[height<=?%s]+bestaudio/best" quality))) + (async-shell-command (format "mpv \"%s\" \"%s\"" fmt url))) + + +(defun my/elfeed-view-mpv (&optional use-generic-p) + "Youtube-feed link" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (my/elfeed-v-mpv it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + +(defun my/elfeed-d-download (url) + "Download media links" + (async-shell-command (format "cd ~/Downloads && curl -O \"%s\"" url))) + +(defun my/elfeed-download-link (&optional use-generic-p) + "Download media links" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (my/elfeed-d-download it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + +(define-key elfeed-search-mode-map (kbd "q") 'my/elfeed-save-db-and-bury) +(define-key elfeed-search-mode-map (kbd "A") 'my/elfeed-show-all) +(define-key elfeed-search-mode-map (kbd "N") 'my/elfeed-show-news) +(define-key elfeed-search-mode-map (kbd "Y") 'my/elfeed-show-youtube) +(define-key elfeed-search-mode-map (kbd "v") 'my/elfeed-view-mpv) +(define-key elfeed-search-mode-map (kbd "d") 'my/elfeed-download-link) +(define-key elfeed-search-mode-map (kbd "h") 'backward-char) +(define-key elfeed-search-mode-map (kbd "j") 'forward-line) +(define-key elfeed-search-mode-map (kbd "k") 'previous-line) +(define-key elfeed-search-mode-map (kbd "l") 'forward-char) + +(add-to-list 'evil-emacs-state-modes 'elfeed-search-mode) +(add-to-list 'evil-emacs-state-modes 'elfeed-show-mode) +#+END_SRC + +*** which-key +#+BEGIN_SRC emacs-lisp +(require 'which-key) +(which-key-mode) +#+END_SRC + +*** shell-pop +#+BEGIN_SRC emacs-lisp +(require 'shell-pop) +(setq my/shell-pop-shell-type + (quote + ("ansi-term" "*ansi-term*" + (lambda nil + (ansi-term shell-pop-term-shell))))) + +(setq shell-pop-term-shell "/usr/local/bin/zsh") +#+END_SRC + +*** org-bullets +#+BEGIN_SRC emacs-lisp +(require 'org-bullets) +(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) +#+END_SRC + +*** toc-org +#+BEGIN_SRC emacs-lisp +(require 'toc-org) +(add-hook 'org-mode-hook 'toc-org-mode) +;; enable in markdown, too +(add-hook 'markdown-mode-hook 'toc-org-mode) +(define-key markdown-mode-map (kbd "\C-c\C-o") 'toc-org-markdown-follow-thing-at-point) +#+END_SRC + +** Compilation +*** Close window after errorless compilation +#+BEGIN_SRC emacs-lisp +(setq compilation-finish-function +(lambda (buf str) + (if (null (string-match ".*exited abnormally.*" str)) + ;;no errors, make the compilation window go away in a few seconds + (progn + (run-at-time + "0.5 sec" nil 'delete-windows-on + (get-buffer-create "*compilation*")) + (message ""))))) +#+END_SRC + +*** Compilation functions +#+BEGIN_SRC emacs-lisp +;; (defvar my/cargo-f5-minor-mode-map +;; (let ((map (make-sparse-keymap))) +;; (define-key map [f5] 'cargo-process-run) +;; map) +;; "my/cargo-f5-minor-mode keymap") + +;; (define-minor-mode my/cargo-f5-minor-mode +;; "A minor mode to execute cargo run with F5 in rust-mode only" +;; :init-value t +;; :lighter " my/cargo") + +;; (my/cargo-f5-minor-mode 0) + +;; (defun my/roff-comp () +;; ;; (interactive) +;; (defvar name) +;; (defvar ext) +;; (defvar exec) +;; (setq name (file-name-sans-extension buffer-file-name)) +;; (setq ext (file-name-extension buffer-file-name)) +;; (if (string-match "ms" ext) +;; (setq exec (format "%s%s%s%s%s%s%s" "nroff -ms " name "." ext " -Tpdf -Kutf8 -Wall > " name ".pdf"))) +;; (if (string-match "ms" ext) +;; (shell-command exec))) + +;; (add-hook 'after-save-hook 'my/roff-comp) + +(defun my/exec-f5 () + (interactive) + (defvar make) + (setq make "gmake -j5 asan") + (save-buffer) + (compile make) + (compilation-finish-function)) + +(defun my/exec-f6 () + (interactive) + (defvar exec) + (setq exec "./a.out; ret=$?; echo \"\e[1;35m~>\"; if [ $ret -ne 0 ]; then echo -n \"\e[1;31m$ret\"; if [ $ret -eq 127 ]; then echo \" - Missing a.out, comipler error! \"; exit; elif [ $ret -eq 134 ]; then echo \" - Abort! \"; elif [ $ret -eq 138 ]; then echo \" - Bus error! \"; elif [ $ret -eq 139 ]; then echo \" - Segmentation fault! \"; fi; fi; echo \"\e[1;35m\n\n.emacs v1.5 Tilde Edition by Joe\"") + (async-shell-command exec)) +#+END_SRC + +** Other key bindings +#+BEGIN_SRC emacs-lisp +(global-set-key [f1] 'shell-pop) +(global-set-key [f2] 'neotree-toggle) +(global-set-key [f4] 'helm-make-projectile) +(global-set-key [f5] 'my/exec-f5) +(global-set-key [f6] 'my/exec-f6) +(global-set-key (kbd "C-x d") 'ranger) +(global-set-key (kbd "M-1") 'ranger) +;; (add-hook 'rust-mode-hook 'my/cargo-f5-minor-mode) + +(shell-pop--set-shell-type 'my/shell-pop-shell-type my/shell-pop-shell-type) +#+END_SRC + diff --git a/.emacs.d/org/elfeed/elfeed.org b/.emacs.d/org/elfeed/elfeed.org new file mode 100644 index 0000000..a8e812d --- /dev/null +++ b/.emacs.d/org/elfeed/elfeed.org @@ -0,0 +1,48 @@ +* All :elfeed: +** News +*** Gentoo :news: +**** https://www.gentoo.org/feeds/news.xml +*** FreeBSD :news: +**** https://www.freebsd.org/news/rss.xml +*** Haiku :news: +**** https://www.haiku-os.org/index.xml +*** Luke Smith :news: +**** https://lukesmith.xyz/rss.xml +*** Pragmatic Emacs :news: +**** http://pragmaticemacs.com/feed/ +*** The Lunduke Show :news: +**** http://vault.lunduke.com/LundukeShowMP3.xml +*** TrueAnon :news: +**** http://feeds.soundcloud.com/users/soundcloud:users:672423809/sounds.rss +** YouTube :youtube: +*** Tech :tech: +**** Luke Smith +***** https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA +**** DistroTube +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg +**** LGR +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCLx053rWZxCiYWsBETgdKrQ +**** RoboNuggie +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCxwcmRAmBRzZMNS37dCgmHA +*** Gaming :gaming: +**** Grubby +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCCF6pCTGMKdo9r_kFQS-H3Q +**** PiG +***** https://www.youtube.com/feeds/videos.xml?channel_id=UC9OluGthYmZo0vsF9IjicFg +**** Artosis +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCuOqvRRt9GqyIUVTwSB4Ucg +**** LowkoTV +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCZNTsLA6t6bRoj-5QRmqt_w +*** Normies :normies: +**** Valek +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCYdyGYM1aoLpAuCxsP86O1g +**** Le Raptor +***** https://www.youtube.com/feeds/videos.xml?channel_id=UC_i-uMpN1lEyuoUGDq-dajQ +**** MisterJDay +***** https://www.youtube.com/feeds/videos.xml?channel_id=UC2uPHgyyLv2rnkm4CfIgWcw +**** Sylvqin +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCseGV3amBLISlIOMQodPfVQ +**** Kurzgesagt - In a Nutshell +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCsXVk37bltHxD1rDPwtNM8Q +**** h3h3Productions +***** https://www.youtube.com/feeds/videos.xml?channel_id=UCDWIvJwLJsE4LG1Atne2blQ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f749bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.config/zsh/history +.emacs.d/org/todo |