Browse Source

Merged selected origin/trb changes

master
chodak166 4 weeks ago
parent
commit
b49a29b5e6
  1. 1
      .config/nvim/.gitignore
  2. 32
      .config/nvim/lazy-lock.json
  3. 1
      .config/nvim/lazyvim.json
  4. 6
      .config/nvim/lua/config/options.lua
  5. 36
      .config/nvim/lua/plugins/diffview.lua
  6. 7
      .config/nvim/lua/plugins/image.lua
  7. 4
      .config/nvim/lua/plugins/zz_disabled.lua
  8. 150
      .local/bin/cat-md

1
.config/nvim/.gitignore vendored

@ -6,3 +6,4 @@ debug
foo.* foo.*
*.log *.log
data data
zz_disabled.lua

32
.config/nvim/lazy-lock.json

@ -1,6 +1,6 @@
{ {
"LazyVim": { "branch": "main", "commit": "c10948c50b18fae7f256433afdef09e432410480" }, "LazyVim": { "branch": "main", "commit": "999700997f72227187d49d8b92667183dc7fc809" },
"avante.nvim": { "branch": "main", "commit": "98bfe1c2a41d645e8d1cbc882aa1067e5f1b6cb0" }, "avante.nvim": { "branch": "main", "commit": "4f49656657d0e1b55a03c23510ccc1ef1eeaa9e9" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" }, "catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" },
@ -9,34 +9,34 @@
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dotenv.nvim": { "branch": "main", "commit": "7d516e9293c6e3ac21830fb10a4e8674c02747c6" }, "dotenv.nvim": { "branch": "main", "commit": "7d516e9293c6e3ac21830fb10a4e8674c02747c6" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" }, "flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "friendly-snippets": { "branch": "main", "commit": "b4d01b0fdf3c9a549961c2f9ffe8dc09be166219" },
"gitsigns.nvim": { "branch": "main", "commit": "5be654f2232c10ddcad19c1607a67b6b4b78fc29" }, "gitsigns.nvim": { "branch": "main", "commit": "851a051e2bd2caba97e23314c68d69f1b1cf5d19" },
"grug-far.nvim": { "branch": "main", "commit": "11595bf747edc270bce2069d1020502ad4ae56cf" }, "grug-far.nvim": { "branch": "main", "commit": "11595bf747edc270bce2069d1020502ad4ae56cf" },
"hybrid-theme": { "branch": "main", "commit": "626ae5426a7c8f21dfccce286c690d9cf4195b46" }, "hybrid-theme": { "branch": "main", "commit": "626ae5426a7c8f21dfccce286c690d9cf4195b46" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "image.nvim": { "branch": "master", "commit": "365e2ace0f619164ae6fd2f6f1d2807775dd6849" },
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
"just-runner.nvim": { "branch": "main", "commit": "f29d405aa828900df242600720a2b0e57261489f" }, "just-runner.nvim": { "branch": "main", "commit": "f29d405aa828900df242600720a2b0e57261489f" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9d28935aa95fa6c1dc7c4d6747f101a72a8a4bec" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e17625cdc8c2650787467398e02c5d63a2cde966" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"mini.ai": { "branch": "main", "commit": "25248c6aa002391936a6200f12d1466015987133" }, "mini.ai": { "branch": "main", "commit": "c2c4278beb759aa24b9506f56a67186a6cc2209c" },
"mini.files": { "branch": "main", "commit": "a249438d15fa6f64085ba83a9d1794d726aaf5ad" }, "mini.icons": { "branch": "main", "commit": "f642e3ba8c12afbc8f32f6d77ef6597eac56786f" },
"mini.icons": { "branch": "main", "commit": "98faae31e9be1cc054ae63485e58ceb185efcad0" },
"mini.pairs": { "branch": "main", "commit": "b1c5a726921b7a8c9321e9a7a208aa0571de5810" }, "mini.pairs": { "branch": "main", "commit": "b1c5a726921b7a8c9321e9a7a208aa0571de5810" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"nui.nvim": { "branch": "main", "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97" }, "nui.nvim": { "branch": "main", "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97" },
"nvim-dev-container": { "branch": "main", "commit": "365b4c815339d42133829006dce3e5f8b182b771" }, "nvim-dev-container": { "branch": "main", "commit": "365b4c815339d42133829006dce3e5f8b182b771" },
"nvim-lint": { "branch": "master", "commit": "0370fe965697aa8f04252a1562441bdc13723cd1" }, "nvim-lint": { "branch": "master", "commit": "f6230a5c06ba59e6059c14637f1dbe29a7978b9b" },
"nvim-lspconfig": { "branch": "master", "commit": "221c43884319e791519f0d6c94a7f2fbcd653278" }, "nvim-lspconfig": { "branch": "master", "commit": "c59fc922f718fa055f69f5f3bc888f23211571eb" },
"nvim-treesitter": { "branch": "main", "commit": "8b98b4470eb326f1c7b50dae79f8c963568e5720" }, "nvim-navic": { "branch": "master", "commit": "455808fd0fae06e6d70fadfd61432275db8f34ce" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "898ee307df58f854d11cd7edd06472574d48014e" }, "nvim-treesitter": { "branch": "main", "commit": "1a4f47b03dfe92d28de7d5654c67327ef008c9e6" },
"nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187" },
"nvim-ts-autotag": { "branch": "main", "commit": "d7220b55e16ed3c04e88086256def5d282429493" },
"persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"render-markdown.nvim": { "branch": "main", "commit": "4663eb3ecd538bd5062628fb6d95bbe6bdca78f6" }, "render-markdown.nvim": { "branch": "main", "commit": "8e8795368391036643b622875a6da6a51bcd33f4" },
"snacks-terminal-ctl.nvim": { "branch": "master", "commit": "97727421c8d0ffa33d893f22e38cda93e9010742" }, "snacks-terminal-ctl.nvim": { "branch": "master", "commit": "97727421c8d0ffa33d893f22e38cda93e9010742" },
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },

1
.config/nvim/lazyvim.json

@ -1,6 +1,5 @@
{ {
"extras": [ "extras": [
"lazyvim.plugins.extras.editor.mini-files"
], ],
"install_version": 8, "install_version": 8,
"news": { "news": {

6
.config/nvim/lua/config/options.lua

@ -25,6 +25,9 @@ vim.g.lazyvim_no_inlay_hints = true
-- -- Enable list mode to show whitespace -- -- Enable list mode to show whitespace
-- vim.opt.list = true -- vim.opt.list = true
-- disable autoformatting not to generate large diffs:
vim.g.autoformat = false
-- Configure listchars to use dots (·) for spaces and tabs -- Configure listchars to use dots (·) for spaces and tabs
vim.opt.listchars = { vim.opt.listchars = {
tab = "· ", -- Dot for the first part of a tab, followed by space tab = "· ", -- Dot for the first part of a tab, followed by space
@ -35,4 +38,5 @@ vim.opt.listchars = {
-- eol = "↲", -- Symbol for end of line (optional) -- eol = "↲", -- Symbol for end of line (optional)
} }
-- Do not hide syntax makers (**, ``` etc)
vim.opt.conceallevel = 0

36
.config/nvim/lua/plugins/diffview.lua

@ -1 +1,35 @@
return { "sindrets/diffview.nvim" } return {
"sindrets/diffview.nvim",
cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles", "DiffviewFileHistory" },
keys = {
{ "<leader>gvv", "<cmd>DiffviewOpen<cr>", desc = "Diffview Open" },
{ "<leader>gvq", "<cmd>DiffviewClose<cr>", desc = "Diffview Close" },
{ "<leader>gvf", "<cmd>DiffviewFileHistory %<cr>", desc = "Browse current file history" },
{ "<leader>gvr", "<cmd>DiffviewFileHistory<cr>", desc = "Browse repo history" },
{ "<leader>gvh", "<cmd>DiffviewOpen HEAD~1<cr>", desc = "Diff vs last commit" },
{ "<leader>gvm", "<cmd>DiffviewOpen master...HEAD<cr>", desc = "Diff branch vs master" },
},
opts = {
enhanced_diff_hl = true,
view = {
merge_tool = {
layout = "diff3_mixed",
},
},
file_history_panel = {
log_options = {
git = {
all = false,
},
},
win_config = {
position = "bottom",
height = 16,
},
},
file_panel = {
listing_style = "tree",
win_config = { width = 35 },
},
},
}

7
.config/nvim/lua/plugins/image.lua

@ -0,0 +1,7 @@
return {
"3rd/image.nvim",
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
opts = {
processor = "magick_cli",
},
}

4
.config/nvim/lua/plugins/zz_disabled.lua

@ -6,6 +6,6 @@
-- config update-index --skip-worktree .config/nvim/lua/plugins/zz_disabled.lua -- config update-index --skip-worktree .config/nvim/lua/plugins/zz_disabled.lua
return { return {
{ "yetone/avante.nvim", enabled = true }, { "yetone/avante.nvim", enabled = false },
{ "p00f/clangd_extensions.nvim", enabled = true }, { "p00f/clangd_extensions.nvim", enabled = false },
} }

150
.local/bin/cat-md

@ -1,26 +1,130 @@
#!/bin/bash #!/bin/bash
# Usage examples: set -euo pipefail
# ./cat-md file1.txt file2.txt # Output multiple files as markdown
# ./cat-md directory/ # Output all files in a directory # --- Defaults ---
# ./cat-md file.txt | xclip -selection clipboard # Copy output to X11 clipboard COPY=true
# ./cat-md file.txt | xsel --clipboard --input # Alternative using xsel CLIP_CMD=()
for path in "$@"; do # --- Detect clipboard tool ---
if [ -d "$path" ]; then detect_clipboard() {
# If it's a directory, call ourselves with each file in it (non-recursively) # Pick the right tool for the session:
for file in "$path"/*; do # wl-copy on Wayland, xclip/xsel on X11. Fall back to whatever exists.
if [ -f "$file" ]; then if [[ "${XDG_SESSION_TYPE:-}" == "wayland" || -n "${WAYLAND_DISPLAY:-}" ]]; then
"$0" "$file" if command -v wl-copy &> /dev/null; then
fi CLIP_CMD=(wl-copy)
done elif command -v xclip &> /dev/null; then
elif [ -f "$path" ]; then CLIP_CMD=(xclip -selection clipboard)
# If it's a file, output the path and content elif command -v xsel &> /dev/null; then
echo "$path:" CLIP_CMD=(xsel --clipboard --input)
echo '```' fi
cat "$path" else
echo if command -v xclip &> /dev/null; then
echo '```' CLIP_CMD=(xclip -selection clipboard)
echo elif command -v xsel &> /dev/null; then
CLIP_CMD=(xsel --clipboard --input)
elif command -v wl-copy &> /dev/null; then
CLIP_CMD=(wl-copy)
fi fi
done fi
}
# --- Help ---
usage() {
cat << 'EOF'
cat-md — concatenate files as a Markdown code block, copy to clipboard.
Usage:
cat-md [OPTIONS] [FILE|DIR]...
Each file is printed as:
path/to/file:
```
<contents>
```
Directories are expanded non-recursively (all files inside).
Options:
-n, --no-copy Print to stdout only, skip clipboard copy
-h, --help Show this help and exit
Examples:
cat-md file1.txt file2.txt
cat-md src/
cat-md -n file.txt # no clipboard
cat-md -n file.txt | less # pipe manually
Requirements (one of):
wl-copy — Wayland clipboard (from wl-clipboard)
xclip — X11 clipboard (preferred on X11)
xsel — alternative X11 clipboard tool
EOF
exit 0
}
# --- Parse arguments ---
ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
-n | --no-copy)
COPY=false
shift
;;
-h | --help) usage ;;
--)
shift
ARGS+=("$@")
break
;;
-*)
echo "Unknown option: $1" >&2
echo "Try -h for help." >&2
exit 1
;;
*)
ARGS+=("$1")
shift
;;
esac
done
# --- Validate ---
if [[ ${#ARGS[@]} -eq 0 ]]; then
echo "Error: no files or directories provided. Try -h for help." >&2
exit 1
fi
detect_clipboard
if $COPY && [[ ${#CLIP_CMD[@]} -eq 0 ]]; then
echo "Warning: no clipboard tool found (tried wl-copy, xclip, xsel). Output will go to stdout only." >&2
COPY=false
fi
# --- Generate output ---
generate() {
for path in "$@"; do
if [[ -d "$path" ]]; then
for file in "$path"/*; do
if [[ -f "$file" ]]; then
generate "$file"
fi
done
elif [[ -f "$path" ]]; then
echo "$path:"
echo '```'
cat "$path"
echo
echo '```'
echo
fi
done
}
if $COPY; then
generate "${ARGS[@]}" | "${CLIP_CMD[@]}"
echo "Copied to clipboard." >&2
else
generate "${ARGS[@]}"
fi

Loading…
Cancel
Save