mirror of
https://github.com/andwati/dotfiles.git
synced 2026-10-18 02:52:52 +00:00
cleanup
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
\.gitignore
|
||||
\.bin
|
||||
|
||||
^/README.*
|
||||
^/LICENSE.*
|
||||
|
||||
\.git
|
||||
#LICENSE
|
||||
README.md
|
||||
|
||||
/scripts
|
||||
@@ -1,3 +0,0 @@
|
||||
require("config.options")
|
||||
require("config.keybinds")
|
||||
require("config.lazy")
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "eda5be8f0ce9816278671f0b578cdbb8b762c701" },
|
||||
"better-indent-support-for-php-with-html": { "branch": "master", "commit": "e907f07b53dd6d6b7b2f6956cd18202ef3f26c24" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
|
||||
"vim-doge": { "branch": "master", "commit": "03a84072ef21b205237c77986c78914395d646c3" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" },
|
||||
"vim-oscyank": { "branch": "main", "commit": "d67d76b2f19b868b70a1cf33a779d71dc092cb30" }
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.keymap.set("n", "<leader>cd", vim.cmd.Ex)
|
||||
@@ -1,23 +0,0 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
change_detection = { notify = false },
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
vim.opt.number = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
local function enable_transparency()
|
||||
vim.api.nvim_set_hl(0, "Normal", {bg = "none"})
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
config = function()
|
||||
vim.cmd([[colorscheme tokyonight]])
|
||||
enable_transparency()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
|
||||
},
|
||||
opts = {
|
||||
theme = "tokyonight",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
local conf = require('telescope.config').values
|
||||
local themes = require('telescope.themes')
|
||||
|
||||
-- helper function to use telescope on harpoon list.
|
||||
-- change get_ivy to other themes if wanted
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
local opts = themes.get_ivy({
|
||||
promt_title = "Working List"
|
||||
})
|
||||
|
||||
require("telescope.pickers").new(opts, {
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer(opts),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
}):find()
|
||||
end
|
||||
|
||||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
config = function()
|
||||
local harpoon = require('harpoon')
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
vim.keymap.set("n", "<leader>fl", function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = "Open harpoon window" })
|
||||
vim.keymap.set("n", "<C-p>", function() harpoon:list():prev() end)
|
||||
vim.keymap.set("n", "<C-n>", function() harpoon:list():next() end)
|
||||
end
|
||||
}
|
||||
@@ -1,230 +0,0 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
-- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
-- Snippets
|
||||
'L3MON4D3/LuaSnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
config = function()
|
||||
local autoformat_filetypes = {
|
||||
"lua",
|
||||
}
|
||||
-- Create a keymap for vim.lsp.buf.implementation
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not client then return end
|
||||
if vim.tbl_contains(autoformat_filetypes, vim.bo.filetype) then
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({
|
||||
formatting_options = { tabSize = 4, insertSpaces = true },
|
||||
bufnr = args.buf,
|
||||
id = client.id
|
||||
})
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- Add borders to floating windows
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover,
|
||||
{ border = 'rounded' }
|
||||
)
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help,
|
||||
{ border = 'rounded' }
|
||||
)
|
||||
|
||||
-- Configure error/warnings interface
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = '✘',
|
||||
[vim.diagnostic.severity.WARN] = '▲',
|
||||
[vim.diagnostic.severity.HINT] = '⚑',
|
||||
[vim.diagnostic.severity.INFO] = '»',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Add cmp_nvim_lsp capabilities settings to lspconfig
|
||||
-- This should be executed before you configure any language server
|
||||
local lspconfig_defaults = require('lspconfig').util.default_config
|
||||
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lspconfig_defaults.capabilities,
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
)
|
||||
|
||||
-- This is where you enable features that only work
|
||||
-- if there is a language server active in the file
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(event)
|
||||
local opts = { buffer = event.buf }
|
||||
|
||||
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
||||
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
||||
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
|
||||
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
|
||||
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
|
||||
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
||||
vim.keymap.set('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
|
||||
vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
|
||||
vim.keymap.set({ 'n', 'x' }, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
|
||||
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
|
||||
end,
|
||||
})
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"intelephense",
|
||||
"ts_ls",
|
||||
"eslint",
|
||||
},
|
||||
handlers = {
|
||||
-- this first function is the "default handler"
|
||||
-- it applies to every language server without a custom handler
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({})
|
||||
end,
|
||||
|
||||
-- this is the "custom handler" for `lua_ls`
|
||||
lua_ls = function()
|
||||
require('lspconfig').lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = { vim.env.VIMRUNTIME },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
|
||||
cmp.setup({
|
||||
preselect = 'item',
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
{ name = 'luasnip', keyword_length = 2 },
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
fields = { 'abbr', 'menu', 'kind' },
|
||||
format = function(entry, item)
|
||||
local n = entry.source.name
|
||||
if n == 'nvim_lsp' then
|
||||
item.menu = '[LSP]'
|
||||
else
|
||||
item.menu = string.format('[%s]', n)
|
||||
end
|
||||
return item
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- confirm completion item
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||
|
||||
-- scroll documentation window
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(5),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-5),
|
||||
|
||||
-- toggle completion menu
|
||||
['<C-e>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.abort()
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end),
|
||||
|
||||
-- tab complete
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
local col = vim.fn.col('.') - 1
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item({ behavior = 'select' })
|
||||
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
fallback()
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
|
||||
-- go to previous item
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = 'select' }),
|
||||
|
||||
-- navigate to next snippet placeholder
|
||||
['<C-d>'] = cmp.mapping(function(fallback)
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
|
||||
-- navigate to the previous snippet placeholder
|
||||
['<C-b>'] = cmp.mapping(function(fallback)
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
}),
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
return {
|
||||
{ -- This helps with php/html for indentation
|
||||
'captbaritone/better-indent-support-for-php-with-html',
|
||||
},
|
||||
{ -- This helps with ssh tunneling and copying to clipboard
|
||||
'ojroques/vim-oscyank',
|
||||
},
|
||||
{ -- This generates docblocks
|
||||
'kkoomen/vim-doge',
|
||||
build = ':call doge#install()'
|
||||
},
|
||||
{ -- Git plugin
|
||||
'tpope/vim-fugitive',
|
||||
},
|
||||
{ -- Show historical versions of the file locally
|
||||
'mbbill/undotree',
|
||||
},
|
||||
{ -- Show CSS Colors
|
||||
'brenoprata10/nvim-highlight-colors',
|
||||
config = function()
|
||||
require('nvim-highlight-colors').setup({})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
|
||||
end
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotage = { enable = true},
|
||||
ensure_installed = {
|
||||
"c", "go", "rust", "typescript", "tsx", "javascript", "yaml", "json", "zig", "python", "cpp"
|
||||
},
|
||||
auto_install = false
|
||||
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt dist-upgrade -y
|
||||
sudo apt autoremove -y
|
||||
sudo apt autoclean -y
|
||||
|
||||
# this fixes .ssh and .gnupg directory permissions
|
||||
find ~/.gnupg -type d -exec chmod 700 {} \;
|
||||
find ~/.gnupg -type f -exec chmod 600 {} \;
|
||||
chmod 600 ~/.ssh/* && chmod 700 ~/.ssh && chmod 644 ~/.ssh/*.pub
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
GITHUB_USERNAME="andwati"
|
||||
DESTINATION_FOLDER=~/dev
|
||||
|
||||
# Define colors
|
||||
GREEN="\e[32m"
|
||||
BLUE="\e[34m"
|
||||
RED="\e[31m"
|
||||
RESET="\e[0m"
|
||||
|
||||
clone_repositories() {
|
||||
local parent_dir=$1
|
||||
local repo_name=$2
|
||||
|
||||
# Clone the repository using GitHub CLI
|
||||
echo -e "${BLUE}Cloning repository: $repo_name${RESET}"
|
||||
if gh repo clone "$GITHUB_USERNAME/$repo_name" "$parent_dir/$repo_name"; then
|
||||
echo -e "${GREEN}Successfully cloned: $repo_name${RESET}"
|
||||
else
|
||||
echo -e "${RED}Failed to clone: $repo_name${RESET}"
|
||||
return
|
||||
fi
|
||||
|
||||
# Move into the cloned repository folder
|
||||
cd "$parent_dir/$repo_name" || exit
|
||||
|
||||
# If there are submodules, initialize and update them
|
||||
if [ -f ".gitmodules" ]; then
|
||||
echo -e "${BLUE}Initializing and updating submodules for: $repo_name${RESET}"
|
||||
git submodule init
|
||||
git submodule update
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
# Ensure the destination folder exists
|
||||
mkdir -p "$DESTINATION_FOLDER"
|
||||
|
||||
# Fetch the list of repositories for the user using GitHub CLI, including private and public repos
|
||||
echo -e "${BLUE}Fetching repositories for user: $GITHUB_USERNAME${RESET}"
|
||||
repos=$(gh repo list "$GITHUB_USERNAME" --visibility public --limit 100 --json name -q '.[].name')
|
||||
private_repos=$(gh repo list "$GITHUB_USERNAME" --visibility private --limit 100 --json name -q '.[].name')
|
||||
|
||||
# Combine public and private repositories
|
||||
repos="$repos $private_repos"
|
||||
|
||||
# Initialize progress variables
|
||||
total_repos=$(echo "$repos" | wc -w)
|
||||
count=0
|
||||
|
||||
# Loop through each repository and clone it
|
||||
for repo in $repos; do
|
||||
count=$((count + 1))
|
||||
echo -e "${BLUE}Progress: [$count/$total_repos]${RESET}"
|
||||
clone_repositories "$DESTINATION_FOLDER" "$repo"
|
||||
done
|
||||
|
||||
echo -e "${GREEN}Cloning complete! ${RESET}"
|
||||
}
|
||||
|
||||
main
|
||||
@@ -1,736 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# =============================================================================
|
||||
# Kali Linux Zsh Setup — mirrors Manjaro zsh config
|
||||
# Run as your normal user (sudo will be used where needed)
|
||||
# =============================================================================
|
||||
set -euo pipefail
|
||||
|
||||
ZDOTDIR="${HOME}"
|
||||
ZSH_CUSTOM_DIR="${HOME}/.zsh-custom"
|
||||
P10K_DIR="${HOME}/.zsh-custom/powerlevel10k"
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
info() { echo -e "${GREEN}[INFO]${NC} $*"; }
|
||||
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
|
||||
die() { echo -e "${RED}[ERROR]${NC} $*" >&2; exit 1; }
|
||||
|
||||
# =============================================================================
|
||||
# 1. Install packages
|
||||
# =============================================================================
|
||||
info "Updating package lists..."
|
||||
sudo apt-get update -qq
|
||||
|
||||
info "Installing zsh and plugins..."
|
||||
sudo apt-get install -y \
|
||||
zsh \
|
||||
zsh-syntax-highlighting \
|
||||
zsh-autosuggestions \
|
||||
git \
|
||||
curl \
|
||||
fonts-powerline \
|
||||
dircolors
|
||||
|
||||
# zsh-history-substring-search is not in Kali repos — install from source
|
||||
HIST_SEARCH_DIR="${ZSH_CUSTOM_DIR}/zsh-history-substring-search"
|
||||
if [[ ! -d "$HIST_SEARCH_DIR" ]]; then
|
||||
info "Installing zsh-history-substring-search..."
|
||||
mkdir -p "$ZSH_CUSTOM_DIR"
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search.git "$HIST_SEARCH_DIR"
|
||||
else
|
||||
info "zsh-history-substring-search already present, pulling latest..."
|
||||
git -C "$HIST_SEARCH_DIR" pull --ff-only
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
# 2. Install Powerlevel10k
|
||||
# =============================================================================
|
||||
if [[ ! -d "$P10K_DIR" ]]; then
|
||||
info "Installing Powerlevel10k..."
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_DIR"
|
||||
else
|
||||
info "Powerlevel10k already present, pulling latest..."
|
||||
git -C "$P10K_DIR" pull --ff-only
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
# 3. Install nvm
|
||||
# =============================================================================
|
||||
if [[ ! -d "${HOME}/.nvm" ]]; then
|
||||
info "Installing nvm..."
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
||||
else
|
||||
info "nvm already installed."
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
# 4. Write zsh-config (equivalent of /usr/share/zsh/manjaro-zsh-config)
|
||||
# =============================================================================
|
||||
info "Writing ~/.zsh-config..."
|
||||
cat > "${ZDOTDIR}/.zsh-config" << 'EOF'
|
||||
## Options section
|
||||
setopt correct
|
||||
setopt extendedglob
|
||||
setopt nocaseglob
|
||||
setopt rcexpandparam
|
||||
setopt nocheckjobs
|
||||
setopt numericglobsort
|
||||
setopt nobeep
|
||||
setopt appendhistory
|
||||
setopt histignorealldups
|
||||
setopt autocd
|
||||
setopt inc_append_history
|
||||
setopt histignorespace
|
||||
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' rehash true
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' accept-exact '*(N)'
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path ~/.zsh/cache
|
||||
HISTFILE=~/.zhistory
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
WORDCHARS=${WORDCHARS//\/[&.;]}
|
||||
|
||||
## Keybindings section
|
||||
bindkey -e
|
||||
bindkey '^[[7~' beginning-of-line
|
||||
bindkey '^[[H' beginning-of-line
|
||||
if [[ "${terminfo[khome]}" != "" ]]; then
|
||||
bindkey "${terminfo[khome]}" beginning-of-line
|
||||
fi
|
||||
bindkey '^[[8~' end-of-line
|
||||
bindkey '^[[F' end-of-line
|
||||
if [[ "${terminfo[kend]}" != "" ]]; then
|
||||
bindkey "${terminfo[kend]}" end-of-line
|
||||
fi
|
||||
bindkey '^[[2~' overwrite-mode
|
||||
bindkey '^[[3~' delete-char
|
||||
bindkey '^[[C' forward-char
|
||||
bindkey '^[[D' backward-char
|
||||
bindkey '^[[5~' history-beginning-search-backward
|
||||
bindkey '^[[6~' history-beginning-search-forward
|
||||
bindkey '^[Oc' forward-word
|
||||
bindkey '^[Od' backward-word
|
||||
bindkey '^[[1;5D' backward-word
|
||||
bindkey '^[[1;5C' forward-word
|
||||
bindkey '^H' backward-kill-word
|
||||
bindkey '^[[Z' undo
|
||||
|
||||
## Alias section
|
||||
alias cp="cp -i"
|
||||
alias df='df -h'
|
||||
alias free='free -m'
|
||||
alias gitu='git add . && git commit && git push'
|
||||
|
||||
## Theming section
|
||||
autoload -U compinit colors zcalc
|
||||
compinit -d
|
||||
colors
|
||||
|
||||
# Color man pages
|
||||
export LESS_TERMCAP_mb=$'\E[01;32m'
|
||||
export LESS_TERMCAP_md=$'\E[01;32m'
|
||||
export LESS_TERMCAP_me=$'\E[0m'
|
||||
export LESS_TERMCAP_se=$'\E[0m'
|
||||
export LESS_TERMCAP_so=$'\E[01;47;34m'
|
||||
export LESS_TERMCAP_ue=$'\E[0m'
|
||||
export LESS_TERMCAP_us=$'\E[01;36m'
|
||||
export LESS=-R
|
||||
|
||||
## Plugins — Kali/Debian paths
|
||||
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
source "${HOME}/.zsh-custom/zsh-history-substring-search/zsh-history-substring-search.zsh"
|
||||
|
||||
zmodload zsh/terminfo
|
||||
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
||||
bindkey "$terminfo[kcud1]" history-substring-search-down
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
|
||||
# Terminal title support
|
||||
function title {
|
||||
emulate -L zsh
|
||||
setopt prompt_subst
|
||||
[[ "$EMACS" == *term* ]] && return
|
||||
: ${2=$1}
|
||||
case "$TERM" in
|
||||
xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|kitty|wezterm|st*)
|
||||
print -Pn "\e]2;${2:q}\a"
|
||||
print -Pn "\e]1;${1:q}\a"
|
||||
;;
|
||||
screen*|tmux*)
|
||||
print -Pn "\ek${1:q}\e\\"
|
||||
;;
|
||||
*)
|
||||
if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
|
||||
echoti tsl
|
||||
print -Pn "$1"
|
||||
echoti fsl
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<"
|
||||
ZSH_THEME_TERM_TITLE_IDLE="%n@%m:%~"
|
||||
|
||||
function mzc_termsupport_precmd {
|
||||
[[ "${DISABLE_AUTO_TITLE:-}" == true ]] && return
|
||||
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
||||
}
|
||||
|
||||
function mzc_termsupport_preexec {
|
||||
[[ "${DISABLE_AUTO_TITLE:-}" == true ]] && return
|
||||
emulate -L zsh
|
||||
local -a cmdargs
|
||||
cmdargs=("${(z)2}")
|
||||
if [[ "${cmdargs[1]}" = fg ]]; then
|
||||
local job_id jobspec="${cmdargs[2]#%}"
|
||||
case "$jobspec" in
|
||||
<->) job_id=${jobspec} ;;
|
||||
""|%|+) job_id=${(k)jobstates[(r)*:+:*]} ;;
|
||||
-) job_id=${(k)jobstates[(r)*:-:*]} ;;
|
||||
[?]*) job_id=${(k)jobtexts[(r)*${(Q)jobspec}*]} ;;
|
||||
*) job_id=${(k)jobtexts[(r)${(Q)jobspec}*]} ;;
|
||||
esac
|
||||
if [[ -n "${jobtexts[$job_id]}" ]]; then
|
||||
1="${jobtexts[$job_id]}"
|
||||
2="${jobtexts[$job_id]}"
|
||||
fi
|
||||
fi
|
||||
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
|
||||
local LINE="${2:gs/%/%%}"
|
||||
title '$CMD' '%100>...>$LINE%<<'
|
||||
}
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook precmd mzc_termsupport_precmd
|
||||
add-zsh-hook preexec mzc_termsupport_preexec
|
||||
|
||||
zmodload zsh/langinfo
|
||||
|
||||
function zsh_urlencode() {
|
||||
emulate -L zsh
|
||||
local -a opts
|
||||
zparseopts -D -E -a opts r m P
|
||||
local in_str="$@"
|
||||
local url_str=""
|
||||
local spaces_as_plus
|
||||
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
|
||||
local str="$in_str"
|
||||
local encoding=$langinfo[CODESET]
|
||||
local safe_encodings
|
||||
safe_encodings=(UTF-8 utf8 US-ASCII)
|
||||
if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
|
||||
str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "Error converting string from $encoding to UTF-8" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
local i byte ord LC_ALL=C
|
||||
export LC_ALL
|
||||
local reserved=';/?:@&=+$,'
|
||||
local mark='_.!~*''()-'
|
||||
local dont_escape="[A-Za-z0-9"
|
||||
if [[ -z $opts[(r)-r] ]]; then dont_escape+=$reserved; fi
|
||||
if [[ -z $opts[(r)-m] ]]; then dont_escape+=$mark; fi
|
||||
dont_escape+="]"
|
||||
local url_str=""
|
||||
for (( i = 1; i <= ${#str}; ++i )); do
|
||||
byte="$str[i]"
|
||||
if [[ "$byte" =~ "$dont_escape" ]]; then
|
||||
url_str+="$byte"
|
||||
else
|
||||
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
|
||||
url_str+="+"
|
||||
else
|
||||
ord=$(( [##16] #byte ))
|
||||
url_str+="%$ord"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo -E "$url_str"
|
||||
}
|
||||
|
||||
function mzc_termsupport_cwd {
|
||||
local URL_HOST URL_PATH
|
||||
URL_HOST="$(zsh_urlencode -P $HOST)" || return 1
|
||||
URL_PATH="$(zsh_urlencode -P $PWD)" || return 1
|
||||
printf "\e]7;%s\a" "file://${URL_HOST}${URL_PATH}"
|
||||
}
|
||||
|
||||
add-zsh-hook precmd mzc_termsupport_cwd
|
||||
|
||||
# File and dir colors
|
||||
export LS_OPTIONS='--color=auto'
|
||||
eval "$(dircolors -b)"
|
||||
alias ls='ls $LS_OPTIONS'
|
||||
EOF
|
||||
|
||||
# =============================================================================
|
||||
# 5. Write zsh-prompt (equivalent of /usr/share/zsh/manjaro-zsh-prompt)
|
||||
# =============================================================================
|
||||
info "Writing ~/.zsh-prompt..."
|
||||
cat > "${ZDOTDIR}/.zsh-prompt" << EOF
|
||||
() {
|
||||
emulate -L zsh
|
||||
|
||||
source "${P10K_DIR}/powerlevel10k.zsh-theme"
|
||||
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
|
||||
{
|
||||
if ! zmodload zsh/langinfo zsh/terminfo ||
|
||||
[[ \$langinfo[CODESET] != (utf|UTF)(-|)8 || \$TERM == (dumb|linux) ]] ||
|
||||
(( terminfo[colors] < 256 )); then
|
||||
local USE_POWERLINE=false
|
||||
local parent
|
||||
if { parent=\$(</proc/\$PPID/comm) } && [[ \${parent:t} == login ]]; then
|
||||
alias x='startx ~/.xinitrc'
|
||||
fi
|
||||
fi
|
||||
} 2>/dev/null
|
||||
|
||||
if [[ \$USE_POWERLINE == false ]]; then
|
||||
source "${ZDOTDIR}/.p10k-portable.zsh"
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold'
|
||||
else
|
||||
source "${ZDOTDIR}/.p10k.zsh"
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=244'
|
||||
fi
|
||||
}
|
||||
EOF
|
||||
|
||||
# =============================================================================
|
||||
# 6. Write p10k configs
|
||||
# =============================================================================
|
||||
info "Writing p10k config files..."
|
||||
|
||||
cat > "${ZDOTDIR}/.p10k.zsh" << 'P10K_EOF'
|
||||
# Generated by Powerlevel10k configuration wizard on 2021-11-14 at 16:02 CET.
|
||||
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 19497.
|
||||
# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode,
|
||||
# angled separators, sharp heads, flat tails, 1 line, compact, many icons, concise,
|
||||
# instant_prompt=quiet.
|
||||
# Type `p10k configure` to generate another config.
|
||||
|
||||
'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 -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||
|
||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||
os_icon
|
||||
dir
|
||||
vcs
|
||||
)
|
||||
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
|
||||
status
|
||||
command_execution_time
|
||||
background_jobs
|
||||
direnv
|
||||
asdf
|
||||
virtualenv
|
||||
anaconda
|
||||
pyenv
|
||||
goenv
|
||||
nodenv
|
||||
nvm
|
||||
nodeenv
|
||||
node_version
|
||||
go_version
|
||||
rust_version
|
||||
dotnet_version
|
||||
php_version
|
||||
laravel_version
|
||||
java_version
|
||||
package
|
||||
rbenv
|
||||
rvm
|
||||
fvm
|
||||
luaenv
|
||||
jenv
|
||||
plenv
|
||||
perlbrew
|
||||
phpenv
|
||||
scalaenv
|
||||
haskell_stack
|
||||
kubecontext
|
||||
terraform
|
||||
terraform_version
|
||||
aws
|
||||
aws_eb_env
|
||||
azure
|
||||
gcloud
|
||||
google_app_cred
|
||||
toolbox
|
||||
context
|
||||
nordvpn
|
||||
ranger
|
||||
nnn
|
||||
lf
|
||||
xplr
|
||||
vim_shell
|
||||
midnight_commander
|
||||
nix_shell
|
||||
vi_mode
|
||||
vpn_ip
|
||||
load
|
||||
disk_usage
|
||||
ram
|
||||
swap
|
||||
todo
|
||||
timewarrior
|
||||
taskwarrior
|
||||
time
|
||||
newline
|
||||
)
|
||||
|
||||
typeset -g POWERLEVEL9K_MODE=nerdfont-complete
|
||||
typeset -g POWERLEVEL9K_ICON_PADDING=none
|
||||
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
|
||||
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
|
||||
|
||||
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
||||
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_PROMPT_FIRST_SEGMENT_START_SYMBOL=
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=
|
||||
typeset -g POWERLEVEL9K_SHOW_RULER=false
|
||||
typeset -g POWERLEVEL9K_RULER_CHAR='─'
|
||||
typeset -g POWERLEVEL9K_RULER_FOREGROUND=242
|
||||
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
|
||||
|
||||
# os_icon
|
||||
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=212
|
||||
|
||||
# dir
|
||||
typeset -g POWERLEVEL9K_DIR_FOREGROUND=31
|
||||
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=
|
||||
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
|
||||
local anchor_files=(
|
||||
.bzr
|
||||
.citc
|
||||
.git
|
||||
.hg
|
||||
.node-version
|
||||
.python-version
|
||||
.go-version
|
||||
.ruby-version
|
||||
.tool-versions
|
||||
.shorten_folder_marker
|
||||
.svn
|
||||
.terraform
|
||||
CVS
|
||||
Cargo.toml
|
||||
composer.json
|
||||
go.mod
|
||||
package.json
|
||||
stack.yaml
|
||||
)
|
||||
typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
|
||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
|
||||
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
|
||||
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
|
||||
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
||||
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3
|
||||
|
||||
# vcs
|
||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 '
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
|
||||
function my_git_formatter() {
|
||||
emulate -L zsh
|
||||
if [[ -n $P9K_CONTENT ]]; then
|
||||
typeset -g my_git_format=$P9K_CONTENT
|
||||
return
|
||||
fi
|
||||
local meta='%7F'
|
||||
local clean='%76F'
|
||||
local modified='%178F'
|
||||
local untracked='%39F'
|
||||
local conflicted='%196F'
|
||||
local res
|
||||
local where
|
||||
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
||||
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
|
||||
where=${(V)VCS_STATUS_LOCAL_BRANCH}
|
||||
elif [[ -n $VCS_STATUS_TAG ]]; then
|
||||
res+="${meta}#"
|
||||
where=${(V)VCS_STATUS_TAG}
|
||||
else
|
||||
res+="${meta}@"
|
||||
where=${VCS_STATUS_COMMIT[1,8]}
|
||||
fi
|
||||
(( $#where > 32 )) && where[13,-13]="…"
|
||||
res+="${clean}${where//\%/%%}"
|
||||
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
||||
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
|
||||
fi
|
||||
if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
|
||||
res+=" ${modified}wip"
|
||||
fi
|
||||
(( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )) && res+=' '
|
||||
(( VCS_STATUS_COMMITS_BEHIND )) && res+="${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
||||
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
||||
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
||||
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}"
|
||||
(( VCS_STATUS_NUM_SKIP_WORKTREE_CHANGED || VCS_STATUS_NUM_ASSUME_UNCHANGED_CHANGED )) && res+=" ${modified}─"
|
||||
(( VCS_STATUS_HAS_STAGED )) && res+=" ${modified}+"
|
||||
(( VCS_STATUS_HAS_UNSTAGED )) && res+=" ${modified}!"
|
||||
(( VCS_STATUS_HAS_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}"
|
||||
(( VCS_STATUS_HAS_CONFLICTED )) && res+=" ${conflicted}~"
|
||||
typeset -g my_git_format=$res
|
||||
}
|
||||
functions -M my_git_formatter 2>/dev/null
|
||||
typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1
|
||||
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
||||
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
|
||||
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}'
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}'
|
||||
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
|
||||
typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244
|
||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
|
||||
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178
|
||||
|
||||
# status
|
||||
typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
|
||||
typeset -g POWERLEVEL9K_STATUS_OK=false
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
|
||||
typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
|
||||
# command_execution_time
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
|
||||
|
||||
# background_jobs
|
||||
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
|
||||
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=37
|
||||
|
||||
# nvm
|
||||
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
||||
|
||||
# node_version
|
||||
typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
|
||||
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
|
||||
|
||||
# go_version
|
||||
typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37
|
||||
typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
|
||||
|
||||
# rust_version
|
||||
typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
|
||||
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
|
||||
|
||||
# java_version
|
||||
typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32
|
||||
typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true
|
||||
|
||||
# package
|
||||
typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117
|
||||
|
||||
# kubecontext
|
||||
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold'
|
||||
|
||||
# context
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=227
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180
|
||||
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
|
||||
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
|
||||
|
||||
# time
|
||||
typeset -g POWERLEVEL9K_TIME_FOREGROUND=66
|
||||
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
|
||||
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
|
||||
|
||||
# Transient prompt
|
||||
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off
|
||||
|
||||
# Instant prompt
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
|
||||
|
||||
# Hot reload
|
||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
||||
|
||||
(( ! $+functions[p10k] )) || p10k reload
|
||||
}
|
||||
|
||||
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
|
||||
'builtin' 'unset' 'p10k_config_opts'
|
||||
P10K_EOF
|
||||
|
||||
# Portable (8-color fallback) p10k config
|
||||
cat > "${ZDOTDIR}/.p10k-portable.zsh" << 'PORTABLE_EOF'
|
||||
'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 -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs prompt_char)
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time background_jobs)
|
||||
|
||||
typeset -g POWERLEVEL9K_MODE=ascii
|
||||
typeset -g POWERLEVEL9K_ICON_PADDING=none
|
||||
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
||||
typeset -g POWERLEVEL9K_BACKGROUND=
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE=
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' '
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR=
|
||||
|
||||
typeset -g POWERLEVEL9K_DIR_FOREGROUND=4
|
||||
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=4
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=4
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
|
||||
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=
|
||||
|
||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2
|
||||
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=3
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2
|
||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||
|
||||
typeset -g POWERLEVEL9K_STATUS_OK=false
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=1
|
||||
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=3
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
|
||||
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1
|
||||
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='O'
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
|
||||
|
||||
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
|
||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
||||
|
||||
(( ! $+functions[p10k] )) || p10k reload
|
||||
}
|
||||
|
||||
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
|
||||
'builtin' 'unset' 'p10k_config_opts'
|
||||
PORTABLE_EOF
|
||||
|
||||
# =============================================================================
|
||||
# 7. Write .zshrc
|
||||
# =============================================================================
|
||||
info "Writing ~/.zshrc..."
|
||||
|
||||
# Back up existing .zshrc if present
|
||||
if [[ -f "${ZDOTDIR}/.zshrc" ]]; then
|
||||
cp "${ZDOTDIR}/.zshrc" "${ZDOTDIR}/.zshrc.bak"
|
||||
warn "Existing .zshrc backed up to ~/.zshrc.bak"
|
||||
fi
|
||||
|
||||
cat > "${ZDOTDIR}/.zshrc" << EOF
|
||||
USE_POWERLINE="true"
|
||||
HAS_WIDECHARS="false"
|
||||
|
||||
source "\${HOME}/.zsh-config"
|
||||
source "\${HOME}/.zsh-prompt"
|
||||
|
||||
# nvm
|
||||
export NVM_DIR="\${HOME}/.nvm"
|
||||
[ -s "\${NVM_DIR}/nvm.sh" ] && source "\${NVM_DIR}/nvm.sh"
|
||||
[ -s "\${NVM_DIR}/bash_completion" ] && source "\${NVM_DIR}/bash_completion"
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="\${HOME}/.local/share/pnpm"
|
||||
case ":\$PATH:" in
|
||||
*":\$PNPM_HOME:"*) ;;
|
||||
*) export PATH="\$PNPM_HOME:\$PATH" ;;
|
||||
esac
|
||||
|
||||
# Java
|
||||
export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto
|
||||
export PATH=\$JAVA_HOME/bin:\$PATH
|
||||
|
||||
# Android
|
||||
export ANDROID_HOME=\$HOME/Android/Sdk
|
||||
export ANDROID_SDK_ROOT=\$ANDROID_HOME
|
||||
export PATH=\$ANDROID_HOME/emulator:\$PATH
|
||||
export PATH=\$ANDROID_HOME/platform-tools:\$PATH
|
||||
export PATH=\$ANDROID_HOME/cmdline-tools/latest/bin:\$PATH
|
||||
EOF
|
||||
|
||||
# =============================================================================
|
||||
# 8. Set zsh as default shell
|
||||
# =============================================================================
|
||||
if [[ "$SHELL" != "$(which zsh)" ]]; then
|
||||
info "Setting zsh as default shell..."
|
||||
chsh -s "$(which zsh)"
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
# Done
|
||||
# =============================================================================
|
||||
echo ""
|
||||
info "Setup complete! Start a new terminal or run: exec zsh"
|
||||
warn "Note: Update JAVA_HOME in ~/.zshrc if your JDK path differs on Kali."
|
||||
warn "Note: Install a Nerd Font for the full powerline prompt (https://www.nerdfonts.com/)."
|
||||
warn " Then set it in your terminal emulator's font settings."
|
||||
@@ -1,169 +0,0 @@
|
||||
{
|
||||
"files.autoSave": "onFocusChange",
|
||||
"editor.formatOnSave": true,
|
||||
"workbench.startupEditor": "none",
|
||||
"cSpell.userWords": [
|
||||
"aiwfi",
|
||||
"Andwati",
|
||||
"ASGI",
|
||||
"celerybeat",
|
||||
"CLKG",
|
||||
"cython",
|
||||
"djangorestframework",
|
||||
"djlint",
|
||||
"dmypy",
|
||||
"dotenv",
|
||||
"endmacro",
|
||||
"expenseswebsite",
|
||||
"flaskr",
|
||||
"gitno",
|
||||
"Goatcounter",
|
||||
"griggs",
|
||||
"gruvbox",
|
||||
"gunicorn",
|
||||
"Gupkre",
|
||||
"hepner",
|
||||
"hermant",
|
||||
"heroicons",
|
||||
"Homesteady",
|
||||
"inspo",
|
||||
"ipython",
|
||||
"isort",
|
||||
"krzysztof",
|
||||
"lbgw",
|
||||
"Machu",
|
||||
"makemigrations",
|
||||
"Matomo",
|
||||
"mattn",
|
||||
"Metawork",
|
||||
"mkdocs",
|
||||
"mypy",
|
||||
"Ndarray",
|
||||
"neogit",
|
||||
"OPENWEATHER",
|
||||
"pgpass",
|
||||
"Phuket",
|
||||
"Picchu",
|
||||
"pipenv",
|
||||
"Pipfile",
|
||||
"psycopg",
|
||||
"pybuilder",
|
||||
"pycache",
|
||||
"pyenv",
|
||||
"pyfile",
|
||||
"pyjwt",
|
||||
"pypa",
|
||||
"pypi",
|
||||
"pytest",
|
||||
"pyupgrade",
|
||||
"Rica",
|
||||
"runserver",
|
||||
"saru",
|
||||
"Scrapy",
|
||||
"shadcn",
|
||||
"shopyangu",
|
||||
"spyproject",
|
||||
"telebot",
|
||||
"TPTX",
|
||||
"turbopack",
|
||||
"venv",
|
||||
"webaliser",
|
||||
"webassets",
|
||||
"websockets",
|
||||
"whitenoise",
|
||||
"wikipediaapi",
|
||||
"yasg"
|
||||
],
|
||||
"git.autofetch": true,
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"explorer.confirmDelete": false,
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"telemetry.telemetryLevel": "off",
|
||||
"emmet.includeLanguages": {
|
||||
"javascript": "javascriptreact",
|
||||
"django-html": "html"
|
||||
},
|
||||
"zig.path": "c:\\Users\\Ian\\AppData\\Roaming\\Code\\User\\globalStorage\\ziglang.vscode-zig\\zig_install\\zig.exe",
|
||||
"zig.zls.path": "c:\\Users\\Ian\\AppData\\Roaming\\Code\\User\\globalStorage\\ziglang.vscode-zig\\zls_install\\zls.exe",
|
||||
"[javascriptreact]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"javascript.updateImportsOnFileMove.enabled": "always",
|
||||
"terminal.integrated.fontFamily": "\"MesloLGM Nerd Font\"",
|
||||
"files.autoSaveWhenNoErrors": true,
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
|
||||
},
|
||||
"haskell.manageHLS": "GHCup",
|
||||
"typescript.updateImportsOnFileMove.enabled": "always",
|
||||
"makefile.configureOnOpen": true,
|
||||
"zig.zls.enabled": "on",
|
||||
"go.toolsManagement.autoUpdate": true,
|
||||
"snyk.folderConfigs": [
|
||||
{
|
||||
"folderPath": "c:\\Users\\Ian\\dev\\hacktrix",
|
||||
"baseBranch": "main",
|
||||
"localBranches": [
|
||||
"main"
|
||||
]
|
||||
}
|
||||
],
|
||||
"snyk.yesWelcomeNotification": false,
|
||||
"snyk.trustedFolders": [
|
||||
"c:\\Users\\Ian\\dev\\hacktrix"
|
||||
],
|
||||
"workbench.colorCustomizations": {
|
||||
"[Vira*]": {
|
||||
"toolbar.activeBackground": "#80CBC426",
|
||||
"activityBarBadge.background": "#80CBC4",
|
||||
"activityBar.activeBorder": "#80CBC4",
|
||||
"activityBarTop.activeBorder": "#80CBC4",
|
||||
"list.inactiveSelectionIconForeground": "#80CBC4",
|
||||
"list.activeSelectionForeground": "#80CBC4",
|
||||
"list.inactiveSelectionForeground": "#80CBC4",
|
||||
"list.highlightForeground": "#80CBC4",
|
||||
"sash.hoverBorder": "#80CBC480",
|
||||
"list.activeSelectionIconForeground": "#80CBC4",
|
||||
"scrollbarSlider.activeBackground": "#80CBC480",
|
||||
"editorSuggestWidget.highlightForeground": "#80CBC4",
|
||||
"textLink.foreground": "#80CBC4",
|
||||
"progressBar.background": "#80CBC4",
|
||||
"pickerGroup.foreground": "#80CBC4",
|
||||
"tab.activeBorder": "#80CBC4",
|
||||
"notificationLink.foreground": "#80CBC4",
|
||||
"editorWidget.resizeBorder": "#80CBC4",
|
||||
"editorWidget.border": "#80CBC4",
|
||||
"settings.modifiedItemIndicator": "#80CBC4",
|
||||
"settings.headerForeground": "#80CBC4",
|
||||
"panelTitle.activeBorder": "#80CBC4",
|
||||
"breadcrumb.activeSelectionForeground": "#80CBC4",
|
||||
"menu.selectionForeground": "#80CBC4",
|
||||
"menubar.selectionForeground": "#80CBC4",
|
||||
"editor.findMatchBorder": "#80CBC4",
|
||||
"selection.background": "#80CBC440",
|
||||
"statusBarItem.remoteBackground": "#80CBC4",
|
||||
"notebook.inactiveFocusedCellBorder": "#80CBC480",
|
||||
"commandCenter.activeBorder": "#80CBC480"
|
||||
}
|
||||
},
|
||||
"snyk.advanced.cliPath": "/home/ian/.local/share/snyk/vscode-cli/snyk-linux",
|
||||
"editor.fontFamily": "\"MesloLGM Nerd Font\", 'monospace', monospace",
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"workbench.iconTheme": "material-icon-theme",
|
||||
"workbench.productIconTheme": "material-product-icons",
|
||||
"editor.minimap.enabled": false,
|
||||
"python.analysis.typeCheckingMode": "strict"
|
||||
}
|
||||
Reference in New Issue
Block a user