commit 8709837ef1efab7195511fb24d12907e066f3de5 Author: ALittlePatate Date: Wed Oct 11 21:51:24 2023 +0200 feat: initial commit diff --git a/.Xresources b/.Xresources new file mode 100755 index 0000000..ab8dce6 --- /dev/null +++ b/.Xresources @@ -0,0 +1,70 @@ +Xft.dpi: 96 +Xft.antialias: 1 +Xft.hinting: 1 +Xft.hintstyle: hintmedium + +URxvt.termName: rxvt +URxvt*depth: 32 +URxvt.transparent: false +URxvt.font: xft:mono:size=22 +URxvt.scrollBar: false +URxvt.iconFile: .rexim/icons/terminal-icon.png +URxvt*lineSpace: -1 +URxvt*letterSpace: -1 + +! Gruber-Darker +URxvt*foreground: #e4e4ef +URxvt*background: #181818 +URxvt*color0: #2E3436 +URxvt*color1: #a40000 +URxvt*color2: #4E9A06 +URxvt*color3: #C4A000 +URxvt*color4: #3465A4 +URxvt*color5: #75507B +URxvt*color6: #ce5c00 +URxvt*color7: #babdb9 +URxvt*color8: #555753 +URxvt*color9: #EF2929 +URxvt*color10: #8AE234 +URxvt*color11: #FCE94F +URxvt*color12: #729FCF +URxvt*color13: #AD7FA8 +URxvt*color14: #fcaf3e +URxvt*color15: #EEEEEC + +! ! Zenburn +! URxvt*background: #3f3f3f +! URxvt*foreground: #dcdccc +! URxvt*cursorColor: #aaaaaa +! ! URxvt*colorUL: #366060 +! ! URxvt*underlineColor: #dfaf8f +! URxvt*color0: #3f3f3f +! URxvt*color1: #cc9393 +! URxvt*color2: #7f9f7f +! URxvt*color3: #d0bf8f +! URxvt*color4: #6ca0a3 +! URxvt*color5: #dc8cc3 +! URxvt*color6: #93e0e3 +! URxvt*color7: #dcdccc +! URxvt*color8: #989890 +! URxvt*color9: #dca3a3 +! URxvt*color10: #bfebbf +! URxvt*color11: #f0dfaf +! URxvt*color12: #8cd0d3 +! URxvt*color13: #dc8cc3 +! URxvt*color14: #93e0e3 +! URxvt*color15: #ffffff + +! Adwaita +! URxvt*background: #EDEDED +! URxvt*foreground: #2E3436 + +URxvt.perl-ext-common: resize-font,matcher +URxvt.url-launcher: /usr/bin/xdg-open +URxvt.matcher.button: 1 + +URxvt.keysym.C-parenright: resize-font:smaller +URxvt.keysym.C-equal: resize-font:bigger +URxvt.keysym.C-agrave: resize-font:reset + + diff --git a/.apvlvrc b/.apvlvrc new file mode 100755 index 0000000..51d2dcc --- /dev/null +++ b/.apvlvrc @@ -0,0 +1 @@ +set inverted=yes diff --git a/.emacs b/.emacs new file mode 100755 index 0000000..6a6ed32 --- /dev/null +++ b/.emacs @@ -0,0 +1,84 @@ +(require 'package) +(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(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)) + +(load "~/.emacs.rc/rc.el") +(load "~/.emacs.rc/misc-rc.el") +(load "~/.emacs.rc/org-mode-rc.el") +(load "~/.emacs.rc/autocommit-rc.el") + +;; 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) +(setq-default indent-tabs-mode t) +(setq-default tab-width 4) +(setq c-set-style "k&r") +(setq c-basic-offset 4) +(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) +(rc/require-theme 'gruber-darker) + +;; 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) + +;; Magit +(unless (package-installed-p 'magit) + (package-install 'magit)) + +;; go-mode +(unless (package-installed-p 'go-mode) + (package-install 'go-mode)) + +;; Rust mode +(unless (package-installed-p 'rust-mode) + (package-refresh-contents) + (package-install 'rust-mode)) + + +;; Download Evil +(unless (package-installed-p 'evil) + (package-install 'evil)) + +;; Enable Evil +(require 'evil) +(evil-mode 1) +(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. + '(package-selected-packages + '(evil rust-mode go-mode smex simpleclip paredit org-cliplink neotree multiple-cursors magit ido-completing-read+ helm haskell-mode gruber-darker-theme 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.local/.gitkeep b/.emacs.local/.gitkeep new file mode 100755 index 0000000..e69de29 diff --git a/.emacs.local/basm-mode.el b/.emacs.local/basm-mode.el new file mode 100755 index 0000000..0d0972b --- /dev/null +++ b/.emacs.local/basm-mode.el @@ -0,0 +1,75 @@ +;;; 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 new file mode 100755 index 0000000..0363883 --- /dev/null +++ b/.emacs.local/jai-mode.el @@ -0,0 +1,214 @@ +;; 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 new file mode 100755 index 0000000..9e8cd61 --- /dev/null +++ b/.emacs.local/noq-mode.el @@ -0,0 +1,86 @@ +;;; 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 new file mode 100755 index 0000000..4d20bca --- /dev/null +++ b/.emacs.local/nothings-mode.el @@ -0,0 +1,26 @@ +(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 new file mode 100755 index 0000000..d089a5a --- /dev/null +++ b/.emacs.local/porth-mode.el @@ -0,0 +1,70 @@ +;;; 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 new file mode 100755 index 0000000..738c960 --- /dev/null +++ b/.emacs.local/simpc-mode.el @@ -0,0 +1,99 @@ +(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 new file mode 100755 index 0000000..ca2ddbe --- /dev/null +++ b/.emacs.rc/autocommit-rc.el @@ -0,0 +1,149 @@ +;;; 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 new file mode 100755 index 0000000..5720c93 --- /dev/null +++ b/.emacs.rc/misc-rc.el @@ -0,0 +1,137 @@ +(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 + tab-width 4 + indent-tabs-mode nil + compilation-scroll-output t + default-input-method "russian-computer" + 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 new file mode 100755 index 0000000..0c1d533 --- /dev/null +++ b/.emacs.rc/org-mode-rc.el @@ -0,0 +1,68 @@ +(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 new file mode 100755 index 0000000..c57f380 --- /dev/null +++ b/.emacs.rc/rc.el @@ -0,0 +1,34 @@ +(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 new file mode 100755 index 0000000..cd49161 --- /dev/null +++ b/.emacs.snippets/c++-mode/.yas-parents @@ -0,0 +1 @@ +c-mode \ No newline at end of file diff --git a/.emacs.snippets/c++-mode/catch b/.emacs.snippets/c++-mode/catch new file mode 100755 index 0000000..7f4744d --- /dev/null +++ b/.emacs.snippets/c++-mode/catch @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..d78601b --- /dev/null +++ b/.emacs.snippets/c++-mode/fore @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..48529f2 --- /dev/null +++ b/.emacs.snippets/c++-mode/ns @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..c54b47e --- /dev/null +++ b/.emacs.snippets/c++-mode/once @@ -0,0 +1,10 @@ +# -*- 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 new file mode 100755 index 0000000..1d427f7 --- /dev/null +++ b/.emacs.snippets/c++-mode/qdebug @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..6991f11 --- /dev/null +++ b/.emacs.snippets/c++-mode/try @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..8c7db5b --- /dev/null +++ b/.emacs.snippets/c++-mode/uns @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..f414f06 --- /dev/null +++ b/.emacs.snippets/c++-mode/vec @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..95661e8 --- /dev/null +++ b/.emacs.snippets/c-like-syntax/block @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..842e9fa --- /dev/null +++ b/.emacs.snippets/c-like-syntax/elif @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..ed256b4 --- /dev/null +++ b/.emacs.snippets/c-like-syntax/else @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..ec70b51 --- /dev/null +++ b/.emacs.snippets/c-like-syntax/for @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..cde6dd3 --- /dev/null +++ b/.emacs.snippets/c-like-syntax/if @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..33097eb --- /dev/null +++ b/.emacs.snippets/c-like-syntax/while @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/c-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/c-mode/inc b/.emacs.snippets/c-mode/inc new file mode 100755 index 0000000..ce7431a --- /dev/null +++ b/.emacs.snippets/c-mode/inc @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..5c91955 --- /dev/null +++ b/.emacs.snippets/c-mode/incq @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..9cf10cd --- /dev/null +++ b/.emacs.snippets/c-mode/main @@ -0,0 +1,9 @@ +# -*- 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 new file mode 100755 index 0000000..af38f31 --- /dev/null +++ b/.emacs.snippets/css-mode/bg @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..3e9e39b --- /dev/null +++ b/.emacs.snippets/css-mode/bgi @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..780979a --- /dev/null +++ b/.emacs.snippets/css-mode/bor @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..f4c5dd1 --- /dev/null +++ b/.emacs.snippets/css-mode/cl @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..4019241 --- /dev/null +++ b/.emacs.snippets/css-mode/dispb @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..2aa3bbb --- /dev/null +++ b/.emacs.snippets/css-mode/dispi @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..0e6d132 --- /dev/null +++ b/.emacs.snippets/css-mode/dispn @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..c04faa5 --- /dev/null +++ b/.emacs.snippets/css-mode/ff @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..33498bb --- /dev/null +++ b/.emacs.snippets/css-mode/fs @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..0e8ddaf --- /dev/null +++ b/.emacs.snippets/css-mode/mar @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..2ed557d --- /dev/null +++ b/.emacs.snippets/css-mode/marb @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..3e0a2d6 --- /dev/null +++ b/.emacs.snippets/css-mode/marl @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..dfc0336 --- /dev/null +++ b/.emacs.snippets/css-mode/marr @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..e17e451 --- /dev/null +++ b/.emacs.snippets/css-mode/mart @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..b40db05 --- /dev/null +++ b/.emacs.snippets/css-mode/pad @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..d537eed --- /dev/null +++ b/.emacs.snippets/css-mode/padb @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..0ade3f5 --- /dev/null +++ b/.emacs.snippets/css-mode/padl @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..73c140c --- /dev/null +++ b/.emacs.snippets/css-mode/padr @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..526450d --- /dev/null +++ b/.emacs.snippets/css-mode/padt @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/d-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/d-mode/imm b/.emacs.snippets/d-mode/imm new file mode 100755 index 0000000..7c71c19 --- /dev/null +++ b/.emacs.snippets/d-mode/imm @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..cbcbfe3 --- /dev/null +++ b/.emacs.snippets/d-mode/import @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..a18b637 --- /dev/null +++ b/.emacs.snippets/emacs-lisp-mode/emacs-lisp-module @@ -0,0 +1,42 @@ +# -*- 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 new file mode 100755 index 0000000..a04a9a1 --- /dev/null +++ b/.emacs.snippets/emacs-lisp-mode/pacmacs-module @@ -0,0 +1,41 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/fan-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/fundamental-mode/mit b/.emacs.snippets/fundamental-mode/mit new file mode 100755 index 0000000..417476a --- /dev/null +++ b/.emacs.snippets/fundamental-mode/mit @@ -0,0 +1,24 @@ +# -*- 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 new file mode 100755 index 0000000..67bea13 --- /dev/null +++ b/.emacs.snippets/fundamental-mode/sb @@ -0,0 +1,8 @@ +# -*- 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 new file mode 100755 index 0000000..ca6b6ca --- /dev/null +++ b/.emacs.snippets/html-mode/tag @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..2d03bef --- /dev/null +++ b/.emacs.snippets/html-mode/tagi @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/java-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/java-mode/ps b/.emacs.snippets/java-mode/ps new file mode 100755 index 0000000..19834c2 --- /dev/null +++ b/.emacs.snippets/java-mode/ps @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..ae30d38 --- /dev/null +++ b/.emacs.snippets/java-mode/psv @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/js-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/js-mode/item b/.emacs.snippets/js-mode/item new file mode 100755 index 0000000..88d5813 --- /dev/null +++ b/.emacs.snippets/js-mode/item @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..4ddab25 --- /dev/null +++ b/.emacs.snippets/latex-mode/begin @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..dfb3cc1 --- /dev/null +++ b/.emacs.snippets/makefile-gmake-mode/make @@ -0,0 +1,10 @@ +# -*- 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 new file mode 100755 index 0000000..f1aa870 --- /dev/null +++ b/.emacs.snippets/markdown-mode/todo @@ -0,0 +1,9 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/nix-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/body b/.emacs.snippets/nxml-mode/body new file mode 100755 index 0000000..1fceda3 --- /dev/null +++ b/.emacs.snippets/nxml-mode/body @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..9234e58 --- /dev/null +++ b/.emacs.snippets/nxml-mode/div @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..0b16f2b --- /dev/null +++ b/.emacs.snippets/nxml-mode/head @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..f6d9fd4 --- /dev/null +++ b/.emacs.snippets/nxml-mode/html @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..e9ddd6f --- /dev/null +++ b/.emacs.snippets/nxml-mode/link @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..1434071 --- /dev/null +++ b/.emacs.snippets/nxml-mode/meta @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..c1435f2 --- /dev/null +++ b/.emacs.snippets/nxml-mode/pom @@ -0,0 +1,17 @@ +# -*- 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 new file mode 100755 index 0000000..482c809 --- /dev/null +++ b/.emacs.snippets/nxml-mode/script @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: \ No newline at end of file diff --git a/.emacs.snippets/nxml-mode/span b/.emacs.snippets/nxml-mode/span new file mode 100755 index 0000000..60c78e2 --- /dev/null +++ b/.emacs.snippets/nxml-mode/span @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..d555e34 --- /dev/null +++ b/.emacs.snippets/nxml-mode/tag @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..fd979eb --- /dev/null +++ b/.emacs.snippets/nxml-mode/tag.1 @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..89c664a --- /dev/null +++ b/.emacs.snippets/nxml-mode/tag.2 @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..0a80a54 --- /dev/null +++ b/.emacs.snippets/nxml-mode/title @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..60d0f1d --- /dev/null +++ b/.emacs.snippets/nxml-mode/xml @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100755 index 0000000..e05b643 --- /dev/null +++ b/.emacs.snippets/org-mode/pomo @@ -0,0 +1,43 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/perl-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/perl-mode/fore b/.emacs.snippets/perl-mode/fore new file mode 100755 index 0000000..319ab36 --- /dev/null +++ b/.emacs.snippets/perl-mode/fore @@ -0,0 +1,7 @@ +# -*- 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 new file mode 100755 index 0000000..af40b93 --- /dev/null +++ b/.emacs.snippets/porth-mode/main @@ -0,0 +1,9 @@ +# -*- 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 new file mode 100755 index 0000000..d509e93 --- /dev/null +++ b/.emacs.snippets/porth-mode/ras @@ -0,0 +1,6 @@ +# -*- 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 new file mode 100755 index 0000000..14d163f --- /dev/null +++ b/.emacs.snippets/porth-mode/todo @@ -0,0 +1,6 @@ +# -*- 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 new file mode 100755 index 0000000..8ef0a5a --- /dev/null +++ b/.emacs.snippets/porth-mode/unreach @@ -0,0 +1,6 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/rust-mode/.yas-parents @@ -0,0 +1 @@ +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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/scala-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.emacs.snippets/snippet-mode/snip b/.emacs.snippets/snippet-mode/snip new file mode 100755 index 0000000..94524d1 --- /dev/null +++ b/.emacs.snippets/snippet-mode/snip @@ -0,0 +1,9 @@ +# -*- 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 new file mode 100755 index 0000000..d927521 --- /dev/null +++ b/.emacs.snippets/typescript-mode/.yas-parents @@ -0,0 +1 @@ +c-like-syntax \ No newline at end of file diff --git a/.ghci b/.ghci new file mode 100755 index 0000000..c398bcf --- /dev/null +++ b/.ghci @@ -0,0 +1,3 @@ +:set prompt "λ> " +:set -XOverloadedStrings +:set editor vim diff --git a/.gitconfig b/.gitconfig new file mode 100755 index 0000000..a9924e5 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,18 @@ +[user] + email = maxime@patate.dev + name = ALittlePatate + signingkey = 3160243661FE9E9D +[merge] + conflictStyle = diff3 +[magit] + hideCampaign = true +[alias] + tree = log --graph --decorate --pretty=oneline --abbrev-commit --all +[commit] + gpgsign = true +[credential "https://github.com"] + helper = + helper = !/usr/bin/gh auth git-credential +[credential "https://gist.github.com"] + helper = + helper = !/usr/bin/gh auth git-credential diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/.i3status.conf b/.i3status.conf new file mode 100755 index 0000000..6dff295 --- /dev/null +++ b/.i3status.conf @@ -0,0 +1,52 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 +} + +order += "wireless _first_" +order += "battery all" +order += "volume master" +order += "disk /" +order += "load" +order += "cpu_temperature 0" +order += "tztime local" + +volume master { + format = "Volume: %volume" + format_muted = "Muted" + device = "pulse:alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink" +} + +cpu_temperature 0 { + format = "Tea: %degrees °C" +} + +wireless _first_ { + # format_up = "W: (%quality at %essid) %ip" + format_up = "W: up" + format_down = "W: down" +} + +battery all { + format = "Focus: %percentage" +} + +tztime local { + format = "%Y-%m-%d %H:%M:%S" +} + +load { + format = "Hot Loads: %1min" +} + +disk "/" { + format = "Porn folder: %avail" +} diff --git a/.jmacsrc b/.jmacsrc new file mode 100755 index 0000000..b80a776 --- /dev/null +++ b/.jmacsrc @@ -0,0 +1,3 @@ +* +-linums +:include /etc/joe/jmacsrc \ No newline at end of file diff --git a/.nexrc b/.nexrc new file mode 100755 index 0000000..9da581c --- /dev/null +++ b/.nexrc @@ -0,0 +1,2 @@ +set number +set autoindent diff --git a/.npmrc b/.npmrc new file mode 100755 index 0000000..e60ae71 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +ignore-scripts=false diff --git a/.rexim/icons/terminal-icon.png b/.rexim/icons/terminal-icon.png new file mode 100755 index 0000000..122e51c Binary files /dev/null and b/.rexim/icons/terminal-icon.png differ diff --git a/.rexim/icons/terminal-icon.svg b/.rexim/icons/terminal-icon.svg new file mode 100755 index 0000000..2c424c5 --- /dev/null +++ b/.rexim/icons/terminal-icon.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/.screenlayout/home-setup-b590.sh b/.screenlayout/home-setup-b590.sh new file mode 100755 index 0000000..36c1c5e --- /dev/null +++ b/.screenlayout/home-setup-b590.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 1920x312 --rotate normal --output VIRTUAL1 --off --output DP1 --off --output VGA1 --primary --mode 1920x1080 --pos 0x0 --rotate normal diff --git a/.screenlayout/home-setup-g50.sh b/.screenlayout/home-setup-g50.sh new file mode 100755 index 0000000..403e0d9 --- /dev/null +++ b/.screenlayout/home-setup-g50.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output DP-1 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --off --output eDP-1 --mode 1366x768 --pos 1920x312 --rotate normal --output HDMI-2 --off diff --git a/.screenlayout/home-setup.sh b/.screenlayout/home-setup.sh new file mode 100755 index 0000000..49ab597 --- /dev/null +++ b/.screenlayout/home-setup.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ `hostname` = "rexim-B590" ]; then + ~/.screenlayout/home-setup-b590.sh +else + ~/.screenlayout/home-setup-g50.sh +fi diff --git a/.screenlayout/portable-setup-b590.sh b/.screenlayout/portable-setup-b590.sh new file mode 100755 index 0000000..5c2372d --- /dev/null +++ b/.screenlayout/portable-setup-b590.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output HDMI1 --off --output LVDS1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output VIRTUAL1 --off --output DP1 --off --output VGA1 --off diff --git a/.screenlayout/portable-setup-g50.sh b/.screenlayout/portable-setup-g50.sh new file mode 100755 index 0000000..ece1ec4 --- /dev/null +++ b/.screenlayout/portable-setup-g50.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output DP-1 --off --output HDMI-1 --off --output eDP-1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output HDMI-2 --off diff --git a/.screenlayout/portable-setup.sh b/.screenlayout/portable-setup.sh new file mode 100755 index 0000000..99b54c9 --- /dev/null +++ b/.screenlayout/portable-setup.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ `hostname` = "rexim-B590" ]; then + ~/.screenlayout/portable-setup-b590.sh +else + ~/.screenlayout/portable-setup-g50.sh +fi diff --git a/.tmux.conf b/.tmux.conf new file mode 100755 index 0000000..a571a51 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,6 @@ +unbind C-b +set -g prefix C-x +bind C-x send-prefix +set -g mode-keys emacs +set -g status-keys emacs +set -s escape-time 0 diff --git a/.urxvt/ext/resize-font b/.urxvt/ext/resize-font new file mode 100755 index 0000000..dcf76c0 --- /dev/null +++ b/.urxvt/ext/resize-font @@ -0,0 +1,170 @@ +# vim:ft=perl:fenc=utf-8:tw=80 +# Copyright (c) 2009-, Simon Lundström +# Copyright (c) 2014 Maarten de Vries +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +# https://github.com/simmel/urxvt-resize-font + +my @fonts = ( + {'name' => 'font', 'code' => 710}, + {'name' => 'boldFont', 'code' => 711}, + {'name' => 'italicFont', 'code' => 712}, + {'name' => 'boldItalicFont', 'code' => 713}, +); + +my @fixed = qw(4x6 5x7 5x8 6x9 6x10 6x12 6x13 7x13 7x14 8x13 8x16 9x15 9x18 + 10x20 12x24); +my $step; + +sub on_start { + my ($self) = @_; + + foreach (@fonts) { + $_->{'default'} = $self->resource($_->{'name'}); + } + + $step = $self->x_resource("%.step") || 2; +} + +sub on_init { + my ($self) = @_; + my $commands = { + "smaller" => "C-minus", + "bigger" => "C-plus", + "reset" => "C-equal", + "show" => "C-question", + }; + bind_hotkeys($self, $commands); + + () +} + +sub bind_hotkeys { + my ($self, $commands) = @_; + + for (keys %$commands) { + my $hotkey = $$commands{$_}; + my $hotkey_bound = $self->{'term'}->x_resource("keysym.$hotkey"); + if (!defined($hotkey_bound) ) { + # Support old-style key bindings + if ($self->x_resource("%.$_")) { + $hotkey = $self->x_resource("%.$_"); + } + + # FIXME If we're bound to a keysym, don't bind the default. + $self->bind_action($hotkey, "%:$_") or + warn "unable to register '$hotkey' as hotkey for $_"; + } + else { + if ($hotkey_bound !~ /^resize-font:/) { + warn "Hotkey $$commands{$_} already bound to $hotkey_bound, not ". + "binding to resize-font:$_ by default."; + } + } + } +} + +sub on_action { + my ($self, $string) = @_; + + if ($string eq "bigger") { + foreach (@fonts) { + next if not defined($_->{'default'}); + update_font_size($self, $_, +$step); + } + } + elsif ($string eq "smaller") { + foreach (@fonts) { + next if not defined($_->{'default'}); + update_font_size($self, $_, -$step); + } + } + elsif ($string eq "reset") { + foreach (@fonts) { + next if not defined($_->{'default'}); + set_font($self, $_, $_->{'default'}); + } + } + elsif ($string eq "show") { + + my $term = $self->{'term'}; + $term->{'resize-font'}{'overlay'} = { + ov => $term->overlay_simple(0, -1, format_font_info($self)), + to => urxvt::timer + ->new + ->start(urxvt::NOW + 1) + ->cb(sub { + delete $term->{'resize-font'}{'overlay'}; + }), + }; + } + + () +} + +sub get_font { + my ($self, $name) = @_; + return $self->resource($name); +} + +sub set_font { + my ($self, $font, $new) = @_; + $self->cmd_parse(sprintf("\33]%d;%s\007", $font->{'code'}, $new)); +} + +sub update_font_size { + my ($self, $font, $delta) = @_; + my $regex = qr"(?<=size=)(\d+)"; + my $current = get_font($self, $font->{'name'}); + + my ($index) = grep { $fixed[$_] eq $current } 0..$#fixed; + if ($index or $index eq 0) { + my $inc = $delta / abs($delta); + $index += $inc; + if ($index < 0) { $index = 0; } + if ($index > $#fixed) { $index = $#fixed; } + $current = $fixed[$index]; + } + elsif ($current =~ /^-/) { + my @font = split(/-/, $current); + # https://en.wikipedia.org/wiki/X_logical_font_description + my $newsize = $font[7]+$delta; + $font[7] = $newsize if ($newsize > 0); + $current = join('-', @font); + } + else { + my $newsize = $1+$delta if ($current =~ /$regex/); + $current =~ s/$regex/$newsize/ge if ($newsize > 0); + } + set_font($self, $font, $current); +} + +sub format_font_info { + my ($self) = @_; + + my $width = 0; + foreach (@fonts) { + my $length = length($_->{'name'}); + $width = $length > $width ? $length : $width; + } + ++$width; + + my $info = ''; + foreach (@fonts) { + $info .= sprintf("%-${width}s %s\n", $_->{'name'} . ':', + get_font($self, $_->{'name'})); + } + + return $info; +} diff --git a/.vimrc b/.vimrc new file mode 100755 index 0000000..2d39de2 --- /dev/null +++ b/.vimrc @@ -0,0 +1,17 @@ +syntax on +filetype plugin indent on +set tabstop=4 +set shiftwidth=4 +set expandtab +set guifont=Iosevka\ 20 +set guioptions-=m +set guioptions-=T +set noesckeys +set relativenumber +set number +set ignorecase +set smartcase +set incsearch +set autochdir +set cinoptions=l1 +colorscheme desert diff --git a/MANIFEST b/MANIFEST new file mode 100755 index 0000000..ab548a6 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,10 @@ +.emacs|symlink| +.emacs.rc|symlink| +.emacs.snippets|symlink| +.emacs.local|symlink| +.gitconfig|symlink| +.rexim|symlink| +.npmrc|symlink| +.jmacsrc|symlink| +.apvlvrc|symlink| +.nexrc|symlink| diff --git a/MANIFEST.linux b/MANIFEST.linux new file mode 100755 index 0000000..fc5460d --- /dev/null +++ b/MANIFEST.linux @@ -0,0 +1,11 @@ +.Xresources|symlink| +.tmux.conf|symlink| +.vimrc|symlink| +i3|symlink|.config +.screenlayout|symlink| +.ghci|symlink| +.i3status.conf|symlink| +bin/hhkb-i3|symlink| +bin/map-wacom|symlink| +settings.ini|symlink|.config/gtk-3.0 +.urxvt/ext/resize-font|symlink| diff --git a/README.md b/README.md new file mode 100755 index 0000000..0cc37dc --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# dotfiles # + +dotfiles for my arch, based on rexim's ones. +stuff are missing (like proper emacs conf but whatever). + +# Requirements # + +* Emacs 24.5+ +* rxvt-unicode v9.19+ +* zsh 5.0.2+ (with oh-my-zsh) +* tmux 1.8+ +* Git +* feh +* maim +* xclip +* blight diff --git a/aide.txt b/aide.txt new file mode 100755 index 0000000..112fdf2 --- /dev/null +++ b/aide.txt @@ -0,0 +1 @@ +installer sof-firmware si pulseaudio marche pas diff --git a/bg.png b/bg.png new file mode 100644 index 0000000..48006de Binary files /dev/null and b/bg.png differ diff --git a/bin/gcc-path b/bin/gcc-path new file mode 100755 index 0000000..abc6d0a --- /dev/null +++ b/bin/gcc-path @@ -0,0 +1,3 @@ +#!/bin/sh + +echo | gcc -E -Wp,-v - diff --git a/bin/hhkb-i3 b/bin/hhkb-i3 new file mode 100755 index 0000000..bae2664 --- /dev/null +++ b/bin/hhkb-i3 @@ -0,0 +1,6 @@ +#!/bin/sh + +set -xe + +setxkbmap -layout us,ru -option grp:shifts_toggle,ctrl:nocaps,compose:ralt +xmodmap -e 'keycode 102 = Super_L' diff --git a/bin/map-wacom b/bin/map-wacom new file mode 100755 index 0000000..29a37d7 --- /dev/null +++ b/bin/map-wacom @@ -0,0 +1,3 @@ +#!/bin/sh + +xsetwacom set "Wacom Intuos S Pen stylus" maptooutput 1920x1080+0+0 diff --git a/bin/png_to_ora b/bin/png_to_ora new file mode 100755 index 0000000..9eb5c78 --- /dev/null +++ b/bin/png_to_ora @@ -0,0 +1,31 @@ +#!/bin/sh + +if [[ $# -ne 1 ]]; then + >&2 echo "Usage ./png_to_ora " + exit 1 +fi + +set -xe + +PNG_PATH="$1" +PNG_FILE=$(basename "${PNG_PATH}") +PNG_NAME="${PNG_FILE%.*}" + +mkdir -p "${PNG_NAME}/data" + +echo "image/openraster" > "${PNG_NAME}/mimetype" +cp "${PNG_FILE}" "${PNG_NAME}/data/layer-00.png" +echo "}" > "${PNG_NAME}/data/layer-00-strokemap.dat" +cat < "${PNG_NAME}/stack.xml" + + + + + + +EOF + +pushd "${PNG_NAME}" +zip -r ../"${PNG_NAME}.ora" * +popd +rm -r "${PNG_NAME}" diff --git a/bin/prepare-pdf-noting b/bin/prepare-pdf-noting new file mode 100755 index 0000000..e9af0e3 --- /dev/null +++ b/bin/prepare-pdf-noting @@ -0,0 +1,40 @@ +#!/bin/sh + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +pdf_to_pngs() { + mkdir -p "$2" + pdftoppm -rx 300 -ry 300 -png "$1" "$2/page" +} + +invert_pngs() { + pushd "$1" + for page in page-*.png; do + convert -negate "${page}" "neg-${page}" + mv "neg-${page}" "${page}" + done + popd +} + +pngs_to_oras() { + pushd "$1" + for page in page-*.png; do + "${SCRIPT_DIR}/png_to_ora" "${page}" + rm "${page}" + done + popd +} + +if [[ $# -ne 2 ]]; then + >&2 echo "Usage ./prepare-pdf-noting " + exit 1 +fi + +set -xe + +PDF_FILE="$1" +NOTES_FOLDER="$2" + +pdf_to_pngs "${PDF_FILE}" "${NOTES_FOLDER}" +invert_pngs "${NOTES_FOLDER}" +pngs_to_oras "${NOTES_FOLDER}" diff --git a/bin/region-to-gif b/bin/region-to-gif new file mode 100755 index 0000000..7460ace --- /dev/null +++ b/bin/region-to-gif @@ -0,0 +1,3 @@ +#!/bin/sh + +byzanz-record $(xrectsel "--x=%x --y=%y --width=%w --height=%h") out.gif diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..44e03bb --- /dev/null +++ b/deploy.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +SCRIPT_DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )" + +symlinkFile() { + filename="$SCRIPT_DIR/$1" + destination="$HOME/$2/$1" + + mkdir -p $(dirname "$destination") + + if [ ! -L "$destination" ]; then + if [ -e "$destination" ]; then + echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually" && exit 1 + else + ln -s "$filename" "$destination" + echo "[OK] $filename -> $destination" + fi + else + echo "[WARNING] $filename already symlinked" + fi +} + +deployManifest() { + for row in $(cat $SCRIPT_DIR/$1); do + filename=$(echo $row | cut -d \| -f 1) + operation=$(echo $row | cut -d \| -f 2) + destination=$(echo $row | cut -d \| -f 3) + + case $operation in + symlink) + symlinkFile $filename $destination + ;; + + *) + echo "[WARNING] Unknown operation $operation. Skipping..." + ;; + esac + done +} + +echo "--- Common configs ---" +deployManifest MANIFEST +echo "--- Linux configs ---" +deployManifest MANIFEST.linux diff --git a/i3/config b/i3/config new file mode 100755 index 0000000..cf9ae1b --- /dev/null +++ b/i3/config @@ -0,0 +1,188 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +exec_always feh --bg-scale ~/dotfiles/bg.png + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +# font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +font pango:Iosevka 9 + +# Before i3 v4.8, we used to recommend this one as the default: +# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +# The font above is very space-efficient, that is, it looks good, sharp and +# clear in small sizes. However, its unicode glyph coverage is limited, the old +# X core fonts rendering does not support right-to-left and this being a bitmap +# font, it doesn’t scale on retina/hidpi displays. + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec i3-sensible-terminal + +# Pulse Audio controls +#alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink + +# Pulse Audio controls +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound + +# Sreen brightness controls +bindsym XF86MonBrightnessUp exec blight set +20% # increase screen brightness +bindsym XF86MonBrightnessDown exec blight set -20% # decrease screen brightness + +# Screen capture +bindsym $mod+Print exec maim -s | xclip -selection clipboard -t image/png + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec dmenu_run +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+l focus left +bindsym $mod+semicolon focus down +bindsym $mod+k focus up +bindsym $mod+m focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+l move left +bindsym $mod+Shift+m move right +bindsym $mod+Shift+semicolon move down + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} + +bindsym Mod1+F1 exec "~/bin/hhkb-i3" +bindsym $mod+Shift+h exec "~/.screenlayout/home-setup.sh" +bindsym $mod+Shift+p exec "~/.screenlayout/portable-setup.sh" +bindsym $mod+Shift+w exec "~/bin/map-wacom" +bindsym $mod+b exec "boomer" +bindsym $mod+Shift+n exec "i3lock --image ~/dotfiles/bg.png" +bindsym --release $mod+Shift+l exec "slock" + +focus_follows_mouse no + +hide_edge_borders both + +exec xinput set-prop "Elan Touchpad" "libinput Tapping Enabled" 1 diff --git a/settings.ini b/settings.ini new file mode 100755 index 0000000..2e6a497 --- /dev/null +++ b/settings.ini @@ -0,0 +1,6 @@ +# https://wiki.archlinux.org/index.php/GTK +[Settings] +#gtk-icon-theme-name = Adwaita +#gtk-theme-name = Adwaita +#gtk-font-name = DejaVu Sans 11 +gtk-application-prefer-dark-theme = true