From b5debb0c8351b65f327df807b6598c7a293176b5 Mon Sep 17 00:00:00 2001 From: asnev Date: Fri, 20 Nov 2026 11:22:32 +0700 Subject: [PATCH 1/2] `.el` files clean-up Vim plugin(s) configuration on-progress --- .gitignore | 3 ++ emacs/.emacs.d/early-init.el | 17 ++++---- emacs/.emacs.d/init.el | 75 +++++++++++------------------------- vim/.vimrc | 61 ++++++++++++++++++++++------- 4 files changed, 80 insertions(+), 76 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4432ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +history +*.swp + diff --git a/emacs/.emacs.d/early-init.el b/emacs/.emacs.d/early-init.el index 058e22a..df0a525 100644 --- a/emacs/.emacs.d/early-init.el +++ b/emacs/.emacs.d/early-init.el @@ -1,11 +1,7 @@ -;;; -*- lexical-binding: t -*- -;;; Emacs Bedrock (early-init.el) +;;; early-init.el --- -*- lexical-binding:t -*- -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Basic settings for quick startup and convenience -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Basic settings for quick startup and convenience ;; Startup speed, annoyance suppression (setq bedrock--initial-gc-threshold gc-cons-threshold) @@ -26,8 +22,9 @@ ;(setq frame-resize-pixelwise t) ;(setq window-resize-pixelwise t) -(when (fboundp 'tool-bar-mode) ; When in a GUI, disable tool bar; - (tool-bar-mode -1)) ; all these tools are in the menu-bar anyway +;; Hides tool bar and menu bar +(tool-bar-mode -1) +(menu-bar-mode -1) ;; These settings apply to *all* frames. (setq default-frame-alist '( @@ -50,3 +47,5 @@ ;; color as the theme gets activated (background-color . "#000000") (foreground-color . "#ffffff"))) + +;; end of early-init.el file diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 045d867..f9b712a 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -1,24 +1,13 @@ -;;; -*- lexical-binding: t -*- -;;; Emacs Bedrock (init.el) -;;; - Basic settings -;;; - Discovery aids -;;; - Minibuffer/completion/searching settings -;;; - Interface enhancements/defaults -;;; - Tab-bar configuration -;;; - Theme -;;; - Optional extras -;;; - Built-in customization framework +;;; init.el --- -*- lexical-binding:t -*- -;;; Guardrail + +;;; Guardrail ----- (when (< emacs-major-version 31) (error "Emacs Bedrock only works with Emacs 31 and newer; you have version %s" emacs-major-version)) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Basic settings -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Basic settings ----- ;; Package initialization ;; @@ -123,15 +112,11 @@ If the new path's directories does not exist, create them." (setq bidi-inhibit-bpa t) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Discovery aids -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Discovery aids ----- ;; Show the help buffer after startup---makes it a little bit like nano. ;; You can open and dismiss this buffer with `C-h C-q'. -(add-hook 'after-init-hook 'help-quick) +;(add-hook 'after-init-hook 'help-quick) (setopt view-lossage-auto-refresh t) @@ -141,11 +126,8 @@ If the new path's directories does not exist, create them." :config (which-key-mode)) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Minibuffer/completion/searching settings -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Minibuffer/completion/searching settings ----- ;; For help, see: https://www.masteringemacs.org/article/understanding-minibuffer-completion @@ -179,7 +161,6 @@ If the new path's directories does not exist, create them." ;(fido-vertical-mode) ;(setopt icomplete-delay-completions-threshold 4000) - ;; isearch is Emacs's built-in searching system (use-package isearch :ensure nil ; already installed @@ -195,11 +176,8 @@ If the new path's directories does not exist, create them." (isearch-wrap-pause 'no-ding) ; Automatically wrap search to top ) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Interface enhancements/defaults -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Interface enhancements/defaults ----- ;; Mode line information (setopt line-number-mode t) ; Show current line in modeline @@ -241,6 +219,7 @@ If the new path's directories does not exist, create them." ;; Display line numbers in programming mode (add-hook 'prog-mode-hook 'display-line-numbers-mode) +(setq display-line-numbers-type 'relative) (setopt display-line-numbers-width 3) ; Set a minimum width ;; Nice line wrapping when working with text @@ -259,11 +238,8 @@ If the new path's directories does not exist, create them." (setopt show-paren-style 'expression) ; default is 'parenthesis and just does delimiters (setopt show-paren-context-when-offscreen 'overlay) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Tab-bar configuration -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Tab-bar configuration ----- ;; Show the tab-bar as soon as tab-bar functions are invoked (setopt tab-bar-show 1) @@ -298,21 +274,15 @@ If the new path's directories does not exist, create them." :bind (:map global-map ("C-c C-t" . tab-bar-transient))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Theme -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Theme ----- (use-package emacs :config (load-theme 'modus-vivendi-tinted)) ; for light theme, use modus-operandi -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Optional extras -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Optional extras ----- ;; Uncomment the (load-file …) lines or copy code from the extras/ elisp files ;; as desired @@ -343,11 +313,8 @@ If the new path's directories does not exist, create them." ;; Tools for academic researchers ;(load-file (expand-file-name "extras/researcher.el" user-emacs-directory)) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Built-in customization framework -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Built-in customization framework ----- (custom-set-variables ;; custom-set-variables was added by Custom. @@ -367,3 +334,5 @@ If the new path's directories does not exist, create them." ) (setq gc-cons-threshold (or bedrock--initial-gc-threshold 800000)) + +;; end of init.el file diff --git a/vim/.vimrc b/vim/.vimrc index 95a6db1..a0c6c36 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,7 +1,7 @@ " This `.vimrc' is written for configuring `vim-classic', an LTS release of " Vim 8. YMMV if using a newer release of Vim. -" options +" Vim options (alphabetical) ----- set background=dark set cursorline set expandtab @@ -12,8 +12,10 @@ set laststatus=2 set listchars=eol:$,tab:»\ ,trail:~,extends:>,precedes:<,space:· set mouse=a set number +set omnifunc=syntaxcomplete#Complete " omnicomplete (^X^O) set relativenumber set shiftwidth=4 +set showcmd set sj=-50 " jumpy scrolling (like Emacs) set smartcase set tabstop=4 @@ -22,30 +24,61 @@ set nocopyindent set noswapfile set noundofile -" vim-plug +" vim-plug ----- call plug#begin('~/.vim/plugged') + " quality-of-life ----- Plug 'tpope/vim-sensible' Plug 'tpope/vim-sleuth' Plug 'tpope/vim-commentary' - Plug 'ThunderBoltCODMYT/gruber-darker.vim' - let g:gruber_contrast = 'soft' + + " visual ----- + Plug 'junegunn/seoul256.vim' + let g:seoul256_background = 233 + let g:seoul256_light_background = 253 + + Plug 'itchyny/vim-gitbranch' + Plug 'itchyny/lightline.vim' + let g:lightline = + \ { 'colorscheme': 'seoul256' + \ , 'active' : { 'left': [ [ 'paste' ] + \ , [ 'filename' + \ , 'gitbranch' + \ , 'readonly' + \ , 'modified' ] ] } + \ , 'component_function': { 'gitbranch': 'gitbranch#name' } } + Plug 'luochen1990/rainbow' + let g:rainbow_conf = + \ { 'separately': { '*' : 0 + \ , 'lisp' : 'default' + \ , 'clojure': 'default' + \ , 'scheme' : 'default' + \ , 'racket' : 'default' } } + augroup always_load_rainbow + autocmd! + autocmd ColorScheme * let g:rainbow_active = 1 + augroup END + + " languages ----- Plug 'LnL7/vim-nix' call plug#end() - -" rainbow s-expressions + fix -augroup fix_rainbow - autocmd! - autocmd ColorScheme * let g:rainbow_active = 1 -augroup END - -" colorscheme -colorscheme gruber-darker +" `vim-plug' automatically initialises `filetype plugin indent on' " set leader key to space nnoremap let mapleader = " " -" copy to system clipboard (Wayland) +colorscheme seoul256 + +" copy visual selection to system clipboard +" (X11) +" vnoremap y :w !xclip -sel clip +" (Wayland) vnoremap y :w !wl-copy +" cursor shapes ----- +let &t_EI = "\e[2 q" " normal : solid block +let &t_SI = "\e[6 q" " insert : solid I-beam +let &t_SR = "\e[4 q" " replace : solid underscore + +" end of `.vimrc' ----- From 28641bc531224f42320687a25f4fd0004270dd5f Mon Sep 17 00:00:00 2001 From: asnev Date: Tue, 24 Nov 2026 16:45:04 +0700 Subject: [PATCH 2/2] added i3 config minor tweaks to others --- .gitignore | 2 + emacs/.emacs.d/early-init.el | 4 +- emacs/.emacs.d/init.el | 2 +- i3/.config/i3/config | 190 +++++++++++++++++++++++++++++++++++ vim/.vimrc | 15 +-- 5 files changed, 204 insertions(+), 9 deletions(-) create mode 100644 i3/.config/i3/config diff --git a/.gitignore b/.gitignore index 4432ead..79d5db1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ history *.swp +*.directory +emacs/.emacs.d/history diff --git a/emacs/.emacs.d/early-init.el b/emacs/.emacs.d/early-init.el index df0a525..33f7de7 100644 --- a/emacs/.emacs.d/early-init.el +++ b/emacs/.emacs.d/early-init.el @@ -1,4 +1,4 @@ -;;; early-init.el --- -*- lexical-binding:t -*- +;;; early-init.el :: -*- lexical-binding:t -*- ;;; Basic settings for quick startup and convenience @@ -23,7 +23,7 @@ ;(setq window-resize-pixelwise t) ;; Hides tool bar and menu bar -(tool-bar-mode -1) +;(tool-bar-mode -1) (menu-bar-mode -1) ;; These settings apply to *all* frames. diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index f9b712a..aae77a8 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -1,4 +1,4 @@ -;;; init.el --- -*- lexical-binding:t -*- +;;; init.el :: -*- lexical-binding:t -*- ;;; Guardrail ----- diff --git a/i3/.config/i3/config b/i3/.config/i3/config new file mode 100644 index 0000000..bb2750b --- /dev/null +++ b/i3/.config/i3/config @@ -0,0 +1,190 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id dmenu_run +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} diff --git a/vim/.vimrc b/vim/.vimrc index a0c6c36..2de48f3 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,3 +1,5 @@ +" .vimrc --- Vim configuration + " This `.vimrc' is written for configuring `vim-classic', an LTS release of " Vim 8. YMMV if using a newer release of Vim. @@ -20,10 +22,15 @@ set sj=-50 " jumpy scrolling (like Emacs) set smartcase set tabstop=4 set termguicolors +set timeoutlen=500 set nocopyindent set noswapfile set noundofile +" set leader key to space +nnoremap +let mapleader = " " + " vim-plug ----- call plug#begin('~/.vim/plugged') " quality-of-life ----- @@ -62,11 +69,7 @@ call plug#begin('~/.vim/plugged') " languages ----- Plug 'LnL7/vim-nix' call plug#end() -" `vim-plug' automatically initialises `filetype plugin indent on' - -" set leader key to space -nnoremap -let mapleader = " " +" vim-plug automatically initialises `filetype plugin indent on' colorscheme seoul256 @@ -81,4 +84,4 @@ let &t_EI = "\e[2 q" " normal : solid block let &t_SI = "\e[6 q" " insert : solid I-beam let &t_SR = "\e[4 q" " replace : solid underscore -" end of `.vimrc' ----- +" end of .vimrc