mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-04 16:48:39 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d203fc9d51 | ||
| bf279b6def | |||
| 87926f8d9b | |||
| 6b056f6072 | |||
| 823cdbc07f | |||
| 0f6157eb04 | |||
| 721fe614a7 | |||
| 5ea16d4653 |
@@ -40,7 +40,7 @@ repos:
|
|||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
|
|
||||||
- repo: https://github.com/scop/pre-commit-shfmt
|
- repo: https://github.com/scop/pre-commit-shfmt
|
||||||
rev: v3.10.0-1
|
rev: v3.10.0-2
|
||||||
hooks:
|
hooks:
|
||||||
- id: shfmt
|
- id: shfmt
|
||||||
|
|
||||||
|
|||||||
41
base/bashrc
41
base/bashrc
@@ -18,41 +18,6 @@ x-have antidot && {
|
|||||||
eval "$(antidot init)"
|
eval "$(antidot init)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
PROMPT_DIRTRIM=3
|
||||||
case $- in
|
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
|
||||||
*i*) ;;
|
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
|
||||||
*) return ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# set variable identifying the chroot you work in (used in the prompt below)
|
|
||||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
||||||
debian_chroot=$(cat /etc/debian_chroot)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
||||||
# We have color support; assume it's compliant with Ecma-48
|
|
||||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
|
||||||
# a case would tend to support setf rather than setaf.)
|
|
||||||
color_prompt=yes
|
|
||||||
else
|
|
||||||
color_prompt=
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
|
||||||
else
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
||||||
fi
|
|
||||||
unset color_prompt
|
|
||||||
|
|
||||||
# If this is an xterm set the title to user@host:dir
|
|
||||||
case "$TERM" in
|
|
||||||
xterm* | rxvt*)
|
|
||||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
x-have oh-my-posh && {
|
|
||||||
eval "$(oh-my-posh init bash --config "$DOTFILES/config/omp/own.toml")"
|
|
||||||
}
|
|
||||||
|
|||||||
42
base/zshrc
42
base/zshrc
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
# export VERBOSE=1
|
# export VERBOSE=1
|
||||||
# export DEBUG=1
|
# export DEBUG=1
|
||||||
|
autoload -U promptinit; promptinit
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
LOCAL_SHARE="$HOME/.local/share"
|
LOCAL_SHARE="$HOME/.local/share"
|
||||||
@@ -14,43 +15,9 @@ source "$DOTFILES/config/shared.sh"
|
|||||||
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
|
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
|
||||||
|
|
||||||
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
||||||
eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")"
|
|
||||||
|
|
||||||
load_antidote()
|
source "$DOTFILES/config/zsh/antidote.zsh"
|
||||||
{
|
# source "$DOTFILES/config/zsh/prompt.zsh"
|
||||||
[[ ! -d "$ANTIDOTE_DIR" ]] && {
|
|
||||||
git submodule add \
|
|
||||||
--name antidote \
|
|
||||||
--depth=1 \
|
|
||||||
-f https://github.com/mattmc3/antidote.git "${ANTIDOTE_DIR}"
|
|
||||||
git config -f .gitmodules submodule.antidote.shallow true
|
|
||||||
}
|
|
||||||
|
|
||||||
# Plugin configurations
|
|
||||||
zstyle ':antidote:bundle' use-friendly-names 'yes'
|
|
||||||
zstyle ':omz:plugins:nvm' autoload yes
|
|
||||||
|
|
||||||
# Disable ls colors to avoid issues with eza
|
|
||||||
export DISABLE_LS_COLORS=true
|
|
||||||
zstyle ':omz:plugins:eza' 'dirs-first' yes
|
|
||||||
zstyle ':omz:plugins:eza' 'git-status' yes
|
|
||||||
zstyle ':omz:plugins:eza' 'icons' yes
|
|
||||||
zstyle ':omz:plugins:eza' 'ls' yes
|
|
||||||
zstyle ':omz:plugins:eza' 'prompt' yes
|
|
||||||
|
|
||||||
zsh_plugins=${ANTIDOTE_PLUGINS}
|
|
||||||
[[ -f ${zsh_plugins}.txt ]] || touch ${zsh_plugins}.txt
|
|
||||||
# Lazy-load antidote from its functions directory.
|
|
||||||
FPATH="$ANTIDOTE_DIR/functions:$FPATH"
|
|
||||||
autoload -Uz antidote
|
|
||||||
# Generate a new static file whenever .zsh_plugins.txt is updated.
|
|
||||||
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
|
|
||||||
antidote bundle <${zsh_plugins}.txt >|${zsh_plugins}.zsh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Source your static plugins file.
|
|
||||||
source ${zsh_plugins}.zsh
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to source FZF configuration
|
# Function to source FZF configuration
|
||||||
source_fzf_config()
|
source_fzf_config()
|
||||||
@@ -66,7 +33,7 @@ source_fzf_config()
|
|||||||
setup_tmux_window_name_plugin()
|
setup_tmux_window_name_plugin()
|
||||||
{
|
{
|
||||||
if [[ -n "$TMUX" ]]; then
|
if [[ -n "$TMUX" ]]; then
|
||||||
local tmux_window_name_plugin="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
|
local tmux_window_name_plugin="$TMUX_PLUGINS/tmux-window-name/scripts/rename_session_windows.py"
|
||||||
if [[ -f "$tmux_window_name_plugin" ]]; then
|
if [[ -f "$tmux_window_name_plugin" ]]; then
|
||||||
tmux_window_name()
|
tmux_window_name()
|
||||||
{
|
{
|
||||||
@@ -78,7 +45,6 @@ setup_tmux_window_name_plugin()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
load_antidote
|
|
||||||
source_fzf_config
|
source_fzf_config
|
||||||
setup_tmux_window_name_plugin
|
setup_tmux_window_name_plugin
|
||||||
x-have antidot && eval "$(antidot init)"
|
x-have antidot && eval "$(antidot init)"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ if ! command -v msg &> /dev/null; then
|
|||||||
# $1 - message (string)
|
# $1 - message (string)
|
||||||
msg()
|
msg()
|
||||||
{
|
{
|
||||||
[[ "$VERBOSE" -eq 1 ]] && msgr msg "-> $1"
|
[[ $VERBOSE -eq 1 ]] && msgr msg "-> $1"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
@@ -43,7 +43,7 @@ else
|
|||||||
# Optionally write a msg to stderr suggesting users install bkt.
|
# Optionally write a msg to stderr suggesting users install bkt.
|
||||||
bkt()
|
bkt()
|
||||||
{
|
{
|
||||||
while [[ "$1" == --* ]]; do shift; done
|
while [[ $1 == --* ]]; do shift; done
|
||||||
"$@"
|
"$@"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
@@ -182,6 +182,7 @@ nonascii()
|
|||||||
# Usage: strip_nonascii "string"
|
# Usage: strip_nonascii "string"
|
||||||
strip_nonascii()
|
strip_nonascii()
|
||||||
{
|
{
|
||||||
|
# shellcheck disable=SC2001
|
||||||
echo "$1" | LC_ALL=C sed 's/[^[:print:][:space:]]//g'
|
echo "$1" | LC_ALL=C sed 's/[^[:print:][:space:]]//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +190,7 @@ strip_nonascii()
|
|||||||
# Usage: slugify "string"
|
# Usage: slugify "string"
|
||||||
slugify()
|
slugify()
|
||||||
{
|
{
|
||||||
echo "$1" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
|
echo "$1" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr '[:upper:]' '[:lower:]'
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://stackoverflow.com/a/85932
|
# https://stackoverflow.com/a/85932
|
||||||
@@ -223,11 +224,11 @@ replacable()
|
|||||||
FILE1="$1"
|
FILE1="$1"
|
||||||
FILE2="$2"
|
FILE2="$2"
|
||||||
|
|
||||||
[[ ! -r "$FILE1" ]] && {
|
[[ ! -r $FILE1 ]] && {
|
||||||
[[ $VERBOSE -eq 1 ]] && msgr err "File 1 ($FILE1) does not exist"
|
[[ $VERBOSE -eq 1 ]] && msgr err "File 1 ($FILE1) does not exist"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
[[ ! -r "$FILE2" ]] && {
|
[[ ! -r $FILE2 ]] && {
|
||||||
[[ $VERBOSE -eq 1 ]] && msgr err "File 2 ($FILE2) does not exist, replaceable"
|
[[ $VERBOSE -eq 1 ]] && msgr err "File 2 ($FILE2) does not exist, replaceable"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -235,16 +236,16 @@ replacable()
|
|||||||
FILE1_HASH=$(get_sha256sum "$FILE1")
|
FILE1_HASH=$(get_sha256sum "$FILE1")
|
||||||
FILE2_HASH=$(get_sha256sum "$FILE2")
|
FILE2_HASH=$(get_sha256sum "$FILE2")
|
||||||
|
|
||||||
[[ $FILE1_HASH = "" ]] && {
|
[[ $FILE1_HASH == "" ]] && {
|
||||||
[[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 1 ($FILE1)"
|
[[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 1 ($FILE1)"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
[[ $FILE2_HASH = "" ]] && {
|
[[ $FILE2_HASH == "" ]] && {
|
||||||
[[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 2 ($FILE2), replaceable"
|
[[ $VERBOSE -eq 1 ]] && msgr err "Could not get hash for file 2 ($FILE2), replaceable"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
|
[[ $FILE1_HASH == "$FILE2_HASH" ]] && {
|
||||||
[[ $VERBOSE -eq 1 ]] && msgr ok "Files match, not replaceable: $FILE1"
|
[[ $VERBOSE -eq 1 ]] && msgr ok "Files match, not replaceable: $FILE1"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -293,6 +294,7 @@ export GREP_OPTIONS="--color=auto"
|
|||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
hash shopt 2> /dev/null && shopt -s checkwinsize
|
hash shopt 2> /dev/null && shopt -s checkwinsize
|
||||||
|
|
||||||
|
# shellcheck disable=SC2155
|
||||||
export SHORT_HOST=$(hostname -s)
|
export SHORT_HOST=$(hostname -s)
|
||||||
|
|
||||||
# asdf
|
# asdf
|
||||||
@@ -474,6 +476,7 @@ export TF_PLUGIN_CACHE_DIR="$XDG_CACHE_HOME/terraform/plugin-cache"
|
|||||||
# tmux
|
# tmux
|
||||||
# https://tmux.github.io/
|
# https://tmux.github.io/
|
||||||
msg "Setting up tmux configuration"
|
msg "Setting up tmux configuration"
|
||||||
|
export TMUX_PLUGINS="$XDG_CONFIG_HOME/tmux/plugins"
|
||||||
export TMUX_CONF="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
export TMUX_CONF="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
||||||
## These settings are for zsh-tmux
|
## These settings are for zsh-tmux
|
||||||
export ZSH_TMUX_AUTOSTART=false
|
export ZSH_TMUX_AUTOSTART=false
|
||||||
@@ -502,6 +505,7 @@ X_EXPORTS_FILES=(
|
|||||||
"$HOME/.config/exports-$(hostname)-secret"
|
"$HOME/.config/exports-$(hostname)-secret"
|
||||||
)
|
)
|
||||||
for exportFile in "${X_EXPORTS_FILES[@]}"; do
|
for exportFile in "${X_EXPORTS_FILES[@]}"; do
|
||||||
|
# shellcheck source=$HOME/.config/exports-secret
|
||||||
[ -f "$exportFile" ] && source "$exportFile" && msg "Sourced $exportFile"
|
[ -f "$exportFile" ] && source "$exportFile" && msg "Sourced $exportFile"
|
||||||
done
|
done
|
||||||
unset X_EXPORTS_FILES
|
unset X_EXPORTS_FILES
|
||||||
|
|||||||
@@ -68,4 +68,10 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|||||||
callback = function() vim.opt_local.conceallevel = 0 end,
|
callback = function() vim.opt_local.conceallevel = 0 end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||||
|
desc = 'Set filetype for SSH config directory',
|
||||||
|
pattern = '*/?.ssh/{config|shared}.d/*',
|
||||||
|
command = 'set filetype=sshconfig',
|
||||||
|
})
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -16,6 +16,24 @@ return {
|
|||||||
-- Replaced kylechui/nvim-surround
|
-- Replaced kylechui/nvim-surround
|
||||||
{ 'echasnovski/mini.surround', version = '*', opts = {} },
|
{ 'echasnovski/mini.surround', version = '*', opts = {} },
|
||||||
|
|
||||||
|
-- Move lines and blocks of text
|
||||||
|
{ 'echasnovski/mini.move', version = '*', opts = {} },
|
||||||
|
|
||||||
|
-- Jump to next/previous single character
|
||||||
|
{
|
||||||
|
'echasnovski/mini.jump',
|
||||||
|
version = '*',
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
forward = 'f',
|
||||||
|
backward = 'F',
|
||||||
|
forward_till = 't',
|
||||||
|
backward_till = 'T',
|
||||||
|
repeat_jump = ';',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Icons
|
-- Icons
|
||||||
{
|
{
|
||||||
'echasnovski/mini.icons',
|
'echasnovski/mini.icons',
|
||||||
@@ -30,6 +48,9 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Highlight cursor word and its matches
|
||||||
|
{ 'echasnovski/mini.cursorword', version = '*' },
|
||||||
|
|
||||||
-- Split and join arguments, lists, and other sequences
|
-- Split and join arguments, lists, and other sequences
|
||||||
-- Replaced Wansmer/treesj
|
-- Replaced Wansmer/treesj
|
||||||
{ 'echasnovski/mini.splitjoin', version = '*', opts = {} },
|
{ 'echasnovski/mini.splitjoin', version = '*', opts = {} },
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ return {
|
|||||||
'kevinhwang91/nvim-ufo',
|
'kevinhwang91/nvim-ufo',
|
||||||
version = '*',
|
version = '*',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'neovim/nvim-lspconfig' },
|
|
||||||
{ 'kevinhwang91/promise-async' },
|
{ 'kevinhwang91/promise-async' },
|
||||||
{ 'nvim-treesitter/nvim-treesitter' },
|
{ 'nvim-treesitter/nvim-treesitter' },
|
||||||
{
|
{
|
||||||
@@ -61,19 +60,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities.textDocument.foldingRange = {
|
|
||||||
dynamicRegistration = true,
|
|
||||||
lineFoldingOnly = true,
|
|
||||||
}
|
|
||||||
local language_servers = require('lspconfig').util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
|
||||||
for _, ls in ipairs(language_servers) do
|
|
||||||
require('lspconfig')[ls].setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
-- you can add other fields for setting up lsp server in this table
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
require('ufo').setup {
|
require('ufo').setup {
|
||||||
open_fold_hl_timeout = 150,
|
open_fold_hl_timeout = 150,
|
||||||
close_fold_kinds_for_ft = { 'imports', 'comment' },
|
close_fold_kinds_for_ft = { 'imports', 'comment' },
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Neovim plugin to animate the cursor with a smear effect in all terminals
|
||||||
|
-- https://github.com/sphamba/smear-cursor.nvim
|
||||||
|
{ 'sphamba/smear-cursor.nvim', opts = {} },
|
||||||
|
|
||||||
-- A neovim plugin that shows colorcolumn dynamically
|
-- A neovim plugin that shows colorcolumn dynamically
|
||||||
-- https://github.com/Bekaboo/deadcolumn.nvim
|
-- https://github.com/Bekaboo/deadcolumn.nvim
|
||||||
{ 'Bekaboo/deadcolumn.nvim' },
|
{ 'Bekaboo/deadcolumn.nvim' },
|
||||||
|
|||||||
@@ -140,6 +140,12 @@ return {
|
|||||||
desc = 'Telescope import',
|
desc = 'Telescope import',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'<leader>f',
|
||||||
|
'<cmd>Telescope find_files<cr>',
|
||||||
|
desc = 'Find files',
|
||||||
|
},
|
||||||
|
|
||||||
-- ── Harpoon ─────────────────────────────────────────────────────────
|
-- ── Harpoon ─────────────────────────────────────────────────────────
|
||||||
-- See: lua/plugins/telescope.lua
|
-- See: lua/plugins/telescope.lua
|
||||||
{ '<leader>h', group = '[h] Harpoon' },
|
{ '<leader>h', group = '[h] Harpoon' },
|
||||||
@@ -196,6 +202,11 @@ return {
|
|||||||
'<cmd>Telescope diagnostics<cr>',
|
'<cmd>Telescope diagnostics<cr>',
|
||||||
desc = 'Search Diagnostics',
|
desc = 'Search Diagnostics',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'<leader>sf',
|
||||||
|
'<cmd>Telescope find_files<cr>',
|
||||||
|
desc = 'Find files',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'<leader>sg',
|
'<leader>sg',
|
||||||
'<cmd>Telescope live_grep<cr>',
|
'<cmd>Telescope live_grep<cr>',
|
||||||
@@ -293,6 +304,11 @@ return {
|
|||||||
'<cmd>TransparentToggle<CR>',
|
'<cmd>TransparentToggle<CR>',
|
||||||
desc = 'Toggle Transparency',
|
desc = 'Toggle Transparency',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'<leader>tl',
|
||||||
|
'<cmd>exec &bg=="light"? "set bg=dark" : "set bg=light"<CR>',
|
||||||
|
desc = 'Toggle Light/Dark Theme',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- ── Workspace ───────────────────────────────────────────────────────
|
-- ── Workspace ───────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"
|
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"
|
||||||
console_title_template = '{{.UserName}}@{{.HostName}} {{.Shell}} in {{.PWD}}'
|
console_title_template = '{{.UserName}}@{{.HostName}} {{.Shell}} in {{.PWD}}'
|
||||||
version = 3
|
version = 3
|
||||||
auto_upgrade = true
|
auto_upgrade = false
|
||||||
final_space = true
|
final_space = true
|
||||||
|
|
||||||
[transient_prompt]
|
[transient_prompt]
|
||||||
|
|||||||
52
config/zsh/antidote.zsh
Executable file
52
config/zsh/antidote.zsh
Executable file
@@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Setup antidote for Oh My Zsh
|
||||||
|
# vim: ft=zsh et sw=2 ts=2
|
||||||
|
|
||||||
|
[[ -z "$DOTFILES" ]] && DOTFILES="$HOME/.dotfiles"
|
||||||
|
[[ -z "$ANTIDOTE_DIR" ]] && ANTIDOTE_DIR="$DOTFILES/tools/antidote"
|
||||||
|
[[ -z "$ANTIDOTE_HOME" ]] && ANTIDOTE_HOME="$XDG_CACHE_HOME/antidote"
|
||||||
|
[[ -z "$ANTIDOTE_PLUGINS" ]] && ANTIDOTE_PLUGINS="$XDG_CONFIG_HOME/zsh/antidote_plugins"
|
||||||
|
|
||||||
|
[[ ! -d "$ANTIDOTE_DIR" ]] && {
|
||||||
|
git submodule add \
|
||||||
|
--name antidote \
|
||||||
|
--depth=1 \
|
||||||
|
-f https://github.com/mattmc3/antidote.git "${ANTIDOTE_DIR}"
|
||||||
|
git config -f .gitmodules submodule.antidote.shallow true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Plugin configurations
|
||||||
|
zstyle ':antidote:bundle' use-friendly-names 'yes'
|
||||||
|
zstyle ':omz:update' mode reminder
|
||||||
|
zstyle ':omz:plugins:nvm' autoload yes
|
||||||
|
|
||||||
|
# Pure prompt settings
|
||||||
|
export PURE_PROMPT_SYMBOL='➜'
|
||||||
|
export PURE_GIT_UNTRACKED_DIRTY=0
|
||||||
|
zstyle ':prompt:pure:git:stash' show yes
|
||||||
|
zstyle ':prompt:pure:execution_time' show no
|
||||||
|
zstyle ':prompt:pure:user' color magenta
|
||||||
|
zstyle ':prompt:pure:user:root' color red
|
||||||
|
zstyle ':prompt:pure:host' color green
|
||||||
|
zstyle ':prompt:pure:path' color white
|
||||||
|
zstyle ':prompt:pure:prompt:success' color green
|
||||||
|
zstyle ':prompt:pure:prompt:error' color red
|
||||||
|
|
||||||
|
# Disable ls colors to avoid issues with eza
|
||||||
|
export DISABLE_LS_COLORS=true
|
||||||
|
zstyle ':omz:plugins:eza' 'dirs-first' yes
|
||||||
|
zstyle ':omz:plugins:eza' 'git-status' yes
|
||||||
|
zstyle ':omz:plugins:eza' 'icons' yes
|
||||||
|
zstyle ':omz:plugins:eza' 'ls' yes
|
||||||
|
zstyle ':omz:plugins:eza' 'prompt' yes
|
||||||
|
|
||||||
|
[[ -f "${ANTIDOTE_PLUGINS}.txt" ]] || touch "${ANTIDOTE_PLUGINS}.txt"
|
||||||
|
FPATH="$ANTIDOTE_DIR/functions:$FPATH"
|
||||||
|
autoload -Uz antidote
|
||||||
|
if [[ ! "${ANTIDOTE_PLUGINS}.zsh" -nt "${ANTIDOTE_PLUGINS}.txt" ]]; then
|
||||||
|
antidote bundle <"${ANTIDOTE_PLUGINS}.txt" >|"${ANTIDOTE_PLUGINS}.zsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Source your static plugins file.
|
||||||
|
# shellcheck source=$HOME/.dotfiles/config/zsh/antidote_plugins.zsh
|
||||||
|
source "${ANTIDOTE_PLUGINS}.zsh"
|
||||||
@@ -10,6 +10,10 @@ zsh-users/zsh-completions kind:fpath path:src
|
|||||||
getantidote/use-omz # handle OMZ dependencies
|
getantidote/use-omz # handle OMZ dependencies
|
||||||
ohmyzsh/ohmyzsh path:lib # load OMZ's library
|
ohmyzsh/ohmyzsh path:lib # load OMZ's library
|
||||||
|
|
||||||
|
# Use pure prompt
|
||||||
|
mafredri/zsh-async
|
||||||
|
sindresorhus/pure
|
||||||
|
|
||||||
ohmyzsh/ohmyzsh path:plugins/colored-man-pages
|
ohmyzsh/ohmyzsh path:plugins/colored-man-pages
|
||||||
ohmyzsh/ohmyzsh path:plugins/brew
|
ohmyzsh/ohmyzsh path:plugins/brew
|
||||||
ohmyzsh/ohmyzsh path:plugins/extract
|
ohmyzsh/ohmyzsh path:plugins/extract
|
||||||
@@ -20,7 +24,6 @@ ohmyzsh/ohmyzsh path:plugins/golang
|
|||||||
ohmyzsh/ohmyzsh path:plugins/gpg-agent
|
ohmyzsh/ohmyzsh path:plugins/gpg-agent
|
||||||
ohmyzsh/ohmyzsh path:plugins/nvm
|
ohmyzsh/ohmyzsh path:plugins/nvm
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
ohmyzsh/ohmyzsh path:plugins/python
|
||||||
# ohmyzsh/ohmyzsh path:plugins/ssh-agent
|
|
||||||
ohmyzsh/ohmyzsh path:plugins/tmux
|
ohmyzsh/ohmyzsh path:plugins/tmux
|
||||||
ohmyzsh/ohmyzsh path:plugins/z
|
ohmyzsh/ohmyzsh path:plugins/z
|
||||||
|
|
||||||
@@ -35,4 +38,4 @@ jreese/zsh-titles
|
|||||||
yuki-ycino/tms
|
yuki-ycino/tms
|
||||||
|
|
||||||
# This needs to be last bundle
|
# This needs to be last bundle
|
||||||
zsh-users/zsh-syntax-highlighting
|
# zsh-users/zsh-syntax-highlighting
|
||||||
|
|||||||
57
config/zsh/prompt.zsh
Executable file
57
config/zsh/prompt.zsh
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Setup prompt
|
||||||
|
# vim: ft=zsh:
|
||||||
|
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
|
||||||
|
# Setup vcs_info
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
zstyle ':vcs_info:*' enable git
|
||||||
|
zstyle ':vcs_info:*' max-exports 2
|
||||||
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
|
zstyle ':vcs_info:*' check-for-staged-changes true
|
||||||
|
zstyle ':vcs_info:*' use-simple true
|
||||||
|
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
|
||||||
|
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
|
||||||
|
|
||||||
|
zstyle ':vcs_info:*' formats '%F{5}%F{2}%b%c%u%F{5}%f '
|
||||||
|
zstyle ':vcs_info:*' actionformats '%F{5}%F{2}%b%F{3}|%F{1}%a%c%u%F{5}%f '
|
||||||
|
|
||||||
|
theme_precmd () {
|
||||||
|
vcs_info
|
||||||
|
}
|
||||||
|
|
||||||
|
export NL=$'\n'
|
||||||
|
|
||||||
|
# Set defaults for display.
|
||||||
|
# We want the host always, but only the user if we are in an SSH session or root.
|
||||||
|
P_HOST="%F{green}%m%f"
|
||||||
|
P_USER=''
|
||||||
|
|
||||||
|
# If we are in an SSH session, we want to show the username
|
||||||
|
[[ "$SSH_CONNECTION" != '' ]] && P_USER="%{${fg}[magenta]%}%n%f"
|
||||||
|
|
||||||
|
# If we are root, color the user name differently
|
||||||
|
[[ $UID -eq 0 ]] && P_USER="%{${fg}[red]%}%n%f"
|
||||||
|
|
||||||
|
# If P_USER is set, suffix user with @ giving us user@host
|
||||||
|
[[ -n "$P_USER" ]] && P_USER="$P_USER@"
|
||||||
|
|
||||||
|
# Combine the prompt parts. Could be just the host, or user@host.
|
||||||
|
P_PREFIX="$P_USER$P_HOST"
|
||||||
|
|
||||||
|
# Set the color of the current directory
|
||||||
|
P_DIR="%F{blue}%~%f"
|
||||||
|
|
||||||
|
# Change the color of the prompt if the last command failed
|
||||||
|
P_SHELL="%(?.%F{green}.%F{red})➜%f"
|
||||||
|
|
||||||
|
# Any extras we want to display
|
||||||
|
P_EXTRA=""
|
||||||
|
|
||||||
|
# Set the prompt
|
||||||
|
# user@host /path/to/current/dir (branch) ➜
|
||||||
|
export PROMPT="${P_PREFIX} ${P_DIR} %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}%{${P_EXTRA}%}${NL}${P_SHELL} "
|
||||||
|
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
add-zsh-hook precmd theme_precmd
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
~/.local/share/gnupg:
|
~/.local/share/gnupg:
|
||||||
mode: 0700
|
mode: 0700
|
||||||
~/.local/state:
|
~/.local/state:
|
||||||
|
~/.local/state/zsh:
|
||||||
~/.ssh:
|
~/.ssh:
|
||||||
mode: 0700
|
mode: 0700
|
||||||
~/.ssh/local.d:
|
~/.ssh/local.d:
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# demons
|
||||||
|
# vim: ft=sshconfig
|
||||||
|
|
||||||
Host vine
|
Host vine
|
||||||
User ubuntu
|
User ubuntu
|
||||||
HostName vine.antiprocess.net
|
HostName vine.antiprocess.net
|
||||||
@@ -13,3 +16,7 @@ Host paimon
|
|||||||
HostName paimon.antiprocess.net
|
HostName paimon.antiprocess.net
|
||||||
IdentityFile ~/.ssh/id_rsa
|
IdentityFile ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
Host baal
|
||||||
|
User ivuorinen
|
||||||
|
HostName baal.antiprocess.net
|
||||||
|
IdentityFile ~/.ssh/id_rsa
|
||||||
|
|||||||
Reference in New Issue
Block a user