summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bash_logout3
-rw-r--r--.bash_profile13
-rw-r--r--.bashrc14
-rw-r--r--.config/gdb/gdbinit1
-rw-r--r--.config/git/ignore40
-rw-r--r--.config/htop/htoprc28
-rw-r--r--.lesskey1
-rwxr-xr-x.local/bin/dedup2
-rwxr-xr-x.local/bin/e2
-rwxr-xr-x.local/bin/http-dir29
-rwxr-xr-x.local/bin/p4
-rwxr-xr-x.local/bin/sh-prompt23
-rwxr-xr-x.local/bin/v5
-rw-r--r--.local/share/flatpak/overrides/org.mozilla.firefox5
-rw-r--r--.profile37
-rw-r--r--.shrc80
-rw-r--r--.vimrc6
-rw-r--r--.zfunc/bell3
-rw-r--r--.zfunc/e3
-rw-r--r--.zfunc/osc7_prompt5
-rw-r--r--.zfunc/p3
-rw-r--r--.zfunc/prompt_marc_setup28
-rw-r--r--.zfunc/set-title29
-rw-r--r--.zfunc/v4
-rw-r--r--.zprofile11
-rw-r--r--.zshenv29
-rw-r--r--.zshrc63
27 files changed, 319 insertions, 152 deletions
diff --git a/.bash_logout b/.bash_logout
index af7c6fd..0e4e4f1 100644
--- a/.bash_logout
+++ b/.bash_logout
@@ -1,2 +1,3 @@
+#
# ~/.bash_logout
-
+#
diff --git a/.bash_profile b/.bash_profile
index 82ea3c8..ad8dc45 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -1,9 +1,6 @@
-#!/bin/bash -l
+#
+# ~/.bash_profile
+#
-for i in ~/.profile ~/.bashrc
-do
- if test -f "$i"
- then
- . "$i"
- fi
-done
+[[ -f ~/.profile ]] && . ~/.profile
+[[ -f ~/.bashrc ]] && . ~/.bashrc
diff --git a/.bashrc b/.bashrc
index 00ec194..60e5681 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,14 +1,2 @@
-#!/bin/bash -i
-case $- in
- *i*) ;;
-
- *)
- return
- ;;
-esac
-
-if test -f ~/.shrc
-then
- . ~/.shrc
-fi
+. "$ENV"
diff --git a/.config/gdb/gdbinit b/.config/gdb/gdbinit
index e69de29..59c2164 100644
--- a/.config/gdb/gdbinit
+++ b/.config/gdb/gdbinit
@@ -0,0 +1 @@
+set debuginfod enabled on
diff --git a/.config/git/ignore b/.config/git/ignore
index 818007b..16d3c4d 100644
--- a/.config/git/ignore
+++ b/.config/git/ignore
@@ -1,39 +1 @@
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-
-# .nfs files are created when an open file is removed but is still being accessed
-.nfs
-
-#vim
-# Swap
-[._]*.s[a-v][a-z]
-!*.svg # comment out if you don't need vector files
-[._]*.sw[a-p]
-[._]s[a-rt-v][a-z]
-[._]ss[a-gi-z]
-[._]sw[a-p]
-
-# Session
-Session.vim
-Sessionx.vim
-
-# Temporary
-.netrwhist
-*~
-# Auto-generated tag files
-tags
-# Persistent undo
-[._]*.un~
-
-#Kate
-# Swap Files #
-.*.kate-swp
-.swp.*
+.cache
diff --git a/.config/htop/htoprc b/.config/htop/htoprc
index abebfe6..06fc74b 100644
--- a/.config/htop/htoprc
+++ b/.config/htop/htoprc
@@ -1,29 +1,31 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
-htop_version=3.2.1
+htop_version=3.2.2
config_reader_min_version=3
fields=0 48 17 18 38 39 40 2 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=1
+hide_running_in_container=0
shadow_other_users=0
-show_thread_names=0
+show_thread_names=1
show_program_path=1
-highlight_base_name=0
+highlight_base_name=1
highlight_deleted_exe=1
+shadow_distribution_path_prefix=0
highlight_megabytes=1
highlight_threads=1
highlight_changes=0
highlight_changes_delay_secs=5
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
-show_merged_command=0
+show_merged_command=1
header_margin=1
screen_tabs=1
detailed_cpu_time=0
cpu_count_from_one=0
show_cpu_usage=1
-show_cpu_frequency=0
-show_cpu_temperature=0
+show_cpu_frequency=1
+show_cpu_temperature=1
degree_fahrenheit=0
update_process_names=0
account_guest_in_cpu_meter=0
@@ -36,22 +38,22 @@ column_meters_0=LeftCPUs Memory Swap
column_meter_modes_0=1 1 1
column_meters_1=RightCPUs Tasks LoadAverage Uptime
column_meter_modes_1=1 2 2 2
-tree_view=1
-sort_key=47
-tree_sort_key=47
+tree_view=0
+sort_key=46
+tree_sort_key=46
sort_direction=-1
tree_sort_direction=-1
tree_view_always_by_pid=0
all_branches_collapsed=0
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
-.sort_key=PERCENT_MEM
-.tree_sort_key=PERCENT_MEM
-.tree_view=1
+.sort_key=PERCENT_CPU
+.tree_sort_key=PERCENT_CPU
+.tree_view=0
.tree_view_always_by_pid=0
.sort_direction=-1
.tree_sort_direction=-1
.all_branches_collapsed=0
-screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE
+screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command
.sort_key=IO_RATE
.tree_sort_key=PID
.tree_view=0
diff --git a/.lesskey b/.lesskey
index cd5e2f8..a06933f 100644
--- a/.lesskey
+++ b/.lesskey
@@ -1,3 +1,4 @@
#env
LESS=-MRF~
LESSCHARSET=UTF-8
+LESSHISTFILE=-
diff --git a/.local/bin/dedup b/.local/bin/dedup
index 912cb95..69913ce 100755
--- a/.local/bin/dedup
+++ b/.local/bin/dedup
@@ -1,3 +1,3 @@
#!/usr/bin/awk -f
-!a[$0]++
+!seen[$0]++
diff --git a/.local/bin/e b/.local/bin/e
index e341837..cab6db4 100755
--- a/.local/bin/e
+++ b/.local/bin/e
@@ -1,3 +1,3 @@
#!/bin/sh --
-exec "${EDITOR:-ed}" "$@"
+"${EDITOR:-ed}" "$@"
diff --git a/.local/bin/http-dir b/.local/bin/http-dir
deleted file mode 100755
index a1dd19d..0000000
--- a/.local/bin/http-dir
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python3
-
-import argparse
-import http.server
-import os
-import sys
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument('--bind', '-b', metavar='ADDRESS',default='', help='specify alternate bind address (default: all interfaces)')
- parser.add_argument('--directory', '-d', default=os.getcwd(), help='specify alternate directory (default: current directory)')
- parser.add_argument('port', action='store', default=8000, type=int,
- nargs='?', help='specify alternate port (default: 8000)')
- args = parser.parse_args()
-
- class app(http.server.SimpleHTTPRequestHandler):
- def __init__(self, request, client_address, server):
- super().__init__(request, client_address, server, directory=args.directory)
-
- with http.server.ThreadingHTTPServer((args.bind, args.port), app) as httpd:
- try:
- httpd.serve_forever()
- except KeyboardInterrupt:
- sys.exit()
-
-
-
-if __name__ == '__main__':
- main()
diff --git a/.local/bin/p b/.local/bin/p
index 3b2aef1..7951699 100755
--- a/.local/bin/p
+++ b/.local/bin/p
@@ -1,3 +1,3 @@
-#!/bin/sh --
+#!/bin/sh --
-exec "${PAGER:-less}" "$@"
+"${PAGER:-more}" "$@"
diff --git a/.local/bin/sh-prompt b/.local/bin/sh-prompt
index ebc1057..389dd3c 100755
--- a/.local/bin/sh-prompt
+++ b/.local/bin/sh-prompt
@@ -1,3 +1,24 @@
#!/bin/sh --
-printf "%u %s@%s %s $ " "$1" "$(id -un)" "$(uname -n)" "$(pwd|sed 's|'"$HOME"'|~|g')"
+(
+ save="$(stty -g)"
+ stty sane
+ tput sgr0
+# tput rmcup
+ if test "${VTE_VERSION:-0}" -ge 3405
+ then
+ printf "\x1b]7;file://%s%s\x1b\\" "$(uname)" "$(pwd)"
+ fi
+ set-title "$(printf "%s@%s:%s" "$(id -un)" "$(uname -n)" "$(pwd|sed 's|'"$HOME"'|~|g')")"
+ stty "$save"
+) > /dev/tty
+
+case "$(id -u)" in
+ 0)
+ PS='#'
+ ;;
+ *)
+ PS='$'
+esac
+
+printf "%u %s@%s:%s %c " "$1" "$(id -un)" "$(uname -n)" "$(pwd -L|sed 's|'"$HOME"'|~|g')" "$PS"
diff --git a/.local/bin/v b/.local/bin/v
index 9a5f35f..0d79e15 100755
--- a/.local/bin/v
+++ b/.local/bin/v
@@ -1,4 +1,3 @@
-#!/bin/sh --
-
-"${VISUAL:-${EDITOR:-vi}}" "$@"
+#!/bin/sh
+"${VISUAL:-vi}" "$@"
diff --git a/.local/share/flatpak/overrides/org.mozilla.firefox b/.local/share/flatpak/overrides/org.mozilla.firefox
deleted file mode 100644
index 3f5fa93..0000000
--- a/.local/share/flatpak/overrides/org.mozilla.firefox
+++ /dev/null
@@ -1,5 +0,0 @@
-[Context]
-sockets=fallback-x11;!x11
-
-[Environment]
-MOZ_ENABLE_WAYLAND=1
diff --git a/.profile b/.profile
index 660cbf6..c5eaf60 100644
--- a/.profile
+++ b/.profile
@@ -1,10 +1,37 @@
#!/bin/sh -l
-export EDITOR=ex
-export VISUAL=vim
-export PAGER=less
+if command -v nvim > /dev/null
+then
+ export VISUAL=nvim
+elif command -v vim > /dev/null
+then
+ export VISUAL=vim
+elif command -v vi > /dev/null
+then
+ export VISUAL=vi
+fi
-PATH="$HOME/.local/bin:$HOME/.local/opt/flutter/bin:$HOME/.local/opt/android-studio/bin:$PATH"
+if command -v ex > /dev/null
+then
+ export EDITOR=ex
+elif command -v ed > /dev/null
+then
+ export EDITOR=ed
+fi
+export FCEDIT="$VISUAL"
-export ENV="$HOME/.shrc"
+if command -v less > /dev/null
+then
+ export PAGER=less
+elif command -v more > /dev/null
+then
+ export PAGER=more
+fi
+if test -r "$HOME"/.shrc
+then
+ export ENV="$HOME"/.shrc
+fi
+
+PATH=$HOME/.nodenv/bin:$HOME/.pyenv/bin:$HOME/.local/bin/:$PATH
+export MANPATH="$HOME"/.local/share/man:
diff --git a/.shrc b/.shrc
index 03ece67..30aa340 100644
--- a/.shrc
+++ b/.shrc
@@ -13,47 +13,65 @@ set -o nounset
set -o noclobber
set -o ignoreeof
-PS1='$(sh-prompt $?)'
-PS2="> "
-PS3='? '
-PS4='+ '
-
-HISTSIZE=65535
-HISTFILE=/dev/null
-
-du(){
+unalias du 2> /dev/null
+du() (
set -- -k "$@"
- command du "$@"
-}
+ exec du "$@"
+)
-df(){
+unalias df 2> /dev/null
+df() (
set -- -k "$@"
- command df "$@"
-}
+ exec df "$@"
+)
-egrep() {
- set -- -E "$@"
- grep "$@"
-}
+unalias ls 2> /dev/null
+ls() (
+ set -- -Fkq "$@"
+ exec ls "$@"
+)
-fgrep() {
- set -- -F "$@"
- grep "$@"
-}
+for cmd in egrep fgrep dir vdir which
+do
+ unalias "$cmd" 2> /dev/null
+ if command -v "$cmd" > /dev/null
+ then
+ eval "$(cat <<-EOF
+ $cmd(){
+ printf "%s: %s: command is disabled.\n" \
+ "$0" "$cmd" >&2
+ return 1
+ }
+ EOF
+ )"
+ fi
+done
-ls(){
- set -- -Fk "$@"
- command ls "$@"
-}
+sudo() (
+ command sudo -nv 2> /dev/null
+ exec sudo "$@"
+)
-venvon(){
- . "${1:-venv}/bin/activate"
-}
+sudoedit() (
+ sudo -e "$@"
+)
+
+if command -v pyenv > /dev/null
+then
+ eval "$(pyenv init -)"
+fi
-if test -n ${TTY-} && test -t 0
+if command -v nodenv > /dev/null
+then
+ eval "$(nodenv init -)"
+fi
+
+if test -n "${TTY-}" && test -t 0
then
TTY=$(tty)
export TTY
- export GPG_TTY=$TTY
+ export GPG_TTY="$TTY"
fi
+PS1='$(sh-prompt $?)'
+
diff --git a/.vimrc b/.vimrc
index ec9f488..d06b8c8 100644
--- a/.vimrc
+++ b/.vimrc
@@ -8,6 +8,12 @@ set errorbells
set belloff=
set title
+noremap <Up> <Nop>
+noremap <Down> <Nop>
+noremap <Left> <Nop>
+noremap <Right> <Nop>
+set clipboard+=unnamedplus
+
set swapfile
set directory^=~/.vim/swap//
set writebackup
diff --git a/.zfunc/bell b/.zfunc/bell
new file mode 100644
index 0000000..cc01adc
--- /dev/null
+++ b/.zfunc/bell
@@ -0,0 +1,3 @@
+#!zsh
+
+echoti bel
diff --git a/.zfunc/e b/.zfunc/e
new file mode 100644
index 0000000..c714d76
--- /dev/null
+++ b/.zfunc/e
@@ -0,0 +1,3 @@
+#!zsh
+
+"${EDITOR:-ed}" "$@"
diff --git a/.zfunc/osc7_prompt b/.zfunc/osc7_prompt
new file mode 100644
index 0000000..28d7a42
--- /dev/null
+++ b/.zfunc/osc7_prompt
@@ -0,0 +1,5 @@
+#!zsh
+emulate -L zsh
+
+printf "\e]7;file://%s%s\e\\" "${HOSTNAME}" "$(/usr/lib/vte-urlencode-cwd)"
+
diff --git a/.zfunc/p b/.zfunc/p
new file mode 100644
index 0000000..59115b7
--- /dev/null
+++ b/.zfunc/p
@@ -0,0 +1,3 @@
+#!zsh
+
+${PAGER:-less} "$@"
diff --git a/.zfunc/prompt_marc_setup b/.zfunc/prompt_marc_setup
new file mode 100644
index 0000000..834b233
--- /dev/null
+++ b/.zfunc/prompt_marc_setup
@@ -0,0 +1,28 @@
+#!zsh
+emulate -L zsh
+
+prompt_marc_precmd() {
+ vcs_info
+ RPS1="%B$vcs_info_msg_0_%b"
+ set-title "$(print -Pn "%n@%m %~")"
+}
+
+prompt_marc_preexec() {
+ set-title "$(print -Pn "%n@%m %~ %# ")${1}"
+}
+
+prompt_marc_setup () {
+ autoload -Uz vcs_info set-title
+ add-zsh-hook precmd prompt_marc_precmd
+ add-zsh-hook preexec prompt_marc_preexec
+
+ zstyle ':vcs_info:*' check-for-changes true
+ zstyle ':vcs_info:*' get-revision true
+ zstyle ':vcs_info:*' formats "%s:%R|%S@%b %m%u%c"
+ zstyle ':vcs_info:*' actionformats "%s:%r|%S@%b (%a) %m%u%c"
+
+ prompt_opts=( )
+ PS1='%B%? %n@%M:%~ %# %b'
+}
+
+prompt_marc_setup "$@"
diff --git a/.zfunc/set-title b/.zfunc/set-title
new file mode 100644
index 0000000..ae46b5a
--- /dev/null
+++ b/.zfunc/set-title
@@ -0,0 +1,29 @@
+#!zsh
+emulate -L zsh
+
+if tput hs
+then
+ tsl="$(tput tsl)"
+ fsl="$(tput fsl)"
+ hs=1
+else
+ case ${TERM} in
+ xterm*|rxvt*)
+ tsl="$(printf "\x1b]0;")"
+ fsl="$(printf "\a")"
+ hs=1
+ ;;
+ screen*)
+ tsl="$(printf "\x1b_")"
+ fsl="$(printf "\x1b\\")"
+ hs=1
+ ;;
+ esac
+fi
+
+if test "$hs" = 1
+then
+ printf "%s" "$tsl"
+ printf "%s" "$@"
+ printf "%s" "$fsl"
+fi
diff --git a/.zfunc/v b/.zfunc/v
new file mode 100644
index 0000000..a223795
--- /dev/null
+++ b/.zfunc/v
@@ -0,0 +1,4 @@
+#!zsh
+
+"${VISUAL:-${EDITOR:-vi}}" "$@"
+
diff --git a/.zprofile b/.zprofile
new file mode 100644
index 0000000..d27a1be
--- /dev/null
+++ b/.zprofile
@@ -0,0 +1,11 @@
+
+typeset -U PATH path
+
+path=( $HOME/.local/bin $path )
+
+if test -d /usr/lib/flatpak-xdg-utils/
+then
+ path=( /usr/lib/flatpak-xdg-utils $path )
+fi
+
+export PATH
diff --git a/.zshenv b/.zshenv
new file mode 100644
index 0000000..0b62efa
--- /dev/null
+++ b/.zshenv
@@ -0,0 +1,29 @@
+if command -v nvim > /dev/null
+then
+ export VISUAL=nvim
+elif command -v vim > /dev/null
+then
+ export VISUAL=vim
+elif command -v vi > /dev/null
+then
+ export VISUAL=vi
+fi
+
+if command -v ex > /dev/null
+then
+ export EDITOR=nvim
+elif command -v ed > /dev/null
+then
+ export EDITOR=vim
+fi
+
+if command -v less > /dev/null
+then
+ export PAGER=less
+elif command -v more > /dev/null
+then
+ export PAGER=more
+fi
+
+ NULLCMD=${PAGER:-cat}
+ READNULLCMD=${PAGER:-more}
diff --git a/.zshrc b/.zshrc
new file mode 100644
index 0000000..d31cbf3
--- /dev/null
+++ b/.zshrc
@@ -0,0 +1,63 @@
+#!/usr/bin/zsh -i
+
+zmodload zsh/zprof
+
+bindkey -v
+autoload -Uz edit-command-line
+zle -N edit-command-line
+bindkey -M vicmd v edit-command-line
+
+HISTFILE=~/.histfile
+HISTSIZE=1000
+SAVEHIST=1000
+setopt hist_ignore_all_dups hist_save_no_dups hist_reduce_blanks share_history extended_history
+
+fpath=(~/.zfunc $fpath)
+
+autoload -Uz compinit promptinit
+zmodload zsh/complist
+zstyle ':completion:*' menu select
+zstyle ':completion:*' group-name ''
+zstyle ':completion:*' completer _extensions _expand_alias _complete _approximate
+zstyle ':completion:*:*:*:*:descriptions' format '%B%d%b'
+zstyle ':completion:*:*:*:*:corrections' format '%B%d (errors: %e)%b'
+zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
+zstyle ':completion:*' complete-options true
+zstyle ':completion:*' rehash true
+zstyle ':completion:*:*:-command-:*:*' group-order alias builtins functions commands
+compinit
+
+bindkey -M menuselect 'h' vi-backward-char
+bindkey -M menuselect 'k' vi-up-line-or-history
+bindkey -M menuselect 'l' vi-forward-char
+bindkey -M menuselect 'j' vi-down-line-or-history
+
+promptinit
+prompt marc
+add-zsh-hook -Uz precmd osc7_prompt
+
+
+setopt no_clobber
+setopt extendedglob
+
+setopt auto_cd auto_pushd pushd_silent pushd_to_home pushd_ignore_dups
+pushd .
+
+autoload -Uz run-help
+(( ${+aliases[run-help]} )) && unalias run-help
+alias help=run-help
+
+autoload -Uz e v p bell
+
+path=( ~/.pyenv/bin ~/.nodenv/bin $path )
+
+if command -v pyenv > /dev/null
+then
+ eval "$(pyenv init -)"
+fi
+
+if command -v nodenv > /dev/null
+then
+ eval "$(nodenv init -)"
+fi
+