wip: emacs

This commit is contained in:
bluxmit 2022-11-03 09:56:10 +00:00
parent e9a7255004
commit 1b051c8c3c
16 changed files with 435 additions and 1 deletions

View file

@ -33,6 +33,6 @@ COPY --chown=abc:abc filebrowser.json /home/abc/apps/filebrowser/.filebrowser.js
# Build Alnoda workspace
COPY --chown=abc:abc workspace /tmp/workspace
RUN echo "------------------------------------------------------ build workspace" \
&& pipx install alnoda-wrk==0.2.23 \
&& pipx install alnoda-wrk==0.2.24 \
&& alnoda-wrk build /tmp/workspace \
&& rm -rf /tmp/workspace

View file

@ -0,0 +1,20 @@
FROM alnoda/base-devspace:4.0
COPY --chown=abc:abc ./emacs.d/ /home/abc/.emacs.d/
RUN echo "------------------------------------------------------ emacs" \
&& sudo add-apt-repository -y ppa:kelleyk/emacs \
&& sudo apt-get -y update \
&& sudo apt-get install -y emacs28-nox \
&& echo "------------------------------------------------------ themes" \
&& mkdir -p /home/abc/.emacs.d/themes \
&& cd /tmp && git clone https://github.com/arcticicestudio/nord-emacs.git \
&& mv /tmp/nord-emacs/nord-theme.el /home/abc/.emacs.d/themes/nord-theme.el \
&& rm -rf /tmp/nord-emacs
# Build Alnoda workspace
COPY --chown=abc:abc workspace /tmp/workspace
RUN echo "------------------------------------------------------ build workspace" \
&& pipx install alnoda-wrk \
&& alnoda-wrk build /tmp/workspace \
&& rm -rf /tmp/workspace

View file

@ -0,0 +1,35 @@
(require 'package)
(add-to-list 'package-archives
'("elpy" . "http://jorgenschaefer.github.io/packages/"))
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
; list the packages you want
(setq package-list
'(python-environment deferred epc
flycheck ctable jedi concurrent company cyberpunk-theme elpy
yasnippet pyvenv highlight-indentation find-file-in-project
sql-indent sql exec-path-from-shell iedit
auto-complete popup let-alist magit git-rebase-mode
git-commit-mode minimap popup))
; activate all the packages
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))

View file

