feat: initial commit

This commit is contained in:
2023-10-11 21:51:24 +02:00
commit 8709837ef1
128 changed files with 2464 additions and 0 deletions

70
.Xresources Executable file
View File

@@ -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

1
.apvlvrc Executable file
View File

@@ -0,0 +1 @@
set inverted=yes

84
.emacs Executable file
View File

@@ -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 "<escape>") '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.
)

0
.emacs.local/.gitkeep Executable file
View File

75
.emacs.local/basm-mode.el Executable file
View File

@@ -0,0 +1,75 @@
;;; basm-mode.el --- Major Mode for editing BASM Assembly Code -*- lexical-binding: t -*-
;; Copyright (C) 2021 Alexey Kutepov <reximkut@gmail.com>
;; Author: Alexey Kutepov <reximkut@gmail.com>
;; 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

214
.emacs.local/jai-mode.el Executable file
View File

@@ -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)

86
.emacs.local/noq-mode.el Executable file
View File

@@ -0,0 +1,86 @@
;;; noq-mode.el --- Major Mode for editing Noq source code -*- lexical-binding: t -*-
;; Copyright (C) 2021 Alexey Kutepov <reximkut@gmail.com>
;; Author: Alexey Kutepov <reximkut@gmail.com>
;; 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

26
.emacs.local/nothings-mode.el Executable file
View File

@@ -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)

70
.emacs.local/porth-mode.el Executable file
View File

@@ -0,0 +1,70 @@
;;; porth-mode.el --- Major Mode for editing Porth source code -*- lexical-binding: t -*-
;; Copyright (C) 2021 Alexey Kutepov <reximkut@gmail.com>
;; Author: Alexey Kutepov <reximkut@gmail.com>
;; 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

99
.emacs.local/simpc-mode.el Executable file
View File

@@ -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)

149
.emacs.rc/autocommit-rc.el Executable file
View File

@@ -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)))))

137
.emacs.rc/misc-rc.el Executable file
View File

@@ -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)

68
.emacs.rc/org-mode-rc.el Executable file
View File

@@ -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)

34
.emacs.rc/rc.el Executable file
View File

@@ -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)

View File

@@ -0,0 +1 @@
c-mode

7
.emacs.snippets/c++-mode/catch Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: catch (...) { ... }
# key: catch
# --
catch ($1) {
$0
}

7
.emacs.snippets/c++-mode/fore Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for (...: ...) { ... }
# key: fore
# --
for ($1: $2) {
$0
}

7
.emacs.snippets/c++-mode/ns Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: namespace Namespace
# key: ns
# --
namespace ${1:Namespace} {
$0
} // namespace $1

10
.emacs.snippets/c++-mode/once Executable file
View File

@@ -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

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: qdebug
# key: qdebug
# --
qDebug() << "----------------------------------------";
qDebug() << "$0";
qDebug() << "----------------------------------------";

7
.emacs.snippets/c++-mode/try Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: try { ... }
# key: try
# --
try {
$0
}

5
.emacs.snippets/c++-mode/uns Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: using namespace std;
# key: uns
# --
using namespace std;

