dotfiles/zsh/_rgv_preview.sh
2024-01-07 00:43:43 +00:00

6 lines
213 B
Bash
Executable File

#!/bin/bash
file=$(echo $1 | cut -d':' -f 1)
line=$(echo $1 | cut -d':' -f 2)
range=$(awk "BEGIN { s = $line - 20; print((s < 0 ? 0 : s) \":\")}")
bat --style=numbers --color=always -H "$line" -r "$range" "$file"