init: initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
require("config.options")
|
||||||
|
require("config.keymaps")
|
||||||
|
require("config.autocmds")
|
||||||
|
require("config.diagnostics")
|
||||||
|
require("config.lazy")
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
local augroup = vim.api.nvim_create_augroup
|
||||||
|
|
||||||
|
-- highlight on yank
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
group = augroup("YankHighlight", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({ timeout = 200 })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- optional: auto format on save (handled by conform too, but this is a safe place for extra logic later)
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
local signs = {
|
||||||
|
Error = " ",
|
||||||
|
Warn = " ",
|
||||||
|
Hint = " ",
|
||||||
|
Info = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
for type, icon in pairs(signs) do
|
||||||
|
local hl = "DiagnosticSign" .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = { spacing = 2, prefix = "●" },
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = true,
|
||||||
|
float = { border = "rounded", source = "if_many" },
|
||||||
|
})
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- basics
|
||||||
|
map("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
|
||||||
|
map("n", "<leader>q", "<cmd>q<cr>", { desc = "Quit" })
|
||||||
|
|
||||||
|
-- better movement
|
||||||
|
map({ "n", "v" }, "H", "^", { desc = "Line start" })
|
||||||
|
map({ "n", "v" }, "L", "$", { desc = "Line end" })
|
||||||
|
|
||||||
|
-- diagnostics
|
||||||
|
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Prev diagnostic" })
|
||||||
|
map("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||||
|
map("n", "<leader>e", vim.diagnostic.open_float, { desc = "Line diagnostic" })
|
||||||
|
map("n", "<leader>dl", "<cmd>Telescope diagnostics<cr>", { desc = "Diagnostics list" })
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Find files" })
|
||||||
|
map("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Live grep" })
|
||||||
|
map("n", "<leader>fb", "<cmd>Telescope buffers<cr>", { desc = "Buffers" })
|
||||||
|
map("n", "<leader>fh", "<cmd>Telescope help_tags<cr>", { desc = "Help" })
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
-- lazy.nvim bootstrap
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git", "clone", "--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable",
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
defaults = { lazy = true },
|
||||||
|
install = { colorscheme = { "gruvbox" } },
|
||||||
|
checker = { enabled = true },
|
||||||
|
ui = { border = "rounded" },
|
||||||
|
})
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
local opt = vim.opt
|
||||||
|
opt.number = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.signcolumn = "yes"
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.wrap = false
|
||||||
|
opt.scrolloff = 10
|
||||||
|
opt.sidescrolloff = 8
|
||||||
|
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.smartindent = true
|
||||||
|
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.smartcase = true
|
||||||
|
opt.incsearch = true
|
||||||
|
|
||||||
|
opt.splitright = true
|
||||||
|
opt.splitbelow = true
|
||||||
|
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.updatetime = 250
|
||||||
|
opt.timeoutlen = 400
|
||||||
|
|
||||||
|
opt.clipboard = "unnamedplus"
|
||||||
|
opt.undofile = true
|
||||||
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
return {
|
||||||
|
{ "L3MON4D3/LuaSnip", event = "InsertEnter" },
|
||||||
|
{ "rafamadriz/friendly-snippets", event = "InsertEnter" },
|
||||||
|
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
local lspkind = require("lspkind")
|
||||||
|
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args) luasnip.lsp_expand(args.body) end,
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 }),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- autopairs integration
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
{ "nvim-lua/plenary.nvim", lazy = true },
|
||||||
|
|
||||||
|
{ "folke/which-key.nvim", event = "VeryLazy", opts = {} },
|
||||||
|
|
||||||
|
{ "numToStr/Comment.nvim", event = "VeryLazy", opts = {} },
|
||||||
|
|
||||||
|
{ "kylechui/nvim-surround", event = "VeryLazy", opts = {} },
|
||||||
|
|
||||||
|
{ "windwp/nvim-autopairs", event = "InsertEnter", opts = {} },
|
||||||
|
|
||||||
|
{ "lewis6991/gitsigns.nvim", event = "VeryLazy", opts = {} },
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
local function lsp_keymaps(ev)
|
||||||
|
local buf = ev.buf
|
||||||
|
local map = function(mode, lhs, rhs, desc)
|
||||||
|
vim.keymap.set(mode, lhs, rhs, { buffer = buf, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
map("n", "K", vim.lsp.buf.hover, "Hover")
|
||||||
|
map("n", "gd", vim.lsp.buf.definition, "Go to definition")
|
||||||
|
map("n", "gD", vim.lsp.buf.declaration, "Go to declaration")
|
||||||
|
map("n", "gr", vim.lsp.buf.references, "References")
|
||||||
|
map("n", "gi", vim.lsp.buf.implementation, "Implementation")
|
||||||
|
map("n", "<leader>rn", vim.lsp.buf.rename, "Rename")
|
||||||
|
map("n", "<leader>ca", vim.lsp.buf.code_action, "Code action")
|
||||||
|
|
||||||
|
if vim.lsp.inlay_hint then
|
||||||
|
pcall(vim.lsp.inlay_hint.enable, true, { bufnr = buf })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{ "williamboman/mason.nvim", cmd = "Mason", opts = {} },
|
||||||
|
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = { "mason.nvim" },
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "clangd", "gopls", "pyright", "lua_ls" },
|
||||||
|
automatic_installation = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Keep nvim-lspconfig installed (it provides server definitions),
|
||||||
|
-- but DO NOT call require("lspconfig") anymore.
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = { "hrsh7th/cmp-nvim-lsp" },
|
||||||
|
config = function()
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", { callback = lsp_keymaps })
|
||||||
|
|
||||||
|
local caps = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
local ok, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
|
if ok then
|
||||||
|
caps = cmp_lsp.default_capabilities(caps)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.lsp.config("clangd", {
|
||||||
|
capabilities = caps,
|
||||||
|
cmd = { "clangd", "--background-index", "--clang-tidy", "--header-insertion=iwyu" },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("gopls", {
|
||||||
|
capabilities = caps,
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
staticcheck = true,
|
||||||
|
analyses = { unusedparams = true, nilness = true, shadow = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("pyright", { capabilities = caps })
|
||||||
|
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
capabilities = caps,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable({ "clangd", "gopls", "pyright", "lua_ls" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
return {
|
||||||
|
-- formatting
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
format_on_save = { timeout_ms = 1500, lsp_fallback = true },
|
||||||
|
formatters_by_ft = {
|
||||||
|
c = { "clang_format" },
|
||||||
|
cpp = { "clang_format" },
|
||||||
|
go = { "gofmt", "goimports" },
|
||||||
|
python = { "isort", "black" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
json = { "prettier" },
|
||||||
|
yaml = { "prettier" },
|
||||||
|
markdown = { "prettier" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("conform").setup(opts)
|
||||||
|
vim.keymap.set("n", "<leader>f", function()
|
||||||
|
require("conform").format({ lsp_fallback = true })
|
||||||
|
end, { desc = "Format buffer" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- linting (optional but nice)
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
config = function()
|
||||||
|
local lint = require("lint")
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
python = { "flake8" },
|
||||||
|
go = { "golangcilint" },
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
|
||||||
|
callback = function()
|
||||||
|
lint.try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"c", "cpp", "go", "python", "lua",
|
||||||
|
"bash", "json", "yaml", "toml",
|
||||||
|
"markdown", "markdown_inline",
|
||||||
|
"regex", "vim", "vimdoc",
|
||||||
|
},
|
||||||
|
auto_install = true,
|
||||||
|
sync_install = false,
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-treesitter").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
return {
|
||||||
|
-- theme
|
||||||
|
{
|
||||||
|
"ellisonleao/gruvbox.nvim",
|
||||||
|
name = "gruvbox",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
opts = {
|
||||||
|
contrast = "hard", -- "hard", "soft", or "" (default medium)
|
||||||
|
transparent_mode = true,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("gruvbox").setup(opts)
|
||||||
|
vim.cmd.colorscheme("gruvbox")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- statusline
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
options = { theme = "gruvbox", globalstatus = true },
|
||||||
|
sections = {
|
||||||
|
lualine_c = { "filename", "diff" },
|
||||||
|
lualine_x = { "diagnostics", "filetype" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
cmd = "Telescope",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {
|
||||||
|
defaults = { borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
+250
@@ -0,0 +1,250 @@
|
|||||||
|
[user]
|
||||||
|
email = itq.dev@ya.ru
|
||||||
|
name = ITQ
|
||||||
|
signingkey = B13C2DAF24268258F525697A063A10A651314CE9
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[core]
|
||||||
|
editor = nvim
|
||||||
|
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
|
||||||
|
autocrlf = input
|
||||||
|
[web]
|
||||||
|
browser = firefox
|
||||||
|
[push]
|
||||||
|
default = matching
|
||||||
|
[commit]
|
||||||
|
template = ~/.gitmessage.txt
|
||||||
|
gpgsign = true
|
||||||
|
[color]
|
||||||
|
ui = auto
|
||||||
|
[color "branch"]
|
||||||
|
current = yellow bold
|
||||||
|
local = green bold
|
||||||
|
remote = cyan bold
|
||||||
|
[color "diff"]
|
||||||
|
meta = yellow bold
|
||||||
|
frag = magenta bold
|
||||||
|
old = red bold
|
||||||
|
new = green bold
|
||||||
|
whitespace = red reverse
|
||||||
|
[color "status"]
|
||||||
|
added = green bold
|
||||||
|
changed = yellow bold
|
||||||
|
untracked = red bold
|
||||||
|
[alias]
|
||||||
|
a = add --all
|
||||||
|
ai = add -i
|
||||||
|
#############
|
||||||
|
ap = apply
|
||||||
|
as = apply --stat
|
||||||
|
ac = apply --check
|
||||||
|
#############
|
||||||
|
ama = am --abort
|
||||||
|
amr = am --resolved
|
||||||
|
ams = am --skip
|
||||||
|
#############
|
||||||
|
b = branch
|
||||||
|
ba = branch -a
|
||||||
|
bd = branch -d
|
||||||
|
bdd = branch -D
|
||||||
|
br = branch -r
|
||||||
|
bc = rev-parse --abbrev-ref HEAD
|
||||||
|
bu = !git rev-parse --abbrev-ref --symbolic-full-name "@{u}"
|
||||||
|
bs = !git-branch-status
|
||||||
|
#############
|
||||||
|
c = commit
|
||||||
|
ca = commit -a
|
||||||
|
cm = commit -m
|
||||||
|
cam = commit -am
|
||||||
|
cem = commit --allow-empty -m
|
||||||
|
cd = commit --amend
|
||||||
|
cad = commit -a --amend
|
||||||
|
ced = commit --allow-empty --amend
|
||||||
|
#############
|
||||||
|
cl = clone
|
||||||
|
cld = clone --depth 1
|
||||||
|
clg = !sh -c 'git clone https://github.com/$1 $(basename $1)' -
|
||||||
|
clgp = !sh -c 'git clone git@github.com:$1 $(basename $1)' -
|
||||||
|
clgu = !sh -c 'git clone git@github.com:$(git config --get user.username)/$1 $1' -
|
||||||
|
#############
|
||||||
|
cp = cherry-pick
|
||||||
|
cpa = cherry-pick --abort
|
||||||
|
cpc = cherry-pick --continue
|
||||||
|
#############
|
||||||
|
d = diff
|
||||||
|
dp = diff --patience
|
||||||
|
dc = diff --cached
|
||||||
|
dk = diff --check
|
||||||
|
dck = diff --cached --check
|
||||||
|
dt = difftool
|
||||||
|
dct = difftool --cached
|
||||||
|
#############
|
||||||
|
f = fetch
|
||||||
|
fo = fetch origin
|
||||||
|
fu = fetch upstream
|
||||||
|
#############
|
||||||
|
fp = format-patch
|
||||||
|
#############
|
||||||
|
fk = fsck
|
||||||
|
#############
|
||||||
|
g = grep -p
|
||||||
|
#############
|
||||||
|
l = log --oneline
|
||||||
|
lg = log --oneline --graph --decorate
|
||||||
|
#############
|
||||||
|
ls = ls-files
|
||||||
|
lsf = !git ls-files | grep -i
|
||||||
|
#############
|
||||||
|
m = merge
|
||||||
|
ma = merge --abort
|
||||||
|
mc = merge --continue
|
||||||
|
ms = merge --skip
|
||||||
|
#############
|
||||||
|
o = checkout
|
||||||
|
om = checkout master
|
||||||
|
ob = checkout -b
|
||||||
|
#############
|
||||||
|
pr = prune -v
|
||||||
|
#############
|
||||||
|
ps = push
|
||||||
|
psf = push -f
|
||||||
|
psu = push -u
|
||||||
|
pst = push --tags
|
||||||
|
#############
|
||||||
|
pso = push origin
|
||||||
|
psao = push --all origin
|
||||||
|
psfo = push -f origin
|
||||||
|
psuo = push -u origin
|
||||||
|
#############
|
||||||
|
psom = push origin master
|
||||||
|
psaom = push --all origin master
|
||||||
|
psfom = push -f origin master
|
||||||
|
psuom = push -u origin master
|
||||||
|
psoc = !git push origin $(git bc)
|
||||||
|
psaoc = !git push --all origin $(git bc)
|
||||||
|
psfoc = !git push -f origin $(git bc)
|
||||||
|
psuoc = !git push -u origin $(git bc)
|
||||||
|
psdc = !git push origin :$(git bc)
|
||||||
|
#############
|
||||||
|
pl = pull
|
||||||
|
pb = pull --rebase
|
||||||
|
#############
|
||||||
|
plo = pull origin
|
||||||
|
pbo = pull --rebase origin
|
||||||
|
plom = pull origin master
|
||||||
|
ploc = !git pull origin $(git bc)
|
||||||
|
pbom = pull --rebase origin master
|
||||||
|
pboc = !git pull --rebase origin $(git bc)
|
||||||
|
#############
|
||||||
|
plu = pull upstream
|
||||||
|
plum = pull upstream master
|
||||||
|
pluc = !git pull upstream $(git bc)
|
||||||
|
pbum = pull --rebase upstream master
|
||||||
|
pbuc = !git pull --rebase upstream $(git bc)
|
||||||
|
#############
|
||||||
|
rb = rebase
|
||||||
|
rba = rebase --abort
|
||||||
|
rbc = rebase --continue
|
||||||
|
rbi = rebase --interactive
|
||||||
|
rbs = rebase --skip
|
||||||
|
#############
|
||||||
|
re = reset
|
||||||
|
rh = reset HEAD
|
||||||
|
reh = reset --hard
|
||||||
|
rem = reset --mixed
|
||||||
|
res = reset --soft
|
||||||
|
rehh = reset --hard HEAD
|
||||||
|
remh = reset --mixed HEAD
|
||||||
|
resh = reset --soft HEAD
|
||||||
|
rehom = reset --hard origin/master
|
||||||
|
#############
|
||||||
|
r = remote
|
||||||
|
ra = remote add
|
||||||
|
rr = remote rm
|
||||||
|
rv = remote -v
|
||||||
|
rn = remote rename
|
||||||
|
rp = remote prune
|
||||||
|
rs = remote show
|
||||||
|
rao = remote add origin
|
||||||
|
rau = remote add upstream
|
||||||
|
rro = remote remove origin
|
||||||
|
rru = remote remove upstream
|
||||||
|
rso = remote show origin
|
||||||
|
rsu = remote show upstream
|
||||||
|
rpo = remote prune origin
|
||||||
|
rpu = remote prune upstream
|
||||||
|
#############
|
||||||
|
rmf = rm -f
|
||||||
|
rmrf = rm -r -f
|
||||||
|
#############
|
||||||
|
s = status
|
||||||
|
sb = status -s -b
|
||||||
|
#############
|
||||||
|
sa = stash apply
|
||||||
|
sc = stash clear
|
||||||
|
sd = stash drop
|
||||||
|
sl = stash list
|
||||||
|
sp = stash pop
|
||||||
|
ss = stash save
|
||||||
|
ssk = stash save -k
|
||||||
|
sw = stash show
|
||||||
|
st = !git stash list | wc -l 2>/dev/null | grep -oEi '[0-9][0-9]*'
|
||||||
|
#############
|
||||||
|
t = tag
|
||||||
|
td = tag -d
|
||||||
|
#############
|
||||||
|
w = show
|
||||||
|
wp = show -p
|
||||||
|
wr = show -p --no-color
|
||||||
|
#############
|
||||||
|
svnr = svn rebase
|
||||||
|
svnd = svn dcommit
|
||||||
|
svnl = svn log --oneline --show-commit
|
||||||
|
#############
|
||||||
|
subadd = !sh -c 'git submodule add https://github.com/$1 $2/$(basename $1)' -
|
||||||
|
subrm = !sh -c 'git submodule deinit -f -- $1 && rm -rf .git/modules/$1 && git rm -f $1' -
|
||||||
|
subup = submodule update --init --recursive
|
||||||
|
subpull = submodule foreach 'git pull --tags -f origin master || git pull --tags -f origin main || git pull --tags -f origin development'
|
||||||
|
#############
|
||||||
|
assume = update-index --assume-unchanged
|
||||||
|
unassume = update-index --no-assume-unchanged
|
||||||
|
assumed = !git ls -v | grep ^h | cut -c 3-
|
||||||
|
unassumeall = !git assumed | xargs git unassume
|
||||||
|
assumeall = !git status -s | awk {'print $2'} | xargs git assume
|
||||||
|
#############
|
||||||
|
bump = !sh -c 'git commit -am \"Version bump v$1\" && git psuoc && git release $1' -
|
||||||
|
release = !sh -c 'git tag v$1 && git pst' -
|
||||||
|
unrelease = !sh -c 'git tag -d v$1 && git pso :v$1' -
|
||||||
|
merged = !sh -c 'git o master && git plom && git bd $1 && git rpo' -
|
||||||
|
aliases = !git config -l | grep alias | cut -c 7-
|
||||||
|
snap = !git stash save 'snapshot: $(date)' && git stash apply 'stash@{0}'
|
||||||
|
bare = !sh -c 'git symbolic-ref HEAD refs/heads/$1 && git rm --cached -r . && git clean -xfd' -
|
||||||
|
whois = !sh -c 'git log -i -1 --author=\"$1\" --pretty=\"format:%an <%ae>\"' -
|
||||||
|
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
|
||||||
|
#############
|
||||||
|
behind = !git rev-list --left-only --count $(git bu)...HEAD
|
||||||
|
ahead = !git rev-list --right-only --count $(git bu)...HEAD
|
||||||
|
#############
|
||||||
|
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
|
||||||
|
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
|
||||||
|
subrepo = !sh -c 'git filter-branch --prune-empty --subdirectory-filter $1 master' -
|
||||||
|
human = name-rev --name-only --refs=refs/heads/*
|
||||||
|
[filter "lfs"]
|
||||||
|
clean = git-lfs clean -- %f
|
||||||
|
smudge = git-lfs smudge -- %f
|
||||||
|
process = git-lfs filter-process
|
||||||
|
required = true
|
||||||
|
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
||||||
|
[merge]
|
||||||
|
log = true
|
||||||
|
[tag]
|
||||||
|
gpgsign = true
|
||||||
|
[gpg]
|
||||||
|
program = gpg
|
||||||
|
[credential]
|
||||||
|
helper = store
|
||||||
|
[advice]
|
||||||
|
detachedHead = false
|
||||||
|
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
__MACOSX/
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
Icon[
|
||||||
|
]
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
# LazyVim lock file
|
||||||
|
lazy-lock.json
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<type>(scope): <description>
|
||||||
|
|
||||||
|
[body]
|
||||||
|
|
||||||
|
[footer(s)]
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
# ################################################################ #
|
||||||
|
# THE FOLLOWING IS AN EXPLANATION OF THE GRAMMAR THAT SKHD PARSES. #
|
||||||
|
# FOR SIMPLE EXAMPLE MAPPINGS LOOK FURTHER DOWN THIS FILE.. #
|
||||||
|
# ################################################################ #
|
||||||
|
|
||||||
|
# A list of all built-in modifier and literal keywords can
|
||||||
|
# be found at https://github.com/koekeishiya/skhd/issues/1
|
||||||
|
#
|
||||||
|
# A hotkey is written according to the following rules:
|
||||||
|
#
|
||||||
|
# hotkey = <mode> '<' <action> | <action>
|
||||||
|
#
|
||||||
|
# mode = 'name of mode' | <mode> ',' <mode>
|
||||||
|
#
|
||||||
|
# action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']'
|
||||||
|
# <keysym> ':' <command> | <keysym> '->' ':' <command>
|
||||||
|
# <keysym> ';' <mode> | <keysym> '->' ';' <mode>
|
||||||
|
#
|
||||||
|
# keysym = <mod> '-' <key> | <key>
|
||||||
|
#
|
||||||
|
# mod = 'modifier keyword' | <mod> '+' <mod>
|
||||||
|
#
|
||||||
|
# key = <literal> | <keycode>
|
||||||
|
#
|
||||||
|
# literal = 'single letter or built-in keyword'
|
||||||
|
#
|
||||||
|
# keycode = 'apple keyboard kVK_<Key> values (0x3C)'
|
||||||
|
#
|
||||||
|
# proc_map_lst = * <proc_map>
|
||||||
|
#
|
||||||
|
# proc_map = <string> ':' <command> | <string> '~' |
|
||||||
|
# '*' ':' <command> | '*' '~'
|
||||||
|
#
|
||||||
|
# string = '"' 'sequence of characters' '"'
|
||||||
|
#
|
||||||
|
# command = command is executed through '$SHELL -c' and
|
||||||
|
# follows valid shell syntax. if the $SHELL environment
|
||||||
|
# variable is not set, it will default to '/bin/bash'.
|
||||||
|
# when bash is used, the ';' delimeter can be specified
|
||||||
|
# to chain commands.
|
||||||
|
#
|
||||||
|
# to allow a command to extend into multiple lines,
|
||||||
|
# prepend '\' at the end of the previous line.
|
||||||
|
#
|
||||||
|
# an EOL character signifies the end of the bind.
|
||||||
|
#
|
||||||
|
# -> = keypress is not consumed by skhd
|
||||||
|
#
|
||||||
|
# * = matches every application not specified in <proc_map_lst>
|
||||||
|
#
|
||||||
|
# ~ = application is unbound and keypress is forwarded per usual, when specified in a <proc_map>
|
||||||
|
#
|
||||||
|
# A mode is declared according to the following rules:
|
||||||
|
#
|
||||||
|
# mode_decl = '::' <name> '@' ':' <command> | '::' <name> ':' <command> |
|
||||||
|
# '::' <name> '@' | '::' <name>
|
||||||
|
#
|
||||||
|
# name = desired name for this mode,
|
||||||
|
#
|
||||||
|
# @ = capture keypresses regardless of being bound to an action
|
||||||
|
#
|
||||||
|
# command = command is executed through '$SHELL -c' and
|
||||||
|
# follows valid shell syntax. if the $SHELL environment
|
||||||
|
# variable is not set, it will default to '/bin/bash'.
|
||||||
|
# when bash is used, the ';' delimeter can be specified
|
||||||
|
# to chain commands.
|
||||||
|
#
|
||||||
|
# to allow a command to extend into multiple lines,
|
||||||
|
# prepend '\' at the end of the previous line.
|
||||||
|
#
|
||||||
|
# an EOL character signifies the end of the bind.
|
||||||
|
|
||||||
|
# ############################################################### #
|
||||||
|
# THE FOLLOWING SECTION CONTAIN SIMPLE MAPPINGS DEMONSTRATING HOW #
|
||||||
|
# TO INTERACT WITH THE YABAI WM. THESE ARE SUPPOSED TO BE USED AS #
|
||||||
|
# A REFERENCE ONLY, WHEN MAKING YOUR OWN CONFIGURATION.. #
|
||||||
|
# ############################################################### #
|
||||||
|
|
||||||
|
# focus window
|
||||||
|
# alt - h : yabai -m window --focus west
|
||||||
|
|
||||||
|
# swap managed window
|
||||||
|
# shift + alt - h : yabai -m window --swap north
|
||||||
|
|
||||||
|
# move managed window
|
||||||
|
# shift + cmd - h : yabai -m window --warp east
|
||||||
|
|
||||||
|
# balance size of windows
|
||||||
|
# shift + alt - 0 : yabai -m space --balance
|
||||||
|
|
||||||
|
# make floating window fill screen
|
||||||
|
# shift + alt - up : yabai -m window --grid 1:1:0:0:1:1
|
||||||
|
|
||||||
|
# make floating window fill left-half of screen
|
||||||
|
# shift + alt - left : yabai -m window --grid 1:2:0:0:1:1
|
||||||
|
|
||||||
|
# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
|
||||||
|
# shift + cmd - n : yabai -m space --create && \
|
||||||
|
# index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \
|
||||||
|
# yabai -m window --space "${index}" && \
|
||||||
|
# yabai -m space --focus "${index}"
|
||||||
|
|
||||||
|
# fast focus desktop
|
||||||
|
# cmd + alt - x : yabai -m space --focus recent
|
||||||
|
# cmd + alt - 1 : yabai -m space --focus 1
|
||||||
|
|
||||||
|
# send window to desktop and follow focus
|
||||||
|
# shift + cmd - z : yabai -m window --space next; yabai -m space --focus next
|
||||||
|
# shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
|
||||||
|
|
||||||
|
# focus monitor
|
||||||
|
# ctrl + alt - z : yabai -m display --focus prev
|
||||||
|
# ctrl + alt - 3 : yabai -m display --focus 3
|
||||||
|
|
||||||
|
# send window to monitor and follow focus
|
||||||
|
# ctrl + cmd - c : yabai -m window --display next; yabai -m display --focus next
|
||||||
|
# ctrl + cmd - 1 : yabai -m window --display 1; yabai -m display --focus 1
|
||||||
|
|
||||||
|
# move floating window
|
||||||
|
# shift + ctrl - a : yabai -m window --move rel:-20:0
|
||||||
|
# shift + ctrl - s : yabai -m window --move rel:0:20
|
||||||
|
|
||||||
|
# increase window size
|
||||||
|
# shift + alt - a : yabai -m window --resize left:-20:0
|
||||||
|
# shift + alt - w : yabai -m window --resize top:0:-20
|
||||||
|
|
||||||
|
# decrease window size
|
||||||
|
# shift + cmd - s : yabai -m window --resize bottom:0:-20
|
||||||
|
# shift + cmd - w : yabai -m window --resize top:0:20
|
||||||
|
|
||||||
|
# set insertion point in focused container
|
||||||
|
# ctrl + alt - h : yabai -m window --insert west
|
||||||
|
|
||||||
|
# toggle window zoom
|
||||||
|
# alt - d : yabai -m window --toggle zoom-parent
|
||||||
|
# alt - f : yabai -m window --toggle zoom-fullscreen
|
||||||
|
|
||||||
|
# toggle window split type
|
||||||
|
# alt - e : yabai -m window --toggle split
|
||||||
|
|
||||||
|
# float / unfloat window and center on screen
|
||||||
|
# alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2
|
||||||
|
|
||||||
|
# toggle sticky(+float), picture-in-picture
|
||||||
|
# alt - p : yabai -m window --toggle sticky --toggle pip
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# for this to work you must configure sudo such that
|
||||||
|
# it will be able to run the command without password
|
||||||
|
#
|
||||||
|
# see this wiki page for information:
|
||||||
|
# - https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition
|
||||||
|
#
|
||||||
|
# yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
|
||||||
|
# sudo yabai --load-sa
|
||||||
|
#
|
||||||
|
|
||||||
|
# global settings
|
||||||
|
yabai -m config \
|
||||||
|
external_bar off:40:0 \
|
||||||
|
menubar_opacity 1.0 \
|
||||||
|
mouse_follows_focus off \
|
||||||
|
focus_follows_mouse off \
|
||||||
|
display_arrangement_order default \
|
||||||
|
window_origin_display default \
|
||||||
|
window_placement second_child \
|
||||||
|
window_insertion_point focused \
|
||||||
|
window_zoom_persist on \
|
||||||
|
window_shadow on \
|
||||||
|
window_animation_duration 0.0 \
|
||||||
|
window_animation_easing ease_out_circ \
|
||||||
|
window_opacity_duration 0.0 \
|
||||||
|
active_window_opacity 1.0 \
|
||||||
|
normal_window_opacity 0.90 \
|
||||||
|
window_opacity off \
|
||||||
|
insert_feedback_color 0xffd75f5f \
|
||||||
|
split_ratio 0.50 \
|
||||||
|
split_type auto \
|
||||||
|
auto_balance off \
|
||||||
|
top_padding 12 \
|
||||||
|
bottom_padding 12 \
|
||||||
|
left_padding 12 \
|
||||||
|
right_padding 12 \
|
||||||
|
window_gap 06 \
|
||||||
|
layout bsp \
|
||||||
|
mouse_modifier fn \
|
||||||
|
mouse_action1 move \
|
||||||
|
mouse_action2 resize \
|
||||||
|
mouse_drop_action swap
|
||||||
|
|
||||||
|
yabai -m config layout bsp
|
||||||
|
yabai -m config window_placement second_child
|
||||||
|
|
||||||
|
# yabai -m window_shadow on
|
||||||
|
# yabai -m active_window_opacity 1.0
|
||||||
|
# yabai -m normal_window_opacity 0.90
|
||||||
|
# Padding
|
||||||
|
yabai -m config top_padding 10
|
||||||
|
yabai -m config bottom_padding 10
|
||||||
|
yabai -m config right_padding 10
|
||||||
|
yabai -m config left_padding 10
|
||||||
|
yabai -m config window_gap 10
|
||||||
|
# mouse settings
|
||||||
|
# yabai -m config mouse_follows_focus on
|
||||||
|
yabai -m config mouse_modifier alt
|
||||||
|
yabai -m config mouse_action1 move
|
||||||
|
yabai -m config mouse_action2 resize
|
||||||
|
yabai -m config mouse_drop_action swap
|
||||||
|
|
||||||
|
# Disable specific apps
|
||||||
|
yabai -m rule --add app="^System Settings$" manage=off
|
||||||
|
yabai -m rule --add app="^Calculator$" manage=off
|
||||||
|
yabai -m rule --add app="^App Store$" manage=off
|
||||||
|
yabai -m rule --add app="^Calendar$" manage=off
|
||||||
|
yabai -m rule --add app="^Finder$" manage=off
|
||||||
|
yabai -m rule --add app="^Discord$" manage=off
|
||||||
|
yabai -m rule --add app="^V2BOX$" manage=off
|
||||||
|
yabai -m rule --add app="^Raycast$" manage=off
|
||||||
|
yabai -m rule --add app="^Preview$" manage=off
|
||||||
|
yabai -m rule --add app="^Archive Utility$" manage=off
|
||||||
|
|
||||||
|
# focus window
|
||||||
|
alt - j : yabai -m window --focus west
|
||||||
|
alt - k : yabai -m window --focus south
|
||||||
|
alt - i : yabai -m window --focus north
|
||||||
|
alt - l : yabai -m window --focus east
|
||||||
|
|
||||||
|
# swap managed window
|
||||||
|
shift + alt - i : yabai -m window --swap north
|
||||||
|
shift + alt - k : yabai -m window --swap south
|
||||||
|
shift + alt - j : yabai -m window --swap west
|
||||||
|
shift + alt - l : yabai -m window --swap east
|
||||||
|
# move managed window
|
||||||
|
shift + cmd - j : yabai -m window --warp west
|
||||||
|
shift + cmd - i : yabai -m window --warp north
|
||||||
|
shift + cmd - k : yabai -m window --warp south
|
||||||
|
shift + cmd - l : yabai -m window --warp east
|
||||||
|
# balance size of windows
|
||||||
|
shift + alt - 0 : yabai -m space --balance
|
||||||
|
# focus monitor
|
||||||
|
ctrl + alt - z : yabai -m display --focus next
|
||||||
|
ctrl + alt - x : yabai -m display --focus prev
|
||||||
|
ctrl + alt - 1 : yabai -m display --focus 1
|
||||||
|
ctrl + alt - 2 : yabai -m display --focus 2
|
||||||
|
ctrl + alt - 3 : yabai -m display --focus 3
|
||||||
|
ctrl + alt - 4 : yabai -m display --focus 4
|
||||||
|
# increase window size
|
||||||
|
shift + alt - a : yabai -m window --resize left:-20:0
|
||||||
|
shift + alt - d : yabai -m window --resize right:-20:0
|
||||||
|
shift + alt - w : yabai -m window --resize top:0:-20
|
||||||
|
shift + alt - s : yabai -m window --resize bottom:0:20
|
||||||
|
# decrease window size
|
||||||
|
shift + cmd - s : yabai -m window --resize bottom:0:-20
|
||||||
|
shift + cmd - w : yabai -m window --resize top:0:20
|
||||||
|
shift + cmd - a : yabai -m window --resize left:20:0
|
||||||
|
shift + cmd - d : yabai -m window --resize right:20:0
|
||||||
|
# toggle window split type
|
||||||
|
alt - e : yabai -m window --toggle split
|
||||||
|
# float / unfloat window and center on screen
|
||||||
|
alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2
|
||||||
|
|
||||||
|
echo "yabai configuration loaded.."
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
# ZSH completion cache
|
||||||
|
ZSH_COMPDUMP="$HOME/.cache/zsh/zcompdump"
|
||||||
|
mkdir -p "${ZSH_COMPDUMP:h}"
|
||||||
|
|
||||||
|
# Compinit setup
|
||||||
|
autoload -Uz compinit
|
||||||
|
if [ "$(date +'%j')" != "$(stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)" ]; then
|
||||||
|
compinit
|
||||||
|
else
|
||||||
|
compinit -C
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If you come from bash you might have to change your $PATH.
|
||||||
|
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||||
|
|
||||||
|
# Path to your Oh My Zsh installation.
|
||||||
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
|
||||||
|
# Theme
|
||||||
|
ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
|
# Hyphen-insensitive completion.
|
||||||
|
HYPHEN_INSENSITIVE="false"
|
||||||
|
|
||||||
|
# Uncomment one of the following lines to change the auto-update behavior
|
||||||
|
zstyle ':omz:update' mode disabled # disable automatic updates
|
||||||
|
# zstyle ':omz:update' mode auto # update automatically without asking
|
||||||
|
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
||||||
|
|
||||||
|
zstyle ':omz:update' verbosity minimal
|
||||||
|
|
||||||
|
# Uncomment the following line to change how often to auto-update (in days).
|
||||||
|
# zstyle ':omz:update' frequency 13
|
||||||
|
|
||||||
|
# Uncomment the following line if pasting URLs and other text is messed up.
|
||||||
|
DISABLE_MAGIC_FUNCTIONS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to disable colors in ls.
|
||||||
|
# DISABLE_LS_COLORS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to disable auto-setting terminal title.
|
||||||
|
# DISABLE_AUTO_TITLE="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to enable command auto-correction.
|
||||||
|
# ENABLE_CORRECTION="true"
|
||||||
|
|
||||||
|
# Disable compfix
|
||||||
|
DISABLE_COMPFIX="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||||
|
# You can also set it to another string to have that shown instead of the default red dots.
|
||||||
|
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
||||||
|
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
||||||
|
# COMPLETION_WAITING_DOTS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line if you want to disable marking untracked files
|
||||||
|
# under VCS as dirty. This makes repository status check for large repositories
|
||||||
|
# much, much faster.
|
||||||
|
DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||||
|
|
||||||
|
# Uncomment the following line if you want to change the command execution time
|
||||||
|
# stamp shown in the history command output.
|
||||||
|
# You can set one of the optional three formats:
|
||||||
|
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||||
|
# or set a custom format using the strftime function format specifications,
|
||||||
|
# see 'man strftime' for details.
|
||||||
|
# HIST_STAMPS="mm/dd/yyyy"
|
||||||
|
|
||||||
|
# Would you like to use another custom folder than $ZSH/custom?
|
||||||
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||||
|
|
||||||
|
# Which plugins would you like to load?
|
||||||
|
# Standard plugins can be found in $ZSH/plugins/
|
||||||
|
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
||||||
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
|
plugins=(aliases alias-finder ansible argocd bun colored-man-pages colorize copybuffer copyfile dnf docker docker-compose git git-lfs golang helm kubectl kubectx nmap npm perl pm2 podman poetry poetry-env postgres rsync rust salt ssh ssh-agent sudo systemd tailscale terraform zsh-navigation-tools)
|
||||||
|
|
||||||
|
# Brew
|
||||||
|
|
||||||
|
eval "$(brew shellenv)"
|
||||||
|
|
||||||
|
# Run Oh-my-zsh
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# User configuration
|
||||||
|
|
||||||
|
export MANPATH="/usr/local/man:$MANPATH"
|
||||||
|
|
||||||
|
# Preferred editor for local and remote sessions
|
||||||
|
if [[ -n $SSH_CONNECTION ]]; then
|
||||||
|
export EDITOR='vim'
|
||||||
|
else
|
||||||
|
export EDITOR='nvim'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Compilation flags
|
||||||
|
export ARCHFLAGS="-arch arm64"
|
||||||
|
|
||||||
|
# Disable pager
|
||||||
|
export SYSTEMD_PAGER=
|
||||||
|
|
||||||
|
# Talos config
|
||||||
|
export TALOSCONFIG=/Users/itq/.talos/config
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
alias tf=terraform
|
||||||
|
alias calc='_(){ awk "BEGIN{print $*}";};_'
|
||||||
|
alias dive='docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock docker.io/wagoodman/dive'
|
||||||
|
alias ktx=kubectx
|
||||||
|
alias kns=kubens
|
||||||
|
alias k=kubectl
|
||||||
|
alias ktop='watch -n 0.5 -d -c kubectl top pod -A --containers=true --show-swap=true --sort-by=memory --sum=true'
|
||||||
|
alias ka='kubectl apply -f'
|
||||||
|
alias kd='kubectl delete -f'
|
||||||
|
alias cdt='cd $(mktemp -d)'
|
||||||
|
alias c=clear
|
||||||
|
alias ipy='ipython --no-autoindent'
|
||||||
|
alias py='python3'
|
||||||
|
alias bat='bat --style=plain'
|
||||||
|
alias netshoot='docker run -it --rm --net host docker.io/nicolaka/netshoot:latest'
|
||||||
|
alias vim='nvim'
|
||||||
|
# InfoSec aliases
|
||||||
|
alias dirsearch=/Users/itq/infosec/tools/dirsearch/.venv/bin/dirsearch
|
||||||
|
alias pwn=/Users/itq/infosec/tools/pwntools/.venv/bin/pwn
|
||||||
|
alias pwni=/Users/itq/infosec/tools/pwntools/.venv/bin/python
|
||||||
|
alias vol2='python2 /Users/itq/infosec/tools/volatility_2/vol.py'
|
||||||
|
alias vol3=/Users/itq/infosec/tools/volatility_3/.venv/bin/vol
|
||||||
|
alias stegoveritas='docker run -it --rm -v /:/mnt bannsec/stegoveritas'
|
||||||
|
|
||||||
|
# Brew
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
|
||||||
|
# fzf
|
||||||
|
source <($(brew --prefix)/bin/fzf --zsh)
|
||||||
|
|
||||||
|
# Pyenv
|
||||||
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
|
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
eval "$(pyenv init - zsh)"
|
||||||
|
|
||||||
|
# NVM
|
||||||
|
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
|
||||||
|
# Yandex Cloud CLI
|
||||||
|
if [ -f '/Users/itq/.yandex-cloud/path.bash.inc' ]; then source '/Users/itq/.yandex-cloud/path.bash.inc'; fi
|
||||||
|
if [ -f '/Users/itq/.yandex-cloud/completion.zsh.inc' ]; then source '/Users/itq/.yandex-cloud/completion.zsh.inc'; fi
|
||||||
|
|
||||||
|
# Show hidden files and folders
|
||||||
|
setopt globdots
|
||||||
|
|
||||||
|
# No pager for systemd
|
||||||
|
export SYSTEMD_PAGER=
|
||||||
|
|
||||||
|
# Go binaries
|
||||||
|
export PATH=$PATH:$(go env GOPATH)/bin
|
||||||
|
|
||||||
|
# load custom zsh snippets
|
||||||
|
for f in ~/.zshrc.d/*.zsh; do source "$f"; done
|
||||||
|
|
||||||
|
# prioritize binaries in /usr/bin
|
||||||
|
export PATH=/usr/bin:$PATH
|
||||||
|
|
||||||
|
# Krew
|
||||||
|
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||||
|
|
||||||
|
# iTerm2 shell integration
|
||||||
|
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
|
||||||
|
|
||||||
|
# sdkman, must be at the end of file!
|
||||||
|
export SDKMAN_DIR="$HOME/.sdkman"
|
||||||
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
|
|
||||||
Executable
+83
@@ -0,0 +1,83 @@
|
|||||||
|
#compdef zshz ${ZSHZ_CMD:-${_Z_CMD:-z}}
|
||||||
|
#
|
||||||
|
# Zsh-z - jump around with Zsh - A native Zsh version of z without awk, sort,
|
||||||
|
# date, or sed
|
||||||
|
#
|
||||||
|
# https://github.com/agkozak/zsh-z
|
||||||
|
#
|
||||||
|
# Copyright (c) 2018-2023 Alexandros Kozak
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# 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 OR COPYRIGHT HOLDERS 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.
|
||||||
|
#
|
||||||
|
# z (https://github.com/rupa/z) is copyright (c) 2009 rupa deadwyler and
|
||||||
|
# licensed under the WTFPL license, Version 2.a
|
||||||
|
#
|
||||||
|
# shellcheck shell=ksh
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
# Zsh-z COMPLETIONS
|
||||||
|
############################################################
|
||||||
|
emulate -L zsh
|
||||||
|
(( ZSHZ_DEBUG )) &&
|
||||||
|
setopt LOCAL_OPTIONS WARN_CREATE_GLOBAL NO_WARN_NESTED_VAR 2> /dev/null
|
||||||
|
|
||||||
|
# TODO: This routine currently reproduces z's feature of allowing spaces to be
|
||||||
|
# used as wildcards in completions, so that
|
||||||
|
#
|
||||||
|
# z us lo bi
|
||||||
|
#
|
||||||
|
# can expand to
|
||||||
|
#
|
||||||
|
# z /usr/local/bin
|
||||||
|
#
|
||||||
|
# but it also reproduces z's buggy display on the commandline, viz.
|
||||||
|
#
|
||||||
|
# z us lo /usr/local/bin
|
||||||
|
#
|
||||||
|
# Address.
|
||||||
|
|
||||||
|
local completions expl completion
|
||||||
|
local -a completion_list
|
||||||
|
|
||||||
|
completions=$(zshz --complete ${(@)words:1})
|
||||||
|
[[ -z $completions ]] && return 1
|
||||||
|
|
||||||
|
for completion in ${(f)completions[@]}; do
|
||||||
|
if (( ZSHZ_TILDE )) && [[ $completion == ${HOME}* ]]; then
|
||||||
|
completion="~${(q)${completion#${HOME}}}"
|
||||||
|
else
|
||||||
|
completion="${(q)completion}"
|
||||||
|
fi
|
||||||
|
completion_list+=( $completion )
|
||||||
|
done
|
||||||
|
|
||||||
|
_description -V completion_list expl 'directories'
|
||||||
|
|
||||||
|
if [[ $ZSHZ_COMPLETION == 'legacy' ]]; then
|
||||||
|
compadd "${expl[@]}" -QU -- "${completion_list[@]}"
|
||||||
|
else
|
||||||
|
compadd "${expl[@]}" -QU -V zsh-z -- "${completion_list[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
compstate[insert]=menu
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# vim: ft=zsh:fdm=indent:ts=2:et:sts=2:sw=2:
|
||||||
|
|
||||||
Executable
+44
@@ -0,0 +1,44 @@
|
|||||||
|
# Common clipboard detection
|
||||||
|
_get_clip_cmd() {
|
||||||
|
if command -v pbcopy >/dev/null 2>&1; then
|
||||||
|
echo "pbcopy"
|
||||||
|
elif command -v xclip >/dev/null 2>&1; then
|
||||||
|
echo "xclip -selection clipboard"
|
||||||
|
elif command -v clip >/dev/null 2>&1; then
|
||||||
|
echo "clip"
|
||||||
|
else
|
||||||
|
echo "Error: No clipboard command found" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cs() {
|
||||||
|
local output clip_cmd
|
||||||
|
clip_cmd=$(_get_clip_cmd) || return 1
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
output=$(cat && printf X)
|
||||||
|
output=${output%X}
|
||||||
|
else
|
||||||
|
output=$("$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s' "$output"
|
||||||
|
printf '%s' "$output" | eval "$clip_cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
cse() {
|
||||||
|
local output clip_cmd
|
||||||
|
clip_cmd=$(_get_clip_cmd) || return 1
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
output=$(cat && printf X)
|
||||||
|
output=${output%X}
|
||||||
|
else
|
||||||
|
output=$("$@" 2>&1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s' "$output"
|
||||||
|
printf '%s' "$output" | eval "$clip_cmd"
|
||||||
|
}
|
||||||
|
|
||||||
Executable
+1023
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user