5
.emacs.snippets/c++-mode/vec Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: std::vector<T>
# key: vec
# --
std::vector<$1> $2;$0

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: { ... }
# key: {
# --
{
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: else if (...) { ... }
# key: elif
# --
else if (${1:condition}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: else { ... }
# key: else
# --
else {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for (...; ...; ...) { ... }
# key: for
# --
for (${1:init}; ${2:condition}; ${3:increment}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if (...) { ... }
# key: if
# --
if (${1:condition}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: while (...) { ... }
# key: while
# --
while (${1:condition}) {
$0
}

View File

@@ -0,0 +1 @@
c-like-syntax

5
.emacs.snippets/c-mode/inc Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: #include <...>
# key: inc
# --
#include <$0>

5
.emacs.snippets/c-mode/incq Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: #include "..."
# key: incq
# --
#include "$0"

9
.emacs.snippets/c-mode/main Executable file
View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: int main(argc, argv) { ... }
# key: main
# --
int main(int argc, char *argv[])
{
$0
return 0;
}

5
.emacs.snippets/css-mode/bg Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: background-color: ...
# key: bg
# --
background-color: #${1:DDD};

5
.emacs.snippets/css-mode/bgi Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: background-image: ...
# key: bgi
# --
background-image: url($1);

5
.emacs.snippets/css-mode/bor Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: border size style color
# key: bor
# --
border: ${1:1px} ${2:solid} #${3:999};

5
.emacs.snippets/css-mode/cl Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: clear: ...
# key: cl
# --
clear: $1;

5
.emacs.snippets/css-mode/dispb Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: block
# key: dispb
# --
display: block;

5
.emacs.snippets/css-mode/dispi Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: inline
# key: dispi
# --
display: inline;

5
.emacs.snippets/css-mode/dispn Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: none
# key: dispn
# --
display: none;

5
.emacs.snippets/css-mode/ff Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: font-family: ...
# key: ff
# --
font-family: $1;

5
.emacs.snippets/css-mode/fs Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: font-size: ...
# key: fs
# --
font-size: ${12px};

5
.emacs.snippets/css-mode/mar Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin: ...
# key: mar
# --
margin: $1;

5
.emacs.snippets/css-mode/marb Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-bottom: ...
# key: marb
# --
margin-bottom: $1;

5
.emacs.snippets/css-mode/marl Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-left: ...
# key: marl
# --
margin-left: $1;

5
.emacs.snippets/css-mode/marr Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-right: ...
# key: marr
# --
margin-right: $1;

5
.emacs.snippets/css-mode/mart Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-top: ...
# key: mart
# --
margin-top: $1;

5
.emacs.snippets/css-mode/pad Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding: ...
# key: pad
# --
padding: $1;

5
.emacs.snippets/css-mode/padb Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-bottom: ...
# key: padb
# --
padding-bottom: $1;

5
.emacs.snippets/css-mode/padl Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-left: ...
# key: padl
# --
padding-left: $1;

5
.emacs.snippets/css-mode/padr Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-right: ...
# key: padr
# --
padding-right: $1;

5
.emacs.snippets/css-mode/padt Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-top: ...
# key: padt
# --
padding-top: $1;

View File

@@ -0,0 +1 @@
c-like-syntax

5
.emacs.snippets/d-mode/imm Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: immutable
# key: imm
# --
immutable $0

5
.emacs.snippets/d-mode/import Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: import <...>;
# key: imp
# --
import $0;

View File

@@ -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 <reximkut@gmail.com>}
;; 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

View File

@@ -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 <codingteam@conference.jabber.ru>
;; Maintainer: Alexey Kutepov <reximkut@gmail.com>
;; 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

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,24 @@
# -*- mode: snippet -*-
# name: mit
# key: mit
# --
Copyright `(format-time-string "%Y")` Alexey Kutepov <reximkut@gmail.com>
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.

View File

@@ -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)

7
.emacs.snippets/html-mode/tag Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: tag
# key: tag
# --
<$1>
$0
</$1>

5
.emacs.snippets/html-mode/tagi Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: tagi
# key: tagi
# --
<$1>$0</$1>

View File

@@ -0,0 +1 @@
c-like-syntax

5
.emacs.snippets/java-mode/ps Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: public static
# key: ps
# --
public static

5
.emacs.snippets/java-mode/psv Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: public static void
# key: psv
# --
public static void

View File

@@ -0,0 +1 @@
c-like-syntax

7
.emacs.snippets/js-mode/item Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: item
# key: item
# --
${1:Item} {
$0
} // $1

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: \begin{environment} ... \end{environment}
# key: begin
# --
\begin{${1:environment}}
$0
\end{$1}

View File

@@ -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)

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: todo
# key: todo
# type: command
# binding: C-x t
# --
(if (region-active-p)
(yas-expand-snippet "<!--TODO:-->`yas-selected-text`<!--$0-->")
(yas-expand-snippet "<!--TODO: $0 -->"))

View File

@@ -0,0 +1 @@
c-like-syntax

7
.emacs.snippets/nxml-mode/body Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <body>...</body>
# key: body
# --
<body>
$0
</body>

7
.emacs.snippets/nxml-mode/div Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <div class="...">\n...\n</div>
# key: div
# --
<div class="$1">
$0
</div>

7
.emacs.snippets/nxml-mode/head Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <head>...</head>
# key: head
# --
<head>
$0
</head>

7
.emacs.snippets/nxml-mode/html Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <html xmlns="...">...</html>
# key: html
# --
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}">
$0
</html>

5
.emacs.snippets/nxml-mode/link Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <link stylesheet="..." />
# key: link
# --
<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" />

5
.emacs.snippets/nxml-mode/meta Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <meta http-equiv="..." content="..." />
# key: meta
# --
<meta http-equiv="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" />

17
.emacs.snippets/nxml-mode/pom Executable file
View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: <project>...</project>
# key: pom
# --
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${1:me.rexim}</groupId>
<artifactId>${2:artifactId}</artifactId>
<version>${3:0.0.1-SNAPSHOT}</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <script type="text/javascript" src="..."></title>
# key: script
# --
<script type="text/javascript" src="$1"></script>

5
.emacs.snippets/nxml-mode/span Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <span class="...">\n...\n</span>
# key: span
# --
<span class="$1">$0</span>

7
.emacs.snippets/nxml-mode/tag Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <tag>\n...\n</tag>
# key: tag
# --
<${1:tag}$2>
$0
</$1>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <tag>...</tag>
# key: tag
# --
<${1:tag}$2>$0</$1>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <tag />
# key: tag
# --
<${1:tag} $2/>$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <title>...</title>
# key: title
# --
<title>$0</title>

5
.emacs.snippets/nxml-mode/xml Executable file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
# key: xml
# --
<?xml version="1.0" encoding="UTF-8" ?>

43
.emacs.snippets/org-mode/pomo Executable file
View File

@@ -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 |
|-------+-------+----------|

View File

@@ -0,0 +1 @@
c-like-syntax

7
.emacs.snippets/perl-mode/fore Executable file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: foreach (...) { ... }
# key: fore
# --
foreach ($1) {
$0
}

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: main
# key: main
# --
include "std.porth"
proc main in
$0
end

6
.emacs.snippets/porth-mode/ras Executable file
View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: ras
# key: ras
# --
here eputs ": Assertion Failed: $0" eputs
1 exit

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: todo
# key: todo
# --
here eputs ": TODO: $0" eputs
1 exit

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: unreach
# key: unreach
# --
here eputs ": unreachable: $0" eputs
69 exit

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -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

View File

@@ -0,0 +1 @@
c-like-syntax

3
.ghci Executable file
View File

@@ -0,0 +1,3 @@
:set prompt "λ> "
:set -XOverloadedStrings
:set editor vim

18
.gitconfig Executable file
View File

@@ -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

1
.gitignore vendored Executable file
View File

@@ -0,0 +1 @@
*~

52
.i3status.conf Executable file
View File

@@ -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"
}

Some files were not shown because too many files have changed in this diff Show More