├── .gitignore
├── .emacs.local
├── .gitkeep
├── nothings-mode.el
├── porth-mode.el
├── basm-mode.el
├── noq-mode.el
├── c3-mode.el
├── simpc-mode.el
├── umka-mode.el
├── jai-mode.el
└── fasm-mode.el
├── .sqliterc
├── .apvlvrc
├── .npmrc
├── .emacs.snippets
├── c++-mode
│ ├── .yas-parents
│ ├── try
│ ├── vec
│ ├── uns
│ ├── catch
│ ├── fore
│ ├── ns
│ ├── qdebug
│ └── once
├── c-mode
│ ├── .yas-parents
│ ├── inc
│ ├── incq
│ └── main
├── d-mode
│ ├── .yas-parents
│ ├── imm
│ └── import
├── fan-mode
│ └── .yas-parents
├── java-mode
│ ├── .yas-parents
│ ├── ps
│ └── psv
├── js-mode
│ ├── .yas-parents
│ └── item
├── nix-mode
│ └── .yas-parents
├── perl-mode
│ ├── .yas-parents
│ └── fore
├── rust-mode
│ └── .yas-parents
├── scala-mode
│ └── .yas-parents
├── typescript-mode
│ └── .yas-parents
├── css-mode
│ ├── cl
│ ├── mar
│ ├── pad
│ ├── ff
│ ├── dispb
│ ├── dispi
│ ├── dispn
│ ├── fs
│ ├── marl
│ ├── mart
│ ├── padt
│ ├── marb
│ ├── marr
│ ├── padb
│ ├── padl
│ ├── padr
│ ├── bg
│ ├── bgi
│ └── bor
├── html-mode
│ ├── tagi
│ └── tag
├── c-like-syntax
│ ├── block
│ ├── else
│ ├── if
│ ├── while
│ ├── elif
│ └── for
├── nxml-mode
│ ├── tag.2
│ ├── tag.1
│ ├── title
│ ├── body
│ ├── head
│ ├── tag
│ ├── div
│ ├── span
│ ├── xml
│ ├── script
│ ├── link
│ ├── meta
│ ├── html
│ └── pom
├── porth-mode
│ ├── todo
│ ├── ras
│ ├── unreach
│ └── main
├── latex-mode
│ └── begin
├── snippet-mode
│ └── snip
├── makefile-gmake-mode
│ └── make
├── fundamental-mode
│ ├── sb
│ ├── ss
│ └── mit
├── markdown-mode
│ └── todo
├── org-mode
│ └── pomo
└── emacs-lisp-mode
│ ├── pacmacs-module
│ └── emacs-lisp-module
├── .jmacsrc
├── mpv.conf
├── .nexrc
├── bin
├── gcc-path
├── map-wacom
├── region-to-gif
├── hhkb-i3
├── prepare-pdf-noting
└── png_to_ora
├── .gdbinit
├── .ghci
├── .rexim
└── icons
│ ├── terminal-icon.png
│ └── terminal-icon.svg
├── .tmux.conf
├── .markut
├── .screenlayout
├── home-setup.sh
├── portable-setup-g50.sh
├── portable-setup.sh
├── portable-setup-b590.sh
├── home-setup-g50.sh
└── home-setup-b590.sh
├── settings.ini
├── gf2_config.ini
├── .gitconfig
├── MANIFEST
├── MANIFEST.linux
├── README.md
├── deploy.ps1
├── .vimrc
├── .emacs.rc
├── rc.el
├── org-mode-rc.el
├── misc-rc.el
└── autocommit-rc.el
├── deploy.sh
├── .i3status.conf
├── .Xresources
├── .emacs.custom.el
├── DotFiles.psm1
├── .urxvt
└── ext
│ └── resize-font
├── i3
└── config
├── .SciTEUser.properties
└── .emacs
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 |
--------------------------------------------------------------------------------
/.emacs.local/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.sqliterc:
--------------------------------------------------------------------------------
1 | .headers on
2 |
--------------------------------------------------------------------------------
/.apvlvrc:
--------------------------------------------------------------------------------
1 | set inverted=yes
2 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | ignore-scripts=false
2 |
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-mode
--------------------------------------------------------------------------------
/.emacs.snippets/c-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/d-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/fan-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/java-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/js-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/nix-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/perl-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/rust-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.emacs.snippets/scala-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.jmacsrc:
--------------------------------------------------------------------------------
1 | *
2 | -linums
3 | :include /etc/joe/jmacsrc
--------------------------------------------------------------------------------
/mpv.conf:
--------------------------------------------------------------------------------
1 | loop=inf
2 | volume=75
3 | force-window=yes
--------------------------------------------------------------------------------
/.emacs.snippets/typescript-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | c-like-syntax
--------------------------------------------------------------------------------
/.nexrc:
--------------------------------------------------------------------------------
1 | set number
2 | set autoindent
3 | set noflash
4 |
--------------------------------------------------------------------------------
/bin/gcc-path:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo | gcc -E -Wp,-v -
4 |
--------------------------------------------------------------------------------
/.gdbinit:
--------------------------------------------------------------------------------
1 | set breakpoint pending on
2 | set disassembly-flavor intel
3 |
--------------------------------------------------------------------------------
/.ghci:
--------------------------------------------------------------------------------
1 | :set prompt "λ> "
2 | :set -XOverloadedStrings
3 | :set editor vim
4 |
--------------------------------------------------------------------------------
/bin/map-wacom:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | xsetwacom set "Wacom Intuos S Pen stylus" maptooutput 1920x1080+0+0
4 |
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/cl:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: clear: ...
3 | # key: cl
4 | # --
5 | clear: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/d-mode/imm:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: immutable
3 | # key: imm
4 | # --
5 | immutable $0
--------------------------------------------------------------------------------
/.emacs.snippets/html-mode/tagi:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: tagi
3 | # key: tagi
4 | # --
5 | <$1>$0$1>
--------------------------------------------------------------------------------
/.rexim/icons/terminal-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rexim/dotfiles/HEAD/.rexim/icons/terminal-icon.png
--------------------------------------------------------------------------------
/bin/region-to-gif:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | byzanz-record $(xrectsel "--x=%x --y=%y --width=%w --height=%h") out.gif
4 |
--------------------------------------------------------------------------------
/.emacs.snippets/c-mode/inc:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: #include <...>
3 | # key: inc
4 | # --
5 | #include <$0>
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/mar:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: margin: ...
3 | # key: mar
4 | # --
5 | margin: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/pad:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: padding: ...
3 | # key: pad
4 | # --
5 | padding: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/d-mode/import:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: import <...>;
3 | # key: imp
4 | # --
5 | import $0;
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/try:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: try { ... }
3 | # key: try
4 | # --
5 | try {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/block:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: { ... }
3 | # key: {
4 | # --
5 | {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/c-mode/incq:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: #include "..."
3 | # key: incq
4 | # --
5 | #include "$0"
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/ff:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: font-family: ...
3 | # key: ff
4 | # --
5 | font-family: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/html-mode/tag:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: tag
3 | # key: tag
4 | # --
5 | <$1>
6 | $0
7 | $1>
--------------------------------------------------------------------------------
/.emacs.snippets/java-mode/ps:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: public static
3 | # key: ps
4 | # --
5 | public static
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/tag.2:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name:
3 | # key: tag
4 | # --
5 | <${1:tag} $2/>$0
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/vec:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: std::vector
3 | # key: vec
4 | # --
5 | std::vector<$1> $2;$0
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/dispb:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: display: block
3 | # key: dispb
4 | # --
5 | display: block;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/dispi:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: display: inline
3 | # key: dispi
4 | # --
5 | display: inline;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/dispn:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: display: none
3 | # key: dispn
4 | # --
5 | display: none;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/fs:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: font-size: ...
3 | # key: fs
4 | # --
5 | font-size: ${12px};
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/marl:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: margin-left: ...
3 | # key: marl
4 | # --
5 | margin-left: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/mart:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: margin-top: ...
3 | # key: mart
4 | # --
5 | margin-top: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/padt:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: padding-top: ...
3 | # key: padt
4 | # --
5 | padding-top: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/uns:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: using namespace std;
3 | # key: uns
4 | # --
5 | using namespace std;
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/else:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: else { ... }
3 | # key: else
4 | # --
5 | else {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/marb:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: margin-bottom: ...
3 | # key: marb
4 | # --
5 | margin-bottom: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/marr:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: margin-right: ...
3 | # key: marr
4 | # --
5 | margin-right: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/padb:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: padding-bottom: ...
3 | # key: padb
4 | # --
5 | padding-bottom: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/padl:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: padding-left: ...
3 | # key: padl
4 | # --
5 | padding-left: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/padr:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: padding-right: ...
3 | # key: padr
4 | # --
5 | padding-right: $1;
--------------------------------------------------------------------------------
/.emacs.snippets/java-mode/psv:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: public static void
3 | # key: psv
4 | # --
5 | public static void
--------------------------------------------------------------------------------
/.emacs.snippets/js-mode/item:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: item
3 | # key: item
4 | # --
5 | ${1:Item} {
6 | $0
7 | } // $1
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/tag.1:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: tag
4 | # --
5 | <${1:tag}$2>$0$1>
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/title:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: title
4 | # --
5 | $0
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/body:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: body
4 | # --
5 |
6 | $0
7 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/head:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: head
4 | # --
5 |
6 | $0
7 |
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/catch:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: catch (...) { ... }
3 | # key: catch
4 | # --
5 | catch ($1) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/bg:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: background-color: ...
3 | # key: bg
4 | # --
5 | background-color: #${1:DDD};
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/tag:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: \n...\n
3 | # key: tag
4 | # --
5 | <${1:tag}$2>
6 | $0
7 | $1>
--------------------------------------------------------------------------------
/.emacs.snippets/porth-mode/todo:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: todo
3 | # key: todo
4 | # --
5 | here eputs ": TODO: $0" eputs
6 | 1 exit
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/fore:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: for (...: ...) { ... }
3 | # key: fore
4 | # --
5 | for ($1: $2) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/if:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: if (...) { ... }
3 | # key: if
4 | # --
5 | if (${1:condition}) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/bgi:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: background-image: ...
3 | # key: bgi
4 | # --
5 | background-image: url($1);
6 |
--------------------------------------------------------------------------------
/.emacs.snippets/perl-mode/fore:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: foreach (...) { ... }
3 | # key: fore
4 | # --
5 | foreach ($1) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/porth-mode/ras:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ras
3 | # key: ras
4 | # --
5 | here eputs ": Assertion Failed: $0" eputs
6 | 1 exit
--------------------------------------------------------------------------------
/.tmux.conf:
--------------------------------------------------------------------------------
1 | unbind C-b
2 | set -g prefix C-x
3 | bind C-x send-prefix
4 | set -g mode-keys emacs
5 | set -g status-keys emacs
6 | set -s escape-time 0
7 |
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/while:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: while (...) { ... }
3 | # key: while
4 | # --
5 | while (${1:condition}) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/css-mode/bor:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: border size style color
3 | # key: bor
4 | # --
5 | border: ${1:1px} ${2:solid} #${3:999};
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/div:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: \n...\n
3 | # key: div
4 | # --
5 |
6 | $0
7 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/span:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: \n...\n
3 | # key: span
4 | # --
5 | $0
--------------------------------------------------------------------------------
/.emacs.snippets/porth-mode/unreach:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: unreach
3 | # key: unreach
4 | # --
5 | here eputs ": unreachable: $0" eputs
6 | 69 exit
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/elif:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: else if (...) { ... }
3 | # key: elif
4 | # --
5 | else if (${1:condition}) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/porth-mode/main:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: main
3 | # key: main
4 | # --
5 | include "std.porth"
6 |
7 | proc main in
8 | $0
9 | end
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/ns:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: namespace Namespace
3 | # key: ns
4 | # --
5 | namespace ${1:Namespace} {
6 | $0
7 | } // namespace $1
--------------------------------------------------------------------------------
/bin/hhkb-i3:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -xe
4 |
5 | setxkbmap -layout us,ru -option grp:shifts_toggle,ctrl:nocaps,compose:ralt
6 | xmodmap -e 'keycode 102 = Super_L'
7 |
--------------------------------------------------------------------------------
/.markut:
--------------------------------------------------------------------------------
1 | // -*- mode: js -*-
2 | home "/.markut.shadow" concat include_if_exists
3 | "4500k" video_bitrate
4 | "-r" outf "60" outf // target framerate is 60fps
5 |
--------------------------------------------------------------------------------
/.emacs.snippets/c-like-syntax/for:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: for (...; ...; ...) { ... }
3 | # key: for
4 | # --
5 | for (${1:init}; ${2:condition}; ${3:increment}) {
6 | $0
7 | }
--------------------------------------------------------------------------------
/.emacs.snippets/c-mode/main:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: int main(argc, argv) { ... }
3 | # key: main
4 | # --
5 | int main(int argc, char *argv[])
6 | {
7 | $0
8 | return 0;
9 | }
--------------------------------------------------------------------------------
/.emacs.snippets/latex-mode/begin:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: \begin{environment} ... \end{environment}
3 | # key: begin
4 | # --
5 | \begin{${1:environment}}
6 | $0
7 | \end{$1}
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/xml:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name:
3 | # key: xml
4 | # --
5 |
--------------------------------------------------------------------------------
/.screenlayout/home-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ `hostname` = "rexim-B590" ]; then
4 | ~/.screenlayout/home-setup-b590.sh
5 | else
6 | ~/.screenlayout/home-setup-g50.sh
7 | fi
8 |
--------------------------------------------------------------------------------
/.screenlayout/portable-setup-g50.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | xrandr --output DP-1 --off --output HDMI-1 --off --output eDP-1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output HDMI-2 --off
3 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/script:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name:
--------------------------------------------------------------------------------
/.screenlayout/portable-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ `hostname` = "rexim-B590" ]; then
4 | ~/.screenlayout/portable-setup-b590.sh
5 | else
6 | ~/.screenlayout/portable-setup-g50.sh
7 | fi
8 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/link:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name:
3 | # key: link
4 | # --
5 |
--------------------------------------------------------------------------------
/.screenlayout/portable-setup-b590.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | xrandr --output HDMI1 --off --output LVDS1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output VIRTUAL1 --off --output DP1 --off --output VGA1 --off
3 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/meta:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name:
3 | # key: meta
4 | # --
5 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/html:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: html
4 | # --
5 |
6 | $0
7 |
--------------------------------------------------------------------------------
/.screenlayout/home-setup-g50.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 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
3 |
--------------------------------------------------------------------------------
/settings.ini:
--------------------------------------------------------------------------------
1 | # https://wiki.archlinux.org/index.php/GTK
2 | [Settings]
3 | #gtk-icon-theme-name = Adwaita
4 | #gtk-theme-name = Adwaita
5 | #gtk-font-name = DejaVu Sans 11
6 | gtk-application-prefer-dark-theme = true
7 |
--------------------------------------------------------------------------------
/gf2_config.ini:
--------------------------------------------------------------------------------
1 | [ui]
2 | scale=1.5
3 | font_size_interface=17
4 | font_size_code=20
5 | layout=v(57,h(79,Source,v(60,t(Exe,Breakpoints,Commands,Struct),t(Stack,Files,Thread,CmdSearch))),h(43,t(Watch,Locals,Registers,Data),Console))
6 |
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/qdebug:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: qdebug
3 | # key: qdebug
4 | # --
5 | qDebug() << "----------------------------------------";
6 | qDebug() << "$0";
7 | qDebug() << "----------------------------------------";
--------------------------------------------------------------------------------
/.screenlayout/home-setup-b590.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 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
3 |
--------------------------------------------------------------------------------
/.emacs.snippets/snippet-mode/snip:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: snippet snippet
3 | # key: snip
4 | # --
5 | # -*- mode: snippet -*-
6 | # name: $1
7 | # key: ${2:`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`}
8 | # --
9 | $0
--------------------------------------------------------------------------------
/.emacs.snippets/makefile-gmake-mode/make:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: make
3 | # key: make
4 | # expand-env: ((yas-indent-line 'fixed))
5 | # --
6 | CFLAGS=-Wall -Wextra -std=c11 -pedantic
7 | LIBS=
8 |
9 | $1: $2
10 | $(CC) $(CFLAGS) -o $1 $2 $(LIBS)
11 |
--------------------------------------------------------------------------------
/.emacs.snippets/fundamental-mode/sb:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: sb
3 | # key: sb
4 | # expand-env: ((yas-indent-line 'fixed))
5 | # --
6 | ${1:$(make-string (+ 2 (string-width yas-text)) ? )}SMOL
7 | ${1:$(make-string (+ 2 (string-width yas-text)) ? )}BREK
8 | ($1 minutes)
--------------------------------------------------------------------------------
/.emacs.snippets/fundamental-mode/ss:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ss
3 | # key: ss
4 | # expand-env: ((yas-indent-line 'fixed))
5 | # --
6 | ${1:$(make-string (+ 2 (string-width yas-text)) ? )}STARTING
7 | ${1:$(make-string (+ 2 (string-width yas-text)) ? )}SOON™
8 | ($1 minutes)
--------------------------------------------------------------------------------
/.emacs.snippets/markdown-mode/todo:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: todo
3 | # key: todo
4 | # type: command
5 | # binding: C-x t
6 | # --
7 | (if (region-active-p)
8 | (yas-expand-snippet "`yas-selected-text`")
9 | (yas-expand-snippet ""))
--------------------------------------------------------------------------------
/.gitconfig:
--------------------------------------------------------------------------------
1 | [user]
2 | email = reximkut@gmail.com
3 | name = rexim
4 | [merge]
5 | conflictStyle = diff3
6 | [magit]
7 | hideCampaign = true
8 | [alias]
9 | tree = log --graph --decorate --pretty=oneline --abbrev-commit --all
10 | [init]
11 | defaultBranch = main
12 |
--------------------------------------------------------------------------------
/.emacs.snippets/c++-mode/once:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: #ifndef XXX; #define XXX; #endif
3 | # key: once
4 | # --
5 | #ifndef ${1:`(upcase (replace-regexp-in-string "\\." "_" (file-name-nondirectory (buffer-file-name))))`_}
6 | #define $1
7 |
8 | $0
9 |
10 | #endif // $1
--------------------------------------------------------------------------------
/MANIFEST:
--------------------------------------------------------------------------------
1 | .emacs|symlink|
2 | .emacs.rc|symlink|
3 | .emacs.snippets|symlink|
4 | .emacs.local|symlink|
5 | .emacs.custom.el|symlink|
6 | .gitconfig|symlink|
7 | .markut|symlink|
8 | #.rexim|symlink|
9 | #.npmrc|symlink|
10 | #.jmacsrc|symlink|
11 | #.apvlvrc|symlink|
12 | .nexrc|symlink|
13 | .sqliterc|symlink|
14 |
--------------------------------------------------------------------------------
/MANIFEST.linux:
--------------------------------------------------------------------------------
1 | #.Xresources|symlink|
2 | .tmux.conf|symlink|
3 | .vimrc|symlink|
4 | i3|symlink|.config
5 | #.screenlayout|symlink|
6 | #.ghci|symlink|
7 | .i3status.conf|symlink|
8 | bin/hhkb-i3|symlink|
9 | bin/map-wacom|symlink|
10 | settings.ini|symlink|.config/gtk-3.0
11 | #.urxvt/ext/resize-font|symlink|
12 | .gdbinit|symlink|
13 | gf2_config.ini|symlink|.config
14 | mpv.conf|symlink|.config/mpv
15 | .SciTEUser.properties|symlink|
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # dotfiles #
2 |
3 | Just config files for some programs that I actively use.
4 |
5 | # Requirements #
6 |
7 | * Emacs 24.5+
8 | * rxvt-unicode v9.19+
9 | * zsh 5.0.2+ (with oh-my-zsh)
10 | * tmux 1.8+
11 | * Git
12 | * Any Linux distribution or Windows 7+
13 | * Internet connection
14 |
15 | # Deployment #
16 |
17 | For Linux, clone the repo somewhere and run `deploy.sh`. For Windows 7+,
18 | clone the repo somewhere and run `deploy.ps1` as Administrator.
19 |
--------------------------------------------------------------------------------
/deploy.ps1:
--------------------------------------------------------------------------------
1 | Import-Module .\DotFiles.psm1
2 |
3 | # TODO: deploy.ps1 doesn't support the latest format of the manifest
4 |
5 | $HomeExists = Test-Path Env:HOME
6 | if ($HomeExists -ne $True) {
7 | echo "Creating HOME environment variable and targeting it to $env:USERPROFILE"
8 | [Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")
9 | } else {
10 | Write-Warning "HOME environment variable already exists. Not modifying the existing value."
11 | }
12 |
13 | Deploy-Manifest MANIFEST
14 |
15 | pause
16 |
--------------------------------------------------------------------------------
/.emacs.snippets/nxml-mode/pom:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ...
3 | # key: pom
4 | # --
5 |
9 | 4.0.0
10 | ${1:me.rexim}
11 | ${2:artifactId}
12 | ${3:0.0.1-SNAPSHOT}
13 |
14 |
15 | UTF-8
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.vimrc:
--------------------------------------------------------------------------------
1 | syntax on
2 | filetype plugin indent on
3 | set tabstop=4
4 | set shiftwidth=4
5 | set expandtab
6 | set guifont=Iosevka\ 20
7 | set guioptions-=m
8 | set guioptions-=T
9 | set noesckeys
10 | set relativenumber
11 | set number
12 | set ignorecase
13 | set smartcase
14 | set incsearch
15 | set cinoptions=l1
16 | set modeline
17 | set keymap=russian-jcukenwin
18 | set iminsert=0
19 | set imsearch=0
20 | set autoindent
21 | set autochdir
22 | colorscheme habamax
23 |
24 | autocmd BufEnter * if &filetype == "go" | setlocal noexpandtab
25 | autocmd BufNewFile,BufRead ?\+.c3 setf c
26 |
27 | map gf :e
28 | "map D :execute 'normal! a' . strftime('(%Y%m%d-%H%M%S)')
29 | map D :execute 'normal! a' . system('date -u "+(%Y%m%d-%H%M%S)"')
30 |
--------------------------------------------------------------------------------
/bin/prepare-pdf-noting:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4 |
5 | pdf_to_pngs() {
6 | mkdir -p "$2"
7 | pdftoppm -rx 300 -ry 300 -png "$1" "$2/page"
8 | }
9 |
10 | invert_pngs() {
11 | pushd "$1"
12 | for page in page-*.png; do
13 | convert -negate "${page}" "neg-${page}"
14 | mv "neg-${page}" "${page}"
15 | done
16 | popd
17 | }
18 |
19 | pngs_to_oras() {
20 | pushd "$1"
21 | for page in page-*.png; do
22 | "${SCRIPT_DIR}/png_to_ora" "${page}"
23 | rm "${page}"
24 | done
25 | popd
26 | }
27 |
28 | if [[ $# -ne 2 ]]; then
29 | >&2 echo "Usage ./prepare-pdf-noting "
30 | exit 1
31 | fi
32 |
33 | set -xe
34 |
35 | PDF_FILE="$1"
36 | NOTES_FOLDER="$2"
37 |
38 | pdf_to_pngs "${PDF_FILE}" "${NOTES_FOLDER}"
39 | invert_pngs "${NOTES_FOLDER}"
40 | pngs_to_oras "${NOTES_FOLDER}"
41 |
--------------------------------------------------------------------------------
/.emacs.local/nothings-mode.el:
--------------------------------------------------------------------------------
1 | (require 'subr-x)
2 |
3 | (defvar nothings-mode-syntax-table
4 | (let ((table (make-syntax-table)))
5 | ;; C/C++ style comments
6 | (modify-syntax-entry ?/ ". 124b" table)
7 | (modify-syntax-entry ?* ". 23" table)
8 | (modify-syntax-entry ?\n "> b" table)
9 | ;; Preprocessor stuff?
10 | (modify-syntax-entry ?# "." table)
11 | ;; Chars are the same as strings
12 | (modify-syntax-entry ?' "\"" table)
13 | table))
14 |
15 | (defun nothings-font-lock-keywords ()
16 | (list
17 | `("# *[a-zA-Z0-9_]+" . font-lock-preprocessor-face)
18 | `("#.*include \\(\\(<\\|\"\\).*\\(>\\|\"\\)\\)" . (1 font-lock-string-face))))
19 |
20 | (define-derived-mode nothings-mode prog-mode "Nothings"
21 | "Simple major mode for editing C files."
22 | :syntax-table nothings-mode-syntax-table
23 | (setq-local font-lock-defaults '(nothings-font-lock-keywords))
24 | (setq-local comment-start "//"))
25 |
26 | (provide 'nothings-mode)
27 |
--------------------------------------------------------------------------------
/bin/png_to_ora:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [[ $# -ne 1 ]]; then
4 | >&2 echo "Usage ./png_to_ora "
5 | exit 1
6 | fi
7 |
8 | set -xe
9 |
10 | PNG_PATH="$1"
11 | PNG_FILE=$(basename "${PNG_PATH}")
12 | PNG_NAME="${PNG_FILE%.*}"
13 |
14 | mkdir -p "${PNG_NAME}/data"
15 |
16 | echo "image/openraster" > "${PNG_NAME}/mimetype"
17 | cp "${PNG_FILE}" "${PNG_NAME}/data/layer-00.png"
18 | echo "}" > "${PNG_NAME}/data/layer-00-strokemap.dat"
19 | cat < "${PNG_NAME}/stack.xml"
20 |
21 |
22 |
23 |
24 |
25 |
26 | EOF
27 |
28 | pushd "${PNG_NAME}"
29 | zip -r ../"${PNG_NAME}.ora" *
30 | popd
31 | rm -r "${PNG_NAME}"
32 |
--------------------------------------------------------------------------------
/.emacs.rc/rc.el:
--------------------------------------------------------------------------------
1 | (add-to-list 'package-archives
2 | '("melpa" . "https://melpa.org/packages/") t)
3 | ;; (add-to-list 'package-archives
4 | ;; '("melpa-stable" . "https://stable.melpa.org/packages/") t)
5 |
6 | (defvar rc/package-contents-refreshed nil)
7 |
8 | (defun rc/package-refresh-contents-once ()
9 | (when (not rc/package-contents-refreshed)
10 | (setq rc/package-contents-refreshed t)
11 | (package-refresh-contents)))
12 |
13 | (defun rc/require-one-package (package)
14 | (when (not (package-installed-p package))
15 | (rc/package-refresh-contents-once)
16 | (package-install package)))
17 |
18 | (defun rc/require (&rest packages)
19 | (dolist (package packages)
20 | (rc/require-one-package package)))
21 |
22 | (defun rc/require-theme (theme)
23 | (let ((theme-package (->> theme
24 | (symbol-name)
25 | (funcall (-flip #'concat) "-theme")
26 | (intern))))
27 | (rc/require theme-package)
28 | (load-theme theme t)))
29 |
30 | (rc/require 'dash)
31 | (require 'dash)
32 |
33 | (rc/require 'dash-functional)
34 | (require 'dash-functional)
35 |
--------------------------------------------------------------------------------
/.emacs.snippets/fundamental-mode/mit:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: mit
3 | # key: mit
4 | # --
5 | Copyright `(format-time-string "%Y")` Alexey Kutepov
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining
8 | a copy of this software and associated documentation files (the
9 | "Software"), to deal in the Software without restriction, including
10 | without limitation the rights to use, copy, modify, merge, publish,
11 | distribute, sublicense, and/or sell copies of the Software, and to
12 | permit persons to whom the Software is furnished to do so, subject to
13 | the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be
16 | included in all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/.emacs.snippets/org-mode/pomo:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: pomo table
3 | # key: pomo
4 | # --
5 | |-------+-------+----------|
6 | | start | type | duration |
7 | |-------+-------+----------|
8 | | | work | 20m |
9 | | | break | 10m |
10 | | | work | 20m |
11 | | | break | 10m |
12 | | | work | 20m |
13 | | | break | 10m |
14 | | | work | 20m |
15 | | | break | 20m |
16 | |-------+-------+----------|
17 | | | work | 20m |
18 | | | break | 10m |
19 | | | work | 20m |
20 | | | break | 10m |
21 | | | work | 20m |
22 | | | break | 10m |
23 | | | work | 20m |
24 | | | break | 20m |
25 | |-------+-------+----------|
26 | | | work | 20m |
27 | | | break | 10m |
28 | | | work | 20m |
29 | | | break | 10m |
30 | | | work | 20m |
31 | | | break | 10m |
32 | | | work | 20m |
33 | | | break | 20m |
34 | |-------+-------+----------|
35 | | | work | 20m |
36 | | | break | 10m |
37 | | | work | 20m |
38 | | | break | 10m |
39 | | | work | 20m |
40 | | | break | 10m |
41 | | | work | 20m |
42 | | | break | 20m |
43 | |-------+-------+----------|
44 |
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | SCRIPT_DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
6 |
7 | symlinkFile() {
8 | filename="$SCRIPT_DIR/$1"
9 | destination="$HOME/$2/$1"
10 |
11 | mkdir -p $(dirname "$destination")
12 |
13 | if [ -L "$destination" ]; then
14 | echo "[WARNING] $filename already symlinked"
15 | return
16 | fi
17 |
18 | if [ -e "$destination" ]; then
19 | echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually"
20 | exit 1
21 | fi
22 |
23 | ln -s "$filename" "$destination"
24 | echo "[OK] $filename -> $destination"
25 | }
26 |
27 | deployManifest() {
28 | for row in $(cat $SCRIPT_DIR/$1); do
29 | if [[ "$row" =~ ^#.* ]]; then
30 | continue
31 | fi
32 |
33 | filename=$(echo $row | cut -d \| -f 1)
34 | operation=$(echo $row | cut -d \| -f 2)
35 | destination=$(echo $row | cut -d \| -f 3)
36 |
37 | case $operation in
38 | symlink)
39 | symlinkFile $filename $destination
40 | ;;
41 |
42 | *)
43 | echo "[WARNING] Unknown operation $operation. Skipping..."
44 | ;;
45 | esac
46 | done
47 | }
48 |
49 | if [ -z "$@" ]; then
50 | echo "Usage: $0 "
51 | echo "ERROR: no MANIFEST file is provided"
52 | exit 1
53 | fi
54 |
55 | deployManifest $1
56 |
--------------------------------------------------------------------------------
/.i3status.conf:
--------------------------------------------------------------------------------
1 | # i3status configuration file.
2 | # see "man i3status" for documentation.
3 |
4 | # It is important that this file is edited as UTF-8.
5 | # The following line should contain a sharp s:
6 | # ß
7 | # If the above line is not correctly displayed, fix your editor first!
8 |
9 | general {
10 | colors = true
11 | interval = 5
12 | }
13 |
14 | order += "ipv6"
15 | order += "cpu_temperature 0"
16 | order += "disk /"
17 | order += "wireless _first_"
18 | order += "ethernet _first_"
19 | order += "battery all"
20 | order += "load"
21 | order += "tztime local"
22 |
23 | cpu_temperature 0 {
24 | format = "Tea: %degrees °C"
25 | }
26 |
27 | wireless _first_ {
28 | # format_up = "W: (%quality at %essid) %ip"
29 | format_up = "W: (%quality) Leaked IP: %ip"
30 | format_down = "W: down"
31 | }
32 |
33 | ethernet _first_ {
34 | # if you use %speed, i3status requires root privileges
35 | # format_up = "E: %ip (%speed)"
36 | format_up = "E: Leaked IP: %ip (%speed)"
37 | format_down = "E: down"
38 | }
39 |
40 | battery all {
41 | format = "Fairy Dust: %percentage %status %remaining"
42 | }
43 |
44 | tztime local {
45 | format = "%Y-%m-%d %H:%M:%S"
46 | }
47 |
48 | load {
49 | format = "Hot Loads: %1min"
50 | }
51 |
52 | disk "/" {
53 | format = "Penger Folder: %avail"
54 | }
55 |
56 | ipv6 {
57 | format_up = "Useless Protocol: %ipv6"
58 | format_down = "Useless Protocol: Down"
59 | }
60 |
--------------------------------------------------------------------------------
/.emacs.snippets/emacs-lisp-mode/pacmacs-module:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: pacmacs module skeleton
3 | # key: pacmacs-module
4 | # --
5 | ;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- Pacman for Emacs -*- lexical-binding: t -*-
6 |
7 | ;; Copyright (C) `(format-time-string "%Y" (current-time))` Codingteam
8 |
9 | ;; Author: Codingteam
10 | ;; Maintainer: Alexey Kutepov
11 | ;; URL: http://github.com/rexim/pacmacs.el
12 |
13 | ;; Permission is hereby granted, free of charge, to any person
14 | ;; obtaining a copy of this software and associated documentation
15 | ;; files (the "Software"), to deal in the Software without
16 | ;; restriction, including without limitation the rights to use, copy,
17 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
18 | ;; of the Software, and to permit persons to whom the Software is
19 | ;; furnished to do so, subject to the following conditions:
20 |
21 | ;; The above copyright notice and this permission notice shall be
22 | ;; included in all copies or substantial portions of the Software.
23 |
24 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 | ;; SOFTWARE.
32 |
33 | ;;; Commentary:
34 |
35 | ;; $2
36 |
37 | ;;; Code:
38 |
39 | $0
40 |
41 | ;;; $1 ends here
--------------------------------------------------------------------------------
/.emacs.snippets/emacs-lisp-mode/emacs-lisp-module:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: emacs lisp module skeleton
3 | # key: emacs-lisp-module
4 | # --
5 | ;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- ${2:Package Description} -*- lexical-binding: t -*-
6 |
7 | ;; Copyright (C) `(format-time-string "%Y" (current-time))` ${3:Alexey Kutepov }
8 |
9 | ;; Author: $3
10 | ;; URL: $4
11 |
12 | ;; Permission is hereby granted, free of charge, to any person
13 | ;; obtaining a copy of this software and associated documentation
14 | ;; files (the "Software"), to deal in the Software without
15 | ;; restriction, including without limitation the rights to use, copy,
16 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
17 | ;; of the Software, and to permit persons to whom the Software is
18 | ;; furnished to do so, subject to the following conditions:
19 |
20 | ;; The above copyright notice and this permission notice shall be
21 | ;; included in all copies or substantial portions of the Software.
22 |
23 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 | ;; SOFTWARE.
31 |
32 | ;;; Commentary:
33 |
34 | ;; $5
35 |
36 | ;;; Code:
37 |
38 | $0
39 |
40 | (provide '${6:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`})
41 |
42 | ;;; $1 ends here
--------------------------------------------------------------------------------
/.Xresources:
--------------------------------------------------------------------------------
1 | Xft.dpi: 96
2 | Xft.antialias: 1
3 | Xft.hinting: 1
4 | Xft.hintstyle: hintmedium
5 |
6 | URxvt.termName: rxvt
7 | URxvt*depth: 32
8 | URxvt.transparent: false
9 | URxvt.font: xft:Iosevka:size=20
10 | URxvt.scrollBar: false
11 | URxvt.iconFile: .rexim/icons/terminal-icon.png
12 |
13 | ! Gruber-Darker
14 | URxvt*foreground: #e4e4ef
15 | URxvt*background: #181818
16 | URxvt*color0: #2E3436
17 | URxvt*color1: #a40000
18 | URxvt*color2: #4E9A06
19 | URxvt*color3: #C4A000
20 | URxvt*color4: #3465A4
21 | URxvt*color5: #75507B
22 | URxvt*color6: #ce5c00
23 | URxvt*color7: #babdb9
24 | URxvt*color8: #555753
25 | URxvt*color9: #EF2929
26 | URxvt*color10: #8AE234
27 | URxvt*color11: #FCE94F
28 | URxvt*color12: #729FCF
29 | URxvt*color13: #AD7FA8
30 | URxvt*color14: #fcaf3e
31 | URxvt*color15: #EEEEEC
32 |
33 | ! ! Zenburn
34 | ! URxvt*background: #3f3f3f
35 | ! URxvt*foreground: #dcdccc
36 | ! URxvt*cursorColor: #aaaaaa
37 | ! ! URxvt*colorUL: #366060
38 | ! ! URxvt*underlineColor: #dfaf8f
39 | ! URxvt*color0: #3f3f3f
40 | ! URxvt*color1: #cc9393
41 | ! URxvt*color2: #7f9f7f
42 | ! URxvt*color3: #d0bf8f
43 | ! URxvt*color4: #6ca0a3
44 | ! URxvt*color5: #dc8cc3
45 | ! URxvt*color6: #93e0e3
46 | ! URxvt*color7: #dcdccc
47 | ! URxvt*color8: #989890
48 | ! URxvt*color9: #dca3a3
49 | ! URxvt*color10: #bfebbf
50 | ! URxvt*color11: #f0dfaf
51 | ! URxvt*color12: #8cd0d3
52 | ! URxvt*color13: #dc8cc3
53 | ! URxvt*color14: #93e0e3
54 | ! URxvt*color15: #ffffff
55 |
56 | ! Adwaita
57 | ! URxvt*background: #EDEDED
58 | ! URxvt*foreground: #2E3436
59 |
60 | URxvt.perl-ext-common: resize-font,matcher
61 | URxvt.url-launcher: /usr/bin/xdg-open
62 | URxvt.matcher.button: 1
63 |
64 | URxvt.keysym.C-minus: resize-font:smaller
65 | URxvt.keysym.C-equal: resize-font:bigger
66 | URxvt.keysym.C-0: resize-font:reset
67 |
--------------------------------------------------------------------------------
/.emacs.custom.el:
--------------------------------------------------------------------------------
1 | (custom-set-variables
2 | ;; custom-set-variables was added by Custom.
3 | ;; If you edit it by hand, you could mess it up, so be careful.
4 | ;; Your init file should contain only one such instance.
5 | ;; If there is more than one, they won't work right.
6 | '(display-line-numbers-type (quote relative))
7 | '(org-agenda-dim-blocked-tasks nil)
8 | '(org-agenda-exporter-settings (quote ((org-agenda-tag-filter-preset (list "+personal")))))
9 | '(org-cliplink-transport-implementation (quote url-el))
10 | '(org-enforce-todo-dependencies nil)
11 | '(org-modules
12 | (quote
13 | (org-bbdb org-bibtex org-docview org-gnus org-habit org-info org-irc org-mhe org-rmail org-w3m)))
14 | '(org-refile-use-outline-path (quote file))
15 | '(package-selected-packages
16 | (quote
17 | (rainbow-mode proof-general elpy hindent ag qml-mode racket-mode php-mode go-mode kotlin-mode nginx-mode toml-mode love-minor-mode dockerfile-mode nix-mode purescript-mode markdown-mode jinja2-mode nim-mode csharp-mode rust-mode cmake-mode clojure-mode graphviz-dot-mode lua-mode tuareg glsl-mode yaml-mode d-mode scala-mode move-text nasm-mode editorconfig tide company powershell js2-mode yasnippet helm-ls-git helm-git-grep helm-cmd-t helm multiple-cursors magit haskell-mode paredit ido-completing-read+ smex gruber-darker-theme org-cliplink dash-functional dash)))
18 | '(safe-local-variable-values
19 | (quote
20 | ((eval progn
21 | (auto-revert-mode 1)
22 | (rc/autopull-changes)
23 | (add-hook
24 | (quote after-save-hook)
25 | (quote rc/autocommit-changes)
26 | nil
27 | (quote make-it-local))))))
28 | '(warning-minimum-level :error)
29 | '(whitespace-style
30 | (quote
31 | (face tabs spaces trailing space-before-tab newline indentation empty space-after-tab space-mark tab-mark))))
32 | (custom-set-faces
33 | ;; custom-set-faces was added by Custom.
34 | ;; If you edit it by hand, you could mess it up, so be careful.
35 | ;; Your init file should contain only one such instance.
36 | ;; If there is more than one, they won't work right.
37 | )
38 |
--------------------------------------------------------------------------------
/.emacs.rc/org-mode-rc.el:
--------------------------------------------------------------------------------
1 | (global-set-key (kbd "C-x a") 'org-agenda)
2 | (global-set-key (kbd "C-c C-x j") #'org-clock-jump-to-current-clock)
3 |
4 | (setq org-agenda-files (list "~/Documents/Agenda/"))
5 |
6 | (setq org-export-backends '(md))
7 |
8 | (defun rc/org-increment-move-counter ()
9 | (interactive)
10 |
11 | (defun default (x d)
12 | (if x x d))
13 |
14 | (let* ((point (point))
15 | (move-counter-name "MOVE_COUNTER")
16 | (move-counter-value (-> (org-entry-get point move-counter-name)
17 | (default "0")
18 | (string-to-number)
19 | (1+))))
20 | (org-entry-put point move-counter-name
21 | (number-to-string move-counter-value)))
22 | nil)
23 |
24 | (defun rc/org-get-heading-name ()
25 | (nth 4 (org-heading-components)))
26 |
27 | (defun rc/org-kill-heading-name-save ()
28 | (interactive)
29 | (let ((heading-name (rc/org-get-heading-name)))
30 | (kill-new heading-name)
31 | (message "Kill \"%s\"" heading-name)))
32 |
33 | (global-set-key (kbd "C-x p w") 'rc/org-kill-heading-name-save)
34 |
35 | (setq org-agenda-custom-commands
36 | '(("u" "Unscheduled" tags "+personal-SCHEDULED={.+}-DEADLINE={.+}/!+TODO"
37 | ((org-agenda-sorting-strategy '(priority-down))))
38 | ("p" "Personal" ((agenda "" ((org-agenda-tag-filter-preset (list "+personal"))))))
39 | ("w" "Work" ((agenda "" ((org-agenda-tag-filter-preset (list "+work"))))))
40 | ))
41 |
42 | ;;; org-cliplink
43 |
44 | (rc/require 'org-cliplink)
45 |
46 | (global-set-key (kbd "C-x p i") 'org-cliplink)
47 |
48 | (defun rc/cliplink-task ()
49 | (interactive)
50 | (org-cliplink-retrieve-title
51 | (substring-no-properties (current-kill 0))
52 | '(lambda (url title)
53 | (insert (if title
54 | (concat "* TODO " title
55 | "\n [[" url "][" title "]]")
56 | (concat "* TODO " url
57 | "\n [[" url "]]"))))))
58 | (global-set-key (kbd "C-x p t") 'rc/cliplink-task)
59 |
60 | ;;; org-capture
61 |
62 | (setq org-capture-templates
63 | '(("p" "Capture task" entry (file "~/Documents/Agenda/Tasks.org")
64 | "* TODO %?\n SCHEDULED: %t\n")
65 | ("K" "Cliplink capture task" entry (file "~/Documents/Agenda/Tasks.org")
66 | "* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 1)))
67 | (define-key global-map "\C-cc" 'org-capture)
68 |
69 |
--------------------------------------------------------------------------------
/DotFiles.psm1:
--------------------------------------------------------------------------------
1 | function Symlink-File {
2 | $DestPath = $args[0]
3 | $SourcePath = $args[1]
4 | if (Test-Path $DestPath) {
5 | Write-Warning "$DestPath is already symlinked"
6 | } else {
7 | if ((Get-Item $SourcePath) -is [System.IO.DirectoryInfo]) {
8 | cmd /c mklink /D "$DestPath" "$SourcePath"
9 | } else {
10 | cmd /c mklink "$DestPath" "$SourcePath"
11 | }
12 | echo "$DestPath has been symlinked"
13 | }
14 | }
15 |
16 | function Unsymlink-File {
17 | $DestPath = $args[0]
18 | $SourcePath = $args[1]
19 | if (Test-Path $DestPath) {
20 | if ((Get-Item $SourcePath) -is [System.IO.DirectoryInfo]) {
21 | cmd /c rmdir "$DestPath"
22 | } else {
23 | cmd /c del "$DestPath"
24 | }
25 | echo "$DestPath has been unsymlinked"
26 | } else {
27 | Write-Warning "$DestPath doesn't exist"
28 | }
29 | }
30 |
31 | function Deploy-Manifest {
32 | $ManifestFile = $args[0]
33 |
34 | echo "Deploying $ManifestFile..."
35 |
36 | $Manifest = Import-Csv -Header ("file", "operation") -Delimiter ("|") -Path ".\$ManifestFile"
37 | $EmacsHome = $env:HOME
38 | foreach ($ManifestRow in $Manifest) {
39 | $DeployFile = $ManifestRow.file
40 | $DeployOp = $ManifestRow.operation
41 | $SourcePath = "$PSScriptRoot\$DeployFile"
42 | $DestPath = "$EmacsHome\$DeployFile"
43 | switch($DeployOp) {
44 | "symlink" {
45 | Symlink-File $DestPath $SourcePath
46 | }
47 |
48 | "copy" {
49 | Write-Warning "The 'copy' operation is not implemented yet. Skipping..."
50 | }
51 |
52 | default {
53 | Write-Warning "Unknown operation $operation. Skipping..."
54 | }
55 | }
56 | }
57 | }
58 |
59 | function Undeploy-Manifest {
60 | $ManifestFile = $args[0]
61 |
62 | echo "Undeploying $ManifestFile..."
63 |
64 | $Manifest = Import-Csv -Header ("file", "operation") -Delimiter ("|") -Path ".\$ManifestFile"
65 | $EmacsHome = $env:HOME
66 | foreach ($ManifestRow in $Manifest) {
67 | $DeployFile = $ManifestRow.file
68 | $DeployOp = $ManifestRow.operation
69 | $SourcePath = "$PSScriptRoot\$DeployFile"
70 | $DestPath = "$EmacsHome\$DeployFile"
71 | switch($DeployOp) {
72 | "symlink" {
73 | Unsymlink-File $DestPath $SourcePath
74 | }
75 |
76 | "copy" {
77 | Write-Warning "The 'copy' operation is not implemented yet. Skipping..."
78 | }
79 |
80 | default {
81 | Write-Warning "Unknown operation $operation. Skipping..."
82 | }
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/.emacs.local/porth-mode.el:
--------------------------------------------------------------------------------
1 | ;;; porth-mode.el --- Major Mode for editing Porth source code -*- lexical-binding: t -*-
2 |
3 | ;; Copyright (C) 2021 Alexey Kutepov
4 |
5 | ;; Author: Alexey Kutepov
6 | ;; URL: https://github.com/tsoding/porth
7 |
8 | ;; Permission is hereby granted, free of charge, to any person
9 | ;; obtaining a copy of this software and associated documentation
10 | ;; files (the "Software"), to deal in the Software without
11 | ;; restriction, including without limitation the rights to use, copy,
12 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
13 | ;; of the Software, and to permit persons to whom the Software is
14 | ;; furnished to do so, subject to the following conditions:
15 |
16 | ;; The above copyright notice and this permission notice shall be
17 | ;; included in all copies or substantial portions of the Software.
18 |
19 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | ;; SOFTWARE.
27 |
28 | ;;; Commentary:
29 | ;;
30 | ;; Major Mode for editing Porth source code. It's Forth but written in Python.
31 |
32 | ;; TODO: jump to the opposite side of the blocks with C-M-f and C-M-b
33 | ;; I think tuareg-mode can do that with similar end-like block, we try
34 | ;; to steal their approach
35 | ;; TODO: color the names of definitions in const, memory, proc, etc differently
36 |
37 | (defconst porth-mode-syntax-table
38 | (with-syntax-table (copy-syntax-table)
39 | ;; C/C++ style comments
40 | (modify-syntax-entry ?/ ". 124b")
41 | (modify-syntax-entry ?* ". 23")
42 | (modify-syntax-entry ?\n "> b")
43 | ;; Chars are the same as strings
44 | (modify-syntax-entry ?' "\"")
45 | (syntax-table))
46 | "Syntax table for `porth-mode'.")
47 |
48 | (eval-and-compile
49 | (defconst porth-keywords
50 | '("if" "else" "while" "do" "include" "memory" "proc"
51 | "const" "end" "offset" "reset" "assert" "in" "inline"
52 | "here" "addr-of" "call-like" "let" "peek" "return"
53 | "var" "cast" "struct")))
54 |
55 | (defconst porth-highlights
56 | `((,(regexp-opt porth-keywords 'symbols) . font-lock-keyword-face)))
57 |
58 | ;;;###autoload
59 | (define-derived-mode porth-mode prog-mode "porth"
60 | "Major Mode for editing Porth source code."
61 | :syntax-table porth-mode-syntax-table
62 | (setq font-lock-defaults '(porth-highlights))
63 | (setq-local comment-start "// "))
64 |
65 | ;;;###autoload
66 | (add-to-list 'auto-mode-alist '("\\.porth\\'" . porth-mode))
67 |
68 | (provide 'porth-mode)
69 |
70 | ;;; porth-mode.el ends here
71 |
--------------------------------------------------------------------------------
/.emacs.local/basm-mode.el:
--------------------------------------------------------------------------------
1 | ;;; basm-mode.el --- Major Mode for editing BASM Assembly Code -*- lexical-binding: t -*-
2 |
3 | ;; Copyright (C) 2021 Alexey Kutepov
4 |
5 | ;; Author: Alexey Kutepov
6 | ;; URL: http://github.com/tsoding/bm
7 |
8 | ;; Permission is hereby granted, free of charge, to any person
9 | ;; obtaining a copy of this software and associated documentation
10 | ;; files (the "Software"), to deal in the Software without
11 | ;; restriction, including without limitation the rights to use, copy,
12 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
13 | ;; of the Software, and to permit persons to whom the Software is
14 | ;; furnished to do so, subject to the following conditions:
15 |
16 | ;; The above copyright notice and this permission notice shall be
17 | ;; included in all copies or substantial portions of the Software.
18 |
19 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | ;; SOFTWARE.
27 |
28 | ;;; Commentary:
29 | ;;
30 | ;; Major Mode for editing BASM Assembly Code. The language for a
31 | ;; simple Virtual Machine.
32 |
33 | (defconst basm-mode-syntax-table
34 | (with-syntax-table (copy-syntax-table)
35 | (modify-syntax-entry ?\; "<")
36 | (modify-syntax-entry ?\n ">")
37 | (modify-syntax-entry ?\" "\"")
38 | (modify-syntax-entry ?\' "\"")
39 | (syntax-table))
40 | "Syntax table for `basm-mode'.")
41 |
42 | (eval-and-compile
43 | (defconst basm-instructions
44 | '("nop" "push" "drop" "dup"
45 | "plusi" "minusi" "multi" "divi" "modi"
46 | "multu" "divu" "modu"
47 | "plusf" "minusf" "multf" "divf"
48 | "jmp" "jmp_if" "halt" "swap" "not"
49 | "eqi" "gei" "gti" "lei" "lti" "nei"
50 | "equ" "geu" "gtu" "leu" "ltu" "neu"
51 | "eqf" "gef" "gtf" "lef" "ltf" "nef"
52 | "ret" "call" "native"
53 | "andb" "orb" "xor" "shr" "shl" "notb"
54 | "read8u" "read16u" "read32u" "read64u"
55 | "read8i" "read16i" "read32i" "read64i"
56 | "write8" "write16" "write32" "write64"
57 | "i2f" "u2f" "f2i" "f2u")))
58 |
59 | (defconst basm-highlights
60 | `(("%[[:word:]_]+" . font-lock-preprocessor-face)
61 | ("[[:word:]_]+\\:" . font-lock-constant-face)
62 | (,(regexp-opt basm-instructions 'symbols) . font-lock-keyword-face)))
63 |
64 | ;;;###autoload
65 | (define-derived-mode basm-mode fundamental-mode "basm"
66 | "Major Mode for editing BASM Assembly Code."
67 | (setq font-lock-defaults '(basm-highlights))
68 | (set-syntax-table basm-mode-syntax-table))
69 |
70 | ;;;###autoload
71 | (add-to-list 'auto-mode-alist '("\\.\\(b\\|h\\)asm\\'" . basm-mode))
72 |
73 | (provide 'basm-mode)
74 |
75 | ;;; basm-mode.el ends here
76 |
--------------------------------------------------------------------------------
/.emacs.local/noq-mode.el:
--------------------------------------------------------------------------------
1 | ;;; noq-mode.el --- Major Mode for editing Noq source code -*- lexical-binding: t -*-
2 |
3 | ;; Copyright (C) 2021 Alexey Kutepov
4 |
5 | ;; Author: Alexey Kutepov
6 | ;; URL: https://github.com/tsoding/noq
7 |
8 | ;; Permission is hereby granted, free of charge, to any person
9 | ;; obtaining a copy of this software and associated documentation
10 | ;; files (the "Software"), to deal in the Software without
11 | ;; restriction, including without limitation the rights to use, copy,
12 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
13 | ;; of the Software, and to permit persons to whom the Software is
14 | ;; furnished to do so, subject to the following conditions:
15 |
16 | ;; The above copyright notice and this permission notice shall be
17 | ;; included in all copies or substantial portions of the Software.
18 |
19 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | ;; SOFTWARE.
27 |
28 | ;;; Commentary:
29 | ;;
30 | ;; Major Mode for editing Noq source code
31 |
32 | (defconst noq-mode-syntax-table
33 | (with-syntax-table (copy-syntax-table)
34 | ;; Python-style comments
35 | (modify-syntax-entry ?# "<")
36 | (modify-syntax-entry ?\n ">")
37 | ;; C/C++ style comments
38 | (modify-syntax-entry ?/ ". 124b")
39 | (modify-syntax-entry ?* ". 23")
40 | (modify-syntax-entry ?\n "> b")
41 | ;; (modify-syntax-entry ?/ ". 124b")
42 | ;; (modify-syntax-entry ?* ". 23")
43 | ;; (modify-syntax-entry ?\n "> b")
44 | ;; Chars are the same as strings
45 | (modify-syntax-entry ?' "\"")
46 | (syntax-table))
47 | "Syntax table for `noq-mode'.")
48 |
49 | (eval-and-compile
50 | (defconst noq-apply-strategies
51 | '("all" "deep")))
52 |
53 | (eval-and-compile
54 | (defconst noq-keywords
55 | '("undo" "quit" "delete" "load" "save")))
56 |
57 | (defconst noq-highlights
58 | `((
59 | ;; Keywords
60 | ,(regexp-opt noq-keywords 'words) . 'font-lock-keyword-face)
61 |
62 | ;; `Apply` strategies
63 | (,(format "\\(%s\\)[\t ]*|" (mapconcat 'regexp-quote noq-apply-strategies "\\|"))
64 | 1 'font-lock-type-face)
65 | ("\\([0-9]+\\)[\t ]*|" 1 'font-lock-type-face)
66 |
67 | ;; Variables
68 | ("\\(^\\|[^a-zA-Z0-9_]\\)\\([_A-Z][_a-zA-Z0-9]*\\)" 2 'font-lock-variable-name-face)
69 |
70 | ;; Functor names
71 | ("\\([^\n\| ]*\\)[\t ]*::" 1 'font-lock-function-name-face)
72 | ))
73 |
74 | ;;;###autoload
75 | (define-derived-mode noq-mode prog-mode "noq"
76 | "Major Mode for editing Noq source code."
77 | :syntax-table noq-mode-syntax-table
78 | (setq font-lock-defaults '(noq-highlights))
79 | (setq-local comment-start "// "))
80 |
81 | ;;;###autoload
82 | (add-to-list 'auto-mode-alist '("\\.noq\\'" . noq-mode))
83 |
84 | (provide 'noq-mode)
85 |
86 | ;;; noq-mode.el ends here
87 |
--------------------------------------------------------------------------------
/.rexim/icons/terminal-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
115 |
--------------------------------------------------------------------------------
/.emacs.local/c3-mode.el:
--------------------------------------------------------------------------------
1 | (require 'subr-x)
2 |
3 | (defvar c3-mode-syntax-table
4 | (let ((table (make-syntax-table)))
5 | ;; C/C++ style comments
6 | (modify-syntax-entry ?/ ". 124b" table)
7 | (modify-syntax-entry ?* ". 23" table)
8 | (modify-syntax-entry ?\n "> b" table)
9 | ;; Chars are the same as strings
10 | (modify-syntax-entry ?' "\"" table)
11 | ;; Treat <> as punctuation (needed to highlight C++ keywords
12 | ;; properly in template syntax)
13 | (modify-syntax-entry ?< "." table)
14 | (modify-syntax-entry ?> "." table)
15 | (modify-syntax-entry ?& "." table)
16 | (modify-syntax-entry ?% "." table)
17 | table))
18 |
19 | (defun c3-types ()
20 | '("void" "bool"
21 | "ichar" "char"
22 | ;; Integer types
23 | "short" "ushort" "int" "uint" "long" "ulong" "int128" "uint128"
24 | "iptr" "uptr"
25 | "isz" "usz"
26 | ;; Floating point types
27 | "float16" "float" "double" "float128"
28 | ;; Other types
29 | "any" "anyfault" "typeid"
30 | ;; C compatibility types
31 | "CChar" "CShort" "CUShort" "CInt" "CUInt" "CLong" "CULong" "CLongLong" "CULongLong" "CFloat" "CDouble" "CLongDouble"
32 | ;; CT types
33 | "$typefrom" "$tyypeof" "$vatype"
34 | ))
35 |
36 | (defun c3-keywords ()
37 | '("asm" "assert" "bitstruct"
38 | "break" "case" "catch"
39 | "const" "continue" "def"
40 | "default" "defer" "distinct"
41 | "do" "else" "enum"
42 | "extern" "false" "fault"
43 | "for" "foreach" "foreach_r"
44 | "fn" "tlocal" "if"
45 | "inline" "import" "macro"
46 | "module" "nextcase" "null"
47 | "return" "static" "struct"
48 | "switch" "true" "try"
49 | "union" "var" "while"
50 | "$alignof" "$assert" "$case"
51 | "$checks" "$default" "$defined"
52 | "$echo" "$else" "$endfor"
53 | "$endforeach" "$endif" "$endswitch"
54 | "$for" "$foreach" "$if"
55 | "$include" "$nameof" "$offsetof"
56 | "$qnameof" "$sizeof" "$stringify"
57 | "$vacount" "$vaconst" "$varef"
58 | "$vaarg" "$vaexpr" "$vasplat"
59 | ))
60 |
61 | (defun c3-font-lock-keywords ()
62 | (list
63 | `("#.*include \\(\\(<\\|\"\\).*\\(>\\|\"\\)\\)" . (1 font-lock-string-face))
64 | `(,(regexp-opt (c3-keywords) 'symbols) . font-lock-keyword-face)
65 | `(,(regexp-opt (c3-types) 'symbols) . font-lock-type-face)))
66 |
67 | (defun c3--space-prefix-len (line)
68 | (- (length line)
69 | (length (string-trim-left line))))
70 |
71 | (defun c3--previous-non-empty-line ()
72 | (save-excursion
73 | (forward-line -1)
74 | (while (and (not (bobp))
75 | (string-empty-p
76 | (string-trim-right
77 | (thing-at-point 'line t))))
78 | (forward-line -1))
79 | (thing-at-point 'line t)))
80 |
81 | (defun c3--desired-indentation ()
82 | (let ((cur-line (string-trim-right (thing-at-point 'line t)))
83 | (prev-line (string-trim-right (c3--previous-non-empty-line)))
84 | (indent-len 4))
85 | (cond
86 | ((and (string-suffix-p "{" prev-line)
87 | (string-prefix-p "}" (string-trim-left cur-line)))
88 | (c3--space-prefix-len prev-line))
89 | ((string-suffix-p "{" prev-line)
90 | (+ (c3--space-prefix-len prev-line) indent-len))
91 | ((string-prefix-p "}" (string-trim-left cur-line))
92 | (max (- (c3--space-prefix-len prev-line) indent-len) 0))
93 | (t (c3--space-prefix-len prev-line)))))
94 |
95 | (defun c3-indent-line ()
96 | (interactive)
97 | (when (not (bobp))
98 | (let* ((current-indentation
99 | (c3--space-prefix-len (thing-at-point 'line t)))
100 | (desired-indentation
101 | (c3--desired-indentation))
102 | (n (max (- (current-column) current-indentation) 0)))
103 | (indent-line-to desired-indentation)
104 | (forward-char n))))
105 |
106 | ;;;###autoload
107 | (define-derived-mode c3-mode prog-mode "Simple C3"
108 | "Simple major mode for C3."
109 | :syntax-table c3-mode-syntax-table
110 | (setq-local font-lock-defaults '(c3-font-lock-keywords))
111 | (setq-local indent-line-function 'c3-indent-line)
112 | (setq-local comment-start "// "))
113 |
114 | ;;;###autoload
115 | (add-to-list 'auto-mode-alist '("\\.c3\\'" . c3-mode))
116 | (add-to-list 'auto-mode-alist '("\\.c3i\\'" . c3-mode))
117 |
118 | (provide 'c3-mode)
119 |
--------------------------------------------------------------------------------
/.urxvt/ext/resize-font:
--------------------------------------------------------------------------------
1 | # vim:ft=perl:fenc=utf-8:tw=80
2 | # Copyright (c) 2009-, Simon Lundström
3 | # Copyright (c) 2014 Maarten de Vries
4 | #
5 | # Permission to use, copy, modify, and/or distribute this software for any
6 | # purpose with or without fee is hereby granted, provided that the above
7 | # copyright notice and this permission notice appear in all copies.
8 | #
9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
17 | # https://github.com/simmel/urxvt-resize-font
18 |
19 | my @fonts = (
20 | {'name' => 'font', 'code' => 710},
21 | {'name' => 'boldFont', 'code' => 711},
22 | {'name' => 'italicFont', 'code' => 712},
23 | {'name' => 'boldItalicFont', 'code' => 713},
24 | );
25 |
26 | my @fixed = qw(4x6 5x7 5x8 6x9 6x10 6x12 6x13 7x13 7x14 8x13 8x16 9x15 9x18
27 | 10x20 12x24);
28 | my $step;
29 |
30 | sub on_start {
31 | my ($self) = @_;
32 |
33 | foreach (@fonts) {
34 | $_->{'default'} = $self->resource($_->{'name'});
35 | }
36 |
37 | $step = $self->x_resource("%.step") || 2;
38 | }
39 |
40 | sub on_init {
41 | my ($self) = @_;
42 | my $commands = {
43 | "smaller" => "C-minus",
44 | "bigger" => "C-plus",
45 | "reset" => "C-equal",
46 | "show" => "C-question",
47 | };
48 | bind_hotkeys($self, $commands);
49 |
50 | ()
51 | }
52 |
53 | sub bind_hotkeys {
54 | my ($self, $commands) = @_;
55 |
56 | for (keys %$commands) {
57 | my $hotkey = $$commands{$_};
58 | my $hotkey_bound = $self->{'term'}->x_resource("keysym.$hotkey");
59 | if (!defined($hotkey_bound) ) {
60 | # Support old-style key bindings
61 | if ($self->x_resource("%.$_")) {
62 | $hotkey = $self->x_resource("%.$_");
63 | }
64 |
65 | # FIXME If we're bound to a keysym, don't bind the default.
66 | $self->bind_action($hotkey, "%:$_") or
67 | warn "unable to register '$hotkey' as hotkey for $_";
68 | }
69 | else {
70 | if ($hotkey_bound !~ /^resize-font:/) {
71 | warn "Hotkey $$commands{$_} already bound to $hotkey_bound, not ".
72 | "binding to resize-font:$_ by default.";
73 | }
74 | }
75 | }
76 | }
77 |
78 | sub on_action {
79 | my ($self, $string) = @_;
80 |
81 | if ($string eq "bigger") {
82 | foreach (@fonts) {
83 | next if not defined($_->{'default'});
84 | update_font_size($self, $_, +$step);
85 | }
86 | }
87 | elsif ($string eq "smaller") {
88 | foreach (@fonts) {
89 | next if not defined($_->{'default'});
90 | update_font_size($self, $_, -$step);
91 | }
92 | }
93 | elsif ($string eq "reset") {
94 | foreach (@fonts) {
95 | next if not defined($_->{'default'});
96 | set_font($self, $_, $_->{'default'});
97 | }
98 | }
99 | elsif ($string eq "show") {
100 |
101 | my $term = $self->{'term'};
102 | $term->{'resize-font'}{'overlay'} = {
103 | ov => $term->overlay_simple(0, -1, format_font_info($self)),
104 | to => urxvt::timer
105 | ->new
106 | ->start(urxvt::NOW + 1)
107 | ->cb(sub {
108 | delete $term->{'resize-font'}{'overlay'};
109 | }),
110 | };
111 | }
112 |
113 | ()
114 | }
115 |
116 | sub get_font {
117 | my ($self, $name) = @_;
118 | return $self->resource($name);
119 | }
120 |
121 | sub set_font {
122 | my ($self, $font, $new) = @_;
123 | $self->cmd_parse(sprintf("\33]%d;%s\007", $font->{'code'}, $new));
124 | }
125 |
126 | sub update_font_size {
127 | my ($self, $font, $delta) = @_;
128 | my $regex = qr"(?<=size=)(\d+)";
129 | my $current = get_font($self, $font->{'name'});
130 |
131 | my ($index) = grep { $fixed[$_] eq $current } 0..$#fixed;
132 | if ($index or $index eq 0) {
133 | my $inc = $delta / abs($delta);
134 | $index += $inc;
135 | if ($index < 0) { $index = 0; }
136 | if ($index > $#fixed) { $index = $#fixed; }
137 | $current = $fixed[$index];
138 | }
139 | elsif ($current =~ /^-/) {
140 | my @font = split(/-/, $current);
141 | # https://en.wikipedia.org/wiki/X_logical_font_description
142 | my $newsize = $font[7]+$delta;
143 | $font[7] = $newsize if ($newsize > 0);
144 | $current = join('-', @font);
145 | }
146 | else {
147 | my $newsize = $1+$delta if ($current =~ /$regex/);
148 | $current =~ s/$regex/$newsize/ge if ($newsize > 0);
149 | }
150 | set_font($self, $font, $current);
151 | }
152 |
153 | sub format_font_info {
154 | my ($self) = @_;
155 |
156 | my $width = 0;
157 | foreach (@fonts) {
158 | my $length = length($_->{'name'});
159 | $width = $length > $width ? $length : $width;
160 | }
161 | ++$width;
162 |
163 | my $info = '';
164 | foreach (@fonts) {
165 | $info .= sprintf("%-${width}s %s\n", $_->{'name'} . ':',
166 | get_font($self, $_->{'name'}));
167 | }
168 |
169 | return $info;
170 | }
171 |
--------------------------------------------------------------------------------
/.emacs.rc/misc-rc.el:
--------------------------------------------------------------------------------
1 | (require 'ansi-color)
2 |
3 | (global-set-key (kbd "C-x C-g") 'find-file-at-point)
4 | (global-set-key (kbd "C-c i m") 'imenu)
5 |
6 | (setq-default inhibit-splash-screen t
7 | make-backup-files nil
8 | tab-width 4
9 | indent-tabs-mode nil
10 | compilation-scroll-output t
11 | default-input-method "russian-computer"
12 | visible-bell (equal system-type 'windows-nt))
13 |
14 | (defun rc/colorize-compilation-buffer ()
15 | (read-only-mode 'toggle)
16 | (ansi-color-apply-on-region compilation-filter-start (point))
17 | (read-only-mode 'toggle))
18 | (add-hook 'compilation-filter-hook 'rc/colorize-compilation-buffer)
19 |
20 | (defun rc/buffer-file-name ()
21 | (if (equal major-mode 'dired-mode)
22 | default-directory
23 | (buffer-file-name)))
24 |
25 | (defun rc/parent-directory (path)
26 | (file-name-directory (directory-file-name path)))
27 |
28 | (defun rc/root-anchor (path anchor)
29 | (cond
30 | ((string= anchor "") nil)
31 | ((file-exists-p (concat (file-name-as-directory path) anchor)) path)
32 | ((string-equal path "/") nil)
33 | (t (rc/root-anchor (rc/parent-directory path) anchor))))
34 |
35 | (defun rc/clipboard-org-mode-file-link (anchor)
36 | (interactive "sRoot anchor: ")
37 | (let* ((root-dir (rc/root-anchor default-directory anchor))
38 | (org-mode-file-link (format "file:%s::%d"
39 | (if root-dir
40 | (file-relative-name (rc/buffer-file-name) root-dir)
41 | (rc/buffer-file-name))
42 | (line-number-at-pos))))
43 | (kill-new org-mode-file-link)
44 | (message org-mode-file-link)))
45 |
46 | ;;; Taken from here:
47 | ;;; http://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs
48 | (defun rc/put-file-name-on-clipboard ()
49 | "Put the current file name on the clipboard"
50 | (interactive)
51 | (let ((filename (rc/buffer-file-name)))
52 | (when filename
53 | (kill-new filename)
54 | (message filename))))
55 |
56 | (defun rc/put-buffer-name-on-clipboard ()
57 | "Put the current buffer name on the clipboard"
58 | (interactive)
59 | (kill-new (buffer-name))
60 | (message (buffer-name)))
61 |
62 | (defun rc/kill-autoloads-buffers ()
63 | (interactive)
64 | (dolist (buffer (buffer-list))
65 | (let ((name (buffer-name buffer)))
66 | (when (string-match-p "-autoloads.el" name)
67 | (kill-buffer buffer)
68 | (message "Killed autoloads buffer %s" name)))))
69 |
70 | ;;; Taken from here:
71 | ;;; http://blog.bookworm.at/2007/03/pretty-print-xml-with-emacs.html
72 | (defun bf-pretty-print-xml-region (begin end)
73 | "Pretty format XML markup in region. You need to have nxml-mode
74 | http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do
75 | this. The function inserts linebreaks to separate tags that have
76 | nothing but whitespace between them. It then indents the markup
77 | by using nxml's indentation rules."
78 | (interactive "r")
79 | (save-excursion
80 | (nxml-mode)
81 | (goto-char begin)
82 | (while (search-forward-regexp "\>[ \\t]*\<" nil t)
83 | (backward-char) (insert "\n"))
84 | (indent-region begin end))
85 | (message "Ah, much better!"))
86 |
87 | ;;; Stolen from http://ergoemacs.org/emacs/emacs_unfill-paragraph.html
88 | (defun rc/unfill-paragraph ()
89 | "Replace newline chars in current paragraph by single spaces.
90 | This command does the inverse of `fill-paragraph'."
91 | (interactive)
92 | (let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum'
93 | (fill-paragraph nil)))
94 |
95 | (global-set-key (kbd "C-c M-q") 'rc/unfill-paragraph)
96 |
97 | (defun rc/load-path-here ()
98 | (interactive)
99 | (add-to-list 'load-path default-directory))
100 |
101 | (defconst rc/frame-transparency 85)
102 |
103 | (defun rc/toggle-transparency ()
104 | (interactive)
105 | (let ((frame-alpha (frame-parameter nil 'alpha)))
106 | (if (or (not frame-alpha)
107 | (= (cadr frame-alpha) 100))
108 | (set-frame-parameter nil 'alpha
109 | `(,rc/frame-transparency
110 | ,rc/frame-transparency))
111 | (set-frame-parameter nil 'alpha '(100 100)))))
112 |
113 | (defun rc/duplicate-line ()
114 | "Duplicate current line"
115 | (interactive)
116 | (let ((column (- (point) (point-at-bol)))
117 | (line (let ((s (thing-at-point 'line t)))
118 | (if s (string-remove-suffix "\n" s) ""))))
119 | (move-end-of-line 1)
120 | (newline)
121 | (insert line)
122 | (move-beginning-of-line 1)
123 | (forward-char column)))
124 |
125 | (global-set-key (kbd "C-,") 'rc/duplicate-line)
126 |
127 | (defun rc/insert-timestamp ()
128 | (interactive)
129 | (insert (format-time-string "(%Y%m%d-%H%M%S)" nil t)))
130 |
131 | (global-set-key (kbd "C-x p d") 'rc/insert-timestamp)
132 |
133 | (defun rc/rgrep-selected (beg end)
134 | (interactive (if (use-region-p)
135 | (list (region-beginning) (region-end))
136 | (list (point-min) (point-min))))
137 | (rgrep (buffer-substring-no-properties beg end) "*" (pwd)))
138 |
139 | (global-set-key (kbd "C-x p s") 'rc/rgrep-selected)
140 |
141 | ;;; A little hack which fixes a problem with meta key in fluxbox under VNC.
142 | (setq x-alt-keysym 'meta)
143 |
144 | (setq confirm-kill-emacs 'y-or-n-p)
145 |
--------------------------------------------------------------------------------
/.emacs.local/simpc-mode.el:
--------------------------------------------------------------------------------
1 | (require 'subr-x)
2 |
3 | (defvar simpc-mode-syntax-table
4 | (let ((table (make-syntax-table)))
5 | ;; C/C++ style comments
6 | (modify-syntax-entry ?/ ". 124b" table)
7 | (modify-syntax-entry ?* ". 23" table)
8 | (modify-syntax-entry ?\n "> b" table)
9 | ;; Preprocessor stuff?
10 | (modify-syntax-entry ?# "." table)
11 | ;; Chars are the same as strings
12 | (modify-syntax-entry ?' "\"" table)
13 | ;; Treat <> as punctuation (needed to highlight C++ keywords
14 | ;; properly in template syntax)
15 | (modify-syntax-entry ?< "." table)
16 | (modify-syntax-entry ?> "." table)
17 |
18 | (modify-syntax-entry ?& "." table)
19 | (modify-syntax-entry ?% "." table)
20 | table))
21 |
22 | (defun simpc-types ()
23 | '("char" "int" "long" "short" "void" "bool" "float" "double" "signed" "unsigned"
24 | "char16_t" "char32_t" "char8_t"
25 | "int8_t" "uint8_t" "int16_t" "uint16_t" "int32_t" "uint32_t" "int64_t" "uint64_t"
26 | "uintptr_t"
27 | "size_t"
28 | "va_list"))
29 |
30 | (defun simpc-keywords ()
31 | '("auto" "break" "case" "const" "continue" "default" "do"
32 | "else" "enum" "extern" "for" "goto" "if" "register"
33 | "return" "sizeof" "static" "struct" "switch" "typedef"
34 | "union" "volatile" "while" "alignas" "alignof" "and"
35 | "and_eq" "asm" "atomic_cancel" "atomic_commit" "atomic_noexcept" "bitand"
36 | "bitor" "catch" "class" "co_await"
37 | "co_return" "co_yield" "compl" "concept" "const_cast" "consteval" "constexpr"
38 | "constinit" "decltype" "delete" "dynamic_cast" "explicit" "export" "false"
39 | "friend" "inline" "mutable" "namespace" "new" "noexcept" "not" "not_eq"
40 | "nullptr" "operator" "or" "or_eq" "private" "protected" "public" "reflexpr"
41 | "reinterpret_cast" "requires" "static_assert" "static_cast" "synchronized"
42 | "template" "this" "thread_local" "throw" "true" "try" "typeid" "typename"
43 | "using" "virtual" "wchar_t" "xor" "xor_eq"))
44 |
45 | (defun simpc-font-lock-keywords ()
46 | (list
47 | `("# *\\(warn\\|error\\)" . font-lock-warning-face)
48 | `("# *[#a-zA-Z0-9_]+" . font-lock-preprocessor-face)
49 | `("# *include\\(?:_next\\)?\\s-+\\(\\(<\\|\"\\).*\\(>\\|\"\\)\\)" . (1 font-lock-string-face))
50 | `("\\(?:enum\\|struct\\)\\s-+\\([a-zA-Z0-9_]+\\)" . (1 font-lock-type-face))
51 | `(,(regexp-opt (simpc-keywords) 'symbols) . font-lock-keyword-face)
52 | `(,(regexp-opt (simpc-types) 'symbols) . font-lock-type-face)))
53 |
54 | (defun simpc--previous-non-empty-line ()
55 | "Returns either NIL when there is no such line or a pair (line . indentation)"
56 | (save-excursion
57 | ;; If you are on the first line, but not at the beginning of buffer (BOB) the `(bobp)`
58 | ;; function does not return `t`. So we have to move to the beginning of the line first.
59 | ;; TODO: feel free to suggest a better approach for checking BOB here.
60 | (move-beginning-of-line nil)
61 | (if (bobp)
62 | ;; If you are standing at the BOB, you by definition don't have a previous non-empty line.
63 | nil
64 | ;; Moving one line backwards because the current line is by definition is not
65 | ;; the previous non-empty line.
66 | (forward-line -1)
67 | ;; Keep moving backwards until we hit BOB or a non-empty line.
68 | (while (and (not (bobp))
69 | (string-empty-p
70 | (string-trim-right
71 | (thing-at-point 'line t))))
72 | (forward-line -1))
73 |
74 | (if (string-empty-p
75 | (string-trim-right
76 | (thing-at-point 'line t)))
77 | ;; If after moving backwards for this long we still look at an empty
78 | ;; line we by definition didn't find the previous non-empty line.
79 | nil
80 | ;; We found the previous non-empty line!
81 | (cons (thing-at-point 'line t)
82 | (current-indentation))))))
83 |
84 | (defun simpc--desired-indentation ()
85 | (let ((prev (simpc--previous-non-empty-line)))
86 | (if (not prev)
87 | (current-indentation)
88 | (let ((indent-len 4)
89 | (cur-line (string-trim-right (thing-at-point 'line t)))
90 | (prev-line (string-trim-right (car prev)))
91 | (prev-indent (cdr prev)))
92 | (cond
93 | ((string-match-p "^\\s-*switch\\s-*(.+)" prev-line)
94 | prev-indent)
95 | ((and (string-suffix-p "{" prev-line)
96 | (string-prefix-p "}" (string-trim-left cur-line)))
97 | prev-indent)
98 | ((string-suffix-p "{" prev-line)
99 | (+ prev-indent indent-len))
100 | ((string-prefix-p "}" (string-trim-left cur-line))
101 | (max (- prev-indent indent-len) 0))
102 | ((string-suffix-p ":" prev-line)
103 | (if (string-suffix-p ":" cur-line)
104 | prev-indent
105 | (+ prev-indent indent-len)))
106 | ((string-suffix-p ":" cur-line)
107 | (max (- prev-indent indent-len) 0))
108 | (t prev-indent))))))
109 |
110 | ;;; TODO: customizable indentation (amount of spaces, tabs, etc)
111 | (defun simpc-indent-line ()
112 | (interactive)
113 | (when (not (bobp))
114 | (let* ((desired-indentation
115 | (simpc--desired-indentation))
116 | (n (max (- (current-column) (current-indentation)) 0)))
117 | (indent-line-to desired-indentation)
118 | (forward-char n))))
119 |
120 | (define-derived-mode simpc-mode prog-mode "Simple C"
121 | "Simple major mode for editing C files."
122 | :syntax-table simpc-mode-syntax-table
123 | (setq-local font-lock-defaults '(simpc-font-lock-keywords))
124 | (setq-local indent-line-function 'simpc-indent-line)
125 | (setq-local comment-start "// "))
126 |
127 | (provide 'simpc-mode)
128 |
--------------------------------------------------------------------------------
/i3/config:
--------------------------------------------------------------------------------
1 | # This file has been auto-generated by i3-config-wizard(1).
2 | # It will not be overwritten, so edit it as you like.
3 | #
4 | # Should you change your keyboard layout some time, delete
5 | # this file and re-run i3-config-wizard(1).
6 | #
7 |
8 | # i3 config file (v4)
9 | #
10 | # Please see http://i3wm.org/docs/userguide.html for a complete reference!
11 |
12 | set $mod Mod4
13 |
14 | # Font for window titles. Will also be used by the bar unless a different font
15 | # is used in the bar {} block below.
16 | # font pango:monospace 8
17 |
18 | # This font is widely installed, provides lots of unicode glyphs, right-to-left
19 | # text rendering and scalability on retina/hidpi displays (thanks to pango).
20 | #font pango:DejaVu Sans Mono 8
21 |
22 | font pango:Iosevka 10
23 |
24 | # Before i3 v4.8, we used to recommend this one as the default:
25 | # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
26 | # The font above is very space-efficient, that is, it looks good, sharp and
27 | # clear in small sizes. However, its unicode glyph coverage is limited, the old
28 | # X core fonts rendering does not support right-to-left and this being a bitmap
29 | # font, it doesn’t scale on retina/hidpi displays.
30 |
31 | # Use Mouse+$mod to drag floating windows to their wanted position
32 | floating_modifier $mod
33 |
34 | # start a terminal
35 | #bindsym $mod+Return exec i3-sensible-terminal
36 | bindsym $mod+Return exec st
37 |
38 | # scrot
39 | bindsym --release $mod+s exec "scrot -s"
40 |
41 | # kill focused window
42 | bindsym $mod+Shift+q kill
43 |
44 | # start dmenu (a program launcher)
45 | bindsym $mod+d exec dmenu_run
46 | # There also is the (new) i3-dmenu-desktop which only displays applications
47 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that
48 | # installed.
49 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
50 |
51 | # change focus
52 | bindsym $mod+j focus left
53 | bindsym $mod+k focus down
54 | bindsym $mod+l focus up
55 | bindsym $mod+semicolon focus right
56 |
57 | # alternatively, you can use the cursor keys:
58 | bindsym $mod+Left focus left
59 | bindsym $mod+Down focus down
60 | bindsym $mod+Up focus up
61 | bindsym $mod+Right focus right
62 |
63 | # move focused window
64 | bindsym $mod+Shift+j move left
65 | bindsym $mod+Shift+k move down
66 | bindsym $mod+Shift+semicolon move right
67 |
68 | # alternatively, you can use the cursor keys:
69 | bindsym $mod+Shift+Left move left
70 | bindsym $mod+Shift+Down move down
71 | bindsym $mod+Shift+Up move up
72 | bindsym $mod+Shift+Right move right
73 |
74 | # split in horizontal orientation
75 | bindsym $mod+h split h
76 |
77 | # split in vertical orientation
78 | bindsym $mod+v split v
79 |
80 | # enter fullscreen mode for the focused container
81 | bindsym $mod+f fullscreen toggle
82 |
83 | # change container layout (stacked, tabbed, toggle split)
84 | # bindsym $mod+s layout stacking
85 | bindsym $mod+w layout tabbed
86 | bindsym $mod+e layout toggle split
87 |
88 | # toggle tiling / floating
89 | bindsym $mod+Shift+space floating toggle
90 |
91 | # change focus between tiling / floating windows
92 | bindsym $mod+space focus mode_toggle
93 |
94 | # focus the parent container
95 | bindsym $mod+a focus parent
96 |
97 | # focus the child container
98 | #bindsym $mod+d focus child
99 |
100 | # switch to workspace
101 | bindsym $mod+1 workspace 1
102 | bindsym $mod+2 workspace 2
103 | bindsym $mod+3 workspace 3
104 | bindsym $mod+4 workspace 4
105 | bindsym $mod+5 workspace 5
106 | bindsym $mod+6 workspace 6
107 | bindsym $mod+7 workspace 7
108 | bindsym $mod+8 workspace 8
109 | bindsym $mod+9 workspace 9
110 | bindsym $mod+0 workspace 10
111 |
112 | # move focused container to workspace
113 | bindsym $mod+Shift+1 move container to workspace 1
114 | bindsym $mod+Shift+2 move container to workspace 2
115 | bindsym $mod+Shift+3 move container to workspace 3
116 | bindsym $mod+Shift+4 move container to workspace 4
117 | bindsym $mod+Shift+5 move container to workspace 5
118 | bindsym $mod+Shift+6 move container to workspace 6
119 | bindsym $mod+Shift+7 move container to workspace 7
120 | bindsym $mod+Shift+8 move container to workspace 8
121 | bindsym $mod+Shift+9 move container to workspace 9
122 | bindsym $mod+Shift+0 move container to workspace 10
123 |
124 | # reload the configuration file
125 | bindsym $mod+Shift+c reload
126 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
127 | bindsym $mod+Shift+r restart
128 | # exit i3 (logs you out of your X session)
129 | 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'"
130 |
131 | # resize window (you can also use the mouse for that)
132 | mode "resize" {
133 | # These bindings trigger as soon as you enter the resize mode
134 |
135 | # Pressing left will shrink the window’s width.
136 | # Pressing right will grow the window’s width.
137 | # Pressing up will shrink the window’s height.
138 | # Pressing down will grow the window’s height.
139 | bindsym j resize shrink width 10 px or 10 ppt
140 | bindsym k resize grow height 10 px or 10 ppt
141 | bindsym l resize shrink height 10 px or 10 ppt
142 | bindsym semicolon resize grow width 10 px or 10 ppt
143 |
144 | # same bindings, but for the arrow keys
145 | bindsym Left resize shrink width 10 px or 10 ppt
146 | bindsym Down resize grow height 10 px or 10 ppt
147 | bindsym Up resize shrink height 10 px or 10 ppt
148 | bindsym Right resize grow width 10 px or 10 ppt
149 |
150 | # back to normal: Enter or Escape
151 | bindsym Return mode "default"
152 | bindsym Escape mode "default"
153 | }
154 |
155 | bindsym $mod+r mode "resize"
156 |
157 | # Start i3bar to display a workspace bar (plus the system information i3status
158 | # finds out, if available)
159 | bar {
160 | status_command i3status
161 | }
162 |
163 | bindsym Mod1+F1 exec "~/bin/hhkb-i3"
164 | bindsym $mod+Shift+h exec "~/.screenlayout/home-setup.sh"
165 | bindsym $mod+Shift+p exec "~/.screenlayout/portable-setup.sh"
166 | bindsym $mod+Shift+w exec "~/bin/map-wacom"
167 | bindsym $mod+b exec "boomer"
168 | bindsym --release $mod+Shift+l exec "slock"
169 |
170 | focus_follows_mouse no
171 |
172 | hide_edge_borders both
173 |
174 |
--------------------------------------------------------------------------------
/.emacs.rc/autocommit-rc.el:
--------------------------------------------------------------------------------
1 | ;;; TODO(c3bdae31-4329-4217-98a0-743b9dcbb6d2): extract autocommit into a separate package
2 | ;;;
3 | ;;; Once e266bfaa-2a01-4881-9e7f-ce2c592f7cdd is done, I think we can do that.
4 |
5 | (defvar rc/autocommit-local-locks
6 | (make-hash-table :test 'equal))
7 |
8 | (defun rc/file-truename-nilable (filename)
9 | (when filename
10 | (file-truename filename)))
11 |
12 | (defun rc/autocommit--id ()
13 | (let ((id (-> default-directory
14 | (locate-dominating-file ".git")
15 | (rc/file-truename-nilable))))
16 | (when (not id)
17 | (error "%s is not inside of a git repository" default-directory))
18 | (unless (gethash id rc/autocommit-local-locks)
19 | (puthash id nil rc/autocommit-local-locks))
20 | id))
21 |
22 | (defun rc/autocommit--get-lock (lock)
23 | (-> (rc/autocommit--id)
24 | (gethash rc/autocommit-local-locks)
25 | (plist-get lock)))
26 |
27 | (defun rc/autocommit--set-lock (lock value)
28 | (puthash (rc/autocommit--id)
29 | (-> (rc/autocommit--id)
30 | (gethash rc/autocommit-local-locks)
31 | (plist-put lock value))
32 | rc/autocommit-local-locks))
33 |
34 | (defun rc/autocommit--toggle-lock (lock)
35 | (-> lock
36 | (rc/autocommit--get-lock)
37 | (not)
38 | (rc/autocommit--set-lock)))
39 |
40 | (defun rc/autocommit--create-dir-locals (file-name)
41 | (write-region "((nil . ((eval . (rc/autocommit-dir-locals)))))"
42 | nil file-name))
43 |
44 | (defun rc/y-or-n-if (predicate question action)
45 | (when (or (not (funcall predicate))
46 | (y-or-n-p question))
47 | (funcall action)))
48 |
49 | ;;; TODO(4229cf9a-4768-4f5e-aca1-865256c64a23): rc/autocommit-init-dir should modify dir locals file on AST level
50 | ;;;
51 | ;;; Right know it just overrides .dir-locals file on text level. I
52 | ;;; want it to
53 | ;;; - read .dir-locals,
54 | ;;; - parse the assoc list,
55 | ;;; - check if there is already autocommit stuff
56 | ;;; - add autocommit stuff to the assoc list if needed
57 | ;;; - and write it back to the file
58 | ;;;
59 | ;;; That will enable us with modifying dir locals that contains custom
60 | ;;; stuff unrelated to autocommit
61 | (defun rc/autocommit-init-dir (&optional dir)
62 | "Initialize autocommit folder."
63 | (interactive "DAutocommit directory: ")
64 | (let* ((autocommit-dir (if dir dir default-directory))
65 | (file-name (concat autocommit-dir
66 | dir-locals-file)))
67 | (rc/y-or-n-if (-partial #'file-exists-p file-name)
68 | (format "%s already exists. Replace it?" file-name)
69 | (-partial #'rc/autocommit--create-dir-locals file-name))))
70 |
71 | (defun rc/autocommit-dir-locals ()
72 | "The function that has to be put into the .dir-locals.el file
73 | of the autocommit folder as evaluated for any mode."
74 | (interactive)
75 | (auto-revert-mode 1)
76 | (rc/autopull-changes)
77 | (add-hook 'after-save-hook
78 | 'rc/autocommit-changes
79 | nil 'make-it-local))
80 |
81 | ;;; TODO: rc/toggle-autocommit-offline doesn't work correctly
82 | ;;;
83 | ;;; It should toggle offline for all of the folders at once
84 | (defun rc/toggle-autocommit-offline ()
85 | "Toggle between OFFLINE and ONLINE modes.
86 |
87 | Autocommit can be in two modes: OFFLINE and ONLINE. When ONLINE
88 | rc/autocommit-changes does `git commit && git push'. When OFFLINE
89 | rc/autocommit does only `git commit'."
90 | (interactive)
91 | (rc/autocommit--toggle-lock 'autocommit-offline)
92 | (if (rc/autocommit--get-lock 'autocommit-offline)
93 | (message "[OFFLINE] Autocommit Mode")
94 | (message "[ONLINE] Autocommit Mode")))
95 |
96 | (defun rc/autopull-changes ()
97 | "Pull the recent changes.
98 |
99 | Should be invoked once before working with the content under
100 | autocommit. Usually put into the dir locals file."
101 | (interactive)
102 | (when (not (rc/autocommit--get-lock 'autopull-lock))
103 | (rc/autocommit--set-lock 'autopull-lock t)
104 | (if (rc/autocommit--get-lock 'autocommit-offline)
105 | (message "[OFFLINE] NOT Syncing the Agenda")
106 | (if (y-or-n-p (format "Sync the Agenda? [%s]" (rc/autocommit--id)))
107 | (progn
108 | (message (format "Syncing the Agenda [%s]" (rc/autocommit--id)))
109 | (shell-command "git pull"))
110 | (progn
111 | (rc/autocommit--set-lock 'autocommit-offline t)
112 | (message (format "[OFFLINE] NOT Syncing the Agenda [%s]"
113 | (rc/autocommit--id))))))))
114 |
115 | (defun rc/autocommit-changes ()
116 | "Commit all of the changes under the autocommit folder.
117 |
118 | Should be invoked each time a change is made. Usually put into
119 | dir locals file."
120 | (interactive)
121 | (if (rc/autocommit--get-lock 'autocommit-lock)
122 | (rc/autocommit--set-lock 'autocommit-changed t)
123 | (rc/autocommit--set-lock 'autocommit-lock t)
124 | (rc/autocommit--set-lock 'autocommit-changed nil)
125 | (set-process-sentinel (rc/run-commit-process (rc/autocommit--id))
126 | (-partial 'rc/autocommit-beat (rc/autocommit--id)))))
127 |
128 | (defun rc/run-commit-process (autocommit-directory)
129 | (let ((default-directory autocommit-directory))
130 | (let ((autocommit-message (format-time-string "Autocommit %s")))
131 | (start-process-shell-command
132 | (format "Autocommit-%s" autocommit-directory)
133 | (format "*Autocommit-%s*" autocommit-directory)
134 | (format (if (rc/autocommit--get-lock 'autocommit-offline)
135 | "git add -A && git commit -m \"%s\""
136 | "git add -A && git commit -m \"%s\" && git push origin master")
137 | autocommit-message)))))
138 |
139 | (defun rc/autocommit-beat (autocommit-directory process event)
140 | (let ((default-directory autocommit-directory))
141 | (message (if (rc/autocommit--get-lock 'autocommit-offline)
142 | "[OFFLINE] Autocommit: %s"
143 | "Autocommit: %s")
144 | event)
145 | (if (not (rc/autocommit--get-lock 'autocommit-changed))
146 | (rc/autocommit--set-lock 'autocommit-lock nil)
147 | (rc/autocommit--set-lock 'autocommit-changed nil)
148 | (set-process-sentinel (rc/run-commit-process autocommit-directory)
149 | (-partial 'rc/autocommit-beat autocommit-directory)))))
150 |
--------------------------------------------------------------------------------
/.emacs.local/umka-mode.el:
--------------------------------------------------------------------------------
1 | ;;; umka-mode.el --- Major Mode for editing Umka source code -*- lexical-binding: t -*-
2 |
3 | ;; Copyright (C) 2025 Alexey Kutepov
4 |
5 | ;; Author: Alexey Kutepov
6 | ;; URL: https://github.com/rexim/umka
7 |
8 | ;; Permission is hereby granted, free of charge, to any person
9 | ;; obtaining a copy of this software and associated documentation
10 | ;; files (the "Software"), to deal in the Software without
11 | ;; restriction, including without limitation the rights to use, copy,
12 | ;; modify, merge, publish, distribute, sublicense, and/or sell copies
13 | ;; of the Software, and to permit persons to whom the Software is
14 | ;; furnished to do so, subject to the following conditions:
15 |
16 | ;; The above copyright notice and this permission notice shall be
17 | ;; included in all copies or substantial portions of the Software.
18 |
19 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | ;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 | ;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 | ;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | ;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | ;; SOFTWARE.
27 |
28 | ;;; Commentary:
29 | ;;
30 | ;; Major Mode for editing Umka source code.
31 |
32 | (require 'subr-x)
33 |
34 | (defvar umka-mode-syntax-table
35 | (let ((table (make-syntax-table)))
36 | ;; C/C++ style comments
37 | (modify-syntax-entry ?/ ". 124b" table)
38 | (modify-syntax-entry ?* ". 23" table)
39 | (modify-syntax-entry ?\n "> b" table)
40 | ;; Preprocessor stuff?
41 | (modify-syntax-entry ?# "." table)
42 | ;; Chars are the same as strings
43 | (modify-syntax-entry ?' "\"" table)
44 | ;; Treat <> as punctuation (needed to highlight C++ keywords
45 | ;; properly in template syntax)
46 | (modify-syntax-entry ?< "." table)
47 | (modify-syntax-entry ?> "." table)
48 |
49 | (modify-syntax-entry ?& "." table)
50 | (modify-syntax-entry ?% "." table)
51 | table))
52 |
53 | (defun umka-types ()
54 | '("str" "void" "int8" "int16" "int32" "int" "uint8" "uint16" "uint32" "uint" "bool" "char"
55 | "real32" "real" "fiber" "any" "__file"))
56 |
57 | (defun umka-keywords ()
58 | '("break" "case" "const" "continue" "default" "else" "enum" "for" "fn" "import" "interface"
59 | "if" "in" "map" "return" "struct" "switch" "type" "var" "weak"))
60 |
61 | (defun umka-builtin ()
62 | '("abs" "append" "atan" "atan2" "cap" "ceil" "copy" "cos" "delete" "exit" "exp" "fabs" "floor"
63 | "fprintf" "fscanf" "insert" "keys" "len" "log" "make" "memusage" "new" "printf" "resume"
64 | "round" "scanf" "selfhasptr" "selfptr" "selftypeeq" "sin" "sizeof" "sizeofself" "slice"
65 | "sort" "sprintf" "sqrt" "sscanf" "trunc" "typeptr" "valid" "validkey"))
66 |
67 | (defun umka-font-lock-keywords ()
68 | (list
69 | `(,(regexp-opt (umka-keywords) 'symbols) . font-lock-keyword-face)
70 | `(,(regexp-opt (umka-types) 'symbols) . font-lock-type-face)
71 | `(,(regexp-opt (umka-builtin) 'symbols) . font-lock-builtin-face)))
72 |
73 | ;;; TODO: backport this to simpc-mode
74 | (defun umka--previous-non-empty-line ()
75 | "Returns either NIL when there is no such line or a pair (line . indentation)"
76 | (save-excursion
77 | ;; If you are on the first line, but not at the beginning of buffer (BOB) the `(bobp)`
78 | ;; function does not return `t`. So we have to move to the beginning of the line first.
79 | ;; TODO: feel free to suggest a better approach for checking BOB here.
80 | (move-beginning-of-line nil)
81 | (if (bobp)
82 | ;; If you are standing at the BOB, you by definition don't have a previous non-empty line.
83 | nil
84 | ;; Moving one line backwards because the current line is by definition is not
85 | ;; the previous non-empty line.
86 | (forward-line -1)
87 | ;; Keep moving backwards until we hit BOB or a non-empty line.
88 | (while (and (not (bobp))
89 | (string-empty-p
90 | (string-trim-right
91 | (thing-at-point 'line t))))
92 | (forward-line -1))
93 |
94 | (if (string-empty-p
95 | (string-trim-right
96 | (thing-at-point 'line t)))
97 | ;; If after moving backwards for this long we still look at an empty
98 | ;; line we by definition didn't find the previous empty line.
99 | nil
100 | ;; We found the previous non-empty line!
101 | (cons (thing-at-point 'line t)
102 | (current-indentation))))))
103 |
104 | (defun umka--desired-indentation ()
105 | (let ((prev (umka--previous-non-empty-line)))
106 | (if (not prev)
107 | (current-indentation)
108 | (let ((indent-len 4)
109 | (cur-line (string-trim-right (thing-at-point 'line t)))
110 | (prev-line (string-trim-right (car prev)))
111 | (prev-indent (cdr prev)))
112 | (cond
113 | ((string-match-p "^\\s-*switch\\s-*(.+)" prev-line)
114 | prev-indent)
115 | ((and (string-suffix-p "{" prev-line)
116 | (string-prefix-p "}" (string-trim-left cur-line)))
117 | prev-indent)
118 | ((string-suffix-p "{" prev-line)
119 | (+ prev-indent indent-len))
120 | ((string-prefix-p "}" (string-trim-left cur-line))
121 | (max (- prev-indent indent-len) 0))
122 | ((string-suffix-p ":" prev-line)
123 | (if (string-suffix-p ":" cur-line)
124 | prev-indent
125 | (+ prev-indent indent-len)))
126 | ((string-suffix-p ":" cur-line)
127 | (max (- prev-indent indent-len) 0))
128 | (t prev-indent))))))
129 |
130 | ;;; TODO: customizable indentation (amount of spaces, tabs, etc)
131 | (defun umka-indent-line ()
132 | (interactive)
133 | (when (not (bobp))
134 | (let* ((desired-indentation (umka--desired-indentation))
135 | (n (max (- (current-column) (current-indentation)) 0)))
136 | (indent-line-to desired-indentation)
137 | (forward-char n))))
138 |
139 | ;;;###autoload
140 | (define-derived-mode umka-mode prog-mode "Umka"
141 | "Simple major mode for editing Umka files."
142 | :syntax-table umka-mode-syntax-table
143 | (setq-local font-lock-defaults '(umka-font-lock-keywords))
144 | (setq-local indent-line-function 'umka-indent-line)
145 | (setq-local comment-start "// "))
146 |
147 | ;;;###autoload
148 | (add-to-list 'auto-mode-alist '("\\.um\\'" . umka-mode))
149 |
150 | (provide 'umka-mode)
151 |
152 | ;;; umka-mode.el ends here
153 |
--------------------------------------------------------------------------------
/.emacs.local/jai-mode.el:
--------------------------------------------------------------------------------
1 | ;; jai-mode.el - very basic jai mode
2 |
3 | (require 'cl)
4 | (require 'rx)
5 | (require 'js)
6 | (require 'compile)
7 |
8 | (defconst jai-mode-syntax-table
9 | (let ((table (make-syntax-table)))
10 | (modify-syntax-entry ?\" "\"" table)
11 | (modify-syntax-entry ?\\ "\\" table)
12 |
13 | ;; additional symbols
14 | (modify-syntax-entry ?_ "w" table)
15 |
16 | (modify-syntax-entry ?' "." table)
17 | (modify-syntax-entry ?: "." table)
18 | (modify-syntax-entry ?+ "." table)
19 | (modify-syntax-entry ?- "." table)
20 | (modify-syntax-entry ?% "." table)
21 | (modify-syntax-entry ?& "." table)
22 | (modify-syntax-entry ?| "." table)
23 | (modify-syntax-entry ?^ "." table)
24 | (modify-syntax-entry ?! "." table)
25 | (modify-syntax-entry ?$ "/" table)
26 | (modify-syntax-entry ?= "." table)
27 | (modify-syntax-entry ?< "." table)
28 | (modify-syntax-entry ?> "." table)
29 | (modify-syntax-entry ?? "." table)
30 |
31 | ;; Modify some syntax entries to allow nested block comments
32 | (modify-syntax-entry ?/ ". 124b" table)
33 | (modify-syntax-entry ?* ". 23n" table)
34 | (modify-syntax-entry ?\n "> b" table)
35 | (modify-syntax-entry ?\^m "> b" table)
36 |
37 | table))
38 |
39 | (defconst jai-builtins
40 | '("cast" "it" "type_info" "size_of"))
41 |
42 | (defconst jai-keywords
43 | '("if" "ifx" "else" "then" "while" "for" "switch" "case" "struct" "enum"
44 | "return" "new" "remove" "continue" "break" "defer" "inline" "no_inline"
45 | "using" "SOA"))
46 |
47 | (defconst jai-constants
48 | '("null" "true" "false"))
49 |
50 | (defconst jai-typenames
51 | '("int" "u64" "u32" "u16" "u8"
52 | "s64" "s32" "s16" "s8" "float"
53 | "float32" "float64" "string"
54 | "bool"))
55 |
56 | (defun jai-wrap-word-rx (s)
57 | (concat "\\<" s "\\>"))
58 |
59 | (defun jai-keywords-rx (keywords)
60 | "build keyword regexp"
61 | (jai-wrap-word-rx (regexp-opt keywords t)))
62 |
63 | (defconst jai-hat-type-rx (rx (group (and "^" (1+ word)))))
64 | (defconst jai-dollar-type-rx (rx (group "$" (or (1+ word) (opt "$")))))
65 | (defconst jai-number-rx
66 | (rx (and
67 | symbol-start
68 | (or (and (+ digit) (opt (and (any "eE") (opt (any "-+")) (+ digit))))
69 | (and "0" (any "xX") (+ hex-digit)))
70 | (opt (and (any "_" "A-Z" "a-z") (* (any "_" "A-Z" "a-z" "0-9"))))
71 | symbol-end)))
72 |
73 | (defconst jai-font-lock-defaults
74 | `(
75 | ;; Keywords
76 | (,(jai-keywords-rx jai-keywords) 1 font-lock-keyword-face)
77 |
78 | ;; single quote characters
79 | ("\\('[[:word:]]\\)\\>" 1 font-lock-constant-face)
80 |
81 | ;; Variables
82 | (,(jai-keywords-rx jai-builtins) 1 font-lock-variable-name-face)
83 |
84 | ;; Constants
85 | (,(jai-keywords-rx jai-constants) 1 font-lock-constant-face)
86 |
87 | ;; Hash directives
88 | ("#\\w+" . font-lock-preprocessor-face)
89 |
90 | ;; At directives
91 | ("@\\w+" . font-lock-preprocessor-face)
92 |
93 | ;; Strings
94 | ("\\\".*\\\"" . font-lock-string-face)
95 |
96 | ;; Numbers
97 | (,(jai-wrap-word-rx jai-number-rx) . font-lock-constant-face)
98 |
99 | ;; Types
100 | (,(jai-keywords-rx jai-typenames) 1 font-lock-type-face)
101 | (,jai-hat-type-rx 1 font-lock-type-face)
102 | (,jai-dollar-type-rx 1 font-lock-type-face)
103 |
104 | ("---" . font-lock-constant-face)
105 | ))
106 |
107 | ;; add setq-local for older emacs versions
108 | (unless (fboundp 'setq-local)
109 | (defmacro setq-local (var val)
110 | `(set (make-local-variable ',var) ,val)))
111 |
112 | (defconst jai--defun-rx "\(.*\).*\{")
113 |
114 | (defmacro jai-paren-level ()
115 | `(car (syntax-ppss)))
116 |
117 | (defun jai-line-is-defun ()
118 | "return t if current line begins a procedure"
119 | (interactive)
120 | (save-excursion
121 | (beginning-of-line)
122 | (let (found)
123 | (while (and (not (eolp)) (not found))
124 | (if (looking-at jai--defun-rx)
125 | (setq found t)
126 | (forward-char 1)))
127 | found)))
128 |
129 | (defun jai-beginning-of-defun (&optional count)
130 | "Go to line on which current function starts."
131 | (interactive)
132 | (let ((orig-level (jai-paren-level)))
133 | (while (and
134 | (not (jai-line-is-defun))
135 | (not (bobp))
136 | (> orig-level 0))
137 | (setq orig-level (jai-paren-level))
138 | (while (>= (jai-paren-level) orig-level)
139 | (skip-chars-backward "^{")
140 | (backward-char))))
141 | (if (jai-line-is-defun)
142 | (beginning-of-line)))
143 |
144 | (defun jai-end-of-defun ()
145 | "Go to line on which current function ends."
146 | (interactive)
147 | (let ((orig-level (jai-paren-level)))
148 | (when (> orig-level 0)
149 | (jai-beginning-of-defun)
150 | (end-of-line)
151 | (setq orig-level (jai-paren-level))
152 | (skip-chars-forward "^}")
153 | (while (>= (jai-paren-level) orig-level)
154 | (skip-chars-forward "^}")
155 | (forward-char)))))
156 |
157 | (defalias 'jai-parent-mode
158 | (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
159 |
160 | ;; imenu hookup
161 | (add-hook 'jai-mode-hook
162 | (lambda ()
163 | (setq imenu-generic-expression
164 | '(
165 | ("type" "^\\(.*:*.*\\) : " 1)
166 | ("function" "^\\(.*\\) :: " 1)
167 | ("struct" "^\\(.*\\) *:: *\\(struct\\)\\(.*\\){" 1)
168 | )
169 | )
170 | )
171 | )
172 |
173 | ;; NOTE: taken from the scala-indent package and modified for Jai.
174 | ;; Still uses the js-indent-line as a base, which will have to be
175 | ;; replaced when the language is more mature.
176 | (defun jai--indent-on-parentheses ()
177 | (when (and (= (char-syntax (char-before)) ?\))
178 | (= (save-excursion (back-to-indentation) (point)) (1- (point))))
179 | (js-indent-line)))
180 |
181 | (defun jai--add-self-insert-hooks ()
182 | (add-hook 'post-self-insert-hook
183 | 'jai--indent-on-parentheses)
184 | )
185 |
186 | ;;;###autoload
187 | (define-derived-mode jai-mode jai-parent-mode "Jai"
188 | :syntax-table jai-mode-syntax-table
189 | :group 'jai
190 | (setq bidi-paragraph-direction 'left-to-right)
191 | (setq-local require-final-newline mode-require-final-newline)
192 | (setq-local parse-sexp-ignore-comments t)
193 | (setq-local comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
194 | (setq-local comment-start "//")
195 | (setq-local block-comment-start "/*")
196 | (setq-local block-comment-end "*/")
197 | (setq-local indent-line-function 'js-indent-line)
198 | (setq-local font-lock-defaults '(jai-font-lock-defaults))
199 | (setq-local beginning-of-defun-function 'jai-beginning-of-defun)
200 | (setq-local end-of-defun-function 'jai-end-of-defun)
201 |
202 | ;; add indent functionality to some characters
203 | (jai--add-self-insert-hooks)
204 |
205 | (font-lock-fontify-buffer))
206 |
207 | ;;;###autoload
208 | (add-to-list 'auto-mode-alist '("\\.jai\\'" . jai-mode))
209 |
210 | (defconst jai--error-regexp
211 | "^\\([^ \n:]+.*\.jai\\):\\([0-9]+\\),\\([0-9]+\\):")
212 | (push `(jai ,jai--error-regexp 1 2 3 2) compilation-error-regexp-alist-alist)
213 | (push 'jai compilation-error-regexp-alist)
214 |
215 | (provide 'jai-mode)
216 |
--------------------------------------------------------------------------------
/.SciTEUser.properties:
--------------------------------------------------------------------------------
1 | # https://stackoverflow.com/questions/16415617/how-to-use-scintilla-for-unicode-strings
2 | code.page=65001
3 |
4 | wrap=1
5 | output.wrap=1
6 |
7 | ccc=./build.sh
8 | lexer.cpp.track.preprocessor=0
9 |
10 | if PLAT_GTK
11 | font.base=font:Iosevka,size:24
12 | font.small=font:Iosevka,size:22
13 | font.comment=font:Iosevka,size:24
14 | font.code.comment.box=$(font.comment)
15 | font.code.comment.line=$(font.comment)
16 | font.code.comment.doc=$(font.comment)
17 | font.code.comment.nested=$(font.comment)
18 | font.text=$(font.base)
19 | font.text.comment=$(font.comment)
20 | font.embedded.base=$(font.base)
21 | font.embedded.comment=$(font.comment)
22 | font.monospaces=$(font.base)
23 | font.vbs=$(font.base)
24 |
25 | line.margin.visible=1
26 | autocompleteword.automatic=1
27 |
28 | # Indentation
29 | tabsize=4
30 | indent.size=4
31 | use.tabs=0
32 | indent.auto=1
33 | indent.automatic=1
34 | indent.opening=0
35 | indent.closing=0
36 | #tab.indents=0
37 | #backspace.unindents=0
38 |
39 | #~ # Misc colours
40 | fold.margin.colour=#303030
41 | fold.margin.highlight.colour=#303030
42 | #~ whitespace.fore=#508050
43 | selection.back=#00000066
44 | selection.additional.back=#00000066
45 | selection.secondary.back=#00000066
46 | selection.inactive.back=#00000066
47 | caret.fore=#e4e4ef
48 | #~ # Additional caret and selection settings
49 | selection.alpha=50
50 | #~ caret.line.back=#E8E8FF
51 | #~ caret.line.back.alpha=90
52 |
53 | #~ # Give symbolic names to the set of colours used in the standard styles.
54 | colour.code.comment.box=fore:#A38D66
55 | colour.code.comment.line=fore:#A38D66
56 | colour.code.comment.doc=fore:#A38D66
57 | colour.text.comment=fore:#A38D66
58 | colour.other.comment=fore:#A38D66
59 | #~ colour.embedded.comment=back:#E0EEFF
60 | #~ colour.embedded.js=back:#F0F0FF
61 | #~ colour.notused=back:#FF0000
62 | colour.number=fore:#9e95c7
63 | colour.keyword=fore:#E5A4CB
64 | colour.keyword2=fore:#9e95c7
65 | colour.keyword3=fore:#7788DD
66 | colour.string=fore:#8AC926
67 | colour.char=fore:#8AC926
68 | colour.operator=fore:#F0E0B0
69 | #~ colour.preproc=fore:#708B75
70 | colour.preproc=fore:#829B87
71 | #~ colour.preproc=fore:#CCFFCC
72 | #~ colour.error=fore:#FFFF00,back:#A05050
73 |
74 | #~ # Global default styles for all languages
75 | #~ # Default
76 | style.*.32=$(font.base),back:#2A2343,fore:#FFFFF2
77 | #~ # Line number
78 | style.*.33=$(font.base),back:#2A2343,fore:#FFFFF2
79 | #~ # Brace highlight
80 | style.*.34=fore:#FFFFEE,bold
81 | #~ # Brace incomplete highlight
82 | #~ style.*.35=fore:#FF0000,bold
83 | #~ # Control characters
84 | #~ style.*.36=
85 | # Indentation guides
86 | style.*.37=fore:#507050
87 |
88 | # Lua Styles
89 | style.lua.32=$(font.base),back:#2A2343,fore:#FFFFF2
90 |
91 | style.lua.13=$(style.lua.5)
92 | style.lua.14=$(style.lua.5)
93 | style.lua.15=$(style.lua.5)
94 | style.lua.16=$(style.lua.5)
95 | style.lua.17=$(style.lua.5)
96 | style.lua.18=$(style.lua.5)
97 | style.lua.19=$(style.lua.5)
98 |
99 | #~ # Comment italique
100 | # style.*.1=$(colour.code.comment.box),$(font.code.comment.box),italics
101 | # style.*.2=$(colour.code.comment.line),$(font.code.comment.line),italics
102 | # style.*.3=$(colour.code.comment.doc),$(font.code.comment.doc),italics
103 |
104 | #~ # White space
105 | #~ style.*.0=fore:#808080
106 | #~ # Number
107 | #~ style.*.4=$(colour.number)
108 |
109 | #~ # Keyword
110 | #~ style.cpp.5=$(colour.keyword),bold
111 |
112 | #~ # Double quoted string
113 | #~ style.*.6=$(colour.string)
114 | #~ # Single quoted string
115 | #~ style.*.7=$(colour.char)
116 | #~ # UUIDs (only in IDL)
117 | #~ style.*.8=fore:#7F7F00
118 | #~ # Preprocessor
119 | #~ style.*.9=$(colour.preproc)
120 | #~ # Operators
121 | #~ style.*.10=$(colour.operator)
122 |
123 | #~ # Identifiers
124 | #~ style.*.11=
125 | #~ # End of line where string is not closed
126 | #~ style.*.12=$(colour.string),back:#5A5050,eolfilled
127 | #~ # Verbatim strings for C#
128 | #~ style.*.13=$(colour.string),back:#5A5050,eolfilled
129 | #~ # Regular expressions for JavaScript
130 | #~ style.*.14=$(colour.string),back:#5A5050,eolfilled
131 | #~ # Doc Comment Line
132 | #~ style.*.15=$(colour.code.comment.doc),$(font.code.comment.doc)
133 | #~ # Keywords2
134 | #~ style.*.16=$(colour.keyword2)
135 | #~ # Comment keyword
136 | #~ style.*.17=fore:#3060A0,$(font.code.comment.doc)
137 | #~ # Comment keyword error
138 | #~ style.*.18=fore:#804020,$(font.code.comment.doc)
139 | #~ # Braces are only matched in operator style
140 | #~ braces.*.style=10
141 |
142 | #~ # Makefile styles
143 | #~ # Default
144 | #~ style.makefile.0=$(font.base)
145 | #~ # Comment: #
146 | #~ style.makefile.1=$(colour.code.comment.box),$(font.comment),italics
147 | #~ comment.block.makefile=#~
148 | #~ # Pre-processor or other comment: !
149 | #~ style.makefile.2=$(colour.preproc)
150 | #~ # Variable: $(x)
151 | #~ style.makefile.3=fore:#9F9F20
152 | #~ # Operator
153 | #~ style.makefile.4=$(colour.operator)
154 | #~ # Target
155 | #~ style.makefile.5=$(colour.preproc)
156 | #~ # Error
157 | #~ style.makefile.9=$(colour.error),eolfilled
158 | #~ # Matched Operators
159 | #~ style.makefile.34=fore:#FF6030,bold
160 | #~ style.makefile.35=fore:#FF0000,bold
161 |
162 | #~ # Batch styles
163 | #~ # Default
164 | #~ style.batch.0=$(font.base)
165 | #~ # Comment (rem or ::)
166 | #~ style.batch.1=$(colour.code.comment.box),$(font.comment),italics
167 | #~ # Keywords
168 | #~ style.batch.2=$(colour.keyword),bold
169 | #~ # Label (line beginning with ':')
170 | #~ style.batch.3=$(colour.preproc),back:#494949,eolfilled
171 | #~ # Hide command character ('@')
172 | #~ style.batch.4=$(colour.preproc)
173 | #~ # External commands
174 | #~ style.batch.5=fore:#007090,$(font.monospace),bold
175 | #~ # Variable: %%x (x is almost whatever, except space and %), %n (n in [0-9]), %EnvironmentVar%
176 | #~ style.batch.6=$(font.base)
177 | #~ # Operator: * ? < > |
178 | #~ style.batch.7=$(colour.operator)
179 |
180 | #~ # Bash styles
181 | #~ # Default
182 | #~ style.bash.32=$(font.base)
183 | #~ # White space
184 | #~ style.bash.0=fore:#808080,$(font.base)
185 | #~ # Error
186 | #~ style.bash.1=$(colour.error)
187 | #~ # Comment
188 | #~ style.bash.2=$(colour.code.comment.box),$(font.comment),italics
189 | #~ # Number
190 | #~ style.bash.3=$(colour.number)
191 | #~ # Keyword
192 | #~ style.bash.4=$(colour.keyword),bold
193 | #~ # Double quoted string
194 | #~ style.bash.5=$(colour.string),$(font.monospace)
195 | #~ # Single quoted string
196 | #~ style.bash.6=$(colour.char),$(font.monospace)
197 | #~ # Operators
198 | #~ style.bash.7=$(colour.operator),bold
199 | #~ # Identifiers (functions, etc.)
200 | #~ style.bash.8=$(font.base)
201 | #~ # Scalars: $var
202 | #~ style.bash.9=fore:#000000,back:#FFE0E0
203 | #~ # Parameter expansion: ${var}
204 | #~ style.bash.10=fore:#000000,back:#FFFFE0
205 | #~ # Back Ticks
206 | #~ style.bash.11=fore:#FFFF00,back:#A08080
207 | #~ # Here-doc (delimiter)
208 | #~ style.bash.12=fore:#000000,back:#DDD0DD
209 | #~ # Here-doc (single quoted, q)
210 | #~ style.bash.13=fore:#7F007F,back:#DDD0DD,eolfilled,notbold
211 | #~ # Braces are only matched in operator style
212 | #~ braces.bash.style=7
213 |
214 | #~ # PHP
215 | #~ # Default
216 | #~ style.hypertext.118=$(font.base)
217 | #~ # Matching braces
218 | #~ style.hypertext.34=$(font.base)
219 | #~ # Not maching braces
220 | #~ style.hypertext.35=$(coulour.error)
221 | #~ # Double quoted String
222 | #~ style.hypertext.119=$(colour.string)
223 | #~ # Single quoted string
224 | #~ style.hypertext.120=$(colour.char)
225 | #~ # Keyword
226 | #~ style.hypertext.121=$(colour.keyword)
227 | #~ # Number
228 | #~ style.hypertext.122=$(colour.number)
229 | #~ # Variable
230 | #~ style.hypertext.123=$(colour.keyword2)
231 | #~ # Comment
232 | #~ style.hypertext.124=$(colour.code.comment.box)
233 | #~ # One line comment
234 | #~ style.hypertext.125=$(colour.code.comment.box)
235 | #~ # PHP variable in double quoted string
236 | #~ style.hypertext.126=$(colour.other)
237 | #~ # PHP operator
238 | #~ style.hypertext.127=$(font.base)
239 |
240 | #~ # Text
241 | #~ style.hypertext.0=$(font.base)
242 | #~ # Tags
243 | #~ style.hypertext.1=$(colour.keyword3)
244 | #~ # Unknown Tags
245 | #~ style.hypertext.2=fore:#FF0000
246 | #~ # Attributes
247 | #~ style.hypertext.3=fore:#008080
248 | #~ # Unknown Attributes
249 | #~ style.hypertext.4=fore:#FF0000
250 |
251 | #~ # output window
252 | #~ style.errorlist.32=$(font.small),back:#000000
253 | style.errorlist.0=fore:#FFFFFF
254 | style.errorlist.2=fore:#0FFFFF
255 | style.errorlist.4=fore:#9999AA
256 |
257 | #~ user.shortcuts=\
258 | #~ Ctrl+N|2300|\
259 | #~ Ctrl+P|2302|\
260 | #~ Ctrl+B|2304|\
261 | #~ Ctrl+F|2306|\
262 | #~ Ctrl+Shift+F|2310|\
263 | #~ Ctrl+Shift+B|2309|
--------------------------------------------------------------------------------
/.emacs:
--------------------------------------------------------------------------------
1 | (setq custom-file "~/.emacs.custom.el")
2 | (package-initialize)
3 |
4 | (add-to-list 'load-path "~/.emacs.local/")
5 |
6 | (load "~/.emacs.rc/rc.el")
7 |
8 | (load "~/.emacs.rc/misc-rc.el")
9 | (load "~/.emacs.rc/org-mode-rc.el")
10 | (load "~/.emacs.rc/autocommit-rc.el")
11 |
12 | ;;; Appearance
13 | (defun rc/get-default-font ()
14 | (cond
15 | ((eq system-type 'windows-nt) "Consolas-13")
16 | ((eq system-type 'gnu/linux) "Iosevka-20")))
17 |
18 | (add-to-list 'default-frame-alist `(font . ,(rc/get-default-font)))
19 |
20 | (tool-bar-mode 0)
21 | (menu-bar-mode 0)
22 | (scroll-bar-mode 0)
23 | (column-number-mode 1)
24 | (show-paren-mode 1)
25 |
26 | (rc/require-theme 'gruber-darker)
27 | ;; (rc/require-theme 'zenburn)
28 | ;; (load-theme 'adwaita t)
29 |
30 | (eval-after-load 'zenburn
31 | (set-face-attribute 'line-number nil :inherit 'default))
32 |
33 | ;;; ido
34 | (rc/require 'smex 'ido-completing-read+)
35 |
36 | (require 'ido-completing-read+)
37 |
38 | (ido-mode 1)
39 | (ido-everywhere 1)
40 | (ido-ubiquitous-mode 1)
41 |
42 | (global-set-key (kbd "M-x") 'smex)
43 | (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
44 |
45 | ;;; c-mode
46 | (setq-default c-basic-offset 4
47 | c-default-style '((java-mode . "java")
48 | (awk-mode . "awk")
49 | (other . "bsd")))
50 |
51 | (add-hook 'c-mode-hook (lambda ()
52 | (interactive)
53 | (c-toggle-comment-style -1)))
54 |
55 | ;;; Paredit
56 | (rc/require 'paredit)
57 |
58 | (defun rc/turn-on-paredit ()
59 | (interactive)
60 | (paredit-mode 1))
61 |
62 | (add-hook 'emacs-lisp-mode-hook 'rc/turn-on-paredit)
63 | (add-hook 'clojure-mode-hook 'rc/turn-on-paredit)
64 | (add-hook 'lisp-mode-hook 'rc/turn-on-paredit)
65 | (add-hook 'common-lisp-mode-hook 'rc/turn-on-paredit)
66 | (add-hook 'scheme-mode-hook 'rc/turn-on-paredit)
67 | (add-hook 'racket-mode-hook 'rc/turn-on-paredit)
68 |
69 | ;;; Emacs lisp
70 | (add-hook 'emacs-lisp-mode-hook
71 | '(lambda ()
72 | (local-set-key (kbd "C-c C-j")
73 | (quote eval-print-last-sexp))))
74 | (add-to-list 'auto-mode-alist '("Cask" . emacs-lisp-mode))
75 |
76 | ;;; uxntal-mode
77 |
78 | (rc/require 'uxntal-mode)
79 |
80 | ;;; Haskell mode
81 | (rc/require 'haskell-mode)
82 |
83 | (setq haskell-process-type 'cabal-new-repl)
84 | (setq haskell-process-log t)
85 |
86 | (add-hook 'haskell-mode-hook 'haskell-indent-mode)
87 | (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
88 | (add-hook 'haskell-mode-hook 'haskell-doc-mode)
89 |
90 | (require 'basm-mode)
91 |
92 | (require 'fasm-mode)
93 | (add-to-list 'auto-mode-alist '("\\.asm\\'" . fasm-mode))
94 |
95 | (require 'porth-mode)
96 |
97 | (require 'noq-mode)
98 |
99 | (require 'jai-mode)
100 |
101 | (require 'simpc-mode)
102 | (add-to-list 'auto-mode-alist '("\\.[hc]\\(pp\\)?\\'" . simpc-mode))
103 | (add-to-list 'auto-mode-alist '("\\.[b]\\'" . simpc-mode))
104 |
105 | (require 'umka-mode)
106 |
107 | (require 'c3-mode)
108 |
109 | ;;; Whitespace mode
110 | (defun rc/set-up-whitespace-handling ()
111 | (interactive)
112 | (whitespace-mode 1)
113 | (add-to-list 'write-file-functions 'delete-trailing-whitespace))
114 |
115 | (add-hook 'tuareg-mode-hook 'rc/set-up-whitespace-handling)
116 | (add-hook 'c++-mode-hook 'rc/set-up-whitespace-handling)
117 | (add-hook 'c-mode-hook 'rc/set-up-whitespace-handling)
118 | (add-hook 'simpc-mode-hook 'rc/set-up-whitespace-handling)
119 | (add-hook 'emacs-lisp-mode 'rc/set-up-whitespace-handling)
120 | (add-hook 'java-mode-hook 'rc/set-up-whitespace-handling)
121 | (add-hook 'lua-mode-hook 'rc/set-up-whitespace-handling)
122 | (add-hook 'rust-mode-hook 'rc/set-up-whitespace-handling)
123 | (add-hook 'scala-mode-hook 'rc/set-up-whitespace-handling)
124 | (add-hook 'markdown-mode-hook 'rc/set-up-whitespace-handling)
125 | (add-hook 'haskell-mode-hook 'rc/set-up-whitespace-handling)
126 | (add-hook 'python-mode-hook 'rc/set-up-whitespace-handling)
127 | (add-hook 'erlang-mode-hook 'rc/set-up-whitespace-handling)
128 | (add-hook 'asm-mode-hook 'rc/set-up-whitespace-handling)
129 | (add-hook 'fasm-mode-hook 'rc/set-up-whitespace-handling)
130 | (add-hook 'go-mode-hook 'rc/set-up-whitespace-handling)
131 | (add-hook 'nim-mode-hook 'rc/set-up-whitespace-handling)
132 | (add-hook 'yaml-mode-hook 'rc/set-up-whitespace-handling)
133 | (add-hook 'porth-mode-hook 'rc/set-up-whitespace-handling)
134 |
135 | ;;; display-line-numbers-mode
136 | (when (version<= "26.0.50" emacs-version)
137 | (global-display-line-numbers-mode))
138 |
139 | ;;; magit
140 | ;; magit requres this lib, but it is not installed automatically on
141 | ;; Windows.
142 | (rc/require 'cl-lib)
143 | (rc/require 'magit)
144 |
145 | (setq magit-auto-revert-mode nil)
146 |
147 | (global-set-key (kbd "C-c m s") 'magit-status)
148 | (global-set-key (kbd "C-c m l") 'magit-log)
149 |
150 | ;;; multiple cursors
151 | (rc/require 'multiple-cursors)
152 |
153 | (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
154 | (global-set-key (kbd "C->") 'mc/mark-next-like-this)
155 | (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
156 | (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
157 | (global-set-key (kbd "C-\"") 'mc/skip-to-next-like-this)
158 | (global-set-key (kbd "C-:") 'mc/skip-to-previous-like-this)
159 |
160 | ;;; dired
161 | (require 'dired-x)
162 | (setq dired-omit-files
163 | (concat dired-omit-files "\\|^\\..+$"))
164 | (setq-default dired-dwim-target t)
165 | (setq dired-listing-switches "-alh")
166 | (setq dired-mouse-drag-files t)
167 |
168 | ;;; helm
169 | (rc/require 'helm 'helm-git-grep 'helm-ls-git)
170 |
171 | (setq helm-ff-transformer-show-only-basename nil)
172 |
173 | (global-set-key (kbd "C-c h t") 'helm-cmd-t)
174 | (global-set-key (kbd "C-c h g g") 'helm-git-grep)
175 | (global-set-key (kbd "C-c h g l") 'helm-ls-git-ls)
176 | (global-set-key (kbd "C-c h f") 'helm-find)
177 | (global-set-key (kbd "C-c h a") 'helm-org-agenda-files-headings)
178 | (global-set-key (kbd "C-c h r") 'helm-recentf)
179 |
180 | ;;; yasnippet
181 | (rc/require 'yasnippet)
182 |
183 | (require 'yasnippet)
184 |
185 | (setq yas/triggers-in-field nil)
186 | (setq yas-snippet-dirs '("~/.emacs.snippets/"))
187 |
188 | (yas-global-mode 1)
189 |
190 | ;;; word-wrap
191 | (defun rc/enable-word-wrap ()
192 | (interactive)
193 | (toggle-word-wrap 1))
194 |
195 | (add-hook 'markdown-mode-hook 'rc/enable-word-wrap)
196 |
197 | ;;; nxml
198 | (add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode))
199 | (add-to-list 'auto-mode-alist '("\\.xsd\\'" . nxml-mode))
200 | (add-to-list 'auto-mode-alist '("\\.ant\\'" . nxml-mode))
201 |
202 | ;;; tramp
203 | ;;; http://stackoverflow.com/questions/13794433/how-to-disable-autosave-for-tramp-buffers-in-emacs
204 | (setq tramp-auto-save-directory "/tmp")
205 |
206 | ;;; powershell
207 | (rc/require 'powershell)
208 | (add-to-list 'auto-mode-alist '("\\.ps1\\'" . powershell-mode))
209 | (add-to-list 'auto-mode-alist '("\\.psm1\\'" . powershell-mode))
210 |
211 | ;;; eldoc mode
212 | (defun rc/turn-on-eldoc-mode ()
213 | (interactive)
214 | (eldoc-mode 1))
215 |
216 | (add-hook 'emacs-lisp-mode-hook 'rc/turn-on-eldoc-mode)
217 |
218 | ;;; Company
219 | (rc/require 'company)
220 | (require 'company)
221 |
222 | (global-company-mode)
223 |
224 | (add-hook 'tuareg-mode-hook
225 | (lambda ()
226 | (interactive)
227 | (company-mode 0)))
228 |
229 | ;;; Typescript
230 | (rc/require 'typescript-mode)
231 | (add-to-list 'auto-mode-alist '("\\.mts\\'" . typescript-mode))
232 |
233 | ;;; Tide
234 | (rc/require 'tide)
235 |
236 | (defun rc/turn-on-tide-and-flycheck () ;Flycheck is a dependency of tide
237 | (interactive)
238 | (tide-setup)
239 | (flycheck-mode 1))
240 |
241 | (add-hook 'typescript-mode-hook 'rc/turn-on-tide-and-flycheck)
242 |
243 | ;;; Proof general
244 | (rc/require 'proof-general)
245 | (add-hook 'coq-mode-hook
246 | '(lambda ()
247 | (local-set-key (kbd "C-c C-q C-n")
248 | (quote proof-assert-until-point-interactive))))
249 |
250 | ;;; LaTeX mode
251 | (add-hook 'tex-mode-hook
252 | (lambda ()
253 | (interactive)
254 | (add-to-list 'tex-verbatim-environments "code")))
255 |
256 | (setq font-latex-fontify-sectioning 'color)
257 |
258 | ;;; Move Text
259 | (rc/require 'move-text)
260 | (global-set-key (kbd "M-p") 'move-text-up)
261 | (global-set-key (kbd "M-n") 'move-text-down)
262 |
263 | ;;; Ebisp
264 | (add-to-list 'auto-mode-alist '("\\.ebi\\'" . lisp-mode))
265 |
266 | ;;; Packages that don't require configuration
267 | (rc/require
268 | 'scala-mode
269 | 'd-mode
270 | 'yaml-mode
271 | 'glsl-mode
272 | 'tuareg
273 | 'lua-mode
274 | 'less-css-mode
275 | 'graphviz-dot-mode
276 | 'clojure-mode
277 | 'cmake-mode
278 | 'rust-mode
279 | 'csharp-mode
280 | 'nim-mode
281 | 'jinja2-mode
282 | 'markdown-mode
283 | 'purescript-mode
284 | 'nix-mode
285 | 'dockerfile-mode
286 | 'toml-mode
287 | 'nginx-mode
288 | 'kotlin-mode
289 | 'go-mode
290 | 'php-mode
291 | 'racket-mode
292 | 'qml-mode
293 | 'ag
294 | 'elpy
295 | 'typescript-mode
296 | 'rfc-mode
297 | 'sml-mode
298 | )
299 |
300 | (load "~/.emacs.shadow/shadow-rc.el" t)
301 |
302 | (defun astyle-buffer (&optional justify)
303 | (interactive)
304 | (let ((saved-line-number (line-number-at-pos)))
305 | (shell-command-on-region
306 | (point-min)
307 | (point-max)
308 | "astyle --style=kr"
309 | nil
310 | t)
311 | (goto-line saved-line-number)))
312 |
313 | (add-hook 'simpc-mode-hook
314 | (lambda ()
315 | (interactive)
316 | (setq-local fill-paragraph-function 'astyle-buffer)))
317 |
318 | (require 'compile)
319 |
320 | ;; pascalik.pas(24,44) Error: Can't evaluate constant expression
321 |
322 | compilation-error-regexp-alist-alist
323 |
324 | (add-to-list 'compilation-error-regexp-alist
325 | '("\\([a-zA-Z0-9\\.]+\\)(\\([0-9]+\\)\\(,\\([0-9]+\\)\\)?) \\(Warning:\\)?"
326 | 1 2 (4) (5)))
327 |
328 | (load-file custom-file)
329 |
--------------------------------------------------------------------------------
/.emacs.local/fasm-mode.el:
--------------------------------------------------------------------------------
1 | ;;; fasm-mode.el --- Fasm major mode
2 |
3 | ;; Author: Fanael Linithien
4 | ;; URL: https://github.com/Fanael/fasm-mode
5 | ;; Version: 0.1.8
6 |
7 | ;; This file is NOT part of GNU Emacs.
8 |
9 | ;; Copyright (c) 2013, Fanael Linithien
10 | ;; All rights reserved.
11 |
12 | ;; Redistribution and use in source and binary forms, with or without
13 | ;; modification, are permitted provided that the following conditions are
14 | ;; met:
15 |
16 | ;; * Redistributions of source code must retain the above copyright
17 | ;; notice, this list of conditions and the following disclaimer.
18 | ;; * Redistributions in binary form must reproduce the above copyright
19 | ;; notice, this list of conditions and the following disclaimer in the
20 | ;; documentation and/or other materials provided with the distribution.
21 | ;; * Neither the name of the copyright holder(s) nor the names of any
22 | ;; contributors may be used to endorse or promote products derived from
23 | ;; this software without specific prior written permission.
24 |
25 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
26 | ;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 | ;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
28 | ;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
29 | ;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 | ;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 | ;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 | ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 | ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 | ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 | ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 |
37 | ;;; Code:
38 |
39 | (defvar fasm-mode-syntax-table
40 | (let ((syntaxtable (make-syntax-table)))
41 | (modify-syntax-entry ?_ "_" syntaxtable)
42 | (modify-syntax-entry ?. "_" syntaxtable)
43 | (modify-syntax-entry ?$ "_" syntaxtable)
44 | (modify-syntax-entry ?@ "_" syntaxtable)
45 | (modify-syntax-entry ?~ "_" syntaxtable)
46 | (modify-syntax-entry ?? "_" syntaxtable)
47 | (modify-syntax-entry ?! "_" syntaxtable)
48 | (modify-syntax-entry ?= "." syntaxtable)
49 | (modify-syntax-entry ?+ "." syntaxtable)
50 | (modify-syntax-entry ?- "." syntaxtable)
51 | (modify-syntax-entry ?* "." syntaxtable)
52 | (modify-syntax-entry ?/ "." syntaxtable)
53 | (modify-syntax-entry ?\\ "." syntaxtable)
54 | (modify-syntax-entry ?\; "<" syntaxtable)
55 | (modify-syntax-entry ?\n ">" syntaxtable)
56 | (modify-syntax-entry ?\" "\"" syntaxtable)
57 | (modify-syntax-entry ?\' "\"" syntaxtable)
58 | syntaxtable)
59 | "Syntax table for FASM mode.")
60 |
61 | (defvar fasm-mode-map
62 | (let ((map (make-sparse-keymap)))
63 | (define-key map (kbd "") (lambda () (interactive) (insert ?\n)))
64 | map)
65 | "Local keymap for FASM mode.")
66 |
67 | (defvar fasm-basic-offset 2
68 | "Offset for FASM mode indentation.")
69 |
70 | (eval-when-compile
71 | (defun fasm--regexp-from-keywords (&rest keywords)
72 | (regexp-opt keywords 'symbols)))
73 |
74 | (defconst fasm-font-lock-keywords
75 | `(;; Numbers
76 | ("\\_<[01]+b\\_>" . 'font-lock-constant-face)
77 | ("\\_<[0-9][0-9a-fA-F]*h\\_>" . 'font-lock-constant-face)
78 | ("\\_<\\(?:0x\\|\\$\\)[0-9a-fA-F]+\\_>" . 'font-lock-constant-face)
79 | ("\\_<[0-9]+\\(?:\\.[0-9]*\\)?\\(?:e[+-]?[0-9]+\\)?\\_>"
80 | . 'font-lock-constant-face)
81 | ;; Types
82 | (,(eval-when-compile
83 | (fasm--regexp-from-keywords
84 | "xx"
85 | "xxxx"
86 | "preserve"
87 | "byte" "word" "dword" "fword" "pword" "qword" "tbyte" "tword"
88 | "dqword" "xword" "qqword" "yword" "db" "rb" "dw" "du" "rw" "dd" "rd"
89 | "df" "dp" "rf" "rp" "dq" "rq" "dt" "rt")) . 'font-lock-type-face)
90 | ;; Directives and operators
91 | (,(eval-when-compile
92 | (fasm--regexp-from-keywords
93 | "labeling"
94 | "mod" "rva" "plt" "align" "as" "at" "defined" "dup" "eq" "eqtype"
95 | "from" "ptr" "relativeto" "used" "binary" "export" "fixups" "import"
96 | "native" "static" "console" "dynamic" "efiboot" "linkinfo" "readable"
97 | "resource" "writable" "shareable" "writeable" "efiruntime"
98 | "executable" "linkremove" "discardable" "interpreter" "notpageable"
99 |
100 | "if"
101 | "end"
102 | "tail_call"
103 | "finish" ;; as end
104 |
105 | "literal"
106 | "address"
107 | "branch"
108 | "false?branch"
109 |
110 | "err" "org" "data" "else" "heap" "load" "align" "break"
111 | "entry" "extrn" "label" "stack" "store" "times" "while" "assert"
112 | "format" "public" "repeat" "display" "section" "segment" "virtual"
113 | "file")) . 'font-lock-keyword-face)
114 | ;; Preprocessor directives
115 | (,(eval-when-compile
116 | (fasm--regexp-from-keywords
117 | "define" "include" "irp" "irps" "macro" "match" "purge" "rept"
118 | "restore" "restruc" "struc" "common" "forward" "local" "reverse"
119 | "equ" "fix")) . 'font-lock-preprocessor-face)
120 | ;; Registers
121 | (,(eval-when-compile
122 | (fasm--regexp-from-keywords
123 | "al" "bl" "cl" "dl" "spl" "bpl" "sil" "dil" "r8b" "r9b" "r10b" "r11b"
124 | "r12b" "r13b" "r14b" "r15b" "ah" "bh" "ch" "dh" "ax" "bx" "cx" "dx"
125 | "sp" "bp" "si" "di" "r8w" "r9w" "r10w" "r11w" "r12w" "r13w" "r14w"
126 | "r15w" "eax" "ebx" "ecx" "edx" "esp" "ebp" "esi" "edi" "r8d" "r9d"
127 | "r10d" "r11d" "r12d" "r13d" "r14d" "r15d"
128 |
129 | "rax" "rbx" "rcx" "rdx" "rsp" "rbp" "rsi" "rdi"
130 | "r8" "r9" "r10" "r11" "r12" "r13" "r14" "r15"
131 |
132 | ;; "xax" "xbx" "xcx" "xdx" "xsp" "xbp" "xsi" "xdi"
133 | ;; "x8" "x9" "x10" "x11" "x12" "x13" "x14" "x15"
134 |
135 | "rip" "es" "cs" "ss" "ds" "fs" "gs" "cr0" "cr2" "cr3" "cr4" "dr0"
136 | "dr1" "dr2" "dr3" "st0" "st1" "st2" "st3" "st4" "st5" "st6" "st7"
137 | "mm0" "mm1" "mm2" "mm3" "mm4" "mm5" "mm6" "mm7" "xmm0" "xmm1" "xmm2"
138 | "xmm3" "xmm4" "xmm5" "xmm6" "xmm7" "xmm8" "xmm9" "xmm10" "xmm11"
139 | "xmm12" "xmm13" "xmm14" "xmm15" "ymm0" "ymm1" "ymm2" "ymm3" "ymm4"
140 | "ymm5" "ymm6" "ymm7" "ymm8" "ymm9" "ymm10" "ymm11" "ymm12" "ymm13"
141 | "ymm14" "ymm15")) . 'font-lock-variable-name-face)
142 | ;; Instructions
143 | (,(eval-when-compile
144 | (fasm--regexp-from-keywords
145 | "bt" "in" "ja" "jb" "jc" "je" "jg" "jl" "jo" "jp" "js" "jz" "or"
146 | "aaa" "aad" "aam" "aas" "adc" "add" "and" "bsf" "bsr" "btc" "btr"
147 | "bts" "cbw" "cdq" "clc" "cld" "cli" "cmc" "cmp" "cqo" "cwd" "daa"
148 | "das" "dec" "div" "fld" "fst" "hlt" "inc" "ins" "int" "jae" "jbe"
149 | "jge" "jle" "jmp" "jna" "jnb" "jnc" "jne" "jng" "jnl" "jno" "jnp"
150 | "jns" "jnz" "jpe" "jpo" "lar" "lds" "lea" "les" "lfs" "lgs" "lsl"
151 | "lss" "ltr" "mov" "mul" "neg" "nop" "not" "out" "pop" "por" "rcl"
152 | "rcr" "rep" "ret" "rol" "ror" "rsm" "sal" "sar" "sbb" "shl" "shr"
153 | "stc" "std" "sti" "str" "sub" "ud2" "xor" "adcx" "adox" "andn" "arpl"
154 | "blci" "blcs" "blsi" "blsr" "bzhi" "call" "cdqe" "clac" "clgi" "clts"
155 | "cmps" "cwde" "dppd" "dpps" "emms" "fabs" "fadd" "fbld" "fchs" "fcom"
156 | "fcos" "fdiv" "feni" "fild" "fist" "fld1" "fldz" "fmul" "fnop" "fsin"
157 | "fstp" "fsub" "ftst" "fxam" "fxch" "idiv" "imul" "insb" "insd" "insw"
158 | "int1" "int3" "into" "invd" "iret" "jcxz" "jnae" "jnbe" "jnge" "jnle"
159 | "lahf" "lgdt" "lidt" "lldt" "lmsw" "lock" "lods" "loop" "movd" "movq"
160 | "movs" "mulx" "orpd" "orps" "outs" "pand" "pdep" "pext" "popa" "popd"
161 | "popf" "popq" "popw" "push" "pxor" "repe" "repz" "retd" "retf" "retn"
162 | "retq" "retw" "rorx" "sahf" "salc" "sarx" "scas" "seta" "setb" "setc"
163 | "sete" "setg" "setl" "seto" "setp" "sets" "setz" "sgdt" "shld" "shlx"
164 | "shrd" "shrx" "sidt" "sldt" "smsw" "stac" "stgi" "stos" "test" "verr"
165 | "verw" "vpor" "wait" "xadd" "xchg" "xend" "xlat" "addpd" "addps"
166 | "addsd" "addss" "andpd" "andps" "bextr" "blcic" "blsic" "bound"
167 | "bswap" "cmova" "cmovb" "cmovc" "cmove" "cmovg" "cmovl" "cmovo"
168 | "cmovp" "cmovs" "cmovz" "cmppd" "cmpps" "cmpsb" "cmpsd" "cmpsq"
169 | "cmpss" "cmpsw" "cpuid" "crc32" "divpd" "divps" "divsd" "divss"
170 | "enter" "extrq" "f2xm1" "faddp" "fbstp" "fclex" "fcomi" "fcomp"
171 | "fdisi" "fdivp" "fdivr" "femms" "ffree" "fiadd" "ficom" "fidiv"
172 | "fimul" "finit" "fistp" "fisub" "fldcw" "fldpi" "fmulp" "fneni"
173 | "fprem" "fptan" "fsave" "fsqrt" "fstcw" "fstsw" "fsubp" "fsubr"
174 | "fucom" "fwait" "fyl2x" "icebp" "iretd" "iretq" "iretw" "jecxz"
175 | "jrcxz" "lddqu" "leave" "lodsb" "lodsd" "lodsq" "lodsw" "loopd"
176 | "loope" "loopq" "loopw" "loopz" "lzcnt" "maxpd" "maxps" "maxsd"
177 | "maxss" "minpd" "minps" "minsd" "minss" "movbe" "movsb" "movsd"
178 | "movsq" "movss" "movsw" "movsx" "movzx" "mulpd" "mulps" "mulsd"
179 | "mulss" "mwait" "outsb" "outsd" "outsw" "pabsb" "pabsd" "pabsw"
180 | "paddb" "paddd" "paddq" "paddw" "pandn" "pause" "pavgb" "pavgw"
181 | "pf2id" "pf2iw" "pfacc" "pfadd" "pfmax" "pfmin" "pfmul" "pfrcp"
182 | "pfsub" "pi2fd" "pi2fw" "popad" "popaw" "popfd" "popfq" "popfw"
183 | "pslld" "psllq" "psllw" "psrad" "psraw" "psrld" "psrlq" "psrlw"
184 | "psubb" "psubd" "psubq" "psubw" "ptest" "pusha" "pushd" "pushf"
185 | "pushq" "pushw" "rcpps" "rcpss" "rdmsr" "rdpmc" "rdtsc" "repne"
186 | "repnz" "retfd" "retfq" "retfw" "retnd" "retnq" "retnw" "scasb"
187 | "scasd" "scasq" "scasw" "setae" "setbe" "setge" "setle" "setna"
188 | "setnb" "setnc" "setne" "setng" "setnl" "setno" "setnp" "setns"
189 | "setnz" "setpe" "setpo" "stosb" "stosd" "stosq" "stosw" "subpd"
190 | "subps" "subsd" "subss" "tzcnt" "tzmsk" "vdppd" "vdpps" "vmovd"
191 | "vmovq" "vmrun" "vmxon" "vorpd" "vorps" "vpand" "vpxor" "wrmsr"
192 | "xlatb" "xorpd" "xorps" "xsave" "xtest" "aesdec" "aesenc" "aesimc"
193 | "andnpd" "andnps" "blcmsk" "blsmsk" "cmovae" "cmovbe" "cmovge"
194 | "cmovle" "cmovna" "cmovnb" "cmovnc" "cmovne" "cmovng" "cmovnl"
195 | "cmovno" "cmovnp" "cmovns" "cmovnz" "cmovpe" "cmovpo" "comisd"
196 | "comiss" "fcmovb" "fcmove" "fcmovu" "fcomip" "fcompp" "fdivrp"
197 | "ffreep" "ficomp" "fidivr" "fisttp" "fisubr" "fldenv" "fldl2e"
198 | "fldl2t" "fldlg2" "fldln2" "fnclex" "fndisi" "fninit" "fnsave"
199 | "fnstcw" "fnstsw" "fpatan" "fprem1" "frstor" "frstpm" "fsaved"
200 | "fsavew" "fscale" "fsetpm" "fstenv" "fsubrp" "fucomi" "fucomp"
201 | "fxsave" "getsec" "haddpd" "haddps" "hsubpd" "hsubps" "invept"
202 | "invlpg" "lfence" "llwpcb" "looped" "loopeq" "loopew" "loopne"
203 | "loopnz" "loopzd" "loopzq" "loopzw" "lwpins" "lwpval" "mfence"
204 | "movapd" "movaps" "movdqa" "movdqu" "movhpd" "movhps" "movlpd"
205 | "movlps" "movnti" "movntq" "movsxd" "movupd" "movups" "paddsb"
206 | "paddsw" "pextrb" "pextrd" "pextrq" "pextrw" "pfnacc" "pfsubr"
207 | "phaddd" "phaddw" "phsubd" "phsubw" "pinsrb" "pinsrd" "pinsrq"
208 | "pinsrw" "pmaxsb" "pmaxsd" "pmaxsw" "pmaxub" "pmaxud" "pmaxuw"
209 | "pminsb" "pminsd" "pminsw" "pminub" "pminud" "pminuw" "pmuldq"
210 | "pmulhw" "pmulld" "pmullw" "popcnt" "psadbw" "pshufb" "pshufd"
211 | "pshufw" "psignb" "psignd" "psignw" "pslldq" "psrldq" "psubsb"
212 | "psubsw" "pswapd" "pushad" "pushaw" "pushfd" "pushfq" "pushfw"
213 | "rdmsrq" "rdrand" "rdseed" "rdtscp" "setalc" "setnae" "setnbe"
214 | "setnge" "setnle" "sfence" "shufpd" "shufps" "skinit" "slwpcb"
215 | "sqrtpd" "sqrtps" "sqrtsd" "sqrtss" "swapgs" "sysret" "t1mskc"
216 | "vaddpd" "vaddps" "vaddsd" "vaddss" "vandpd" "vandps" "vcmppd"
217 | "vcmpps" "vcmpsd" "vcmpss" "vdivpd" "vdivps" "vdivsd" "vdivss"
218 | "vlddqu" "vmaxpd" "vmaxps" "vmaxsd" "vmaxss" "vmcall" "vminpd"
219 | "vminps" "vminsd" "vminss" "vmload" "vmovsd" "vmovss" "vmread"
220 | "vmsave" "vmulpd" "vmulps" "vmulsd" "vmulss" "vmxoff" "vpabsb"
221 | "vpabsd" "vpabsw" "vpaddb" "vpaddd" "vpaddq" "vpaddw" "vpandn"
222 | "vpavgb" "vpavgw" "vpcmov" "vpcomb" "vpcomd" "vpcomq" "vpcomw"
223 | "vpermd" "vpermq" "vpperm" "vprotb" "vprotd" "vprotq" "vprotw"
224 | "vpshab" "vpshad" "vpshaq" "vpshaw" "vpshlb" "vpshld" "vpshlq"
225 | "vpshlw" "vpslld" "vpsllq" "vpsllw" "vpsrad" "vpsraw" "vpsrld"
226 | "vpsrlq" "vpsrlw" "vpsubb" "vpsubd" "vpsubq" "vpsubw" "vptest"
227 | "vrcpps" "vrcpss" "vsubpd" "vsubps" "vsubsd" "vsubss" "vxorpd"
228 | "vxorps" "wbinvd" "wrmsrq" "xabort" "xbegin" "xgetbv" "xrstor"
229 | "xsetbv" "blcfill" "blendpd" "blendps" "blsfill" "clflush" "cmovnae"
230 | "cmovnbe" "cmovnge" "cmovnle" "cmpeqpd" "cmpeqps" "cmpeqsd" "cmpeqss"
231 | "cmplepd" "cmpleps" "cmplesd" "cmpless" "cmpltpd" "cmpltps" "cmpltsd"
232 | "cmpltss" "cmpxchg" "fcmovbe" "fcmovnb" "fcmovne" "fcmovnu" "fdecstp"
233 | "fincstp" "fldenvd" "fldenvw" "fnsaved" "fnsavew" "fnstenv" "frndint"
234 | "frstord" "frstorw" "fsincos" "fstenvd" "fstenvw" "fucomip" "fucompp"
235 | "fxrstor" "fxtract" "fyl2xp1" "insertq" "invlpga" "invpcid" "invvpid"
236 | "ldmxcsr" "loopned" "loopneq" "loopnew" "loopnzd" "loopnzq" "loopnzw"
237 | "monitor" "movddup" "movdq2q" "movhlps" "movlhps" "movntdq" "movntpd"
238 | "movntps" "movntsd" "movntss" "movq2dq" "mpsadbw" "paddusb" "paddusw"
239 | "palignr" "pavgusb" "pblendw" "pcmpeqb" "pcmpeqd" "pcmpeqq" "pcmpeqw"
240 | "pcmpgtb" "pcmpgtd" "pcmpgtq" "pcmpgtw" "pfcmpeq" "pfcmpge" "pfcmpgt"
241 | "pfpnacc" "pfrsqrt" "phaddsw" "phsubsw" "pmaddwd" "pmulhrw" "pmulhuw"
242 | "pmuludq" "pshufhw" "pshuflw" "psubusb" "psubusw" "roundpd" "roundps"
243 | "roundsd" "roundss" "rsqrtps" "rsqrtss" "stmxcsr" "syscall" "sysexit"
244 | "sysretq" "ucomisd" "ucomiss" "vaesdec" "vaesenc" "vaesimc" "vandnpd"
245 | "vandnps" "vcomisd" "vcomiss" "vfrczpd" "vfrczps" "vfrczsd" "vfrczss"
246 | "vhaddpd" "vhaddps" "vhsubpd" "vhsubps" "vmclear" "vmmcall" "vmovapd"
247 | "vmovaps" "vmovdqa" "vmovdqu" "vmovhpd" "vmovhps" "vmovlpd" "vmovlps"
248 | "vmovupd" "vmovups" "vmptrld" "vmptrst" "vmwrite" "vpaddsb" "vpaddsw"
249 | "vpcomub" "vpcomud" "vpcomuq" "vpcomuw" "vpermpd" "vpermps" "vpextrb"
250 | "vpextrd" "vpextrq" "vpextrw" "vphaddd" "vphaddw" "vphsubd" "vphsubw"
251 | "vpinsrb" "vpinsrd" "vpinsrq" "vpinsrw" "vpmaxsb" "vpmaxsd" "vpmaxsw"
252 | "vpmaxub" "vpmaxud" "vpmaxuw" "vpminsb" "vpminsd" "vpminsw" "vpminub"
253 | "vpminud" "vpminuw" "vpmuldq" "vpmulhw" "vpmulld" "vpmullw" "vpsadbw"
254 | "vpshufb" "vpshufd" "vpsignb" "vpsignd" "vpsignw" "vpslldq" "vpsllvd"
255 | "vpsllvq" "vpsravd" "vpsrldq" "vpsrlvd" "vpsrlvq" "vpsubsb" "vpsubsw"
256 | "vshufpd" "vshufps" "vsqrtpd" "vsqrtps" "vsqrtsd" "vsqrtss" "vtestpd"
257 | "vtestps" "xsave64" "addsubpd" "addsubps" "blendvpd" "blendvps"
258 | "cmpneqpd" "cmpneqps" "cmpneqsd" "cmpneqss" "cmpnlepd" "cmpnleps"
259 | "cmpnlesd" "cmpnless" "cmpnltpd" "cmpnltps" "cmpnltsd" "cmpnltss"
260 | "cmpordpd" "cmpordps" "cmpordsd" "cmpordss" "cvtdq2pd" "cvtdq2ps"
261 | "cvtpd2dq" "cvtpd2pi" "cvtpd2ps" "cvtpi2pd" "cvtpi2ps" "cvtps2dq"
262 | "cvtps2pd" "cvtps2pi" "cvtsd2si" "cvtsd2ss" "cvtsi2sd" "cvtsi2ss"
263 | "cvtss2sd" "cvtss2si" "fcmovnbe" "fnstenvd" "fnstenvw" "fxsave64"
264 | "insertps" "maskmovq" "movmskpd" "movmskps" "movntdqa" "movshdup"
265 | "movsldup" "packssdw" "packsswb" "packusdw" "packuswb" "pblendvb"
266 | "pfrcpit1" "pfrcpit2" "pfrsqit1" "pmovmskb" "pmovsxbd" "pmovsxbq"
267 | "pmovsxbw" "pmovsxdq" "pmovsxwd" "pmovsxwq" "pmovzxbd" "pmovzxbq"
268 | "pmovzxbw" "pmovzxdq" "pmovzxwd" "pmovzxwq" "pmulhrsw" "prefetch"
269 | "rdfsbase" "rdgsbase" "sysenter" "sysexitq" "unpckhpd" "unpckhps"
270 | "unpcklpd" "unpcklps" "vblendpd" "vblendps" "vcmpeqpd" "vcmpeqps"
271 | "vcmpeqsd" "vcmpeqss" "vcmpgepd" "vcmpgeps" "vcmpgesd" "vcmpgess"
272 | "vcmpgtpd" "vcmpgtps" "vcmpgtsd" "vcmpgtss" "vcmplepd" "vcmpleps"
273 | "vcmplesd" "vcmpless" "vcmpltpd" "vcmpltps" "vcmpltsd" "vcmpltss"
274 | "vfmaddpd" "vfmaddps" "vfmaddsd" "vfmaddss" "vfmsubpd" "vfmsubps"
275 | "vfmsubsd" "vfmsubss" "vldmxcsr" "vmlaunch" "vmovddup" "vmovhlps"
276 | "vmovlhps" "vmovntdq" "vmovntpd" "vmovntps" "vmpsadbw" "vmresume"
277 | "vpaddusb" "vpaddusw" "vpalignr" "vpblendd" "vpblendw" "vpcmpeqb"
278 | "vpcmpeqd" "vpcmpeqq" "vpcmpeqw" "vpcmpgtb" "vpcmpgtd" "vpcmpgtq"
279 | "vpcmpgtw" "vpcomeqb" "vpcomeqd" "vpcomeqq" "vpcomeqw" "vpcomgeb"
280 | "vpcomged" "vpcomgeq" "vpcomgew" "vpcomgtb" "vpcomgtd" "vpcomgtq"
281 | "vpcomgtw" "vpcomleb" "vpcomled" "vpcomleq" "vpcomlew" "vpcomltb"
282 | "vpcomltd" "vpcomltq" "vpcomltw" "vphaddbd" "vphaddbq" "vphaddbw"
283 | "vphadddq" "vphaddsw" "vphaddwd" "vphaddwq" "vphsubbw" "vphsubdq"
284 | "vphsubsw" "vphsubwd" "vpmacsdd" "vpmacswd" "vpmacsww" "vpmaddwd"
285 | "vpmulhuw" "vpmuludq" "vpshufhw" "vpshuflw" "vpsubusb" "vpsubusw"
286 | "vroundpd" "vroundps" "vroundsd" "vroundss" "vrsqrtps" "vrsqrtss"
287 | "vstmxcsr" "vucomisd" "vucomiss" "vzeroall" "wrfsbase" "wrgsbase"
288 | "xacquire" "xrelease" "xrstor64" "xsaveopt" "cmpxchg8b" "cvttpd2dq"
289 | "cvttpd2pi" "cvttps2dq" "cvttps2pi" "cvttsd2si" "cvttss2si"
290 | "extractps" "fxrstor64" "pclmulqdq" "pcmpestri" "pcmpestrm"
291 | "pcmpistri" "pcmpistrm" "pmaddubsw" "prefetchw" "punpckhbw"
292 | "punpckhdq" "punpckhwd" "punpcklbw" "punpckldq" "punpcklwd"
293 | "vaddsubpd" "vaddsubps" "vblendvpd" "vblendvps" "vcmpneqpd"
294 | "vcmpneqps" "vcmpneqsd" "vcmpneqss" "vcmpngepd" "vcmpngeps"
295 | "vcmpngesd" "vcmpngess" "vcmpngtpd" "vcmpngtps" "vcmpngtsd"
296 | "vcmpngtss" "vcmpnlepd" "vcmpnleps" "vcmpnlesd" "vcmpnless"
297 | "vcmpnltpd" "vcmpnltps" "vcmpnltsd" "vcmpnltss" "vcmpordpd"
298 | "vcmpordps" "vcmpordsd" "vcmpordss" "vcvtdq2pd" "vcvtdq2ps"
299 | "vcvtpd2dq" "vcvtpd2ps" "vcvtph2ps" "vcvtps2dq" "vcvtps2pd"
300 | "vcvtps2ph" "vcvtsd2si" "vcvtsd2ss" "vcvtsi2sd" "vcvtsi2ss"
301 | "vcvtss2sd" "vcvtss2si" "vfnmaddpd" "vfnmaddps" "vfnmaddsd"
302 | "vfnmaddss" "vfnmsubpd" "vfnmsubps" "vfnmsubsd" "vfnmsubss"
303 | "vinsertps" "vmovmskpd" "vmovmskps" "vmovntdqa" "vmovshdup"
304 | "vmovsldup" "vpackssdw" "vpacksswb" "vpackusdw" "vpackuswb"
305 | "vpblendvb" "vpcomequb" "vpcomequd" "vpcomequq" "vpcomequw"
306 | "vpcomgeub" "vpcomgeud" "vpcomgeuq" "vpcomgeuw" "vpcomgtub"
307 | "vpcomgtud" "vpcomgtuq" "vpcomgtuw" "vpcomleub" "vpcomleud"
308 | "vpcomleuq" "vpcomleuw" "vpcomltub" "vpcomltud" "vpcomltuq"
309 | "vpcomltuw" "vpcomneqb" "vpcomneqd" "vpcomneqq" "vpcomneqw"
310 | "vpermilpd" "vpermilps" "vphaddubd" "vphaddubq" "vphaddubw"
311 | "vphaddudq" "vphadduwd" "vphadduwq" "vpmacsdqh" "vpmacsdql"
312 | "vpmacssdd" "vpmacsswd" "vpmacssww" "vpmadcswd" "vpmovmskb"
313 | "vpmovsxbd" "vpmovsxbq" "vpmovsxbw" "vpmovsxdq" "vpmovsxwd"
314 | "vpmovsxwq" "vpmovzxbd" "vpmovzxbq" "vpmovzxbw" "vpmovzxdq"
315 | "vpmovzxwd" "vpmovzxwq" "vpmulhrsw" "vunpckhpd" "vunpckhps"
316 | "vunpcklpd" "vunpcklps" "aesdeclast" "aesenclast" "cmpunordpd"
317 | "cmpunordps" "cmpunordsd" "cmpunordss" "cmpxchg16b" "loadall286"
318 | "loadall386" "maskmovdqu" "phminposuw" "prefetcht0" "prefetcht1"
319 | "prefetcht2" "punpckhqdq" "punpcklqdq" "vcmptruepd" "vcmptrueps"
320 | "vcmptruesd" "vcmptruess" "vcvttpd2dq" "vcvttps2dq" "vcvttsd2si"
321 | "vcvttss2si" "vextractps" "vgatherdpd" "vgatherdps" "vgatherqpd"
322 | "vgatherqps" "vmaskmovpd" "vmaskmovps" "vpclmulqdq" "vpcmpestri"
323 | "vpcmpestrm" "vpcmpistri" "vpcmpistrm" "vpcomnequb" "vpcomnequd"
324 | "vpcomnequq" "vpcomnequw" "vpcomtrueb" "vpcomtrued" "vpcomtrueq"
325 | "vpcomtruew" "vperm2f128" "vperm2i128" "vpermil2pd" "vpermil2ps"
326 | "vpgatherdd" "vpgatherdq" "vpgatherqd" "vpgatherqq" "vpmacssdqh"
327 | "vpmacssdql" "vpmadcsswd" "vpmaddubsw" "vpmaskmovd" "vpmaskmovq"
328 | "vpunpckhbw" "vpunpckhdq" "vpunpckhwd" "vpunpcklbw" "vpunpckldq"
329 | "vpunpcklwd" "vzeroupper" "xsaveopt64" "pclmulhqhdq" "pclmullqhdq"
330 | "prefetchnta" "vaesdeclast" "vaesenclast" "vcmpeq_ospd" "vcmpeq_osps"
331 | "vcmpeq_ossd" "vcmpeq_osss" "vcmpeq_uqpd" "vcmpeq_uqps" "vcmpeq_uqsd"
332 | "vcmpeq_uqss" "vcmpeq_uspd" "vcmpeq_usps" "vcmpeq_ussd" "vcmpeq_usss"
333 | "vcmpfalsepd" "vcmpfalseps" "vcmpfalsesd" "vcmpfalsess" "vcmpge_oqpd"
334 | "vcmpge_oqps" "vcmpge_oqsd" "vcmpge_oqss" "vcmpgt_oqpd" "vcmpgt_oqps"
335 | "vcmpgt_oqsd" "vcmpgt_oqss" "vcmple_oqpd" "vcmple_oqps" "vcmple_oqsd"
336 | "vcmple_oqss" "vcmplt_oqpd" "vcmplt_oqps" "vcmplt_oqsd" "vcmplt_oqss"
337 | "vcmpord_spd" "vcmpord_sps" "vcmpord_ssd" "vcmpord_sss" "vcmpunordpd"
338 | "vcmpunordps" "vcmpunordsd" "vcmpunordss" "vfmadd132pd" "vfmadd132ps"
339 | "vfmadd132sd" "vfmadd132ss" "vfmadd213pd" "vfmadd213ps" "vfmadd213sd"
340 | "vfmadd213ss" "vfmadd231pd" "vfmadd231ps" "vfmadd231sd" "vfmadd231ss"
341 | "vfmaddsubpd" "vfmaddsubps" "vfmsub132pd" "vfmsub132ps" "vfmsub132sd"
342 | "vfmsub132ss" "vfmsub213pd" "vfmsub213ps" "vfmsub213sd" "vfmsub213ss"
343 | "vfmsub231pd" "vfmsub231ps" "vfmsub231sd" "vfmsub231ss" "vfmsubaddpd"
344 | "vfmsubaddps" "vinsertf128" "vinserti128" "vmaskmovdqu" "vpcomfalseb"
345 | "vpcomfalsed" "vpcomfalseq" "vpcomfalsew" "vpcomtrueub" "vpcomtrueud"
346 | "vpcomtrueuq" "vpcomtrueuw" "vphminposuw" "vpunpckhqdq" "vpunpcklqdq"
347 | "pclmulhqhqdq" "pclmulhqlqdq" "pclmullqhqdq" "pclmullqlqdq"
348 | "vbroadcastsd" "vbroadcastss" "vcmpneq_oqpd" "vcmpneq_oqps"
349 | "vcmpneq_oqsd" "vcmpneq_oqss" "vcmpneq_ospd" "vcmpneq_osps"
350 | "vcmpneq_ossd" "vcmpneq_osss" "vcmpneq_uspd" "vcmpneq_usps"
351 | "vcmpneq_ussd" "vcmpneq_usss" "vcmpnge_uqpd" "vcmpnge_uqps"
352 | "vcmpnge_uqsd" "vcmpnge_uqss" "vcmpngt_uqpd" "vcmpngt_uqps"
353 | "vcmpngt_uqsd" "vcmpngt_uqss" "vcmpnle_uqpd" "vcmpnle_uqps"
354 | "vcmpnle_uqsd" "vcmpnle_uqss" "vcmpnlt_uqpd" "vcmpnlt_uqps"
355 | "vcmpnlt_uqsd" "vcmpnlt_uqss" "vextractf128" "vextracti128"
356 | "vfnmadd132pd" "vfnmadd132ps" "vfnmadd132sd" "vfnmadd132ss"
357 | "vfnmadd213pd" "vfnmadd213ps" "vfnmadd213sd" "vfnmadd213ss"
358 | "vfnmadd231pd" "vfnmadd231ps" "vfnmadd231sd" "vfnmadd231ss"
359 | "vfnmsub132pd" "vfnmsub132ps" "vfnmsub132sd" "vfnmsub132ss"
360 | "vfnmsub213pd" "vfnmsub213ps" "vfnmsub213sd" "vfnmsub213ss"
361 | "vfnmsub231pd" "vfnmsub231ps" "vfnmsub231sd" "vfnmsub231ss"
362 | "vpbroadcastb" "vpbroadcastd" "vpbroadcastq" "vpbroadcastw"
363 | "vpclmulhqhdq" "vpclmullqhdq" "vpcomfalseub" "vpcomfalseud"
364 | "vpcomfalseuq" "vpcomfalseuw" "vpermilmo2pd" "vpermilmo2ps"
365 | "vpermilmz2pd" "vpermilmz2ps" "vpermiltd2pd" "vpermiltd2ps"
366 | "vcmptrue_uspd" "vcmptrue_usps" "vcmptrue_ussd" "vcmptrue_usss"
367 | "vcmpunord_spd" "vcmpunord_sps" "vcmpunord_ssd" "vcmpunord_sss"
368 | "vpclmulhqlqdq" "vpclmullqlqdq" "vbroadcastf128" "vbroadcasti128"
369 | "vcmpfalse_ospd" "vcmpfalse_osps" "vcmpfalse_ossd" "vcmpfalse_osss"
370 | "vfmaddsub132pd" "vfmaddsub132ps" "vfmaddsub213pd" "vfmaddsub213ps"
371 | "vfmaddsub231pd" "vfmaddsub231ps" "vfmsubadd132pd" "vfmsubadd132ps"
372 | "vfmsubadd213pd" "vfmsubadd213ps" "vfmsubadd231pd" "vfmsubadd231ps"
373 | "aeskeygenassist" "vaeskeygenassist")) . 'font-lock-builtin-face)
374 | ;; Labels
375 | ("^[ \t]*\\([a-z$A-Z0-9.?!@]\\(?:\\sw\\|\\s_\\)*\\):"
376 | . (1 'font-lock-function-name-face))
377 | ;; Macro names
378 | ("\\(?:macro\\|struc\\)[ \t]+\\([a-zA-Z0-9.?!@]\\(?:\\sw\\|\\s_\\)*\\)"
379 | . (1 'font-lock-function-name-face)))
380 | "Syntax highlighting for FASM mode.")
381 |
382 |
383 |
384 |
385 | ;; (defun fasm--get-indent-level (lineoffset)
386 | ;; (save-excursion
387 | ;; (forward-line (1- lineoffset))
388 | ;; (back-to-indentation)
389 | ;; (current-column)))
390 |
391 | (defun empty-line? ()
392 | (save-excursion
393 | (let ((column-a (progn (move-beginning-of-line nil)
394 | (current-column)))
395 | (column-b (progn (back-to-indentation)
396 | (current-column))))
397 | ;; 下面这个谓词看似是冗余的 但是没有关系
398 | (and (= column-b column-a)
399 | (eq (following-char) 10))
400 | )))
401 |
402 | (defun above-char ()
403 | (interactive)
404 | (save-excursion
405 | (backward-char 1)
406 | (following-char)))
407 |
408 | (defun fasm-label? ()
409 | (interactive)
410 | (save-excursion
411 | (and (progn
412 | (whitespace-cleanup)
413 | (not (empty-line?)))
414 | (progn
415 | ;; (whitespace-cleanup)
416 | (end-of-line)
417 | (eq 58 ;; 58 -- ":"
418 | (above-char))))))
419 |
420 | ;; (defun' test-fasm-get-indent ()
421 | ;; (interactive)
422 | ;; (message "><><><"))
423 | (defun fasm-get-indent (n)
424 | (save-excursion
425 | (forward-line n)
426 | (cond ((empty-line?)
427 | "empty-line")
428 | ((fasm-label?)
429 | "fasm-label")
430 | (t
431 | (progn
432 | (back-to-indentation)
433 | (current-column))))))
434 |
435 | (defun fasm-indent-line ()
436 | "Indent according to FASM major mode."
437 | (interactive)
438 | ;; 可以发现缩进函数根本就写不好 因为emacs不能真正明白文本的语法
439 | (cond
440 | ;; 下面是根据当前一行来缩进
441 | ((fasm-label?)
442 | (let ()
443 | (back-to-indentation)
444 | (delete-backward-char (current-column))))
445 | ;; 下面是根据上一行来缩进
446 | (t;; else
447 | (back-to-indentation)
448 | (let ((prev-indent (fasm-get-indent -1))
449 | (curr-indent (current-column)))
450 | (cond ((equal prev-indent "empty-line")
451 | ;; (indent-to 8)
452 | (indent-to 3)
453 | )
454 | ((equal prev-indent "fasm-label")
455 | ;; (indent-to 0)
456 | ;; 上面的那个命令根本不会缩进 这样看似是合理的 所以增加下面这句:
457 | (message "do not indent at all !"))
458 | ((< curr-indent prev-indent)
459 | (indent-to prev-indent))
460 | ((>= curr-indent prev-indent)
461 | (delete-backward-char (- curr-indent prev-indent)))
462 | ((>= curr-indent prev-indent)
463 | (delete-backward-char (- curr-indent prev-indent)))
464 | )))))
465 |
466 | ;; Emacs < 24 did not have prog-mode
467 | (defalias 'fasm-parent-mode
468 | (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
469 |
470 | ;;;###autoload
471 | (define-derived-mode fasm-mode fasm-parent-mode
472 | "Fasm"
473 | "Major mode for editing assembly in FASM format."
474 | (set (make-local-variable 'font-lock-defaults)
475 | (list 'fasm-font-lock-keywords nil t))
476 | (set (make-local-variable 'indent-line-function) 'fasm-indent-line)
477 | (set (make-local-variable 'comment-start) ";; "))
478 |
479 | (provide 'fasm-mode)
480 | ;;; fasm-mode.el ends here
481 |
--------------------------------------------------------------------------------