From 5acb369b6ccf93eb30c2c575da8ec8fba9364b19 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Thu, 29 Feb 2024 12:19:00 +0100 Subject: [PATCH] updated emacs configs --- .emacs | 103 ++------- .emacs.local/.gitkeep | 0 .emacs.local/basm-mode.el | 75 ------ .emacs.local/jai-mode.el | 214 ------------------ .emacs.local/noq-mode.el | 86 ------- .emacs.local/nothings-mode.el | 26 --- .emacs.local/porth-mode.el | 70 ------ .emacs.local/simpc-mode.el | 99 -------- .emacs.rc/autocommit-rc.el | 149 ------------ .emacs.rc/misc-rc.el | 134 ----------- .emacs.rc/org-mode-rc.el | 68 ------ .emacs.rc/rc.el | 34 --- .emacs.snippets/c++-mode/.yas-parents | 1 - .emacs.snippets/c++-mode/catch | 7 - .emacs.snippets/c++-mode/fore | 7 - .emacs.snippets/c++-mode/ns | 7 - .emacs.snippets/c++-mode/once | 10 - .emacs.snippets/c++-mode/qdebug | 7 - .emacs.snippets/c++-mode/try | 7 - .emacs.snippets/c++-mode/uns | 5 - .emacs.snippets/c++-mode/vec | 5 - .emacs.snippets/c-like-syntax/block | 7 - .emacs.snippets/c-like-syntax/elif | 7 - .emacs.snippets/c-like-syntax/else | 7 - .emacs.snippets/c-like-syntax/for | 7 - .emacs.snippets/c-like-syntax/if | 7 - .emacs.snippets/c-like-syntax/while | 7 - .emacs.snippets/c-mode/.yas-parents | 1 - .emacs.snippets/c-mode/inc | 5 - .emacs.snippets/c-mode/incq | 5 - .emacs.snippets/c-mode/main | 9 - .emacs.snippets/css-mode/bg | 5 - .emacs.snippets/css-mode/bgi | 5 - .emacs.snippets/css-mode/bor | 5 - .emacs.snippets/css-mode/cl | 5 - .emacs.snippets/css-mode/dispb | 5 - .emacs.snippets/css-mode/dispi | 5 - .emacs.snippets/css-mode/dispn | 5 - .emacs.snippets/css-mode/ff | 5 - .emacs.snippets/css-mode/fs | 5 - .emacs.snippets/css-mode/mar | 5 - .emacs.snippets/css-mode/marb | 5 - .emacs.snippets/css-mode/marl | 5 - .emacs.snippets/css-mode/marr | 5 - .emacs.snippets/css-mode/mart | 5 - .emacs.snippets/css-mode/pad | 5 - .emacs.snippets/css-mode/padb | 5 - .emacs.snippets/css-mode/padl | 5 - .emacs.snippets/css-mode/padr | 5 - .emacs.snippets/css-mode/padt | 5 - .emacs.snippets/d-mode/.yas-parents | 1 - .emacs.snippets/d-mode/imm | 5 - .emacs.snippets/d-mode/import | 5 - .../emacs-lisp-mode/emacs-lisp-module | 42 ---- .../emacs-lisp-mode/pacmacs-module | 41 ---- .emacs.snippets/fan-mode/.yas-parents | 1 - .emacs.snippets/fundamental-mode/mit | 24 -- .emacs.snippets/fundamental-mode/sb | 8 - .emacs.snippets/html-mode/tag | 7 - .emacs.snippets/html-mode/tagi | 5 - .emacs.snippets/java-mode/.yas-parents | 1 - .emacs.snippets/java-mode/ps | 5 - .emacs.snippets/java-mode/psv | 5 - .emacs.snippets/js-mode/.yas-parents | 1 - .emacs.snippets/js-mode/item | 7 - .emacs.snippets/latex-mode/begin | 7 - .emacs.snippets/makefile-gmake-mode/make | 10 - .emacs.snippets/markdown-mode/todo | 9 - .emacs.snippets/nix-mode/.yas-parents | 1 - .emacs.snippets/nxml-mode/body | 7 - .emacs.snippets/nxml-mode/div | 7 - .emacs.snippets/nxml-mode/head | 7 - .emacs.snippets/nxml-mode/html | 7 - .emacs.snippets/nxml-mode/link | 5 - .emacs.snippets/nxml-mode/meta | 5 - .emacs.snippets/nxml-mode/pom | 17 -- .emacs.snippets/nxml-mode/script | 5 - .emacs.snippets/nxml-mode/span | 5 - .emacs.snippets/nxml-mode/tag | 7 - .emacs.snippets/nxml-mode/tag.1 | 5 - .emacs.snippets/nxml-mode/tag.2 | 5 - .emacs.snippets/nxml-mode/title | 5 - .emacs.snippets/nxml-mode/xml | 5 - .emacs.snippets/org-mode/pomo | 43 ---- .emacs.snippets/perl-mode/.yas-parents | 1 - .emacs.snippets/perl-mode/fore | 7 - .emacs.snippets/porth-mode/main | 9 - .emacs.snippets/porth-mode/ras | 6 - .emacs.snippets/porth-mode/todo | 6 - .emacs.snippets/porth-mode/unreach | 6 - .emacs.snippets/rust-mode/.yas-parents | 1 - .emacs.snippets/scala-mode/.yas-parents | 1 - .emacs.snippets/snippet-mode/snip | 9 - .emacs.snippets/typescript-mode/.yas-parents | 1 - .emacs_lsp | 196 ++++++++++++++++ .emacs_piscine | 44 +++- MANIFEST | 3 - 97 files changed, 249 insertions(+), 1632 deletions(-) delete mode 100755 .emacs.local/.gitkeep delete mode 100755 .emacs.local/basm-mode.el delete mode 100755 .emacs.local/jai-mode.el delete mode 100755 .emacs.local/noq-mode.el delete mode 100755 .emacs.local/nothings-mode.el delete mode 100755 .emacs.local/porth-mode.el delete mode 100755 .emacs.local/simpc-mode.el delete mode 100755 .emacs.rc/autocommit-rc.el delete mode 100755 .emacs.rc/misc-rc.el delete mode 100755 .emacs.rc/org-mode-rc.el delete mode 100755 .emacs.rc/rc.el delete mode 100755 .emacs.snippets/c++-mode/.yas-parents delete mode 100755 .emacs.snippets/c++-mode/catch delete mode 100755 .emacs.snippets/c++-mode/fore delete mode 100755 .emacs.snippets/c++-mode/ns delete mode 100755 .emacs.snippets/c++-mode/once delete mode 100755 .emacs.snippets/c++-mode/qdebug delete mode 100755 .emacs.snippets/c++-mode/try delete mode 100755 .emacs.snippets/c++-mode/uns delete mode 100755 .emacs.snippets/c++-mode/vec delete mode 100755 .emacs.snippets/c-like-syntax/block delete mode 100755 .emacs.snippets/c-like-syntax/elif delete mode 100755 .emacs.snippets/c-like-syntax/else delete mode 100755 .emacs.snippets/c-like-syntax/for delete mode 100755 .emacs.snippets/c-like-syntax/if delete mode 100755 .emacs.snippets/c-like-syntax/while delete mode 100755 .emacs.snippets/c-mode/.yas-parents delete mode 100755 .emacs.snippets/c-mode/inc delete mode 100755 .emacs.snippets/c-mode/incq delete mode 100755 .emacs.snippets/c-mode/main delete mode 100755 .emacs.snippets/css-mode/bg delete mode 100755 .emacs.snippets/css-mode/bgi delete mode 100755 .emacs.snippets/css-mode/bor delete mode 100755 .emacs.snippets/css-mode/cl delete mode 100755 .emacs.snippets/css-mode/dispb delete mode 100755 .emacs.snippets/css-mode/dispi delete mode 100755 .emacs.snippets/css-mode/dispn delete mode 100755 .emacs.snippets/css-mode/ff delete mode 100755 .emacs.snippets/css-mode/fs delete mode 100755 .emacs.snippets/css-mode/mar delete mode 100755 .emacs.snippets/css-mode/marb delete mode 100755 .emacs.snippets/css-mode/marl delete mode 100755 .emacs.snippets/css-mode/marr delete mode 100755 .emacs.snippets/css-mode/mart delete mode 100755 .emacs.snippets/css-mode/pad delete mode 100755 .emacs.snippets/css-mode/padb delete mode 100755 .emacs.snippets/css-mode/padl delete mode 100755 .emacs.snippets/css-mode/padr delete mode 100755 .emacs.snippets/css-mode/padt delete mode 100755 .emacs.snippets/d-mode/.yas-parents delete mode 100755 .emacs.snippets/d-mode/imm delete mode 100755 .emacs.snippets/d-mode/import delete mode 100755 .emacs.snippets/emacs-lisp-mode/emacs-lisp-module delete mode 100755 .emacs.snippets/emacs-lisp-mode/pacmacs-module delete mode 100755 .emacs.snippets/fan-mode/.yas-parents delete mode 100755 .emacs.snippets/fundamental-mode/mit delete mode 100755 .emacs.snippets/fundamental-mode/sb delete mode 100755 .emacs.snippets/html-mode/tag delete mode 100755 .emacs.snippets/html-mode/tagi delete mode 100755 .emacs.snippets/java-mode/.yas-parents delete mode 100755 .emacs.snippets/java-mode/ps delete mode 100755 .emacs.snippets/java-mode/psv delete mode 100755 .emacs.snippets/js-mode/.yas-parents delete mode 100755 .emacs.snippets/js-mode/item delete mode 100755 .emacs.snippets/latex-mode/begin delete mode 100755 .emacs.snippets/makefile-gmake-mode/make delete mode 100755 .emacs.snippets/markdown-mode/todo delete mode 100755 .emacs.snippets/nix-mode/.yas-parents delete mode 100755 .emacs.snippets/nxml-mode/body delete mode 100755 .emacs.snippets/nxml-mode/div delete mode 100755 .emacs.snippets/nxml-mode/head delete mode 100755 .emacs.snippets/nxml-mode/html delete mode 100755 .emacs.snippets/nxml-mode/link delete mode 100755 .emacs.snippets/nxml-mode/meta delete mode 100755 .emacs.snippets/nxml-mode/pom delete mode 100755 .emacs.snippets/nxml-mode/script delete mode 100755 .emacs.snippets/nxml-mode/span delete mode 100755 .emacs.snippets/nxml-mode/tag delete mode 100755 .emacs.snippets/nxml-mode/tag.1 delete mode 100755 .emacs.snippets/nxml-mode/tag.2 delete mode 100755 .emacs.snippets/nxml-mode/title delete mode 100755 .emacs.snippets/nxml-mode/xml delete mode 100755 .emacs.snippets/org-mode/pomo delete mode 100755 .emacs.snippets/perl-mode/.yas-parents delete mode 100755 .emacs.snippets/perl-mode/fore delete mode 100755 .emacs.snippets/porth-mode/main delete mode 100755 .emacs.snippets/porth-mode/ras delete mode 100755 .emacs.snippets/porth-mode/todo delete mode 100755 .emacs.snippets/porth-mode/unreach delete mode 100755 .emacs.snippets/rust-mode/.yas-parents delete mode 100755 .emacs.snippets/scala-mode/.yas-parents delete mode 100755 .emacs.snippets/snippet-mode/snip delete mode 100755 .emacs.snippets/typescript-mode/.yas-parents create mode 100755 .emacs_lsp diff --git a/.emacs b/.emacs index 90198a0..54a5877 100755 --- a/.emacs +++ b/.emacs @@ -11,10 +11,16 @@ (setq use-package-always-ensure t use-package-expand-minimally t)) -(load "~/.emacs.rc/rc.el") -(load "~/.emacs.rc/misc-rc.el") -(load "~/.emacs.rc/org-mode-rc.el") -(load "~/.emacs.rc/autocommit-rc.el") +(unless (package-installed-p 'benchmark-init) + (package-refresh-contents) + (package-install 'benchmark-init)) + +(require 'benchmark-init) +;; To disable collection of benchmark data after init is done. +(add-hook 'after-init-hook 'benchmark-init/deactivate) + +;; shell +(global-set-key (kbd "C-c RET") (lambda () (interactive) (ansi-term "/bin/zsh"))) ;; Look (tool-bar-mode 0) @@ -23,6 +29,7 @@ (column-number-mode 1) (show-paren-mode 1) (electric-pair-mode 1) +(global-font-lock-mode 0) (global-display-line-numbers-mode 1) (setq display-line-numbers-type 'relative) (set-face-attribute 'default nil :height 200) @@ -37,33 +44,6 @@ (setq-default display-fill-column-indicator-column 79) ; 80 column indicator - Emacs columns are 0-based... (global-display-fill-column-indicator-mode 1) -(unless (package-installed-p 'lsp-mode) - (package-install 'lsp-mode)) - -(use-package lsp-mode - :init - :config - :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) - (c-mode . lsp) - (c++-mode . lsp) - (python-mode . lsp)) - :commands lsp) - -;; company -(unless (package-installed-p 'company) - (package-install 'company)) - -(use-package company - :after lsp-mode - :hook (prog-mode . company-mode) - :bind (:map company-active-map - ("" . company-complete-selection)) - (:map lsp-mode-map - ("" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0)) - (setq neo-theme (if (display-graphic-p) 'icons)) ;; Use keybindings @@ -72,18 +52,6 @@ :bind (:map markdown-mode-command-map ("g" . grip-mode))) -;; emacs gdb -(fmakunbound 'gdb) -(fmakunbound 'gdb-enable-debug) - -(unless (package-installed-p 'gdb-mi) - (package-install 'gdb-mi)) - -(use-package gdb-mi - :init - (fmakunbound 'gdb) - (fmakunbound 'gdb-enable-debug)) - ;; neotree (unless (package-installed-p 'neotree) (package-install 'neotree) @@ -108,6 +76,10 @@ (require 'evil) (evil-mode 1) +;; exwm +(unless (package-installed-p 'exwm) + (package-install 'exwm)) + (defun my-untabify-all-lines () "Select all lines in the buffer and run 'untabify' on them." (interactive) @@ -124,56 +96,15 @@ (add-to-list 'load-path "~/.emacs.d/lisp") (load "site-start.d/epitech-init.el") -;; example configuration for mu4e -(require 'mu4e) - -;; use mu4e for e-mail in emacs -(setq mail-user-agent 'mu4e-user-agent) - -;; the next are relative to the root maildir -;; (see `mu info`). -;; instead of strings, they can be functions too, see -;; their docstring or the chapter 'Dynamic folders' -(setq mu4e-sent-folder "/sent" - mu4e-drafts-folder "/drafts" - mu4e-trash-folder "/trash") - -;; the maildirs you use frequently; access them with 'j' ('jump') -(setq mu4e-maildir-shortcuts - '((:maildir "/archive" :key ?a) - (:maildir "/inbox" :key ?i) - (:maildir "/work" :key ?w) - (:maildir "/sent" :key ?s))) - -;; the headers to show in the headers list -- a pair of a field -;; and its width, with `nil' meaning 'unlimited' -;; (better only use that for the last field. -;; These are the defaults: -(setq mu4e-headers-fields - '( (:date . 25) ;; alternatively, use :human-date - (:flags . 6) - (:from . 22) - (:subject . nil))) ;; alternatively, use :thread-subject - -(add-to-list 'mu4e-bookmarks - ;; ':favorite t' i.e, use this one for the modeline - '(:query "maildir:/inbox" :name "Inbox" :key ?i :favorite t)) - -;; program to get mail; alternatives are 'fetchmail', 'getmail' -;; isync or your own shellscript. called when 'U' is pressed in -;; main view. - -;; don't keep message buffers around -(setq message-kill-buffer-on-exit t) - (setq-default indent-tabs-mode nil) (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. + '(inhibit-startup-screen t) '(package-selected-packages - '(company simpleclip rust-mode org-cliplink neotree magit gruber-darker-theme go-mode evil dash-functional all-the-icons))) + '(benchmark-init company simpleclip rust-mode org-cliplink neotree magit gruber-darker-theme go-mode evil dash-functional all-the-icons))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/.emacs.local/.gitkeep b/.emacs.local/.gitkeep deleted file mode 100755 index e69de29..0000000 diff --git a/.emacs.local/basm-mode.el b/.emacs.local/basm-mode.el deleted file mode 100755 index 0d0972b..0000000 --- a/.emacs.local/basm-mode.el +++ /dev/null @@ -1,75 +0,0 @@ -;;; basm-mode.el --- Major Mode for editing BASM Assembly Code -*- lexical-binding: t -*- - -;; Copyright (C) 2021 Alexey Kutepov - -;; Author: Alexey Kutepov -;; URL: http://github.com/tsoding/bm - -;; Permission is hereby granted, free of charge, to any person -;; obtaining a copy of this software and associated documentation -;; files (the "Software"), to deal in the Software without -;; restriction, including without limitation the rights to use, copy, -;; modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is -;; furnished to do so, subject to the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. - -;;; Commentary: -;; -;; Major Mode for editing BASM Assembly Code. The language for a -;; simple Virtual Machine. - -(defconst basm-mode-syntax-table - (with-syntax-table (copy-syntax-table) - (modify-syntax-entry ?\; "<") - (modify-syntax-entry ?\n ">") - (modify-syntax-entry ?\" "\"") - (modify-syntax-entry ?\' "\"") - (syntax-table)) - "Syntax table for `basm-mode'.") - -(eval-and-compile - (defconst basm-instructions - '("nop" "push" "drop" "dup" - "plusi" "minusi" "multi" "divi" "modi" - "multu" "divu" "modu" - "plusf" "minusf" "multf" "divf" - "jmp" "jmp_if" "halt" "swap" "not" - "eqi" "gei" "gti" "lei" "lti" "nei" - "equ" "geu" "gtu" "leu" "ltu" "neu" - "eqf" "gef" "gtf" "lef" "ltf" "nef" - "ret" "call" "native" - "andb" "orb" "xor" "shr" "shl" "notb" - "read8u" "read16u" "read32u" "read64u" - "read8i" "read16i" "read32i" "read64i" - "write8" "write16" "write32" "write64" - "i2f" "u2f" "f2i" "f2u"))) - -(defconst basm-highlights - `(("%[[:word:]_]+" . font-lock-preprocessor-face) - ("[[:word:]_]+\\:" . font-lock-constant-face) - (,(regexp-opt basm-instructions 'symbols) . font-lock-keyword-face))) - -;;;###autoload -(define-derived-mode basm-mode fundamental-mode "basm" - "Major Mode for editing BASM Assembly Code." - (setq font-lock-defaults '(basm-highlights)) - (set-syntax-table basm-mode-syntax-table)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.\\(b\\|h\\)asm\\'" . basm-mode)) - -(provide 'basm-mode) - -;;; basm-mode.el ends here diff --git a/.emacs.local/jai-mode.el b/.emacs.local/jai-mode.el deleted file mode 100755 index 0363883..0000000 --- a/.emacs.local/jai-mode.el +++ /dev/null @@ -1,214 +0,0 @@ -;; jai-mode.el - very basic jai mode - -(require 'cl) -(require 'rx) -(require 'js) -(require 'compile) - -(defconst jai-mode-syntax-table - (let ((table (make-syntax-table))) - (modify-syntax-entry ?\" "\"" table) - (modify-syntax-entry ?\\ "\\" table) - - ;; additional symbols - (modify-syntax-entry ?_ "w" table) - - (modify-syntax-entry ?' "." table) - (modify-syntax-entry ?: "." table) - (modify-syntax-entry ?+ "." table) - (modify-syntax-entry ?- "." table) - (modify-syntax-entry ?% "." table) - (modify-syntax-entry ?& "." table) - (modify-syntax-entry ?| "." table) - (modify-syntax-entry ?^ "." table) - (modify-syntax-entry ?! "." table) - (modify-syntax-entry ?$ "/" table) - (modify-syntax-entry ?= "." table) - (modify-syntax-entry ?< "." table) - (modify-syntax-entry ?> "." table) - (modify-syntax-entry ?? "." table) - - ;; Modify some syntax entries to allow nested block comments - (modify-syntax-entry ?/ ". 124b" table) - (modify-syntax-entry ?* ". 23n" table) - (modify-syntax-entry ?\n "> b" table) - (modify-syntax-entry ?\^m "> b" table) - - table)) - -(defconst jai-builtins - '("cast" "it" "type_info" "size_of")) - -(defconst jai-keywords - '("if" "ifx" "else" "then" "while" "for" "switch" "case" "struct" "enum" - "return" "new" "remove" "continue" "break" "defer" "inline" "no_inline" - "using" "SOA")) - -(defconst jai-constants - '("null" "true" "false")) - -(defconst jai-typenames - '("int" "u64" "u32" "u16" "u8" - "s64" "s32" "s16" "s8" "float" - "float32" "float64" "string" - "bool")) - -(defun jai-wrap-word-rx (s) - (concat "\\<" s "\\>")) - -(defun jai-keywords-rx (keywords) - "build keyword regexp" - (jai-wrap-word-rx (regexp-opt keywords t))) - -(defconst jai-hat-type-rx (rx (group (and "^" (1+ word))))) -(defconst jai-dollar-type-rx (rx (group "$" (or (1+ word) (opt "$"))))) -(defconst jai-number-rx - (rx (and - symbol-start - (or (and (+ digit) (opt (and (any "eE") (opt (any "-+")) (+ digit)))) - (and "0" (any "xX") (+ hex-digit))) - (opt (and (any "_" "A-Z" "a-z") (* (any "_" "A-Z" "a-z" "0-9")))) - symbol-end))) - -(defconst jai-font-lock-defaults - `( - ;; Keywords - (,(jai-keywords-rx jai-keywords) 1 font-lock-keyword-face) - - ;; single quote characters - ("\\('[[:word:]]\\)\\>" 1 font-lock-constant-face) - - ;; Variables - (,(jai-keywords-rx jai-builtins) 1 font-lock-variable-name-face) - - ;; Constants - (,(jai-keywords-rx jai-constants) 1 font-lock-constant-face) - - ;; Hash directives - ("#\\w+" . font-lock-preprocessor-face) - - ;; At directives - ("@\\w+" . font-lock-preprocessor-face) - - ;; Strings - ("\\\".*\\\"" . font-lock-string-face) - - ;; Numbers - (,(jai-wrap-word-rx jai-number-rx) . font-lock-constant-face) - - ;; Types - (,(jai-keywords-rx jai-typenames) 1 font-lock-type-face) - (,jai-hat-type-rx 1 font-lock-type-face) - (,jai-dollar-type-rx 1 font-lock-type-face) - - ("---" . font-lock-constant-face) - )) - -;; add setq-local for older emacs versions -(unless (fboundp 'setq-local) - (defmacro setq-local (var val) - `(set (make-local-variable ',var) ,val))) - -(defconst jai--defun-rx "\(.*\).*\{") - -(defmacro jai-paren-level () - `(car (syntax-ppss))) - -(defun jai-line-is-defun () - "return t if current line begins a procedure" - (interactive) - (save-excursion - (beginning-of-line) - (let (found) - (while (and (not (eolp)) (not found)) - (if (looking-at jai--defun-rx) - (setq found t) - (forward-char 1))) - found))) - -(defun jai-beginning-of-defun (&optional count) - "Go to line on which current function starts." - (interactive) - (let ((orig-level (jai-paren-level))) - (while (and - (not (jai-line-is-defun)) - (not (bobp)) - (> orig-level 0)) - (setq orig-level (jai-paren-level)) - (while (>= (jai-paren-level) orig-level) - (skip-chars-backward "^{") - (backward-char)))) - (if (jai-line-is-defun) - (beginning-of-line))) - -(defun jai-end-of-defun () - "Go to line on which current function ends." - (interactive) - (let ((orig-level (jai-paren-level))) - (when (> orig-level 0) - (jai-beginning-of-defun) - (end-of-line) - (setq orig-level (jai-paren-level)) - (skip-chars-forward "^}") - (while (>= (jai-paren-level) orig-level) - (skip-chars-forward "^}") - (forward-char))))) - -(defalias 'jai-parent-mode - (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode)) - -;; imenu hookup -(add-hook 'jai-mode-hook - (lambda () - (setq imenu-generic-expression - '( - ("type" "^\\(.*:*.*\\) : " 1) - ("function" "^\\(.*\\) :: " 1) - ("struct" "^\\(.*\\) *:: *\\(struct\\)\\(.*\\){" 1) - ) - ) - ) -) - -;; NOTE: taken from the scala-indent package and modified for Jai. -;; Still uses the js-indent-line as a base, which will have to be -;; replaced when the language is more mature. -(defun jai--indent-on-parentheses () - (when (and (= (char-syntax (char-before)) ?\)) - (= (save-excursion (back-to-indentation) (point)) (1- (point)))) - (js-indent-line))) - -(defun jai--add-self-insert-hooks () - (add-hook 'post-self-insert-hook - 'jai--indent-on-parentheses) - ) - -;;;###autoload -(define-derived-mode jai-mode jai-parent-mode "Jai" - :syntax-table jai-mode-syntax-table - :group 'jai - (setq bidi-paragraph-direction 'left-to-right) - (setq-local require-final-newline mode-require-final-newline) - (setq-local parse-sexp-ignore-comments t) - (setq-local comment-start-skip "\\(//+\\|/\\*+\\)\\s *") - (setq-local comment-start "/*") - (setq-local comment-end "*/") - (setq-local indent-line-function 'js-indent-line) - (setq-local font-lock-defaults '(jai-font-lock-defaults)) - (setq-local beginning-of-defun-function 'jai-beginning-of-defun) - (setq-local end-of-defun-function 'jai-end-of-defun) - - ;; add indent functionality to some characters - (jai--add-self-insert-hooks) - - (font-lock-fontify-buffer)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.jai\\'" . jai-mode)) - -(defconst jai--error-regexp - "^\\([^ :]+\\):\\([0-9]+\\),\\([0-9]+\\):") -(push `(jai ,jai--error-regexp 1 2 3 2) compilation-error-regexp-alist-alist) -(push 'jai compilation-error-regexp-alist) - -(provide 'jai-mode) diff --git a/.emacs.local/noq-mode.el b/.emacs.local/noq-mode.el deleted file mode 100755 index 9e8cd61..0000000 --- a/.emacs.local/noq-mode.el +++ /dev/null @@ -1,86 +0,0 @@ -;;; noq-mode.el --- Major Mode for editing Noq source code -*- lexical-binding: t -*- - -;; Copyright (C) 2021 Alexey Kutepov - -;; Author: Alexey Kutepov -;; URL: https://github.com/tsoding/noq - -;; Permission is hereby granted, free of charge, to any person -;; obtaining a copy of this software and associated documentation -;; files (the "Software"), to deal in the Software without -;; restriction, including without limitation the rights to use, copy, -;; modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is -;; furnished to do so, subject to the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. - -;;; Commentary: -;; -;; Major Mode for editing Noq source code - -(defconst noq-mode-syntax-table - (with-syntax-table (copy-syntax-table) - ;; Python-style comments - (modify-syntax-entry ?# "<") - (modify-syntax-entry ?\n ">") - ;; C/C++ style comments - (modify-syntax-entry ?/ ". 124b") - (modify-syntax-entry ?* ". 23") - (modify-syntax-entry ?\n "> b") - ;; (modify-syntax-entry ?/ ". 124b") - ;; (modify-syntax-entry ?* ". 23") - ;; (modify-syntax-entry ?\n "> b") - ;; Chars are the same as strings - (modify-syntax-entry ?' "\"") - (syntax-table)) - "Syntax table for `noq-mode'.") - -(eval-and-compile - (defconst noq-apply-strategies - '("all" "deep"))) - -(eval-and-compile - (defconst noq-keywords - '("undo" "quit" "delete" "load" "save"))) - -(defconst noq-highlights - `(( - ;; Keywords - ,(regexp-opt noq-keywords 'words) . 'font-lock-keyword-face) - - ;; `Apply` strategies - (,(format "\\(%s\\)[\t ]*|" (mapconcat 'regexp-quote noq-apply-strategies "\\|")) - 1 'font-lock-type-face) - ("\\([0-9]+\\)[\t ]*|" 1 'font-lock-type-face) - - ;; Variables - ("\\(^\\|[^a-zA-Z0-9_]\\)\\([_A-Z][_a-zA-Z0-9]*\\)" 2 'font-lock-variable-name-face) - - ;; Functor names - ("\\([^\n\| ]*\\)[\t ]*::" 1 'font-lock-function-name-face) - )) - -;;;###autoload -(define-derived-mode noq-mode prog-mode "noq" - "Major Mode for editing Noq source code." - :syntax-table noq-mode-syntax-table - (setq font-lock-defaults '(noq-highlights)) - (setq-local comment-start "// ")) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.noq\\'" . noq-mode)) - -(provide 'noq-mode) - -;;; noq-mode.el ends here diff --git a/.emacs.local/nothings-mode.el b/.emacs.local/nothings-mode.el deleted file mode 100755 index 4d20bca..0000000 --- a/.emacs.local/nothings-mode.el +++ /dev/null @@ -1,26 +0,0 @@ -(require 'subr-x) - -(defvar nothings-mode-syntax-table - (let ((table (make-syntax-table))) - ;; C/C++ style comments - (modify-syntax-entry ?/ ". 124b" table) - (modify-syntax-entry ?* ". 23" table) - (modify-syntax-entry ?\n "> b" table) - ;; Preprocessor stuff? - (modify-syntax-entry ?# "." table) - ;; Chars are the same as strings - (modify-syntax-entry ?' "\"" table) - table)) - -(defun nothings-font-lock-keywords () - (list - `("# *[a-zA-Z0-9_]+" . font-lock-preprocessor-face) - `("#.*include \\(\\(<\\|\"\\).*\\(>\\|\"\\)\\)" . (1 font-lock-string-face)))) - -(define-derived-mode nothings-mode prog-mode "Nothings" - "Simple major mode for editing C files." - :syntax-table nothings-mode-syntax-table - (setq-local font-lock-defaults '(nothings-font-lock-keywords)) - (setq-local comment-start "//")) - -(provide 'nothings-mode) diff --git a/.emacs.local/porth-mode.el b/.emacs.local/porth-mode.el deleted file mode 100755 index d089a5a..0000000 --- a/.emacs.local/porth-mode.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; porth-mode.el --- Major Mode for editing Porth source code -*- lexical-binding: t -*- - -;; Copyright (C) 2021 Alexey Kutepov - -;; Author: Alexey Kutepov -;; URL: https://github.com/tsoding/porth - -;; Permission is hereby granted, free of charge, to any person -;; obtaining a copy of this software and associated documentation -;; files (the "Software"), to deal in the Software without -;; restriction, including without limitation the rights to use, copy, -;; modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is -;; furnished to do so, subject to the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. - -;;; Commentary: -;; -;; Major Mode for editing Porth source code. It's Forth but written in Python. - -;; TODO: jump to the opposite side of the blocks with C-M-f and C-M-b -;; I think tuareg-mode can do that with similar end-like block, we try -;; to steal their approach -;; TODO: color the names of definitions in const, memory, proc, etc differently - -(defconst porth-mode-syntax-table - (with-syntax-table (copy-syntax-table) - ;; C/C++ style comments - (modify-syntax-entry ?/ ". 124b") - (modify-syntax-entry ?* ". 23") - (modify-syntax-entry ?\n "> b") - ;; Chars are the same as strings - (modify-syntax-entry ?' "\"") - (syntax-table)) - "Syntax table for `porth-mode'.") - -(eval-and-compile - (defconst porth-keywords - '("if" "else" "while" "do" "include" "memory" "proc" - "const" "end" "offset" "reset" "assert" "in" "inline" - "here" "addr-of" "call-like" "let" "peek" "return" - "var" "cast" "struct"))) - -(defconst porth-highlights - `((,(regexp-opt porth-keywords 'symbols) . font-lock-keyword-face))) - -;;;###autoload -(define-derived-mode porth-mode prog-mode "porth" - "Major Mode for editing Porth source code." - :syntax-table porth-mode-syntax-table - (setq font-lock-defaults '(porth-highlights)) - (setq-local comment-start "// ")) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.porth\\'" . porth-mode)) - -(provide 'porth-mode) - -;;; porth-mode.el ends here diff --git a/.emacs.local/simpc-mode.el b/.emacs.local/simpc-mode.el deleted file mode 100755 index 738c960..0000000 --- a/.emacs.local/simpc-mode.el +++ /dev/null @@ -1,99 +0,0 @@ -(require 'subr-x) - -(defvar simpc-mode-syntax-table - (let ((table (make-syntax-table))) - ;; C/C++ style comments - (modify-syntax-entry ?/ ". 124b" table) - (modify-syntax-entry ?* ". 23" table) - (modify-syntax-entry ?\n "> b" table) - ;; Preprocessor stuff? - (modify-syntax-entry ?# "." table) - ;; Chars are the same as strings - (modify-syntax-entry ?' "\"" table) - ;; Treat <> as punctuation (needed to highlight C++ keywords - ;; properly in template syntax) - (modify-syntax-entry ?< "." table) - (modify-syntax-entry ?> "." table) - - (modify-syntax-entry ?& "." table) - (modify-syntax-entry ?% "." table) - table)) - -(defun simpc-types () - '("char" "int" "long" "short" "void" "bool" "float" "double" "signed" "unsigned" - "char16_t" "char32_t" "char8_t" - "int8_t" "uint8_t" "int16_t" "uint16_t" "int32_t" "uint32_t" "int64_t" "uint64_t" - "uintptr_t" - "size_t")) - -(defun simpc-keywords () - '("auto" "break" "case" "const" "continue" "default" "do" - "else" "enum" "extern" "for" "goto" "if" "register" - "return" "sizeof" "static" "struct" "switch" "typedef" - "union" "volatile" "while" "alignas" "alignof" "and" - "and_eq" "asm" "atomic_cancel" "atomic_commit" "atomic_noexcept" "bitand" - "bitor" "catch" "class" "co_await" - "co_return" "co_yield" "compl" "concept" "const_cast" "consteval" "constexpr" - "constinit" "decltype" "delete" "dynamic_cast" "explicit" "export" "false" - "friend" "inline" "mutable" "namespace" "new" "noexcept" "not" "not_eq" - "nullptr" "operator" "or" "or_eq" "private" "protected" "public" "reflexpr" - "reinterpret_cast" "requires" "static_assert" "static_cast" "synchronized" - "template" "this" "thread_local" "throw" "true" "try" "typeid" "typename" - "using" "virtual" "wchar_t" "xor" "xor_eq")) - -(defun simpc-font-lock-keywords () - (list - `("# *[#a-zA-Z0-9_]+" . font-lock-preprocessor-face) - `("#.*include \\(\\(<\\|\"\\).*\\(>\\|\"\\)\\)" . (1 font-lock-string-face)) - `(,(regexp-opt (simpc-keywords) 'symbols) . font-lock-keyword-face) - `(,(regexp-opt (simpc-types) 'symbols) . font-lock-type-face))) - -;;; TODO: try to replace simpc--space-prefix-len with current-indentation -(defun simpc--space-prefix-len (line) - (- (length line) - (length (string-trim-left line)))) - -(defun simpc--previous-non-empty-line () - (save-excursion - (forward-line -1) - (while (and (not (bobp)) - (string-empty-p - (string-trim-right - (thing-at-point 'line t)))) - (forward-line -1)) - (thing-at-point 'line t))) - -(defun simpc--desired-indentation () - (let ((cur-line (string-trim-right (thing-at-point 'line t))) - (prev-line (string-trim-right (simpc--previous-non-empty-line))) - (indent-len 4)) - (cond - ((and (string-suffix-p "{" prev-line) - (string-prefix-p "}" (string-trim-left cur-line))) - (simpc--space-prefix-len prev-line)) - ((string-suffix-p "{" prev-line) - (+ (simpc--space-prefix-len prev-line) indent-len)) - ((string-prefix-p "}" (string-trim-left cur-line)) - (max (- (simpc--space-prefix-len prev-line) indent-len) 0)) - (t (simpc--space-prefix-len prev-line))))) - -;;; TODO: customizable indentation (amount of spaces, tabs, etc) -(defun simpc-indent-line () - (interactive) - (when (not (bobp)) - (let* ((current-indentation - (simpc--space-prefix-len (thing-at-point 'line t))) - (desired-indentation - (simpc--desired-indentation)) - (n (max (- (current-column) current-indentation) 0))) - (indent-line-to desired-indentation) - (forward-char n)))) - -(define-derived-mode simpc-mode prog-mode "Simple C" - "Simple major mode for editing C files." - :syntax-table simpc-mode-syntax-table - (setq-local font-lock-defaults '(simpc-font-lock-keywords)) - (setq-local indent-line-function 'simpc-indent-line) - (setq-local comment-start "// ")) - -(provide 'simpc-mode) diff --git a/.emacs.rc/autocommit-rc.el b/.emacs.rc/autocommit-rc.el deleted file mode 100755 index ca2ddbe..0000000 --- a/.emacs.rc/autocommit-rc.el +++ /dev/null @@ -1,149 +0,0 @@ -;;; TODO(c3bdae31-4329-4217-98a0-743b9dcbb6d2): extract autocommit into a separate package -;;; -;;; Once e266bfaa-2a01-4881-9e7f-ce2c592f7cdd is done, I think we can do that. - -(defvar rc/autocommit-local-locks - (make-hash-table :test 'equal)) - -(defun rc/file-truename-nilable (filename) - (when filename - (file-truename filename))) - -(defun rc/autocommit--id () - (let ((id (-> default-directory - (locate-dominating-file ".git") - (rc/file-truename-nilable)))) - (when (not id) - (error "%s is not inside of a git repository" default-directory)) - (unless (gethash id rc/autocommit-local-locks) - (puthash id nil rc/autocommit-local-locks)) - id)) - -(defun rc/autocommit--get-lock (lock) - (-> (rc/autocommit--id) - (gethash rc/autocommit-local-locks) - (plist-get lock))) - -(defun rc/autocommit--set-lock (lock value) - (puthash (rc/autocommit--id) - (-> (rc/autocommit--id) - (gethash rc/autocommit-local-locks) - (plist-put lock value)) - rc/autocommit-local-locks)) - -(defun rc/autocommit--toggle-lock (lock) - (-> lock - (rc/autocommit--get-lock) - (not) - (rc/autocommit--set-lock))) - -(defun rc/autocommit--create-dir-locals (file-name) - (write-region "((nil . ((eval . (rc/autocommit-dir-locals)))))" - nil file-name)) - -(defun rc/y-or-n-if (predicate question action) - (when (or (not (funcall predicate)) - (y-or-n-p question)) - (funcall action))) - -;;; TODO(4229cf9a-4768-4f5e-aca1-865256c64a23): rc/autocommit-init-dir should modify dir locals file on AST level -;;; -;;; Right know it just overrides .dir-locals file on text level. I -;;; want it to -;;; - read .dir-locals, -;;; - parse the assoc list, -;;; - check if there is already autocommit stuff -;;; - add autocommit stuff to the assoc list if needed -;;; - and write it back to the file -;;; -;;; That will enable us with modifying dir locals that contains custom -;;; stuff unrelated to autocommit -(defun rc/autocommit-init-dir (&optional dir) - "Initialize autocommit folder." - (interactive "DAutocommit directory: ") - (let* ((autocommit-dir (if dir dir default-directory)) - (file-name (concat autocommit-dir - dir-locals-file))) - (rc/y-or-n-if (-partial #'file-exists-p file-name) - (format "%s already exists. Replace it?" file-name) - (-partial #'rc/autocommit--create-dir-locals file-name)))) - -(defun rc/autocommit-dir-locals () - "The function that has to be put into the .dir-locals.el file -of the autocommit folder as evaluated for any mode." - (interactive) - (auto-revert-mode 1) - (rc/autopull-changes) - (add-hook 'after-save-hook - 'rc/autocommit-changes - nil 'make-it-local)) - -;;; TODO: rc/toggle-autocommit-offline doesn't work correctly -;;; -;;; It should toggle offline for all of the folders at once -(defun rc/toggle-autocommit-offline () - "Toggle between OFFLINE and ONLINE modes. - -Autocommit can be in two modes: OFFLINE and ONLINE. When ONLINE -rc/autocommit-changes does `git commit && git push'. When OFFLINE -rc/autocommit does only `git commit'." - (interactive) - (rc/autocommit--toggle-lock 'autocommit-offline) - (if (rc/autocommit--get-lock 'autocommit-offline) - (message "[OFFLINE] Autocommit Mode") - (message "[ONLINE] Autocommit Mode"))) - -(defun rc/autopull-changes () - "Pull the recent changes. - -Should be invoked once before working with the content under -autocommit. Usually put into the dir locals file." - (interactive) - (when (not (rc/autocommit--get-lock 'autopull-lock)) - (rc/autocommit--set-lock 'autopull-lock t) - (if (rc/autocommit--get-lock 'autocommit-offline) - (message "[OFFLINE] NOT Syncing the Agenda") - (if (y-or-n-p (format "Sync the Agenda? [%s]" (rc/autocommit--id))) - (progn - (message (format "Syncing the Agenda [%s]" (rc/autocommit--id))) - (shell-command "git pull")) - (progn - (rc/autocommit--set-lock 'autocommit-offline t) - (message (format "[OFFLINE] NOT Syncing the Agenda [%s]" - (rc/autocommit--id)))))))) - -(defun rc/autocommit-changes () - "Commit all of the changes under the autocommit folder. - -Should be invoked each time a change is made. Usually put into -dir locals file." - (interactive) - (if (rc/autocommit--get-lock 'autocommit-lock) - (rc/autocommit--set-lock 'autocommit-changed t) - (rc/autocommit--set-lock 'autocommit-lock t) - (rc/autocommit--set-lock 'autocommit-changed nil) - (set-process-sentinel (rc/run-commit-process (rc/autocommit--id)) - (-partial 'rc/autocommit-beat (rc/autocommit--id))))) - -(defun rc/run-commit-process (autocommit-directory) - (let ((default-directory autocommit-directory)) - (let ((autocommit-message (format-time-string "Autocommit %s"))) - (start-process-shell-command - (format "Autocommit-%s" autocommit-directory) - (format "*Autocommit-%s*" autocommit-directory) - (format (if (rc/autocommit--get-lock 'autocommit-offline) - "git add -A && git commit -m \"%s\"" - "git add -A && git commit -m \"%s\" && git push origin master") - autocommit-message))))) - -(defun rc/autocommit-beat (autocommit-directory process event) - (let ((default-directory autocommit-directory)) - (message (if (rc/autocommit--get-lock 'autocommit-offline) - "[OFFLINE] Autocommit: %s" - "Autocommit: %s") - event) - (if (not (rc/autocommit--get-lock 'autocommit-changed)) - (rc/autocommit--set-lock 'autocommit-lock nil) - (rc/autocommit--set-lock 'autocommit-changed nil) - (set-process-sentinel (rc/run-commit-process autocommit-directory) - (-partial 'rc/autocommit-beat autocommit-directory))))) diff --git a/.emacs.rc/misc-rc.el b/.emacs.rc/misc-rc.el deleted file mode 100755 index 84ad5db..0000000 --- a/.emacs.rc/misc-rc.el +++ /dev/null @@ -1,134 +0,0 @@ -(require 'ansi-color) - -(global-set-key (kbd "C-c p") 'find-file-at-point) -(global-set-key (kbd "C-c i m") 'imenu) - -(setq-default inhibit-splash-screen t - make-backup-files nil - compilation-scroll-output t - visible-bell (equal system-type 'windows-nt)) - -(defun rc/colorize-compilation-buffer () - (toggle-read-only) - (ansi-color-apply-on-region compilation-filter-start (point)) - (toggle-read-only)) -(add-hook 'compilation-filter-hook 'rc/colorize-compilation-buffer) - -(defun rc/buffer-file-name () - (if (equal major-mode 'dired-mode) - default-directory - (buffer-file-name))) - -(defun rc/parent-directory (path) - (file-name-directory (directory-file-name path))) - -(defun rc/root-anchor (path anchor) - (cond - ((string= anchor "") nil) - ((file-exists-p (concat (file-name-as-directory path) anchor)) path) - ((string-equal path "/") nil) - (t (rc/root-anchor (rc/parent-directory path) anchor)))) - -(defun rc/clipboard-org-mode-file-link (anchor) - (interactive "sRoot anchor: ") - (let* ((root-dir (rc/root-anchor default-directory anchor)) - (org-mode-file-link (format "file:%s::%d" - (if root-dir - (file-relative-name (rc/buffer-file-name) root-dir) - (rc/buffer-file-name)) - (line-number-at-pos)))) - (kill-new org-mode-file-link) - (message org-mode-file-link))) - -;;; Taken from here: -;;; http://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs -(defun rc/put-file-name-on-clipboard () - "Put the current file name on the clipboard" - (interactive) - (let ((filename (rc/buffer-file-name))) - (when filename - (kill-new filename) - (message filename)))) - -(defun rc/put-buffer-name-on-clipboard () - "Put the current buffer name on the clipboard" - (interactive) - (kill-new (buffer-name)) - (message (buffer-name))) - -(defun rc/kill-autoloads-buffers () - (interactive) - (dolist (buffer (buffer-list)) - (let ((name (buffer-name buffer))) - (when (string-match-p "-autoloads.el" name) - (kill-buffer buffer) - (message "Killed autoloads buffer %s" name))))) - -(defun rc/start-python-simple-http-server () - (interactive) - (shell-command "python -m SimpleHTTPServer 3001 &" - "*Simple Python HTTP Server*")) - -(global-set-key (kbd "C-x p s") 'rc/start-python-simple-http-server) - -;;; Taken from here: -;;; http://blog.bookworm.at/2007/03/pretty-print-xml-with-emacs.html -(defun bf-pretty-print-xml-region (begin end) - "Pretty format XML markup in region. You need to have nxml-mode -http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do -this. The function inserts linebreaks to separate tags that have -nothing but whitespace between them. It then indents the markup -by using nxml's indentation rules." - (interactive "r") - (save-excursion - (nxml-mode) - (goto-char begin) - (while (search-forward-regexp "\>[ \\t]*\<" nil t) - (backward-char) (insert "\n")) - (indent-region begin end)) - (message "Ah, much better!")) - -;;; Stolen from http://ergoemacs.org/emacs/emacs_unfill-paragraph.html -(defun rc/unfill-paragraph () - "Replace newline chars in current paragraph by single spaces. -This command does the inverse of `fill-paragraph'." - (interactive) - (let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum' - (fill-paragraph nil))) - -(global-set-key (kbd "C-c M-q") 'rc/unfill-paragraph) - -(defun rc/load-path-here () - (interactive) - (add-to-list 'load-path default-directory)) - -(defconst rc/frame-transparency 85) - -(defun rc/toggle-transparency () - (interactive) - (let ((frame-alpha (frame-parameter nil 'alpha))) - (if (or (not frame-alpha) - (= (cadr frame-alpha) 100)) - (set-frame-parameter nil 'alpha - `(,rc/frame-transparency - ,rc/frame-transparency)) - (set-frame-parameter nil 'alpha '(100 100))))) - -(defun rc/duplicate-line () - "Duplicate current line" - (interactive) - (let ((column (- (point) (point-at-bol))) - (line (let ((s (thing-at-point 'line t))) - (if s (string-remove-suffix "\n" s) "")))) - (move-end-of-line 1) - (newline) - (insert line) - (move-beginning-of-line 1) - (forward-char column))) - -(global-set-key (kbd "C-,") 'rc/duplicate-line) - -;;; A little hack which fixes a problem with meta key in fluxbox under VNC. -(setq x-alt-keysym 'meta) - -(setq confirm-kill-emacs 'y-or-n-p) diff --git a/.emacs.rc/org-mode-rc.el b/.emacs.rc/org-mode-rc.el deleted file mode 100755 index 0c1d533..0000000 --- a/.emacs.rc/org-mode-rc.el +++ /dev/null @@ -1,68 +0,0 @@ -(global-set-key (kbd "C-x a") 'org-agenda) -(global-set-key (kbd "C-c C-x j") #'org-clock-jump-to-current-clock) - -(setq org-agenda-files (list "~/Documents/Agenda/")) - -(setq org-export-backends '(md)) - -(defun rc/org-increment-move-counter () - (interactive) - - (defun default (x d) - (if x x d)) - - (let* ((point (point)) - (move-counter-name "MOVE_COUNTER") - (move-counter-value (-> (org-entry-get point move-counter-name) - (default "0") - (string-to-number) - (1+)))) - (org-entry-put point move-counter-name - (number-to-string move-counter-value))) - nil) - -(defun rc/org-get-heading-name () - (nth 4 (org-heading-components))) - -(defun rc/org-kill-heading-name-save () - (interactive) - (let ((heading-name (rc/org-get-heading-name))) - (kill-new heading-name) - (message "Kill \"%s\"" heading-name))) - -(global-set-key (kbd "C-x p w") 'rc/org-kill-heading-name-save) - -(setq org-agenda-custom-commands - '(("u" "Unscheduled" tags "+personal-SCHEDULED={.+}-DEADLINE={.+}/!+TODO" - ((org-agenda-sorting-strategy '(priority-down)))) - ("p" "Personal" ((agenda "" ((org-agenda-tag-filter-preset (list "+personal")))))) - ("w" "Work" ((agenda "" ((org-agenda-tag-filter-preset (list "+work")))))) - )) - -;;; org-cliplink - -(rc/require 'org-cliplink) - -(global-set-key (kbd "C-x p i") 'org-cliplink) - -(defun rc/cliplink-task () - (interactive) - (org-cliplink-retrieve-title - (substring-no-properties (current-kill 0)) - '(lambda (url title) - (insert (if title - (concat "* TODO " title - "\n [[" url "][" title "]]") - (concat "* TODO " url - "\n [[" url "]]")))))) -(global-set-key (kbd "C-x p t") 'rc/cliplink-task) - -;;; org-capture - -(setq org-capture-templates - '(("p" "Capture task" entry (file "~/Documents/Agenda/Tasks.org") - "* TODO %?\n SCHEDULED: %t\n") - ("K" "Cliplink capture task" entry (file "~/Documents/Agenda/Tasks.org") - "* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 1))) -(define-key global-map "\C-cc" 'org-capture) - diff --git a/.emacs.rc/rc.el b/.emacs.rc/rc.el deleted file mode 100755 index c57f380..0000000 --- a/.emacs.rc/rc.el +++ /dev/null @@ -1,34 +0,0 @@ -(add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) -;; (add-to-list 'package-archives -;; '("melpa-stable" . "https://stable.melpa.org/packages/") t) - -(defvar rc/package-contents-refreshed nil) - -(defun rc/package-refresh-contents-once () - (when (not rc/package-contents-refreshed) - (setq rc/package-contents-refreshed t) - (package-refresh-contents))) - -(defun rc/require-one-package (package) - (when (not (package-installed-p package)) - (rc/package-refresh-contents-once) - (package-install package))) - -(defun rc/require (&rest packages) - (dolist (package packages) - (rc/require-one-package package))) - -(defun rc/require-theme (theme) - (let ((theme-package (->> theme - (symbol-name) - (funcall (-flip #'concat) "-theme") - (intern)))) - (rc/require theme-package) - (load-theme theme t))) - -(rc/require 'dash) -(require 'dash) - -(rc/require 'dash-functional) -(require 'dash-functional) diff --git a/.emacs.snippets/c++-mode/.yas-parents b/.emacs.snippets/c++-mode/.yas-parents deleted file mode 100755 index cd49161..0000000 --- a/.emacs.snippets/c++-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-mode \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/catch b/.emacs.snippets/c++-mode/catch deleted file mode 100755 index 7f4744d..0000000 --- a/.emacs.snippets/c++-mode/catch +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: catch (...) { ... } -# key: catch -# -- -catch ($1) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/fore b/.emacs.snippets/c++-mode/fore deleted file mode 100755 index d78601b..0000000 --- a/.emacs.snippets/c++-mode/fore +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: for (...: ...) { ... } -# key: fore -# -- -for ($1: $2) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/ns b/.emacs.snippets/c++-mode/ns deleted file mode 100755 index 48529f2..0000000 --- a/.emacs.snippets/c++-mode/ns +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: namespace Namespace -# key: ns -# -- -namespace ${1:Namespace} { -$0 -} // namespace $1 \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/once b/.emacs.snippets/c++-mode/once deleted file mode 100755 index c54b47e..0000000 --- a/.emacs.snippets/c++-mode/once +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# name: #ifndef XXX; #define XXX; #endif -# key: once -# -- -#ifndef ${1:`(upcase (replace-regexp-in-string "\\." "_" (file-name-nondirectory (buffer-file-name))))`_} -#define $1 - -$0 - -#endif // $1 \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/qdebug b/.emacs.snippets/c++-mode/qdebug deleted file mode 100755 index 1d427f7..0000000 --- a/.emacs.snippets/c++-mode/qdebug +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: qdebug -# key: qdebug -# -- -qDebug() << "----------------------------------------"; -qDebug() << "$0"; -qDebug() << "----------------------------------------"; \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/try b/.emacs.snippets/c++-mode/try deleted file mode 100755 index 6991f11..0000000 --- a/.emacs.snippets/c++-mode/try +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: try { ... } -# key: try -# -- -try { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/uns b/.emacs.snippets/c++-mode/uns deleted file mode 100755 index 8c7db5b..0000000 --- a/.emacs.snippets/c++-mode/uns +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: using namespace std; -# key: uns -# -- -using namespace std; \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/vec b/.emacs.snippets/c++-mode/vec deleted file mode 100755 index f414f06..0000000 --- a/.emacs.snippets/c++-mode/vec +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: std::vector -# key: vec -# -- -std::vector<$1> $2;$0 \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/block b/.emacs.snippets/c-like-syntax/block deleted file mode 100755 index 95661e8..0000000 --- a/.emacs.snippets/c-like-syntax/block +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: { ... } -# key: { -# -- -{ -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/elif b/.emacs.snippets/c-like-syntax/elif deleted file mode 100755 index 842e9fa..0000000 --- a/.emacs.snippets/c-like-syntax/elif +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: else if (...) { ... } -# key: elif -# -- -else if (${1:condition}) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/else b/.emacs.snippets/c-like-syntax/else deleted file mode 100755 index ed256b4..0000000 --- a/.emacs.snippets/c-like-syntax/else +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: else { ... } -# key: else -# -- -else { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/for b/.emacs.snippets/c-like-syntax/for deleted file mode 100755 index ec70b51..0000000 --- a/.emacs.snippets/c-like-syntax/for +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: for (...; ...; ...) { ... } -# key: for -# -- -for (${1:init}; ${2:condition}; ${3:increment}) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/if b/.emacs.snippets/c-like-syntax/if deleted file mode 100755 index cde6dd3..0000000 --- a/.emacs.snippets/c-like-syntax/if +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: if (...) { ... } -# key: if -# -- -if (${1:condition}) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-like-syntax/while b/.emacs.snippets/c-like-syntax/while deleted file mode 100755 index 33097eb..0000000 --- a/.emacs.snippets/c-like-syntax/while +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: while (...) { ... } -# key: while -# -- -while (${1:condition}) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/c-mode/.yas-parents b/.emacs.snippets/c-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/c-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/c-mode/inc b/.emacs.snippets/c-mode/inc deleted file mode 100755 index ce7431a..0000000 --- a/.emacs.snippets/c-mode/inc +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: #include <...> -# key: inc -# -- -#include <$0> \ No newline at end of file diff --git a/.emacs.snippets/c-mode/incq b/.emacs.snippets/c-mode/incq deleted file mode 100755 index 5c91955..0000000 --- a/.emacs.snippets/c-mode/incq +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: #include "..." -# key: incq -# -- -#include "$0" \ No newline at end of file diff --git a/.emacs.snippets/c-mode/main b/.emacs.snippets/c-mode/main deleted file mode 100755 index 9cf10cd..0000000 --- a/.emacs.snippets/c-mode/main +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: int main(argc, argv) { ... } -# key: main -# -- -int main(int argc, char *argv[]) -{ -$0 -return 0; -} \ No newline at end of file diff --git a/.emacs.snippets/css-mode/bg b/.emacs.snippets/css-mode/bg deleted file mode 100755 index af38f31..0000000 --- a/.emacs.snippets/css-mode/bg +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: background-color: ... -# key: bg -# -- -background-color: #${1:DDD}; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/bgi b/.emacs.snippets/css-mode/bgi deleted file mode 100755 index 3e9e39b..0000000 --- a/.emacs.snippets/css-mode/bgi +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: background-image: ... -# key: bgi -# -- -background-image: url($1); diff --git a/.emacs.snippets/css-mode/bor b/.emacs.snippets/css-mode/bor deleted file mode 100755 index 780979a..0000000 --- a/.emacs.snippets/css-mode/bor +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: border size style color -# key: bor -# -- -border: ${1:1px} ${2:solid} #${3:999}; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/cl b/.emacs.snippets/css-mode/cl deleted file mode 100755 index f4c5dd1..0000000 --- a/.emacs.snippets/css-mode/cl +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: clear: ... -# key: cl -# -- -clear: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/dispb b/.emacs.snippets/css-mode/dispb deleted file mode 100755 index 4019241..0000000 --- a/.emacs.snippets/css-mode/dispb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: display: block -# key: dispb -# -- -display: block; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/dispi b/.emacs.snippets/css-mode/dispi deleted file mode 100755 index 2aa3bbb..0000000 --- a/.emacs.snippets/css-mode/dispi +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: display: inline -# key: dispi -# -- -display: inline; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/dispn b/.emacs.snippets/css-mode/dispn deleted file mode 100755 index 0e6d132..0000000 --- a/.emacs.snippets/css-mode/dispn +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: display: none -# key: dispn -# -- -display: none; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/ff b/.emacs.snippets/css-mode/ff deleted file mode 100755 index c04faa5..0000000 --- a/.emacs.snippets/css-mode/ff +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: font-family: ... -# key: ff -# -- -font-family: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/fs b/.emacs.snippets/css-mode/fs deleted file mode 100755 index 33498bb..0000000 --- a/.emacs.snippets/css-mode/fs +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: font-size: ... -# key: fs -# -- -font-size: ${12px}; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/mar b/.emacs.snippets/css-mode/mar deleted file mode 100755 index 0e8ddaf..0000000 --- a/.emacs.snippets/css-mode/mar +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: margin: ... -# key: mar -# -- -margin: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/marb b/.emacs.snippets/css-mode/marb deleted file mode 100755 index 2ed557d..0000000 --- a/.emacs.snippets/css-mode/marb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: margin-bottom: ... -# key: marb -# -- -margin-bottom: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/marl b/.emacs.snippets/css-mode/marl deleted file mode 100755 index 3e0a2d6..0000000 --- a/.emacs.snippets/css-mode/marl +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: margin-left: ... -# key: marl -# -- -margin-left: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/marr b/.emacs.snippets/css-mode/marr deleted file mode 100755 index dfc0336..0000000 --- a/.emacs.snippets/css-mode/marr +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: margin-right: ... -# key: marr -# -- -margin-right: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/mart b/.emacs.snippets/css-mode/mart deleted file mode 100755 index e17e451..0000000 --- a/.emacs.snippets/css-mode/mart +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: margin-top: ... -# key: mart -# -- -margin-top: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/pad b/.emacs.snippets/css-mode/pad deleted file mode 100755 index b40db05..0000000 --- a/.emacs.snippets/css-mode/pad +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: padding: ... -# key: pad -# -- -padding: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/padb b/.emacs.snippets/css-mode/padb deleted file mode 100755 index d537eed..0000000 --- a/.emacs.snippets/css-mode/padb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: padding-bottom: ... -# key: padb -# -- -padding-bottom: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/padl b/.emacs.snippets/css-mode/padl deleted file mode 100755 index 0ade3f5..0000000 --- a/.emacs.snippets/css-mode/padl +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: padding-left: ... -# key: padl -# -- -padding-left: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/padr b/.emacs.snippets/css-mode/padr deleted file mode 100755 index 73c140c..0000000 --- a/.emacs.snippets/css-mode/padr +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: padding-right: ... -# key: padr -# -- -padding-right: $1; \ No newline at end of file diff --git a/.emacs.snippets/css-mode/padt b/.emacs.snippets/css-mode/padt deleted file mode 100755 index 526450d..0000000 --- a/.emacs.snippets/css-mode/padt +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: padding-top: ... -# key: padt -# -- -padding-top: $1; \ No newline at end of file diff --git a/.emacs.snippets/d-mode/.yas-parents b/.emacs.snippets/d-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/d-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/d-mode/imm b/.emacs.snippets/d-mode/imm deleted file mode 100755 index 7c71c19..0000000 --- a/.emacs.snippets/d-mode/imm +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: immutable -# key: imm -# -- -immutable $0 \ No newline at end of file diff --git a/.emacs.snippets/d-mode/import b/.emacs.snippets/d-mode/import deleted file mode 100755 index cbcbfe3..0000000 --- a/.emacs.snippets/d-mode/import +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: import <...>; -# key: imp -# -- -import $0; \ No newline at end of file diff --git a/.emacs.snippets/emacs-lisp-mode/emacs-lisp-module b/.emacs.snippets/emacs-lisp-mode/emacs-lisp-module deleted file mode 100755 index a18b637..0000000 --- a/.emacs.snippets/emacs-lisp-mode/emacs-lisp-module +++ /dev/null @@ -1,42 +0,0 @@ -# -*- mode: snippet -*- -# name: emacs lisp module skeleton -# key: emacs-lisp-module -# -- -;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- ${2:Package Description} -*- lexical-binding: t -*- - -;; Copyright (C) `(format-time-string "%Y" (current-time))` ${3:Alexey Kutepov } - -;; Author: $3 -;; URL: $4 - -;; Permission is hereby granted, free of charge, to any person -;; obtaining a copy of this software and associated documentation -;; files (the "Software"), to deal in the Software without -;; restriction, including without limitation the rights to use, copy, -;; modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is -;; furnished to do so, subject to the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. - -;;; Commentary: - -;; $5 - -;;; Code: - -$0 - -(provide '${6:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`}) - -;;; $1 ends here \ No newline at end of file diff --git a/.emacs.snippets/emacs-lisp-mode/pacmacs-module b/.emacs.snippets/emacs-lisp-mode/pacmacs-module deleted file mode 100755 index a04a9a1..0000000 --- a/.emacs.snippets/emacs-lisp-mode/pacmacs-module +++ /dev/null @@ -1,41 +0,0 @@ -# -*- mode: snippet -*- -# name: pacmacs module skeleton -# key: pacmacs-module -# -- -;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- Pacman for Emacs -*- lexical-binding: t -*- - -;; Copyright (C) `(format-time-string "%Y" (current-time))` Codingteam - -;; Author: Codingteam -;; Maintainer: Alexey Kutepov -;; URL: http://github.com/rexim/pacmacs.el - -;; Permission is hereby granted, free of charge, to any person -;; obtaining a copy of this software and associated documentation -;; files (the "Software"), to deal in the Software without -;; restriction, including without limitation the rights to use, copy, -;; modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is -;; furnished to do so, subject to the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. - -;;; Commentary: - -;; $2 - -;;; Code: - -$0 - -;;; $1 ends here \ No newline at end of file diff --git a/.emacs.snippets/fan-mode/.yas-parents b/.emacs.snippets/fan-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/fan-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/fundamental-mode/mit b/.emacs.snippets/fundamental-mode/mit deleted file mode 100755 index 417476a..0000000 --- a/.emacs.snippets/fundamental-mode/mit +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: snippet -*- -# name: mit -# key: mit -# -- -Copyright `(format-time-string "%Y")` Alexey Kutepov - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.emacs.snippets/fundamental-mode/sb b/.emacs.snippets/fundamental-mode/sb deleted file mode 100755 index 67bea13..0000000 --- a/.emacs.snippets/fundamental-mode/sb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: sb -# key: sb -# expand-env: ((yas-indent-line 'fixed)) -# -- -${1:$(make-string (+ 2 (string-width yas-text)) ? )}SMOL -${1:$(make-string (+ 2 (string-width yas-text)) ? )}BREK -($1 minutes) \ No newline at end of file diff --git a/.emacs.snippets/html-mode/tag b/.emacs.snippets/html-mode/tag deleted file mode 100755 index ca6b6ca..0000000 --- a/.emacs.snippets/html-mode/tag +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: tag -# key: tag -# -- -<$1> - $0 - \ No newline at end of file diff --git a/.emacs.snippets/html-mode/tagi b/.emacs.snippets/html-mode/tagi deleted file mode 100755 index 2d03bef..0000000 --- a/.emacs.snippets/html-mode/tagi +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: tagi -# key: tagi -# -- -<$1>$0 \ No newline at end of file diff --git a/.emacs.snippets/java-mode/.yas-parents b/.emacs.snippets/java-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/java-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/java-mode/ps b/.emacs.snippets/java-mode/ps deleted file mode 100755 index 19834c2..0000000 --- a/.emacs.snippets/java-mode/ps +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: public static -# key: ps -# -- -public static \ No newline at end of file diff --git a/.emacs.snippets/java-mode/psv b/.emacs.snippets/java-mode/psv deleted file mode 100755 index ae30d38..0000000 --- a/.emacs.snippets/java-mode/psv +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: public static void -# key: psv -# -- -public static void \ No newline at end of file diff --git a/.emacs.snippets/js-mode/.yas-parents b/.emacs.snippets/js-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/js-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/js-mode/item b/.emacs.snippets/js-mode/item deleted file mode 100755 index 88d5813..0000000 --- a/.emacs.snippets/js-mode/item +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: item -# key: item -# -- -${1:Item} { -$0 -} // $1 \ No newline at end of file diff --git a/.emacs.snippets/latex-mode/begin b/.emacs.snippets/latex-mode/begin deleted file mode 100755 index 4ddab25..0000000 --- a/.emacs.snippets/latex-mode/begin +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: \begin{environment} ... \end{environment} -# key: begin -# -- -\begin{${1:environment}} -$0 -\end{$1} \ No newline at end of file diff --git a/.emacs.snippets/makefile-gmake-mode/make b/.emacs.snippets/makefile-gmake-mode/make deleted file mode 100755 index dfb3cc1..0000000 --- a/.emacs.snippets/makefile-gmake-mode/make +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# name: make -# key: make -# expand-env: ((yas-indent-line 'fixed)) -# -- -CFLAGS=-Wall -Wextra -std=c11 -pedantic -LIBS= - -$1: $2 - $(CC) $(CFLAGS) -o $1 $2 $(LIBS) diff --git a/.emacs.snippets/markdown-mode/todo b/.emacs.snippets/markdown-mode/todo deleted file mode 100755 index f1aa870..0000000 --- a/.emacs.snippets/markdown-mode/todo +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: todo -# key: todo -# type: command -# binding: C-x t -# -- -(if (region-active-p) - (yas-expand-snippet "`yas-selected-text`") - (yas-expand-snippet "")) \ No newline at end of file diff --git a/.emacs.snippets/nix-mode/.yas-parents b/.emacs.snippets/nix-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/nix-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/body b/.emacs.snippets/nxml-mode/body deleted file mode 100755 index 1fceda3..0000000 --- a/.emacs.snippets/nxml-mode/body +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: body -# -- - -$0 - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/div b/.emacs.snippets/nxml-mode/div deleted file mode 100755 index 9234e58..0000000 --- a/.emacs.snippets/nxml-mode/div +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name:
\n...\n
-# key: div -# -- -
-$0 -
\ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/head b/.emacs.snippets/nxml-mode/head deleted file mode 100755 index 0b16f2b..0000000 --- a/.emacs.snippets/nxml-mode/head +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: head -# -- - -$0 - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/html b/.emacs.snippets/nxml-mode/html deleted file mode 100755 index f6d9fd4..0000000 --- a/.emacs.snippets/nxml-mode/html +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: html -# -- - -$0 - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/link b/.emacs.snippets/nxml-mode/link deleted file mode 100755 index e9ddd6f..0000000 --- a/.emacs.snippets/nxml-mode/link +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: -# key: link -# -- - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/meta b/.emacs.snippets/nxml-mode/meta deleted file mode 100755 index 1434071..0000000 --- a/.emacs.snippets/nxml-mode/meta +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: -# key: meta -# -- - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/pom b/.emacs.snippets/nxml-mode/pom deleted file mode 100755 index c1435f2..0000000 --- a/.emacs.snippets/nxml-mode/pom +++ /dev/null @@ -1,17 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: pom -# -- - - 4.0.0 - ${1:me.rexim} - ${2:artifactId} - ${3:0.0.1-SNAPSHOT} - - - UTF-8 - - diff --git a/.emacs.snippets/nxml-mode/script b/.emacs.snippets/nxml-mode/script deleted file mode 100755 index 482c809..0000000 --- a/.emacs.snippets/nxml-mode/script +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/span b/.emacs.snippets/nxml-mode/span deleted file mode 100755 index 60c78e2..0000000 --- a/.emacs.snippets/nxml-mode/span +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: \n...\n -# key: span -# -- -$0 \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/tag b/.emacs.snippets/nxml-mode/tag deleted file mode 100755 index d555e34..0000000 --- a/.emacs.snippets/nxml-mode/tag +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: \n...\n -# key: tag -# -- -<${1:tag}$2> -$0 - \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/tag.1 b/.emacs.snippets/nxml-mode/tag.1 deleted file mode 100755 index fd979eb..0000000 --- a/.emacs.snippets/nxml-mode/tag.1 +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: tag -# -- -<${1:tag}$2>$0 \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/tag.2 b/.emacs.snippets/nxml-mode/tag.2 deleted file mode 100755 index 89c664a..0000000 --- a/.emacs.snippets/nxml-mode/tag.2 +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: -# key: tag -# -- -<${1:tag} $2/>$0 \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/title b/.emacs.snippets/nxml-mode/title deleted file mode 100755 index 0a80a54..0000000 --- a/.emacs.snippets/nxml-mode/title +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: ... -# key: title -# -- -$0 \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/xml b/.emacs.snippets/nxml-mode/xml deleted file mode 100755 index 60d0f1d..0000000 --- a/.emacs.snippets/nxml-mode/xml +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: -# key: xml -# -- - \ No newline at end of file diff --git a/.emacs.snippets/org-mode/pomo b/.emacs.snippets/org-mode/pomo deleted file mode 100755 index e05b643..0000000 --- a/.emacs.snippets/org-mode/pomo +++ /dev/null @@ -1,43 +0,0 @@ -# -*- mode: snippet -*- -# name: pomo table -# key: pomo -# -- -|-------+-------+----------| -| start | type | duration | -|-------+-------+----------| -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 20m | -|-------+-------+----------| -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 20m | -|-------+-------+----------| -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 20m | -|-------+-------+----------| -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 10m | -| | work | 20m | -| | break | 20m | -|-------+-------+----------| diff --git a/.emacs.snippets/perl-mode/.yas-parents b/.emacs.snippets/perl-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/perl-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/perl-mode/fore b/.emacs.snippets/perl-mode/fore deleted file mode 100755 index 319ab36..0000000 --- a/.emacs.snippets/perl-mode/fore +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: foreach (...) { ... } -# key: fore -# -- -foreach ($1) { -$0 -} \ No newline at end of file diff --git a/.emacs.snippets/porth-mode/main b/.emacs.snippets/porth-mode/main deleted file mode 100755 index af40b93..0000000 --- a/.emacs.snippets/porth-mode/main +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: main -# key: main -# -- -include "std.porth" - -proc main in - $0 -end \ No newline at end of file diff --git a/.emacs.snippets/porth-mode/ras b/.emacs.snippets/porth-mode/ras deleted file mode 100755 index d509e93..0000000 --- a/.emacs.snippets/porth-mode/ras +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: ras -# key: ras -# -- -here eputs ": Assertion Failed: $0" eputs -1 exit \ No newline at end of file diff --git a/.emacs.snippets/porth-mode/todo b/.emacs.snippets/porth-mode/todo deleted file mode 100755 index 14d163f..0000000 --- a/.emacs.snippets/porth-mode/todo +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: todo -# key: todo -# -- -here eputs ": TODO: $0" eputs -1 exit \ No newline at end of file diff --git a/.emacs.snippets/porth-mode/unreach b/.emacs.snippets/porth-mode/unreach deleted file mode 100755 index 8ef0a5a..0000000 --- a/.emacs.snippets/porth-mode/unreach +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: unreach -# key: unreach -# -- -here eputs ": unreachable: $0" eputs -69 exit \ No newline at end of file diff --git a/.emacs.snippets/rust-mode/.yas-parents b/.emacs.snippets/rust-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/rust-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/scala-mode/.yas-parents b/.emacs.snippets/scala-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/scala-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/snippet-mode/snip b/.emacs.snippets/snippet-mode/snip deleted file mode 100755 index 94524d1..0000000 --- a/.emacs.snippets/snippet-mode/snip +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: snippet snippet -# key: snip -# -- -# -*- mode: snippet -*- -# name: $1 -# key: ${2:`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`} -# -- -$0 \ No newline at end of file diff --git a/.emacs.snippets/typescript-mode/.yas-parents b/.emacs.snippets/typescript-mode/.yas-parents deleted file mode 100755 index d927521..0000000 --- a/.emacs.snippets/typescript-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -c-like-syntax \ No newline at end of file diff --git a/.emacs_lsp b/.emacs_lsp new file mode 100755 index 0000000..31bddd5 --- /dev/null +++ b/.emacs_lsp @@ -0,0 +1,196 @@ +(require 'package) +(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") +(package-initialize) + +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) +(eval-and-compile + (setq use-package-always-ensure t + use-package-expand-minimally t)) + +(unless (package-installed-p 'benchmark-init) + (package-refresh-contents) + (package-install 'benchmark-init)) + +(require 'benchmark-init) +;; To disable collection of benchmark data after init is done. +(add-hook 'after-init-hook 'benchmark-init/deactivate) + +;; shell +(global-set-key (kbd "C-c RET") (lambda () (interactive) (ansi-term "/bin/zsh"))) + +;; Look +(tool-bar-mode 0) +(menu-bar-mode 0) +(scroll-bar-mode 0) +(column-number-mode 1) +(show-paren-mode 1) +(electric-pair-mode 1) +(global-display-line-numbers-mode 1) +(setq display-line-numbers-type 'relative) +(set-face-attribute 'default nil :height 200) +(global-set-key (kbd "") 'keyboard-escape-quit) +;; Auto-refresh dired on file change +(add-hook 'dired-mode-hook 'auto-revert-mode) + +(unless (package-installed-p 'gruvbox-theme) + (package-install 'gruvbox-theme)) +(load-theme 'gruvbox-dark-soft t) + +(setq-default display-fill-column-indicator-column 79) ; 80 column indicator - Emacs columns are 0-based... +(global-display-fill-column-indicator-mode 1) + +(unless (package-installed-p 'lsp-mode) + (package-install 'lsp-mode)) + +(use-package lsp-mode + :init + :config + (add-hook 'lsp-mode-hook 'lsp-ui-mode) + :custom + ;; what to use when checking on-save. "check" is default, I prefer clippy + (lsp-rust-analyzer-cargo-watch-command "clippy") + (lsp-eldoc-render-all t) + (lsp-idle-delay 0.6) + ;; enable / disable the hints as you prefer: + (lsp-inlay-hint-enable t) + ;; These are optional configurations. See https://emacs-lsp.github.io/lsp-mode/page/lsp-rust-analyzer/#lsp-rust-analyzer-display-chaining-hints for a full list + (lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial") + (lsp-rust-analyzer-display-chaining-hints t) + (lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil) + (lsp-rust-analyzer-display-closure-return-type-hints t) + (lsp-rust-analyzer-display-parameter-hints nil) + (lsp-rust-analyzer-display-reborrow-hints nil) + :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) + (c-mode . lsp) + (python-mode . lsp)) + :commands lsp) + +(use-package lsp-ui + :ensure + :commands lsp-ui-mode + :custom + (lsp-ui-peek-always-show t) + (lsp-ui-sideline-show-hover t) + (lsp-ui-doc-enable nil)) + +;;https://robert.kra.hn/posts/rust-emacs-setup/ +(use-package rustic + :ensure + :bind (:map rustic-mode-map + ("M-j" . lsp-ui-imenu) + ("M-?" . lsp-find-references) + ("C-c C-c l" . flycheck-list-errors) + ("C-c C-c a" . lsp-execute-code-action) + ("C-c C-c r" . lsp-rename) + ("C-c C-c q" . lsp-workspace-restart) + ("C-c C-c Q" . lsp-workspace-shutdown) + ("C-c C-c s" . lsp-rust-analyzer-status)) + :config + ;; uncomment for less flashiness + ;; (setq lsp-eldoc-hook nil) + ;; (setq lsp-enable-symbol-highlighting nil) + ;; (setq lsp-signature-auto-activate nil) + + ;; comment to disable rustfmt on save + (setq rustic-format-on-save t) + (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook)) + +(defun rk/rustic-mode-hook () + ;; so that run C-c C-c C-r works without having to confirm, but don't try to + ;; save rust buffers that are not file visiting. Once + ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should + ;; no longer be necessary. + (when buffer-file-name + (setq-local buffer-save-without-query t)) + (add-hook 'before-save-hook 'lsp-format-buffer nil t)) + +;; company +(unless (package-installed-p 'company) + (package-install 'company)) + +(use-package company + :after lsp-mode + :hook (prog-mode . company-mode) + :bind (:map company-active-map + ("" . company-complete-selection)) + (:map lsp-mode-map + ("" . company-indent-or-complete-common)) + :custom + (company-minimum-prefix-length 1) + (company-idle-delay 0.0)) + +(setq neo-theme (if (display-graphic-p) 'icons)) + +;; Use keybindings +(use-package grip-mode + :ensure t + :bind (:map markdown-mode-command-map + ("g" . grip-mode))) + +;; neotree +(unless (package-installed-p 'neotree) + (package-install 'neotree) + (package-install 'all-the-icons)) + +(setq neo-theme (if (display-graphic-p) 'icons)) +(setq neo-smart-open t) +(global-set-key [f8] 'neotree-toggle) + +;; Simpleclip +(unless (package-installed-p 'simpleclip) + (package-install 'simpleclip)) + +(global-set-key (kbd "C-c C-c") 'simpleclip-copy) +(global-set-key (kbd "C-c C-v") 'simpleclip-paste) + +;; Download Evil +(unless (package-installed-p 'evil) + (package-install 'evil)) + +;; Enable Evil +(require 'evil) +(evil-mode 1) + +;; exwm +(unless (package-installed-p 'exwm) + (package-install 'exwm)) + +(require 'exwm) +(require 'exwm-config) +;;(exwm-config-example) + +(defun my-untabify-all-lines () + "Select all lines in the buffer and run 'untabify' on them." + (interactive) + (save-excursion + (goto-char (point-min)) + (push-mark (point-max) t t) + (untabify (region-beginning) (region-end)))) + +(global-set-key (kbd "C-c C-x") 'my-untabify-all-lines) + +;; +;; Epitech configuration +;; +(add-to-list 'load-path "~/.emacs.d/lisp") +(load "site-start.d/epitech-init.el") + +(setq-default indent-tabs-mode nil) +(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. + '(inhibit-startup-screen t) + '(package-selected-packages + '(benchmark-init company simpleclip rust-mode org-cliplink neotree magit gruber-darker-theme go-mode evil dash-functional all-the-icons))) +(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_piscine b/.emacs_piscine index d2a4852..54a5877 100644 --- a/.emacs_piscine +++ b/.emacs_piscine @@ -1,6 +1,7 @@ (require 'package) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") (package-initialize) (unless (package-installed-p 'use-package) @@ -10,10 +11,16 @@ (setq use-package-always-ensure t use-package-expand-minimally t)) -(load "~/.emacs.rc/rc.el") -(load "~/.emacs.rc/misc-rc.el") -(load "~/.emacs.rc/org-mode-rc.el") -(load "~/.emacs.rc/autocommit-rc.el") +(unless (package-installed-p 'benchmark-init) + (package-refresh-contents) + (package-install 'benchmark-init)) + +(require 'benchmark-init) +;; To disable collection of benchmark data after init is done. +(add-hook 'after-init-hook 'benchmark-init/deactivate) + +;; shell +(global-set-key (kbd "C-c RET") (lambda () (interactive) (ansi-term "/bin/zsh"))) ;; Look (tool-bar-mode 0) @@ -22,22 +29,38 @@ (column-number-mode 1) (show-paren-mode 1) (electric-pair-mode 1) -(global-display-line-numbers-mode 1) (global-font-lock-mode 0) +(global-display-line-numbers-mode 1) (setq display-line-numbers-type 'relative) (set-face-attribute 'default nil :height 200) (global-set-key (kbd "") 'keyboard-escape-quit) +;; Auto-refresh dired on file change +(add-hook 'dired-mode-hook 'auto-revert-mode) (unless (package-installed-p 'gruvbox-theme) (package-install 'gruvbox-theme)) - - (load-theme 'gruvbox-dark-soft t) +(load-theme 'gruvbox-dark-soft t) (setq-default display-fill-column-indicator-column 79) ; 80 column indicator - Emacs columns are 0-based... (global-display-fill-column-indicator-mode 1) (setq neo-theme (if (display-graphic-p) 'icons)) +;; Use keybindings +(use-package grip-mode + :ensure t + :bind (:map markdown-mode-command-map + ("g" . grip-mode))) + +;; neotree +(unless (package-installed-p 'neotree) + (package-install 'neotree) + (package-install 'all-the-icons)) + +(setq neo-theme (if (display-graphic-p) 'icons)) +(setq neo-smart-open t) +(global-set-key [f8] 'neotree-toggle) + ;; Simpleclip (unless (package-installed-p 'simpleclip) (package-install 'simpleclip)) @@ -53,6 +76,10 @@ (require 'evil) (evil-mode 1) +;; exwm +(unless (package-installed-p 'exwm) + (package-install 'exwm)) + (defun my-untabify-all-lines () "Select all lines in the buffer and run 'untabify' on them." (interactive) @@ -75,8 +102,9 @@ ;; 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. + '(inhibit-startup-screen t) '(package-selected-packages - '(company simpleclip rust-mode org-cliplink neotree magit gruber-darker-theme go-mode evil dash-functional all-the-icons))) + '(benchmark-init company simpleclip rust-mode org-cliplink neotree magit gruber-darker-theme go-mode evil dash-functional all-the-icons))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/MANIFEST b/MANIFEST index ab548a6..8cd859f 100755 --- a/MANIFEST +++ b/MANIFEST @@ -1,7 +1,4 @@ .emacs|symlink| -.emacs.rc|symlink| -.emacs.snippets|symlink| -.emacs.local|symlink| .gitconfig|symlink| .rexim|symlink| .npmrc|symlink|