@ -0,0 +1,34 @@
;; emacs configuration suited for terminal use
(xterm-mouse-mode 1)
(global-set-key [mouse-5] 'scroll-up-command)
(global-set-key [mouse-4] 'scroll-down-command)
(pixel-scroll-mode 1)
(add-to-list 'load-path "~/.emacs.d")
(add-to-list 'custom-theme-load-path "/home/abc/.emacs.d/themes")
(load-theme 'nord t)
(load "/home/abc/.emacs.d/init-packages")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
(fset 'yes-or-no-p 'y-or-n-p)
(delete-selection-mode t)
(scroll-bar-mode 1)
(tool-bar-mode 1)
(blink-cursor-mode t)
(show-paren-mode t)
(column-number-mode t)
(set-fringe-style -1)
(tooltip-mode -1)
(require 'package)
(setq package-archives (cons '("tromey" . "http://tromey.com/elpa/") package-archives))
(package-initialize)

View file

@ -0,0 +1,10 @@
# Use colon separators.
xterm-24bit|xterm with 24-bit direct color mode,
use=xterm-256color,
setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
setf24=\E[38:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
# Use semicolon separators.
xterm-24bits|xterm with 24-bit direct color mode,
use=xterm-256color,
setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,

View file

@ -0,0 +1,113 @@
(use-package treemacs
:ensure t
:defer t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(progn
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-deferred-git-apply-delay 0.5
treemacs-directory-name-transformer #'identity
treemacs-display-in-side-window t
treemacs-eldoc-display 'simple
treemacs-file-event-delay 2000
treemacs-file-extension-regex treemacs-last-period-regex-value
treemacs-file-follow-delay 0.2
treemacs-file-name-transformer #'identity
treemacs-follow-after-init t
treemacs-expand-after-init t
treemacs-find-workspace-method 'find-for-file-or-pick-first
treemacs-git-command-pipe ""
treemacs-goto-tag-strategy 'refetch-index
treemacs-header-scroll-indicators '(nil . "^^^^^^")
treemacs-hide-dot-git-directory t
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window nil
treemacs-max-git-entries 5000
treemacs-missing-project-action 'ask
treemacs-move-forward-on-expand nil
treemacs-no-png-images nil
treemacs-no-delete-other-windows t
treemacs-project-follow-cleanup nil
treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
treemacs-position 'left
treemacs-read-string-input 'from-child-frame
treemacs-recenter-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
treemacs-recenter-after-project-jump 'always
treemacs-recenter-after-project-expand 'on-distance
treemacs-litter-directories '("/node_modules" "/.venv" "/.cask")
treemacs-show-cursor nil
treemacs-show-hidden-files t
treemacs-silent-filewatch nil
treemacs-silent-refresh nil
treemacs-sorting 'alphabetic-asc
treemacs-select-when-already-in-treemacs 'move-back
treemacs-space-between-root-nodes t
treemacs-tag-follow-cleanup t
treemacs-tag-follow-delay 1.5
treemacs-text-scale nil
treemacs-user-mode-line-format nil
treemacs-user-header-line-format nil
treemacs-wide-toggle-width 70
treemacs-width 35
treemacs-width-increment 1
treemacs-width-is-initially-locked t
treemacs-workspace-switch-cleanup nil)
;; The default width and height of the icons is 22 pixels. If you are
;; using a Hi-DPI display, uncomment this to double the icon size.
;;(treemacs-resize-icons 44)
(treemacs-follow-mode t)
(treemacs-filewatch-mode t)
(treemacs-fringe-indicator-mode 'always)
(when treemacs-python-executable
(treemacs-git-commit-diff-mode t))
(pcase (cons (not (null (executable-find "git")))
(not (null treemacs-python-executable)))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple)))
(treemacs-hide-gitignored-files-mode nil))
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("C-x t t" . treemacs)
("C-x t d" . treemacs-select-directory)
("C-x t B" . treemacs-bookmark)
("C-x t C-t" . treemacs-find-file)
("C-x t M-t" . treemacs-find-tag)))
(use-package treemacs-evil
:after (treemacs evil)
:ensure t)
(use-package treemacs-projectile
:after (treemacs projectile)
:ensure t)
(use-package treemacs-icons-dired
:hook (dired-mode . treemacs-icons-dired-enable-once)
:ensure t)
(use-package treemacs-magit
:after (treemacs magit)
:ensure t)
(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
:after (treemacs persp-mode) ;;or perspective vs. persp-mode
:ensure t
:config (treemacs-set-scope-type 'Perspectives))
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
:after (treemacs)
:ensure t
:config (treemacs-set-scope-type 'Tabs))

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none; fill: rgb(255, 255, 255);" id="path14"/>
</g>
</g>
<path d="M 449.47 900 C 201.039 900 -1.059 698.137 -1.059 450 C -1.059 201.863 201.039 0 449.47 0 C 697.903 0 900 201.863 900 450 C 900 698.137 697.903 900 449.47 900 Z M 462.8 34.848 C 228.209 34.848 24.003 215.55 24.003 450 C 24.003 684.45 214.878 875.212 449.47 875.212 C 684.063 875.212 879.062 701.912 879.062 467.424 C 879.062 232.937 697.392 34.848 462.8 34.848 Z M 298.941 757.387 C 298.941 757.387 336.022 759.976 383.723 755.812 C 403.06 754.126 476.391 746.999 531.257 735.112 C 531.257 735.112 598.143 720.975 633.899 707.924 C 671.323 694.276 691.684 682.687 700.86 666.299 C 700.444 662.925 703.666 651 686.413 643.838 C 642.277 625.538 591.09 628.837 489.814 626.7 C 377.504 622.874 340.118 604.276 320.248 589.312 C 301.177 574.125 310.769 532.087 392.558 495.074 C 433.735 475.351 595.223 438.975 595.223 438.975 C 540.851 412.388 439.423 365.662 418.569 355.574 C 400.293 346.725 371.021 333.412 364.689 317.287 C 357.484 301.799 381.675 288.488 395.173 284.662 C 438.664 272.25 500.052 264.562 555.942 263.662 C 584.038 263.212 588.589 261.45 588.589 261.45 C 627.339 255.076 652.857 228.863 642.203 187.35 C 632.647 144.975 582.332 120.039 534.518 128.663 C 489.473 136.801 380.954 167.963 380.954 167.963 C 515.143 166.799 537.59 169.013 547.599 182.887 C 553.514 191.063 544.907 202.313 509.113 208.088 C 470.173 214.388 389.183 221.964 389.183 221.964 C 311.491 226.537 256.776 226.837 240.358 261.188 C 229.627 283.65 251.81 303.525 261.517 315.937 C 302.543 361.087 361.845 385.425 399.988 403.35 C 414.359 410.101 456.486 422.85 456.486 422.85 C 332.685 416.1 243.43 453.713 191.028 496.988 C 131.802 551.175 158.002 615.788 279.376 655.538 C 351.075 679.013 386.604 690.075 493.531 680.55 C 556.51 677.175 566.445 679.201 567.05 684.3 C 567.923 691.5 497.094 709.387 477.757 714.899 C 428.541 728.925 299.585 757.238 298.941 757.387 Z" style="fill: rgb(255, 255, 255);"/>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
</g>
</g>
<path d="M 449.47 900 C 201.039 900 -1.059 698.137 -1.059 450 C -1.059 201.863 201.039 0 449.47 0 C 697.903 0 900 201.863 900 450 C 900 698.137 697.903 900 449.47 900 Z M 462.8 34.848 C 228.209 34.848 24.003 215.55 24.003 450 C 24.003 684.45 214.878 875.212 449.47 875.212 C 684.063 875.212 879.062 701.912 879.062 467.424 C 879.062 232.937 697.392 34.848 462.8 34.848 Z M 298.941 757.387 C 298.941 757.387 336.022 759.976 383.723 755.812 C 403.06 754.126 476.391 746.999 531.257 735.112 C 531.257 735.112 598.143 720.975 633.899 707.924 C 671.323 694.276 691.684 682.687 700.86 666.299 C 700.444 662.925 703.666 651 686.413 643.838 C 642.277 625.538 591.09 628.837 489.814 626.7 C 377.504 622.874 340.118 604.276 320.248 589.312 C 301.177 574.125 310.769 532.087 392.558 495.074 C 433.735 475.351 595.223 438.975 595.223 438.975 C 540.851 412.388 439.423 365.662 418.569 355.574 C 400.293 346.725 371.021 333.412 364.689 317.287 C 357.484 301.799 381.675 288.488 395.173 284.662 C 438.664 272.25 500.052 264.562 555.942 263.662 C 584.038 263.212 588.589 261.45 588.589 261.45 C 627.339 255.076 652.857 228.863 642.203 187.35 C 632.647 144.975 582.332 120.039 534.518 128.663 C 489.473 136.801 380.954 167.963 380.954 167.963 C 515.143 166.799 537.59 169.013 547.599 182.887 C 553.514 191.063 544.907 202.313 509.113 208.088 C 470.173 214.388 389.183 221.964 389.183 221.964 C 311.491 226.537 256.776 226.837 240.358 261.188 C 229.627 283.65 251.81 303.525 261.517 315.937 C 302.543 361.087 361.845 385.425 399.988 403.35 C 414.359 410.101 456.486 422.85 456.486 422.85 C 332.685 416.1 243.43 453.713 191.028 496.988 C 131.802 551.175 158.002 615.788 279.376 655.538 C 351.075 679.013 386.604 690.075 493.531 680.55 C 556.51 677.175 566.445 679.201 567.05 684.3 C 567.923 691.5 497.094 709.387 477.757 714.899 C 428.541 728.925 299.585 757.238 298.941 757.387 Z" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View file

@ -0,0 +1,75 @@
---
# mandatory
name: Emacs workspace
doc_url: https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/emacs-workspace/README.md
author: bluxmit
version: 4.0
repository: https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/emacs-workspace
description: |
Workspace with hyperextensible Emacs-based text editor
tags: web-ide, emacs
logo: emacs-circle-white.svg
favicon: emacs-circle.svg
styles:
font: JetBrains Mono
colors:
light:
primary: "#282A36"
accent: "#EB71B9"
background: "#F5F7F7"
title: "#005F87"
code_text: "#EAB676"
code_background: "#252525"
code_text: "#282A36"
code_background: "#eab676"
dark:
primary: "#424450"
accent: "#45C368"
background: "#282A36"
title: "#F1FA8C"
text: "#BD93F9"
code_text: "#282A36"
code_background: "#eab676"
common_colors:
header: "#FFFFFF"
nav: "#eab676"
pages:
home:
- name: IDE
port: 8021
path: /
title: IDE
description: "Browser-based Emacs IDE"
image: emacs.png
- name: M.Commander
port: 8025
title: M.Commander
description: Feature rich visual file manager with internal text viewer and editor
image: mc.jpg
start:
- name: Emacs
folder: /home/
cmd: ttyd -p 8021 -P 15 /bin/zsh -c 'TERM=xterm-256color COLORTERM=truecolor emacs'
cheatsheet:
Emacs:
- cmd: Esc-x (or Meta-x)
description: run any Emacs command by its extended (i.e., full) name
- cmd: Esc-x package-list-packages
description: Show list of available Emacs packages
links:
Developer help:
- url: "https://elpa.gnu.org/packages/"
name: "ELPA"
description: "GNU ELPA Packages"
- url: "https://melpa.org/"
name: "MELPA"
description: "Milkypostmans Emacs Lisp Package Archive"

View file

@ -3,6 +3,7 @@ FROM alnoda/base-devspace:4.0
RUN echo "------------------------------------------------------ nvim" \
&& cd /tmp && wget https://github.com/neovim/neovim/releases/download/v0.8.0/nvim-linux64.tar.gz \
&& tar -xzf nvim-linux64.tar.gz \
&& rm /tmp/nvim-linux64.tar.gz \
&& mv /tmp/nvim-linux64 /home/abc/apps/nvim \
&& mkdir /home/abc/.config/nvim/ \
&& echo "------------------------------------------------------ vim-plug" \

View file

@ -8,6 +8,8 @@ repository: https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/ne
description: |
Workspace with hyperextensible Vim-based text editor
tags: web-ide, vim, neovim
logo: vim-circle-white.svg
favicon: vim-circle.svg

View file

@ -0,0 +1,9 @@
FROM alnoda/base-devspace:4.0
RUN echo "------------------------------------------------------ emacs" \
&& sudo add-apt-repository -y ppa:kelleyk/emacs \
&& sudo apt-get -y update \
&& sudo apt-get install -y emacs28 \
&& echo "------------------------------------------------------ spacemacs" \
&& git clone https://github.com/syl20bnr/spacemacs $HOME/.emacs.d

View file

@ -0,0 +1,115 @@
---
# mandatory
name: Spacemacs workspace
doc_url: https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/spacevim-workspace/README.md
author: bluxmit
version: 4.0
repository: https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/spacevim-workspace
description: |
Workspace with browser-based SpaceVim IDE
tags: web-ide, vim, spacevim
logo: vim-circle-white.svg
favicon: vim-circle.svg
styles:
font: Anonymous Pro
colors:
light:
primary: "#282828"
accent: "#729665"
background: "#d6d3ce"
code_text: "#282828"
code_background: "#729665"
dark:
primary: "#504945"
accent: "#B8BB26"
background: "#282828"
title: "#F1FA8C"
text: "#EBDBB2"
code_text: "#282828"
code_background: "#F97D18"
common_colors:
header: "#FFFFFF"
nav: "#F97D18"
pages:
home:
- name: IDE
port: 8021
path: /
title: IDE
description: "Browser-based full-featured SpaceVim IDE"
image: spacevim.jpg
- name: M.Commander
port: 8025
title: M.Commander
description: Feature rich visual file manager with internal text viewer and editor
image: mc.jpg
start:
- name: SpaceVim
folder: /home/
cmd: ttyd -p 8021 -P 15 /bin/zsh -c 'nvim'
cheatsheet:
SpaceVim:
- cmd: i
description: enter insert mode, allows editing file
- cmd: Esc
description: exit insert mode, enter command mode
- cmd: y
description: copy (yank) selected text
- cmd: p
description: paste copied (yank) text
- cmd: d
description: delete selected lines
- cmd: u
description: undo all changes in the last insert mode
- cmd: 2u
description: undo all changes done in 2 last insert modes
- cmd: Ctrl + r
description: redo (undone changes)
- cmd: Space
description: menu to manage files, windows, togglers, options and more
- cmd: Space + b + d
description: close current tab
- cmd: s
description: manage tabs, screens
- cmd: g
description: editor and navigation menu
- cmd: /
description: search in file
- cmd: n
description: find next (when searching)
- cmd: N
description: find previous (when searching)
- cmd: :w
description: save file changes
- cmd: :wq
description: save and exit
- cmd: :q!
description: trash all changes
- cmd: r
description: refresh file tree folders (if focused on file tree folder)
- cmd: .
description: show hidden files (if focused on file tree)
- cmd: N
description: create new folder or file (if focused on file tree)
- cmd: m
description: manage (rename, delete, copy, move) folder or file (if focused on file tree)
- cmd: d
description: delete folder or file (if focused on file tree)
- cmd: i
description: open the selected file in a horizontal split window (if focused on file tree)
- cmd: s
description: open the selected file in a vertical split window (if focused on file tree)
links:
Developer help:
- url: "https://spacevim.org/"
name: "SpaceVim"
description: "SpaceVim community website"

View file

@ -8,6 +8,8 @@ repository: https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/sp
description: |
Workspace with browser-based SpaceVim IDE
tags: web-ide, vim, spacevim
logo: vim-circle-white.svg
favicon: vim-circle.svg