1
0
Fork 0

use stow for dotfiles (#1)

Reviewed-on: #1
This commit is contained in:
Von Random 2023-02-04 12:45:02 +02:00
parent a282cf4d63
commit 8789a2a83e
33 changed files with 37 additions and 24 deletions

58
cli/.bashrc Normal file
View file

@ -0,0 +1,58 @@
# shellcheck shell=bash
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
HISTSIZE=1000
HISTFILE="$HOME/.bash_history.$UID"
HISTCONTROL=ignoredups
shopt -s histappend checkwinsize autocd
export LESS='i M R'
export PAGER=less
export EDITOR=vim
export TIME_STYLE=long-iso
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
((UID)) && ps_clr=53 || ps_clr=52
# just a colored version of [ $USER $HOSTNAME:$CWD ]
printf -v PS1 '\\[\\e[0m\\]\\[\\e[48;5;%sm\\] \\u \\[\\e[48;5;237m\\] \\h \\[\\e[48;5;234m \\w \\[\\e[0m\\]\n\\$ ' $ps_clr
unset ps_clr
unalias ls ld ll 2>/dev/null
beep() { printf "\007"; }
fixterm() { printf "c"; }
diff() { command diff --color "$@"; }
tailf() { command less +F "$@"; }
rgrep() { command grep --exclude-dir=\.git -R "$@"; }
whence() { command -v "$@"; }
# ls
ls() { command ls --color=auto --group-directories-first "$@"; }
ll() { ls -alh "$@"; }
ll() { ls -dlh "$@"; }
# git
gci() { command git commit "$@"; }
gsl() { command git stash list "$@"; }
gss() { command git status -sbu "$@"; }
gup() { command git pull "$@"; }
groot() { cd "$(command git rev-parse --show-cdup)" || return 1; }
ggrep() { command git grep "$@"; }
gsi() { command tig status; }
# tmux
tmux() { command tmux -2 "$@"; }
atmux() { tmux attach; }
# sudo
sush() { command sudo -Es; }
# bash-completion
completion_path='/usr/share/bash-completion/bash_completion'
[[ -r "$completion_path" ]] && source "$completion_path"
# we want to see exit code on error (it also has to be the last entry here)
trap_msg='\e[31m>>\e[0m exit \e[31m%s\e[0m\n'
trap 'printf "$trap_msg" "$?" >&2' ERR

2
cli/.config/bat/config Normal file
View file

@ -0,0 +1,2 @@
--theme=gruvbox-dark
--italic-text=always

View file

@ -0,0 +1,49 @@
if status is-interactive
set prompt_sep_a \ue0b0
set prompt_bang \n\U1f41f\
set git_sign \ue0a0
set color_fg brwhite
set color_git_branch 3c3c3c
set color_git yellow blue red purple
function prompt.add
set color $argv[1]
set text $argv[2]
if test -z "$prompt_string"
set prompt_string (set_color -b $color)(set_color $color_fg) $text
else
set -a prompt_string (set_color -b $color)(set_color $prev_color)$prompt_sep_a(set_color $color_fg) $text
end
set prev_color $color
end
function prompt.git
git rev-parse 2>/dev/null || return
git status --porcelain -bu | while read line
if string match -qr "^##" "$line"
set git_branch (string match -r "\ (.+)\.\.\." "$line")[2]
string match -qr "\[behind" $line && set git_branch "$git_branch?"
string match -qr "\[ahead" $line && set git_branch "$git_branch!"
prompt.add "$color_git_branch" "$git_sign $git_branch"
else
string match -qr "^.[MD]" "$line" && set git_count[1] (math $git_count[1] + 1)
string match -qr "^[MDARC]." "$line" && set git_count[2] (math $git_count[2] + 1)
string match -qr "^\?\?" "$line" && set git_count[3] (math $git_count[3] + 1)
string match -qr "^[ADU]{2}" "$line" && set git_count[4] (math $git_count[4] + 1)
end
end
test -n "$git_count[1]" && prompt.add "$color_git[1]" "~$git_count[1]"
test -n "$git_count[2]" && prompt.add "$color_git[2]" "+$git_count[2]"
test -n "$git_count[3]" && prompt.add "$color_git[3]" "!$git_count[3]"
test -n "$git_count[4]" && prompt.add "$color_git[4]" "*$git_count[4]"
end
function fish_prompt
set -g prompt_string
set -g prev_color
prompt.add blue (pwd)
prompt.git
prompt.add normal $prompt_bang
echo $prompt_string
set -e prompt_string
end
# Commands to run in interactive sessions can go here
end

View file

@ -0,0 +1,3 @@
require('settings')
require('maps')
require('plugins')

View file

@ -0,0 +1,31 @@
vim.g.mapleader = ' '
function unmap(key)
vim.api.nvim_set_keymap('', key, '', {})
end
function map(mode, key, action)
vim.api.nvim_set_keymap(mode, key, action, {noremap = true})
end
-- some unmaps
unmap(' ')
unmap('q')
unmap('<F1>')
-- option control
map('n', '<Leader>c', ':setlocal cursorline!<CR>')
map('n', '<Leader>l', ':setlocal list!<CR>')
map('n', '<Leader>w', ':setlocal wrap!<CR>')
-- search
map('n', '<Leader>/', ':noh<CR>')
-- copy / paste
map('n', '<Leader>y', '"+y')
map('n', '<Leader>d', '"+d')
map('n', '<Leader>p', '"+p')
map('n', '<Leader>P', '"+P')
-- keymap switch
map('!', '<C-Space>', '<C-^>')
map('!', '<C-@>', '<C-^>')

View file

@ -0,0 +1,23 @@
local packer_init = {}
packer_init.init = function(plugins)
local ensure_packer = function()
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.fn.system {'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
require('packer').startup(plugins)
if packer_bootstrap then
require('packer').sync()
return true
end
return false
end
return packer_init

View file

@ -0,0 +1,43 @@
-- [[ plugins list ]]
local function plugins(use)
use 'wbthomason/packer.nvim'
use 'lifepillar/vim-gruvbox8'
use 'hoob3rt/lualine.nvim'
use 'hashivim/vim-terraform'
use 'mhinz/vim-signify'
use 'tpope/vim-fugitive'
use 'tpope/vim-rsi'
use 'tpope/vim-vinegar'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use {
'w0rp/ale',
ft = { 'sh', 'zsh', 'lua', 'python' },
cmd = 'ALEEnable'
}
end
--[[ init plugins and install packer if missing ]]
if require('packer_init').init(plugins) then return end
--[[ plugins config ]]
require('lualine').setup{
options = {
icons_enabled = false,
component_separators = { left = '\u{2022}', right = '\u{2022}' }
}
}
--[[ telescope maps ]]
map('n', '<Leader>.', '<cmd>Telescope find_files<CR>')
map('n', '<Leader>,', '<cmd>Telescope buffers<CR>')
--[[ theme ]]
vim.o.bg = 'dark'
vim.o.termguicolors = true
vim.g.gruvbox_plugin_hi_groups = 1
vim.g.gruvbox_filetype_hi_groups = 1
vim.cmd [[colorscheme gruvbox8]]

View file

@ -0,0 +1,34 @@
local fsize = '11'
if vim.loop.os_uname().sysname == 'Darwin' then fsize = '14' end
vim.o.modeline = false
vim.o.foldmethod = 'marker'
vim.o.cursorline = true
vim.o.colorcolumn = '80'
vim.o.relativenumber = true
vim.o.breakindent = true
vim.o.clipboard = 'unnamedplus'
vim.o.list = true
vim.o.listchars = 'tab:==>,nbsp:x,trail:*'
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.scrolloff = 3
vim.o.sidescrolloff = 15
vim.o.tabstop = 3
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
vim.o.keymap = 'russian-jcukenwintype'
vim.o.iminsert = 0
vim.o.imsearch = 0
vim.o.title = true
vim.o.titlestring = '[%{hostname()}] %t - neovim'
vim.o.statusline = '[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]'
vim.o.guifont = 'vcascadia:h' .. fsize

View file

@ -0,0 +1,102 @@
# Fuck default aliases
unalias -a
testbin() { whence $@ > /dev/null }
termcompat() {
typeset term=$TERM
case $term in
(alacritty*) ;&
(kitty*) ;&
(wezterm) ;&
(xterm-*)
term=xterm;;
(rxvt-unicode*)
term=rxvt-unicode;;
(tmux*)
term=screen.xterm-new;;
esac
TERM=$term command $@
}
addpath() {
typeset newpath=$1
if [[ ! $PATH =~ $newpath ]]; then
PATH+=:$newpath
export PATH
fi
}
fsf() {
typeset host prompt="SSH Remote > "
host=$(cut -d\ -f1 $HOME/.ssh/known_hosts | sort -u | fzf --prompt=$prompt) || return 1
termcompat ssh $host $@
}
beep() { printf $'\007' }
fixterm() { printf $'c' }
diff() { command diff --color $@ }
tailf() { command less +F $@ }
grep() { command grep --color=auto }
rgrep() { grep --color=auto --exclude-dir=\.git -R $@ }
fwcmd() { command firewall-cmd $@ }
sush() { command sudo -Es }
s() { termcompat ssh $@ }
if testbin nvim; then
vi() { command nvim $@ }
vim() { command nvim $@ }
fi
tmux() { command tmux -2 $@ }
atmux() { tmux attach || tmux }
g() { command lazygit $@ }
tig() { termcompat tig $@ }
gsi() { tig status }
gci() { command git commit $@ }
gsl() { command git stash list $@ }
gss() { command git status -sbu $@ }
gsw() { command git switch $@ }
gup() { command git pull $@ }
gwt() { command git worktree $@ }
groot() { cd $(command git rev-parse --show-toplevel) || return 1 }
ggrep() { command git grep $@ }
gdiff() { command git diff --color $@; }
greset() {
echo "OK to reset and clean teh repo?"
read -sq _
(( $? )) && return 1
/usr/bin/git clean -fd
/usr/bin/git reset --hard
}
if testbin diff-so-fancy; then
gdf() { gdiff $@ | command diff-so-fancy | command less --tabs=4 -RSFX }
else
gdf() { gdiff $@ }
fi
if testbin exa; then
ls() { command exa --group-directories-first $@ }
ll() { ls -alg $@ }
ld() { ls -dlg $@ }
else
ls() { command ls --color=auto --group-directories-first $@ }
ll() { ls -alh $@ }
ld() { ls -dlh $@ }
fi
# grc
if testbin grc; then
cmds=(\
cc configure cvs df dig gcc gmake id ip last lsof make mount \
mtr netstat ping ping6 ps tcpdump traceroute traceroute6 \
)
for cmd in $cmds[@]; do
alias $cmd="command grc -es --colour=auto $cmd"
done
unset cmds cmd
fi

View file

@ -0,0 +1,158 @@
prompt_fmtn='[ %%{\e[2;3m%%}%s%%{\e[0m%%} ] '
printf -v PROMPT2 $prompt_fmtn '%_'
printf -v PROMPT3 $prompt_fmtn '?#'
printf -v PROMPT4 $prompt_fmtn '+%N:%i'
prompt_wt="$USERNAME@$HOST"
prompt_fifo=~/.zsh_gitstatus_$$
prompt_blimit=12
typeset -A prompt_symbols=(
sep_a $'\ue0b0'
ellipsis $'\u2026'
git $'\ue0a0'
git_unstaged '~'
git_staged $'\u2713'
git_untracked '!'
git_unmerged '*'
bang $'\n %F{202}\u266a%f'
)
typeset -A prompt_colors=(
fg '15'
root '1'
ssh '0'
cwd '4'
git_branch '237'
git_unstaged '3'
git_staged '6'
git_untracked '1'
git_unmerged '5'
)
precmd.is_git_repo() {
typeset prompt_git_dir
prompt_git_dir=$(git rev-parse --git-dir 2>/dev/null) || return 1
[[ ! -e $prompt_git_dir/nozsh ]]
}
precmd.prompt.init() {
typeset -g prompt_string= prev_color=
}
precmd.prompt.add() {
(( $# < 2 )) && return 1
typeset data=$1 color=$2
if [[ -z $prompt_string ]]; then
prompt_string+="%K{$color}%F{$prompt_colors[fg]} $data "
else
prompt_string+="%F{$prev_color}%K{$color}$prompt_symbols[sep_a]%F{$prompt_colors[fg]} $data "
fi
prev_color=$color
}
precmd.prompt.bang() {
prompt_string+="%F{$prev_color}%k$prompt_symbols[sep_a]%f$prompt_symbols[bang] "
}
precmd.prompt.apply() {
PROMPT=$prompt_string
unset prompt_string
}
precmd.prompt.user() {
(( UID )) || precmd.prompt.add '#' $prompt_colors[root]
}
precmd.prompt.cwd() {
precmd.prompt.add %~ $prompt_colors[cwd]
}
precmd.prompt.ssh() {
[[ -n $SSH_CONNECTION ]] || return 0
precmd.prompt.add %n@%m $prompt_colors[ssh]
}
precmd.prompt.pre_git() {
precmd.prompt.add "$prompt_symbols[git] $prompt_symbols[ellipsis]" $prompt_colors[git_branch]
}
precmd.prompt.git() {
typeset raw_status IFS=
raw_status=$(git status --porcelain -bu 2>/dev/null) || return 0
typeset -A count
while read line; do
case $line[1,2] in
('##')
typeset branch_status=${line[4,-1]%%...*}
((${#branch_status}>prompt_blimit)) && \
branch_status=$branch_status[1,$prompt_blimit]$prompt_symbols[ellipsis]
[[ $line =~ behind ]] && branch_status+=?
[[ $line =~ ahead ]] && branch_status+=!
precmd.prompt.add "$prompt_symbols[git] $branch_status" $prompt_colors[git_branch]
;;
(?[MD]) (( ++count[git_unstaged] )) ;|
([MDARC]?) (( ++count[git_staged] )) ;|
('??') (( ++count[git_untracked] )) ;|
([ADU][ADU]) (( ++count[git_unmerged] ))
esac
done <<< $raw_status
for i in git_untracked git_unmerged git_unstaged git_staged; do
(( count[$i] )) && precmd.prompt.add "$count[$i]$prompt_symbols[$i]" $prompt_colors[$i]
done
}
precmd.prompt() {
precmd.prompt.init
precmd.prompt.user
precmd.prompt.ssh
precmd.prompt.cwd
}
precmd.git_update() {
precmd.prompt
precmd.prompt.git
precmd.prompt.bang
[[ ! -p $prompt_fifo ]] && mkfifo -m 0600 $prompt_fifo
echo -n $prompt_string > $prompt_fifo &!
kill -s USR1 $$
}
precmd.prompt.update() {
typeset -g prompt_string=$(<$prompt_fifo)
precmd.prompt.apply
zle && zle reset-prompt
}
precmd.window_title() {
printf '\033]0;%s\007' $prompt_wt
}
precmd() {
precmd.window_title
precmd.prompt
if precmd.is_git_repo; then
precmd.prompt.pre_git
precmd.git_update &!
fi
precmd.prompt.bang
precmd.prompt.apply
}
TRAPUSR1() {
precmd.prompt.update
}
TRAPEXIT() {
[[ -p $prompt_fifo ]] && rm $prompt_fifo
}
function zle-line-init zle-keymap-select {
local seq=$'\e[2 q'
[[ $KEYMAP == vicmd ]] && seq=$'\e[4 q'
printf $seq
}
zle -N zle-line-init
zle -N zle-keymap-select

View file

@ -0,0 +1,43 @@
# disable the bloody ^S / ^Q, I use tmux all the time anyway
stty -ixon
setopt APPEND_HISTORY EXTENDED_HISTORY HIST_IGNORE_DUPS EXTENDED_GLOB AUTO_CD AUTO_PUSHD PRINT_EXIT_VALUE
unsetopt BEEP NO_MATCH NOTIFY MENU_COMPLETE AUTO_MENU
SAVEHIST=1000
HISTSIZE=1000
HISTFILE=$HOME/.histfile.$UID
export LESS='i M R'
export PAGER=less
export EDITOR=vim
export TIME_STYLE=long-iso
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
export ALTERNATE_EDITOR=
bindkey -e
bindkey $terminfo[kdch1] delete-char
bindkey $terminfo[khome] beginning-of-line
bindkey $terminfo[kend] end-of-line
bindkey '^[' vi-cmd-mode
# autocompletion
autoload -Uz compinit
compinit
zstyle ':completion:*' completer _list _complete _ignored
zstyle ':completion:*' insert-unambiguous true
zstyle ':completion:*' file-sort name
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' list-suffixes true
zstyle ':completion:*' original true
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
zstyle ':completion:*' rehash true
zstyle ':completion:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd'
zstyle ':completion:*:processes-names' command 'ps axho command'
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
unalias ld ls ll &>/dev/null

10
cli/.doom.d/config.el Normal file
View file

@ -0,0 +1,10 @@
(setq user-full-name "Von Random"
user-mail-address "von@mechanus.net")
(setq doom-font (font-spec :family "vcascadia" :size 14)
doom-variable-pitch-font (font-spec :family "PT Sans"))
(setq doom-theme 'doom-gruvbox)
(setq display-line-numbers-type 'relative)
(setq org-directory "~/org/")
(menu-bar-mode -1)

194
cli/.doom.d/init.el Normal file
View file

@ -0,0 +1,194 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
;;doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
ansible
;;biblio ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
;;(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
;;json ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
yaml ; JSON, but readable
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

50
cli/.doom.d/packages.el Normal file
View file

@ -0,0 +1,50 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;(package! another-package
; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;(package! this-package
; :recipe (:host github :repo "username/repo"
; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;(package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;(package! builtin-package :recipe (:nonrecursive t))
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;(package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)

2
cli/.inputrc Normal file
View file

@ -0,0 +1,2 @@
set bell-style none
set completion-ignore-case on

66
cli/.nanorc Normal file
View file

@ -0,0 +1,66 @@
set autoindent
set boldtext
#set breaklonglines
set constantshow
set guidestripe 80
set linenumbers
set minibar
#set mouse
set noconvert
#set nohelp
set smarthome
set softwrap
set tabsize 3
set whitespace "»·"
## Paint the interface elements of nano. These are examples; there are
## no colors by default, except for errorcolor and spotlightcolor.
set titlecolor bold,white,blue
set promptcolor lightwhite,white
set statuscolor bold,white,green
set errorcolor bold,white,red
set spotlightcolor black,lightyellow
set selectedcolor lightwhite,magenta
set stripecolor ,yellow
set scrollercolor cyan
set numbercolor cyan
set keycolor cyan
set functioncolor green
## === Syntax coloring ===
include "/usr/share/nano/*.nanorc"
## === Key bindings ===
## If you would like nano to have keybindings that are more "usual",
## such as ^O for Open, ^F for Find, ^H for Help, and ^Q for Quit,
## then uncomment these:
#bind ^X cut main
#bind ^C copy main
#bind ^V paste all
#bind ^Q exit all
#bind ^S savefile main
#bind ^W writeout main
#bind ^O insert main
#set multibuffer
#bind ^H help all
#bind ^H exit help
#bind ^F whereis all
#bind ^G findnext all
#bind ^B wherewas all
#bind ^D findprevious all
#bind ^R replace main
#bind ^Z undo main
#bind ^Y redo main
#unbind ^K main
#unbind ^U all
#unbind ^N main
#unbind ^Y all
#unbind M-J main
#unbind M-T main
#bind ^A mark main
#bind ^P location main
#bind ^T gotoline main
#bind ^T gotodir browser
#bind ^T cutrestoffile execute
#bind ^L linter execute
#bind ^E execute main

18
cli/.screenrc Normal file
View file

@ -0,0 +1,18 @@
# window title hack
hardstatus string "[%H:%n] %t"
# so we don't have to enter the copy mode every time we want to scroll
termcapinfo rxvt*|xterm* ti@:te@
# the rest is pretty obvious
startup_message off
hardstatus off
defscrollback 10000
vbell off
bell off
autodetach on
term screen
altscreen on
activity "activity on %n"
caption always '%{=}%{RW} %H %{Yw} %S %{wd} %-w%{wk}%n_%t%{wd}%+w'
escape ^gg
bindkey "^[g" command
bind w windowlist -b

3
cli/.tigrc Normal file
View file

@ -0,0 +1,3 @@
color cursor default green bold
color title-blur default blue
color title-focus default blue bold

47
cli/.tmux.conf Normal file
View file

@ -0,0 +1,47 @@
unbind C-b
bind C-g send-prefix
bind v split-window -h
bind s split-window -v
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind t command-prompt -p "attach pane to:" "join-pane -t '%%'"
bind y command-prompt break-pane
bind N new-session
set -g prefix C-g
set -g mode-keys "vi"
set -g escape-time "0"
set -g history-limit "10000"
set -g mouse on
# newer options, not universally compatible
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
bind r display "resize" \; switch-client -T resize
bind -T resize -r h resize-pane -L 5
bind -T resize -r j resize-pane -D 5
bind -T resize -r k resize-pane -U 5
bind -T resize -r l resize-pane -R 5
# styling, new incompatible format
set -g set-titles on
set -g set-titles-string "[#h:#S] #W"
set -g automatic-rename off
set -g pane-border-status off
set -g pane-border-lines "heavy"
set -g pane-border-style "default"
set -g pane-active-border-style "fg=brightred"
set -g message-style "bg=blue,fg=white"
set -g message-command-style "bg=red,fg=white"
set -g status on
set -g status-style "fg=black,bg=white"
set -g status-format[0] "#[fg=brightred,bg=black,italics] #h[#S] #[default]\ue0b0 #{W: #I:#W ,#[reverse] #I:#W #[noreverse]} #[align=right]\ue0b2#[reverse] %a %e %k:%M "
set -g status-interval 2
set -g status-position "bottom"
set -g status-justify "left"
set -g status-left-length "100"
set -g status-right-length "100"
# relevant to local only
set -g terminal-overrides "alacritty:Tc,kitty-xterm:Tc,xterm-256color:Tc,rxvt-unicode*:Tc"
set -g default-terminal "tmux-256color"

55
cli/.vimplugrc Normal file
View file

@ -0,0 +1,55 @@
vim9script
autocmd BufRead *vimplugrc set ft=vim
execute 'source' fnameescape(g:plug)
plug#begin(g:plugdir)
Plug 'junegunn/vim-plug'
Plug 'lifepillar/vim-gruvbox8'
Plug 'hashivim/vim-terraform'
Plug 'itchyny/lightline.vim'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rsi'
Plug 'tpope/vim-vinegar'
Plug 'w0rp/ale', {'for': ['sh']}
plug#end()
# easy-align
xmap <Leader>a <Plug>(EasyAlign)
nmap <Leader>a <Plug>(EasyAlign)
# fzf
nmap <Leader>ff :Files<CR>
nmap <Leader>fg :GFiles<CR>
nmap <Leader>fb :Buffers<CR>
nmap <Leader>fl :Lines<CR>
nmap <Leader>ft :Filetypes<CR>
# lightline
g:lightline = {
colorscheme: 'gruvbox8',
separator: { left: "\ue0b0", right: "\ue0b2"},
subseparator: { left: "\ue0b1", right: "\ue0b3"}
}
g:gruvbox_transp_bg = 1
g:gruvbox_plugin_hi_groups = 1
g:gruvbox_filetype_hi_groups = 1
&t_8f = "\u1b[38;2;%lu;%lu;%lum"
&t_8b = "\u1b[48;2;%lu;%lu;%lum"
&tgc = 1
&bg = 'dark'
colorscheme gruvbox8
if has('gui_running')
set guifont=JetBrains\ Mono:h14
set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor
set guiheadroom=0 guioptions=aei mouse=a
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
endif

38
cli/.vimrc Normal file
View file

@ -0,0 +1,38 @@
vim9script
set nobackup nomodeline backspace=indent,eol,start foldmethod=marker cursorline
set list listchars=tab:-->,nbsp:x,trail:*
set hlsearch incsearch ignorecase smartcase
set scrolloff=3 sidescrolloff=15 sidescroll=1
set tabstop=3 softtabstop=4 shiftwidth=4 smarttab expandtab autoindent
set wildmenu showcmd ruler laststatus=2 mouse= t_ut= guicursor= t_Co=256
set belloff=all colorcolumn=80 formatoptions+=j relativenumber breakindent
set keymap=russian-jcukenwintype iminsert=0 imsearch=0
&statusline = "[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]"
g:sh_indent_case_labels = 1
g:mapleader = "\<Space>"
# mappings
map <Space> <NOP>
noremap <F1> <Esc>
noremap <Leader>/ :noh<CR>
noremap <Leader>y "+y
noremap <Leader>d "+d
noremap <Leader>p "+p
noremap <Leader>P "+P
noremap q <NOP>
noremap! <F1> <Esc>
noremap! <C-@> <C-^>
noremap! <C-Space> <C-^>
nnoremap <Leader>l :setlocal list!<CR>
nnoremap <Leader>c :setlocal cursorline!<CR>
nnoremap <Leader>w :setlocal wrap!<CR>
g:plugrc = expand('$HOME/.vimplugrc')
g:plugdir = expand('$HOME/.vim/plugged')
g:plug = g:plugdir .. '/vim-plug/plug.vim'
if filereadable(g:plugrc) && filereadable(g:plug) && v:version >= 703
execute 'source' fnameescape(g:plugrc)
endif
syntax on
filetype plugin on

16
cli/.zshrc Normal file
View file

@ -0,0 +1,16 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
confdir=$HOME/.config/zsh
conflist=(
settings.zsh
powerline.zsh
functions.zsh
local.zsh
)
for conf in $conflist; do
[[ -f $confdir/$conf ]] && . $confdir/$conf
done
unset conf confdir conflist