Skip to content

Instantly share code, notes, and snippets.

View zibertscrem's full-sized avatar
🇺🇦

Dmytro Selishchev zibertscrem

🇺🇦
View GitHub Profile
@zibertscrem
zibertscrem / virtualenv.plugin.zsh
Created March 14, 2024 11:31
ZSH virtualenv plugin
function virtualenv_prompt_info() {
local venvName=""
if [ -n "${VIRTUAL_ENV_PROMPT}" ]; then
venvName="${VIRTUAL_ENV_PROMPT}"
elif [ -n "${VIRTUAL_ENV}" ]; then
venvName="${VIRTUAL_ENV:t:gs/%/%%}"
fi
if [ -n "${venvName}" ]; then
echo -n "${ZSH_THEME_VIRTUALENV_PREFIX=[}${venvName}${ZSH_THEME_VIRTUALENV_SUFFIX=]}"
fi
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)%{$fg_bold[cyan]%}%c%{$reset_color%}"
PROMPT+='$(git_prompt_info)$(virtualenv_prompt_info)%{$reset_color%}
$ '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}%1{✗%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %{$fg[green]%} "
@zibertscrem
zibertscrem / .fzf.zsh
Last active October 21, 2024 10:55
FZF Config
# Setup fzf
# ---------
export FZF_ALT_C_OPTS="--walker dir --walker-root $HOME/projects/ --walker-skip .git,node_modules,zig-out,.zig-cache,build,dist,.venv,__pycache__,.mypy_cache,target,.idea"
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
fi
eval "$(fzf --zsh)"
fzf-open-nvim(){
@zibertscrem
zibertscrem / .tmux.conf
Last active April 28, 2025 16:52
Tmux config
set -g prefix C-a
unbind C-b
unbind C-z
bind C-a send-prefix
bind C-a last-window
bind C-z switch-client -l
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi r send-keys -X rectangle-toggle
bind v copy-mode
@zibertscrem
zibertscrem / meminder.py
Last active August 5, 2022 21:36
Pure python deps-less tool for finding integer value in Linux process and then replace it with desired value
#!/usr/bin/env python3
"""
MIT License
Copyright (c) 2022 Dmytro Selishchev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell