Add comprehensive Zsh configuration files including aliases, completion settings, environment variables, custom functions, keybindings, shell options, plugins, and prompt configuration

- Created aliases for navigation, file management, system commands, and Git operations
- Configured completion settings with caching and custom formatting
- Set environment variables for editor, history, and various programming languages
- Implemented custom functions for navigation, file extraction, and process management
- Defined keybindings for efficient command line navigation and editing
- Established shell options for enhanced history management and command correction
- Integrated various plugins for improved functionality, including FZF, autosuggestions, and syntax highlighting
- Configured Powerlevel10k theme for a visually appealing prompt
This commit is contained in:
Dmitry
2025-12-11 12:09:10 +03:00
parent 89c55ac4ef
commit 8c5234c800
29 changed files with 5781 additions and 1 deletions

1
.gitignore vendored
View File

@@ -8,7 +8,6 @@
# Config files # Config files
*/.env */.env
*/.env.local */.env.local
*/.config/
# Editor config # Editor config
*/.vscode/ */.vscode/

View File

@@ -0,0 +1,157 @@
# Alacritty configuration generated from kitty settings, with Nord color scheme
# See https://alacritty.org/config-alacritty.html (TOML format)
[general]
live_config_reload = true
[terminal.shell]
program = "/usr/bin/zsh"
args = ["-l", "-c", "tmux new-session -A -s main"]
[window]
opacity = 0.85
decorations = "Full"
startup_mode = "Maximized"
# dimensions are in columns/lines; omitted to use terminal defaults
# padding can be added if desired:
padding = { x = 10, y = 5 }
[font]
size = 14.0
[font.normal]
family = "FiraCode Nerd Font Mono"
style = "Regular"
[font.bold]
family = "FiraCode Nerd Font Mono"
style = "Bold"
[font.italic]
family = "FiraCode Nerd Font Mono"
style = "Italic"
[scrolling]
history = 10000
multiplier = 5
[selection]
save_to_clipboard = true
semantic_escape_chars = "@-./_~?&=%+#"
[mouse]
hide_when_typing = false
[cursor]
# kitty: beam + blinking
blink_interval = 500
thickness = 0.15
[cursor.style]
shape = "Beam"
blinking = "On"
[bell]
# Disable visual bell by setting duration to 0; keep a valid easing to satisfy parser
animation = "EaseOutExpo"
duration = 0
# Nord color scheme
# https://www.nordtheme.com/
[colors.primary]
background = "#2E3440"
foreground = "#D8DEE9"
[colors.cursor]
text = "#2E3440"
cursor = "#D8DEE9"
[colors.selection]
text = "#D8DEE9"
background = "#434C5E"
[colors.normal]
black = "#3B4252"
red = "#BF616A"
green = "#A3BE8C"
yellow = "#EBCB8B"
blue = "#81A1C1"
magenta = "#B48EAD"
cyan = "#88C0D0"
white = "#E5E9F0"
[colors.bright]
black = "#4C566A"
red = "#BF616A"
green = "#A3BE8C"
yellow = "#EBCB8B"
blue = "#81A1C1"
magenta = "#B48EAD"
cyan = "#8FBCBB"
white = "#ECEFF4"
# Key bindings translated where possible
[[keyboard.bindings]]
key = "C"
mods = "Control|Shift"
action = "Copy"
[[keyboard.bindings]]
key = "V"
mods = "Control|Shift"
action = "Paste"
[[keyboard.bindings]]
key = "Enter"
mods = "Control|Shift"
action = "SpawnNewInstance"
[[keyboard.bindings]]
key = "F11"
mods = "Control|Shift"
action = "ToggleFullscreen"
[[keyboard.bindings]]
key = "Equals"
mods = "Control|Shift"
action = "IncreaseFontSize"
[[keyboard.bindings]]
key = "Minus"
mods = "Control|Shift"
action = "DecreaseFontSize"
[[keyboard.bindings]]
key = "Key0"
mods = "Control|Shift"
action = "ResetFontSize"
[[keyboard.bindings]]
key = "Up"
mods = "Control|Shift"
action = "ScrollLineUp"
[[keyboard.bindings]]
key = "Down"
mods = "Control|Shift"
action = "ScrollLineDown"
[[keyboard.bindings]]
key = "PageUp"
mods = "Control|Shift"
action = "ScrollPageUp"
[[keyboard.bindings]]
key = "PageDown"
mods = "Control|Shift"
action = "ScrollPageDown"
[[keyboard.bindings]]
key = "Home"
mods = "Control|Shift"
action = "ScrollToTop"
[[keyboard.bindings]]
key = "End"
mods = "Control|Shift"
action = "ScrollToBottom"

View File

@@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"

24
nvim/.config/nvim/LICENSE Normal file
View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

View File

@@ -0,0 +1,9 @@
**This repo is supposed to be used as config by NvChad users!**
- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo.
- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"`
- So you can delete the .git from this repo ( when you clone it locally ) or fork it :)
# Credits
1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier!

View File

@@ -0,0 +1,37 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "options"
require "autocmds"
vim.schedule(function()
require "mappings"
end)

View File

@@ -0,0 +1,29 @@
{
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
"NvChad": { "branch": "v2.5", "commit": "eb209a4a82aecabe609d8206b865e00a760fb644" },
"base46": { "branch": "v3.0", "commit": "45b336ec52615dd1a3aa47848d894616dd6293a5" },
"cmp-async-path": { "branch": "main", "commit": "b8aade3a0626f2bc1d3cd79affcd7da9f47f7ab1" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "cde4da5c1083d3527776fee69536107d98dae6c9" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
"menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" },
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
"nvim-cmp": { "branch": "main", "commit": "d78fb3b64eedb701c9939f97361c06483af575e0" },
"nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" },
"nvim-tree.lua": { "branch": "master", "commit": "1eda2569394f866360e61f590f1796877388cb8a" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" },
"ui": { "branch": "v3.0", "commit": "bea2af0a76c1098fac0988ad296aa028cad2a333" },
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View File

@@ -0,0 +1 @@
require "nvchad.autocmds"

View File

@@ -0,0 +1,24 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig
local M = {}
M.base46 = {
theme = "nord",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
-- M.nvdash = { load_on_startup = true }
-- M.ui = {
-- tabufline = {
-- lazyload = false
-- }
-- }
return M

View File

@@ -0,0 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
return options

View File

@@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View File

@@ -0,0 +1,6 @@
require("nvchad.configs.lspconfig").defaults()
local servers = { "html", "cssls" }
vim.lsp.enable(servers)
-- read :h vim.lsp.config for changing options of lsp servers

View File

@@ -0,0 +1,10 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")

View File

@@ -0,0 +1,6 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

View File

@@ -0,0 +1,28 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
-- test new blink
-- { import = "nvchad.blink.lazyspec" },
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}

Submodule nvim/.config/nvim/pack/github/start/copilot.vim added at da369d90cf

View File

@@ -0,0 +1,41 @@
# Privoxy Configuration
# Minimal config with only active settings
# Configuration directories
confdir /etc/privoxy
logdir /var/log/privoxy
# Actions and filters
actionsfile match-all.action
actionsfile default.action
actionsfile user.action
filterfile default.filter
filterfile user.filter
# Logging
logfile logfile
# Network settings
listen-address 127.0.0.1:8118
# SOCKS5 proxy forwarding
forward-socks5 / ada_proxy:5i3BSdxgE1FBh7kI@150.241.116.110:40724 .
# Security settings
toggle 1
enable-remote-toggle 0
enable-remote-http-toggle 0
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
enable-proxy-authentication-forwarding 0
# Connection settings
forwarded-connect-retries 0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
tolerate-pipelining 1
socket-timeout 300

1844
zsh/.config/zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

2395
zsh/.config/zsh/.zcompdump Normal file

File diff suppressed because it is too large Load Diff

45
zsh/.config/zsh/.zshrc Normal file
View File

@@ -0,0 +1,45 @@
# ════════════════════════════════════════════════════════════
# Ada's Modular ZSH Configuration
# ════════════════════════════════════════════════════════════
# ═══ Powerlevel10k Instant Prompt ══════════════════════════
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Путь к конфигурации zsh
export ZDOTDIR="${ZDOTDIR:-${HOME}/.config/zsh}"
ZSH_CONFIG_DIR="${ZDOTDIR}/config"
# ═══ Zinit (Plugin Manager) ════════════════════════════════
# Автоматическая установка zinit при первом запуске
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
if [[ ! -d "$ZINIT_HOME" ]]; then
print -P "%F{blue}▓▒░ Установка zinit...%f"
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# Загрузка zinit
source "${ZINIT_HOME}/zinit.zsh"
# ═══ Загрузка модулей ══════════════════════════════════════
# Порядок загрузки важен!
source "${ZSH_CONFIG_DIR}/env.zsh" # Переменные окружения
source "${ZSH_CONFIG_DIR}/options.zsh" # Настройки оболочки
source "${ZSH_CONFIG_DIR}/plugins.zsh" # Плагины через zinit
source "${ZSH_CONFIG_DIR}/completion.zsh" # Автодополнение
source "${ZSH_CONFIG_DIR}/aliases.zsh" # Алиасы
source "${ZSH_CONFIG_DIR}/functions.zsh" # Пользовательские функции
source "${ZSH_CONFIG_DIR}/keybindings.zsh" # Горячие клавиши
source "${ZSH_CONFIG_DIR}/prompt.zsh" # Настройка промпта (starship)
# ═══ Локальные настройки (опционально) ═════════════════════
# Для машинно-специфичных настроек
[[ -f "${ZSH_CONFIG_DIR}/local.zsh" ]] && source "${ZSH_CONFIG_DIR}/local.zsh"
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh

View File

@@ -0,0 +1,269 @@
# ════════════════════════════════════════════════════════════
# Powerlevel10k Configuration (Nord Theme)
# ════════════════════════════════════════════════════════════
# Сгенерировано для Ada's dotfiles
# Для полной настройки запустите: p10k configure
# Временно отключить опции для безопасной загрузки
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
() {
emulate -L zsh -o extended_glob
# Unset all configuration options. This allows you to apply configuration changes without
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
# Zsh >= 5.1 is required.
autoload -Uz is-at-least && is-at-least 5.1 || return
# ═══ Prompt Elements ═══════════════════════════════════════
# Левая часть промпта
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
os_icon # иконка ОС
dir # текущая директория
vcs # git status
newline # перенос строки
prompt_char # символ промпта
)
# Правая часть промпта
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
status # код возврата последней команды
command_execution_time # время выполнения команды
background_jobs # фоновые задачи
direnv # direnv
asdf # asdf version manager
virtualenv # python virtualenv
anaconda # anaconda
pyenv # pyenv
goenv # goenv
nodenv # nodenv
nvm # nvm
nodeenv # nodeenv
node_version # node version
go_version # go version
rust_version # rust version
dotnet_version # .NET version
php_version # php version
laravel_version # laravel version
java_version # java version
package # package version (package.json)
rbenv # rbenv
rvm # rvm
fvm # fvm
luaenv # luaenv
jenv # jenv
plenv # plenv
perlbrew # perlbrew
phpenv # phpenv
scalaenv # scalaenv
haskell_stack # haskell stack
kubecontext # kubernetes context
terraform # terraform workspace
aws # aws profile
aws_eb_env # aws elastic beanstalk
azure # azure account
gcloud # google cloud
google_app_cred # google application credentials
toolbox # toolbox
context # user@hostname
nordvpn # nordvpn
ranger # ranger
nnn # nnn
lf # lf
xplr # xplr
vim_shell # vim shell
midnight_commander # midnight commander
nix_shell # nix shell
vi_mode # vi mode indicator
vpn_ip # vpn ip
load # cpu load
disk_usage # disk usage
ram # ram usage
swap # swap usage
todo # todo items
timewarrior # timewarrior
taskwarrior # taskwarrior
time # время
newline # перенос строки
)
# ═══ Стиль ═════════════════════════════════════════════════
# Стиль промпта: (lean|classic|rainbow|pure)
typeset -g POWERLEVEL9K_MODE='nerdfont-v3'
typeset -g POWERLEVEL9K_ICON_PADDING=moderate
# Prompt style
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=''
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=''
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=''
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=''
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=''
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR=' '
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR=' '
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true
# ═══ Nord Colors ═══════════════════════════════════════════
# Nord color palette
local nord0='#2E3440' # Polar Night - darkest
local nord1='#3B4252' # Polar Night
local nord2='#434C5E' # Polar Night
local nord3='#4C566A' # Polar Night - brightest
local nord4='#D8DEE9' # Snow Storm
local nord5='#E5E9F0' # Snow Storm
local nord6='#ECEFF4' # Snow Storm - brightest
local nord7='#8FBCBB' # Frost - cyan
local nord8='#88C0D0' # Frost - bright cyan
local nord9='#81A1C1' # Frost - blue
local nord10='#5E81AC' # Frost - dark blue
local nord11='#BF616A' # Aurora - red
local nord12='#D08770' # Aurora - orange
local nord13='#EBCB8B' # Aurora - yellow
local nord14='#A3BE8C' # Aurora - green
local nord15='#B48EAD' # Aurora - purple
# ═══ OS Icon ═══════════════════════════════════════════════
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=$nord8
typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=$nord1
# ═══ Prompt Character ══════════════════════════════════════
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=$nord14
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=$nord11
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
# ═══ Directory ═════════════════════════════════════════════
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$nord4
typeset -g POWERLEVEL9K_DIR_BACKGROUND=$nord2
typeset -g POWERLEVEL9K_DIR_SHORTENED=true
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=''
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=$nord3
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=$nord4
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
# Special directories
typeset -g POWERLEVEL9K_DIR_CLASSES=(
'~/Documents(|/*)' DOCUMENTS
'~/Downloads(|/*)' DOWNLOADS
'~(|/*)' HOME
'*' DEFAULT
)
typeset -g POWERLEVEL9K_DIR_DOCUMENTS_FOREGROUND=$nord13
typeset -g POWERLEVEL9K_DIR_DOWNLOADS_FOREGROUND=$nord12
typeset -g POWERLEVEL9K_DIR_HOME_FOREGROUND=$nord8
typeset -g POWERLEVEL9K_DIR_DEFAULT_FOREGROUND=$nord4
# ═══ Git ═══════════════════════════════════════════════════
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=$nord14
typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=$nord8
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=$nord13
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_VCS_CONFLICTED_FOREGROUND=$nord11
typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=''
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON='!'
typeset -g POWERLEVEL9K_VCS_STAGED_ICON='+'
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='⇣'
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='⇡'
typeset -g POWERLEVEL9K_VCS_STASH_ICON='*'
typeset -g POWERLEVEL9K_VCS_TAG_ICON='#'
# ═══ Status ════════════════════════════════════════════════
typeset -g POWERLEVEL9K_STATUS_OK=false
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=$nord11
typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=$nord1
# ═══ Command Execution Time ════════════════════════════════
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=1
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$nord13
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=$nord1
# ═══ Background Jobs ═══════════════════════════════════════
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=$nord12
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=$nord1
# ═══ Context (user@host) ═══════════════════════════════════
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=$nord4
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=$nord2
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=$nord11
typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=$nord13
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
# Don't show context unless running with privileges or in SSH.
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=
# ═══ Virtualenv ════════════════════════════════════════════
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$nord9
typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# ═══ Node Version ══════════════════════════════════════════
typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=$nord14
typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
# ═══ Go Version ════════════════════════════════════════════
typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=$nord8
typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
# ═══ Rust Version ══════════════════════════════════════════
typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=$nord12
typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
# ═══ Kubernetes ════════════════════════════════════════════
typeset -g POWERLEVEL9K_KUBECONTEXT_FOREGROUND=$nord9
typeset -g POWERLEVEL9K_KUBECONTEXT_BACKGROUND=$nord1
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE=true
# ═══ Terraform ═════════════════════════════════════════════
typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=$nord15
typeset -g POWERLEVEL9K_TERRAFORM_BACKGROUND=$nord1
# ═══ Time ══════════════════════════════════════════════════
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$nord4
typeset -g POWERLEVEL9K_TIME_BACKGROUND=$nord2
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# ═══ Transient Prompt ══════════════════════════════════════
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
# ═══ Другие настройки ══════════════════════════════════════
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=false
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
# ═══ Finalization ══════════════════════════════════════════
(( ! $+functions[p10k] )) || p10k reload
}
# Применить временные опции обратно
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'

View File

@@ -0,0 +1,174 @@
# ════════════════════════════════════════════════════════════
# Aliases
# ════════════════════════════════════════════════════════════
# ═══ Навигация ═════════════════════════════════════════════
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# Быстрый переход в часто используемые директории
alias dl='cd ~/Downloads'
alias dt='cd ~/Desktop'
alias doc='cd ~/Documents'
alias dev='cd ~/dev'
# zoxide - умная навигация (если установлен)
if command -v zoxide &>/dev/null; then
alias cd='z' # заменить cd на z
alias cdi='zi' # интерактивный выбор через fzf
alias cdq='zoxide query'
alias cdr='zoxide remove'
fi
# ═══ Списки файлов ═════════════════════════════════════════
# Использовать eza если доступен, иначе ls с цветами
if command -v eza &>/dev/null; then
alias ls='eza --icons --group-directories-first'
alias ll='eza -l --icons --group-directories-first --git'
alias la='eza -la --icons --group-directories-first --git'
alias lt='eza --tree --level=2 --icons'
alias l='eza -lah --icons --group-directories-first --git'
else
alias ls='ls --color=auto --group-directories-first'
alias ll='ls -lh --color=auto --group-directories-first'
alias la='ls -lAh --color=auto --group-directories-first'
alias l='ls -lah --color=auto --group-directories-first'
fi
# ═══ Безопасность ══════════════════════════════════════════
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# ═══ Системные команды ═════════════════════════════════════
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias df='df -h'
alias du='du -h'
alias free='free -h'
# Быстрый доступ к редактору
alias v='${EDITOR}'
alias vim='nvim'
alias vi='nvim'
# ═══ Сеть ══════════════════════════════════════════════════
alias ping='ping -c 5'
alias ports='netstat -tulanp'
# myip определена как функция в functions.zsh (более полная версия)
alias localip="ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v 127.0.0.1"
# Proxy
alias proxy-on='export http_proxy="http://127.0.0.1:8118" https_proxy="http://127.0.0.1:8118" HTTP_PROXY="http://127.0.0.1:8118" HTTPS_PROXY="http://127.0.0.1:8118" && echo "Proxy enabled"'
alias proxy-off='unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY && echo "Proxy disabled"'
alias proxy-status='env | grep -i proxy'
# ═══ Git ═══════════════════════════════════════════════════
alias g='git'
alias gs='git status'
alias gst='git --no-pager status' # без пейджера
alias ga='git add'
alias gaa='git add .'
alias gc='git commit'
alias gcm='git commit -m'
alias gp='git push'
alias gpl='git pull'
alias gd='git diff'
alias gco='git checkout'
alias gb='git branch'
alias gl='git log --oneline --graph --decorate'
alias glog='git log --oneline --graph --decorate --all'
# ═══ Docker ════════════════════════════════════════════════
if command -v docker &>/dev/null; then
alias d='docker'
alias dc='docker-compose'
alias dps='docker ps'
alias dpsa='docker ps -a'
alias di='docker images'
alias dex='docker exec -it'
alias dlog='docker logs -f'
alias dstop='docker stop $(docker ps -aq)'
alias drm='docker rm $(docker ps -aq)'
alias drmi='docker rmi $(docker images -q)'
alias dclean='docker system prune -af --volumes'
fi
# ═══ Kubectl ═══════════════════════════════════════════════
if command -v kubectl &>/dev/null; then
alias k='kubectl'
alias kgp='kubectl get pods'
alias kgs='kubectl get services'
alias kgd='kubectl get deployments'
alias kdp='kubectl describe pod'
alias kds='kubectl describe service'
alias kdd='kubectl describe deployment'
alias kl='kubectl logs -f'
alias kex='kubectl exec -it'
fi
# ═══ Ruby (rbenv) ══════════════════════════════════════════
if command -v rbenv &>/dev/null; then
alias rb='ruby'
alias be='bundle exec'
alias bi='bundle install'
alias bu='bundle update'
fi
# ═══ Python ════════════════════════════════════════════════
alias py='python3'
alias pip='pip3'
alias venv='python3 -m venv'
alias activate='source venv/bin/activate'
# ═══ Node.js ═══════════════════════════════════════════════
alias ni='npm install'
alias nid='npm install --save-dev'
alias nig='npm install -g'
alias nr='npm run'
alias ns='npm start'
alias nt='npm test'
# ═══ Утилиты ═══════════════════════════════════════════════
alias zshrc='${EDITOR} ~/.config/zsh/.zshrc'
alias reload='source ~/.config/zsh/.zshrc'
alias path='echo $PATH | tr ":" "\n"'
alias h='history'
alias c='clear'
alias x='exit'
alias rsend='sudo rsync -avhP --stats'
alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"'
# Быстрое обновление системы (для разных дистрибутивов)
if command -v apt &>/dev/null; then
alias update='sudo apt update && sudo apt upgrade -y'
elif command -v pacman &>/dev/null; then
alias update='sudo pacman -Syu'
elif command -v dnf &>/dev/null; then
alias update='sudo dnf upgrade -y'
elif command -v zypper &>/dev/null; then
alias update='sudo zypper refresh && sudo zypper update -y'
fi
# Универсальная установка пакетов (для разных дистрибутивов)
if command -v apt &>/dev/null; then
alias install='sudo apt install -y'
elif command -v pacman &>/dev/null; then
alias install='sudo pacman -S --noconfirm'
elif command -v dnf &>/dev/null; then
alias install='sudo dnf install -y'
elif command -v zypper &>/dev/null; then
alias install='sudo zypper install -y'
fi
# ═══ Прочее ════════════════════════════════════════════════
# weather определена как функция в functions.zsh (более полная версия)
alias cheat='curl cheat.sh'
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
alias lidon='sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target'
alias lidoff='sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target'

View File

@@ -0,0 +1,94 @@
# ════════════════════════════════════════════════════════════
# Completion Settings
# ════════════════════════════════════════════════════════════
# ═══ Инициализация ═════════════════════════════════════════
autoload -Uz compinit
# Проверять новые автодополнения раз в день
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
compinit
touch ${ZDOTDIR}/.zcompdump
else
compinit -C
fi
# ═══ Кэш дополнений ════════════════════════════════════════
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "${XDG_CACHE_HOME}/zsh/zcompcache"
# Создать директорию для кэша если не существует
[[ ! -d "${XDG_CACHE_HOME}/zsh" ]] && mkdir -p "${XDG_CACHE_HOME}/zsh"
# ═══ Меню выбора ═══════════════════════════════════════════
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' verbose yes
# ═══ Форматирование ════════════════════════════════════════
zstyle ':completion:*:descriptions' format '%F{blue}-- %d --%f'
zstyle ':completion:*:messages' format '%F{purple}-- %d --%f'
zstyle ':completion:*:warnings' format '%F{red}-- no matches found --%f'
zstyle ':completion:*:corrections' format '%F{yellow}-- %d (errors: %e) --%f'
# ═══ Сопоставление ═════════════════════════════════════════
zstyle ':completion:*' matcher-list \
'm:{a-zA-Z}={A-Za-z}' \
'r:|[._-]=* r:|=*' \
'l:|=* r:|=*'
# ═══ Цвета ═════════════════════════════════════════════════
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
# ═══ Процессы ══════════════════════════════════════════════
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
# Не предлагать уже использованные опции
zstyle ':completion:*:*:kill:*' ignore-line yes
# ═══ Команды ═══════════════════════════════════════════════
# Игнорировать внутренние функции (начинающиеся с _)
zstyle ':completion:*:functions' ignored-patterns '_*'
# ═══ Директории ════════════════════════════════════════════
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' list-dirs-first true
# Игнорировать родительскую директорию
zstyle ':completion:*:cd:*' ignore-parents parent pwd
# ═══ Хосты ═════════════════════════════════════════════════
zstyle ':completion:*:ssh:*' hosts off
zstyle ':completion:*:scp:*' hosts off
# Читать хосты из ~/.ssh/config
if [[ -f ~/.ssh/config ]]; then
h=()
if [[ -r ~/.ssh/config ]]; then
h=(${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:scp:*' hosts $h
fi
# ═══ Man страницы ══════════════════════════════════════════
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
# ═══ Автодополнение для sudo ═══════════════════════════════
zstyle ':completion:*:sudo:*' command-path \
/usr/local/sbin \
/usr/local/bin \
/usr/sbin \
/usr/bin \
/sbin \
/bin
# ═══ Массивы ═══════════════════════════════════════════════
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
# ═══ Расширения ════════════════════════════════════════════
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' expand yes

View File

@@ -0,0 +1,79 @@
# ════════════════════════════════════════════════════════════
# Environment Variables
# ════════════════════════════════════════════════════════════
# ═══ Основные пути ═════════════════════════════════════════
export EDITOR="${EDITOR:-nvim}"
export VISUAL="${VISUAL:-nvim}"
export PAGER="less"
# ═══ XDG Base Directories ══════════════════════════════════
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_STATE_HOME="${HOME}/.local/state"
# ═══ История команд ════════════════════════════════════════
export HISTFILE="${XDG_STATE_HOME}/zsh/history"
export HISTSIZE=50000
export SAVEHIST=50000
# Создать директорию для истории если не существует
[[ ! -d "$(dirname $HISTFILE)" ]] && mkdir -p "$(dirname $HISTFILE)"
# ═══ Less ══════════════════════════════════════════════════
export LESS='-R -M -i -j10'
export LESSHISTFILE="${XDG_CACHE_HOME}/less/history"
# ═══ Ruby (rbenv) ══════════════════════════════════════════
if [[ -d "${HOME}/.rbenv" ]]; then
export PATH="${HOME}/.rbenv/bin:${PATH}"
command -v rbenv &>/dev/null && eval "$(rbenv init - zsh)"
fi
# ═══ Node.js ═══════════════════════════════════════════════
# Если используете nvm
export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use # Ленивая загрузка
# ═══ Python ════════════════════════════════════════════════
# Отключить создание .pyc файлов
export PYTHONDONTWRITEBYTECODE=1
# export PYENV_ROOT="$HOME/.pyenv"
# export PATH="$PYENV_ROOT/bin:$PATH"
# ═══ Go ════════════════════════════════════════════════════
export GOPATH="${HOME}/go"
export PATH="${GOPATH}/bin:${PATH}"
# ═══ Rust ══════════════════════════════════════════════════
export CARGO_HOME="${HOME}/.cargo"
export PATH="${CARGO_HOME}/bin:${PATH}"
# ═══ Локальные бинарники ═══════════════════════════════════
export PATH="${HOME}/.local/bin:${PATH}"
# ═══ Цвета ═════════════════════════════════════════════════
export CLICOLOR=1
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43'
# ═══ FZF ═══════════════════════════════════════════════════
export FZF_DEFAULT_OPTS="
--height 40%
--layout=reverse
--border
--inline-info
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8
"
# Использовать fd вместо find если доступен
if command -v fd &>/dev/null; then
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
fi
if command -v zoxide &>/dev/null; then
eval "$(zoxide init zsh)"
fi

View File

@@ -0,0 +1,181 @@
# ════════════════════════════════════════════════════════════
# Custom Functions
# ════════════════════════════════════════════════════════════
# ═══ Навигация ═════════════════════════════════════════════
# mkcd - создать директорию и перейти в неё
mkcd() {
mkdir -p "$1" && cd "$1"
}
# up - подняться на N уровней вверх
up() {
local d=""
local limit="${1:-1}"
for ((i=1; i<=limit; i++)); do
d="../$d"
done
if [[ -z "$d" ]]; then
d=..
fi
cd "$d" || return
}
# ═══ Поиск ═════════════════════════════════════════════════
# ff - быстрый поиск файлов
ff() {
if command -v fd &>/dev/null; then
fd "$@"
else
find . -iname "*$1*"
fi
}
# fh - поиск в истории команд с fzf
fh() {
if command -v fzf &>/dev/null; then
print -z $(history -n 1 | fzf --tac --no-sort)
else
history | grep "$1"
fi
}
# ═══ Файлы и директории ════════════════════════════════════
# extract - универсальная распаковка (если плагин не загружен)
if ! command -v extract &>/dev/null; then
extract() {
if [[ -f $1 ]]; then
case $1 in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.tar.xz) tar xJf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
fi
# backup - создать резервную копию файла
backup() {
if [[ -f $1 ]]; then
cp "$1"{,.backup-$(date +%Y%m%d-%H%M%S)}
echo "Backup created: $1.backup-$(date +%Y%m%d-%H%M%S)"
else
echo "File not found: $1"
fi
}
# ═══ Размер файлов ═════════════════════════════════════════
# dirsize - показать размер директории
dirsize() {
du -sh "${1:-.}" 2>/dev/null || echo "Directory not found"
}
# largest - показать N самых больших файлов в директории
largest() {
local num=${1:-10}
du -ah "${2:-.}" | sort -rh | head -n "$num"
}
# ═══ Процессы ══════════════════════════════════════════════
# psgrep - поиск процессов
psgrep() {
ps aux | grep -v grep | grep -i -e VSZ -e "$1"
}
# kill процесс по имени
killp() {
local pid
pid=$(ps aux | grep -v grep | grep "$1" | awk '{print $2}')
if [[ -n $pid ]]; then
echo "Killing process: $1 (PID: $pid)"
kill -9 "$pid"
else
echo "Process not found: $1"
fi
}
# ═══ Сеть ══════════════════════════════════════════════════
# myip - показать все IP адреса
myip() {
echo "External IP: $(curl -s ifconfig.me)"
echo "Local IPs:"
ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v 127.0.0.1
}
# ports - показать открытые порты
openports() {
sudo netstat -tulanp | grep LISTEN
}
# ═══ Git ═══════════════════════════════════════════════════
# gitignore - скачать .gitignore для языка
gitignore() {
if [[ -z $1 ]]; then
echo "Usage: gitignore <language>"
return 1
fi
curl -sL "https://www.toptal.com/developers/gitignore/api/$1" -o .gitignore
echo ".gitignore created for: $1"
}
# gclone - клонировать репозиторий и перейти в него
gclone() {
if [[ -z $1 ]]; then
echo "Usage: gclone <repository>"
return 1
fi
local repo_name=$(basename "$1" .git)
git clone "$1" && cd "$repo_name" || return
}
# ═══ Разработка ════════════════════════════════════════════
# serve - быстрый HTTP сервер
serve() {
local port="${1:-8000}"
if command -v python3 &>/dev/null; then
echo "Starting server on http://localhost:$port"
python3 -m http.server "$port"
else
echo "Python3 not found"
fi
}
# json - форматировать JSON
json() {
if [[ -f $1 ]]; then
python3 -m json.tool "$1"
else
echo "$1" | python3 -m json.tool
fi
}
# ═══ Утилиты ═══════════════════════════════════════════════
# weather - погода для города
weather() {
local city="${1:-Moscow}"
curl -s "wttr.in/$city?format=3"
}

View File

@@ -0,0 +1,87 @@
# ════════════════════════════════════════════════════════════
# Keybindings
# ════════════════════════════════════════════════════════════
# ═══ Режим редактирования ══════════════════════════════════
# Использовать emacs режим (можно переключить на vi)
bindkey -e
# Для vi режима раскомментируйте:
# bindkey -v
# ═══ Навигация по строке ═══════════════════════════════════
bindkey '^A' beginning-of-line # Ctrl+A - начало строки
bindkey '^E' end-of-line # Ctrl+E - конец строки
bindkey '^[[H' beginning-of-line # Home - начало строки
bindkey '^[[F' end-of-line # End - конец строки
# ═══ Редактирование ════════════════════════════════════════
bindkey '^K' kill-line # Ctrl+K - удалить до конца
bindkey '^U' backward-kill-line # Ctrl+U - удалить до начала
bindkey '^W' backward-kill-word # Ctrl+W - удалить слово назад
bindkey '^Y' yank # Ctrl+Y - вставить
# ═══ Навигация по словам ═══════════════════════════════════
bindkey '^[[1;5C' forward-word # Ctrl+Right - вперёд на слово
bindkey '^[[1;5D' backward-word # Ctrl+Left - назад на слово
bindkey '^[^[[C' forward-word # Alt+Right - вперёд на слово
bindkey '^[^[[D' backward-word # Alt+Left - назад на слово
# ═══ История команд ════════════════════════════════════════
# Обычная навигация по истории (без фильтрации)
bindkey '^P' up-history # Ctrl+P - предыдущая команда (без фильтра)
bindkey '^N' down-history # Ctrl+N - следующая команда (без фильтра)
# Стрелки вверх/вниз - с фильтрацией по началу строки
bindkey '^[[A' up-line-or-search # Up - предыдущая команда (с фильтром)
bindkey '^[[B' down-line-or-search # Down - следующая команда (с фильтром)
# Поиск в истории (если загружен history-substring-search)
if (( $+functions[history-substring-search-up] )); then
# Alt+Up/Down для поиска подстроки в истории
bindkey '^[[1;3A' history-substring-search-up # Alt+Up
bindkey '^[[1;3B' history-substring-search-down # Alt+Down
fi
# ═══ Автодополнение ════════════════════════════════════════
bindkey '^I' complete-word # Tab - автодополнение
bindkey '^[[Z' reverse-menu-complete # Shift+Tab - назад по меню
# Принять автопредложение (если загружен autosuggestions)
if (( $+widgets[autosuggest-accept] )); then
bindkey '^F' autosuggest-accept # Ctrl+F - принять предложение
bindkey '^[[C' forward-char # Right - вперёд на символ (не принимая)
bindkey '^ ' autosuggest-accept # Ctrl+Space - принять предложение
fi
# ═══ FZF ═══════════════════════════════════════════════════
# FZF key-bindings загружаются в plugins.zsh
# Здесь можно переопределить привязки если нужно
if command -v fzf &>/dev/null; then
# Привязки уже установлены в plugins.zsh через key-bindings.zsh
# Можно добавить дополнительные кастомные привязки здесь
:
fi
# ═══ Полезные команды ══════════════════════════════════════
bindkey '^L' clear-screen # Ctrl+L - очистить экран
bindkey '^X^E' edit-command-line # Ctrl+X Ctrl+E - редактировать в $EDITOR
# Загрузить edit-command-line если нужно
autoload -Uz edit-command-line
zle -N edit-command-line
# ═══ Дополнительные привязки ═══════════════════════════════
bindkey '^D' delete-char-or-list # Ctrl+D - удалить символ или показать список
bindkey '^H' backward-delete-char # Ctrl+H - удалить символ назад
bindkey '^?' backward-delete-char # Backspace - удалить символ назад
# ═══ Копирование/вставка (xclip) ══════════════════════════
if command -v xclip &>/dev/null; then
# Скопировать текущую команду в буфер обмена
function _copy_command_to_clipboard() {
echo -n "$BUFFER" | xclip -selection clipboard
zle -M "Copied to clipboard"
}
zle -N _copy_command_to_clipboard
bindkey '^X^C' _copy_command_to_clipboard # Ctrl+X Ctrl+C
fi

View File

@@ -0,0 +1,48 @@
# ════════════════════════════════════════════════════════════
# Shell Options
# ════════════════════════════════════════════════════════════
# ═══ История ═══════════════════════════════════════════════
setopt EXTENDED_HISTORY # Записывать timestamp в историю
setopt HIST_EXPIRE_DUPS_FIRST # Удалять дубликаты в первую очередь
setopt HIST_IGNORE_DUPS # Не записывать дубликаты подряд
setopt HIST_IGNORE_ALL_DUPS # Удалить старую запись если новая - дубликат
setopt HIST_FIND_NO_DUPS # Не показывать дубликаты при поиске
setopt HIST_IGNORE_SPACE # Не записывать команды начинающиеся с пробела
setopt HIST_SAVE_NO_DUPS # Не сохранять дубликаты
setopt HIST_REDUCE_BLANKS # Убирать лишние пробелы
setopt HIST_VERIFY # Показывать команду перед выполнением из истории
setopt SHARE_HISTORY # Делиться историей между сессиями
# ═══ Навигация ═════════════════════════════════════════════
setopt AUTO_CD # cd в директорию просто набрав её имя
setopt AUTO_PUSHD # Автоматически делать pushd
setopt PUSHD_IGNORE_DUPS # Не добавлять дубликаты в стек директорий
setopt PUSHD_SILENT # Не печатать стек после pushd/popd
setopt PUSHD_TO_HOME # pushd без аргументов = pushd $HOME
# ═══ Дополнение ════════════════════════════════════════════
setopt ALWAYS_TO_END # Курсор в конец при автодополнении
setopt AUTO_MENU # Показывать меню при повторном tab
setopt AUTO_LIST # Автоматически показывать список вариантов
setopt COMPLETE_IN_WORD # Дополнять внутри слова
unsetopt MENU_COMPLETE # Не вставлять первый вариант автоматически
# ═══ Глобы и расширения ════════════════════════════════════
setopt EXTENDED_GLOB # Расширенный синтаксис глобов
setopt GLOB_DOTS # Включать скрытые файлы в глобы
setopt NOMATCH # Ошибка если паттерн не совпал
setopt NUMERIC_GLOB_SORT # Сортировать числовые имена файлов численно
# ═══ Работа с командами ════════════════════════════════════
setopt CORRECT # Исправлять опечатки в командах
setopt CORRECT_ALL # Исправлять опечатки в аргументах
setopt INTERACTIVE_COMMENTS # Разрешить комментарии в интерактивном режиме
setopt MULTIOS # Множественные перенаправления
setopt LONG_LIST_JOBS # Подробный вывод jobs
# ═══ Другое ════════════════════════════════════════════════
setopt NOTIFY # Сообщать о завершении фоновых задач немедленно
setopt NO_BEEP # Отключить звуковые сигналы
setopt NO_HUP # Не убивать фоновые задачи при выходе
setopt PROMPT_SUBST # Разрешить подстановки в промпте

View File

@@ -0,0 +1,100 @@
# ════════════════════════════════════════════════════════════
# Plugins (via Zinit)
# ════════════════════════════════════════════════════════════
# ═══ Powerlevel10k Theme ═══════════════════════════════════
# Загружаем ПЕРВЫМ для instant prompt
zinit ice depth=1
zinit light romkatv/powerlevel10k
# ═══ Turbo Mode ════════════════════════════════════════════
# Плагины загружаются асинхронно для ускорения старта
# ═══ FZF key-bindings ══════════════════════════════════════
# Загружаем ПЕРВЫМ, чтобы виджеты были определены до syntax-highlighting
if command -v fzf &>/dev/null; then
# Попробовать разные пути установки fzf
if [[ -f /usr/share/fzf/key-bindings.zsh ]]; then
source /usr/share/fzf/key-bindings.zsh
elif [[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ]]; then
source /usr/share/doc/fzf/examples/key-bindings.zsh
elif [[ -f ~/.fzf.zsh ]]; then
source ~/.fzf.zsh
fi
fi
# ═══ Автодополнение ════════════════════════════════════════
# zsh-completions - дополнительные автодополнения
zinit ice wait lucid blockf atpull'zinit creinstall -q .'
zinit light zsh-users/zsh-completions
# ═══ Автопредложения ═══════════════════════════════════════
# zsh-autosuggestions - предложения из истории
zinit ice wait lucid atload'_zsh_autosuggest_start'
zinit light zsh-users/zsh-autosuggestions
# Настройки autosuggestions
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#585b70'
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
# ═══ История ═══════════════════════════════════════════════
# zsh-history-substring-search - поиск в истории
zinit ice wait lucid
zinit light zsh-users/zsh-history-substring-search
# ═══ FZF ═══════════════════════════════════════════════════
# fzf - интерактивный поиск
if command -v fzf &>/dev/null; then
# fzf-tab - fzf для автодополнения
zinit ice wait lucid
zinit light Aloxaf/fzf-tab
# Настройки fzf-tab
zstyle ':fzf-tab:*' fzf-command fzf
zstyle ':fzf-tab:*' fzf-pad 4
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath 2>/dev/null || ls -1 --color=always $realpath'
zstyle ':fzf-tab:complete:*:*' fzf-preview 'less ${(Q)realpath} 2>/dev/null || eza -1 --color=always ${(Q)realpath} 2>/dev/null || ls -1 --color=always ${(Q)realpath}'
fi
# ═══ Навигация ═════════════════════════════════════════════
# zoxide - умный cd с историей
if command -v zoxide &>/dev/null; then
eval "$(zoxide init zsh)"
fi
# ═══ Git ═══════════════════════════════════════════════════
# Быстрые git алиасы и функции
zinit ice wait lucid
zinit snippet OMZ::plugins/git/git.plugin.zsh
# ═══ Дополнительные инструменты ════════════════════════════
# sudo - нажать ESC дважды чтобы добавить sudo
zinit ice wait lucid
zinit snippet OMZ::plugins/sudo/sudo.plugin.zsh
# extract - универсальная распаковка архивов
zinit ice wait lucid
zinit snippet OMZ::plugins/extract/extract.plugin.zsh
# colored-man-pages - цветные man страницы
zinit ice wait lucid
zinit snippet OMZ::plugins/colored-man-pages/colored-man-pages.plugin.zsh
# docker - автодополнение для docker
if command -v docker &>/dev/null; then
zinit ice wait lucid as'completion'
zinit snippet OMZP::docker
fi
# kubectl - автодополнение для kubectl
if command -v kubectl &>/dev/null; then
zinit ice wait lucid as'completion'
zinit snippet OMZ::plugins/kubectl/kubectl.plugin.zsh
fi
# ═══ Подсветка синтаксиса (ПОСЛЕДНИЙ плагин) ═══════════════
# zsh-syntax-highlighting - ОБЯЗАТЕЛЬНО загружать последним
# Это гарантирует, что все виджеты уже определены
zinit ice wait lucid atinit'zpcompinit; zpcdreplay'
zinit light zsh-users/zsh-syntax-highlighting

View File

@@ -0,0 +1,24 @@
# ════════════════════════════════════════════════════════════
# Prompt Configuration (Powerlevel10k)
# ════════════════════════════════════════════════════════════
# ═══ Powerlevel10k Instant Prompt ══════════════════════════
# Должен быть в самом начале ~/.zshrc для мгновенного промпта
# Перенесен сюда для модульности, но в идеале должен быть раньше
# Включить Powerlevel10k instant prompt. Должно быть близко к началу ~/.config/zsh/.zshrc.
# Инициализация кода, который может требовать ввод консоли или печать, должна идти выше этого блока.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# ═══ Powerlevel10k Theme ═══════════════════════════════════
# Загрузка через zinit (будет установлена автоматически)
# Примечание: этот блок должен быть в plugins.zsh, но оставлен здесь для ясности
# zinit ice depth=1
# zinit light romkatv/powerlevel10k
# ═══ P10k Configuration ════════════════════════════════════
# Загрузка конфигурации p10k
# Для настройки запустите: p10k configure
[[ -f ~/.config/zsh/.p10k.zsh ]] && source ~/.config/zsh/.p10k.zsh