1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
Luca Bilke 7df2de8159
nvim: switch to fzf rather than telescope 2024-10-23 17:12:55 +02:00
Luca Bilke ee67adaf8e
lf: highlight line in find_word 2024-10-23 17:12:35 +02:00
Luca Bilke 6e2e0d6d89
lf: clean up preview 2024-10-23 17:12:22 +02:00
Luca Bilke faf4613719
git: add sf credential 2024-10-23 17:12:16 +02:00
6 changed files with 45 additions and 31 deletions

View File

@ -1,2 +1,3 @@
<#git_credential_gitlab_schneiderfilz_com#>
<#git_credential_git_snaile_de#>
<#git_credential_github_com#>

View File

@ -141,26 +141,33 @@ cmd fzf ${{
}}
cmd find_word ${{
set +ue
rg_cmd="rg -uu --column --line-number --no-heading --color=always --smart-case --follow"
res="$(
set +ue
BAT="bat --style=plain --color=always --italic-text=always --pager=never --tabs=4 --theme=base16"
rg_cmd="rg -uu --column --line-number --no-heading --color=always --smart-case --follow"
res="$(
fzf --disabled --ansi --exact --layout=reverse --header 'Searching file contents' --delimiter=: \
--bind="start:reload([ -n {q} ] && $rg_cmd -- {q} || true)" \
--bind="change:reload([ -n {q} ] && $rg_cmd -- {q} || true)" \
--preview-window="right,50%" \
--preview='~/.config/lf/preview {1} "$FZF_PREVIEW_COLUMNS" "$FZF_PREVIEW_LINES" "$FZF_PREVIEW_LEFT" "$FZF_PREVIEW_TOP"'
)"
file="$(realpath "$(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g')" 2>/dev/null)"
row="$(echo "$res" | cut -d':' -f2)"
column="$(echo "$res" | cut -d':' -f3)"
if [ -n "$res" ]; then
--preview-window="right,50%,+{2}/2" \
--preview="$BAT"' --highlight-line {2} {1} "$FZF_PREVIEW_COLUMNS" "$FZF_PREVIEW_LINES" "$FZF_PREVIEW_LEFT" "$FZF_PREVIEW_TOP"'
)"
file="$(realpath "$(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g')" 2>/dev/null)"
row="$(echo "$res" | cut -d':' -f2)"
column="$(echo "$res" | cut -d':' -f3)"
if [ -n "$res" ]; then
if [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; then
lf -remote "send $id \$$EDITOR +'call cursor($row, $column)' -- '$file'"
else
lf -remote "send $id \$$EDITOR '$file'"
fi
fi
return 0
fi
return 0
}}
cmd find_project ${{

View File

@ -8,7 +8,7 @@ RED="\033[31m"
RESET="\033[0m"
RS="$(printf "\037")"
CACHE="${XDG_CACHE_HOME}/lf/$(stat --printf "%n\0%i\0%F\0%s\0%W\0%Y" -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"
BAT="bat --style=plain --color=always --italic-text=always --pager=never --tabs=4 --theme=base16 --line-range=":$h" --terminal-width="$((w - 2))""
BAT="bat --style=plain --color=always --italic-text=always --pager=never --tabs=4 --theme=base16 --line-range=:$h --terminal-width=$((w - 2))"
CHAFA="chafa -f sixel -s ${w}x${h} --polite on --animate false"
run() {
@ -28,10 +28,10 @@ run() {
cached_text() {
if [ -f "$CACHE" ]; then
# shellcheck disable=SC2086
$BAT $BAT_ARGS "$CACHE"
$BAT "$CACHE"
else
# shellcheck disable=SC2086
run "$@" | tee -p "$CACHE" | $BAT $BAT_ARGS
run "$@" | tee -p "$CACHE" | $BAT
fi
}

View File

@ -21,6 +21,7 @@ require("lazy").setup({
-- { import = "lazyvim.plugins.extras.coding.neogen" },
{ import = "lazyvim.plugins.extras.dap.core" },
-- { import = "lazyvim.plugins.extras.editor.dial" },
{ import = "lazyvim.plugins.extras.editor.fzf" },
{ import = "lazyvim.plugins.extras.editor.illuminate" },
{ import = "lazyvim.plugins.extras.editor.leap" },
{ import = "lazyvim.plugins.extras.editor.overseer" },

View File

@ -8,5 +8,7 @@ local map = vim.keymap.set
-- TODO: Also remove which-key entries
unmap("n", "<Leader>uL")
unmap("n", "<Leader>ul")
-- unmap("n", "<Leader>ft")
-- unmap("n", "<Leader>fT")
map("v", "p", "pgvy", { remap = true })

View File

@ -19,15 +19,18 @@ return {
},
},
},
{
"folke/todo-comments.nvim",
event = "VeryLazy",
opts = {
highlight = {
multiline = false,
},
},
},
-- {
-- "folke/todo-comments.nvim",
-- event = "VeryLazy",
-- opts = {
-- highlight = {
-- multiline = false,
-- },
-- },
-- keys = {
-- { "<leader>ft", "<cmd>TodoTelescope<cr>", desc = "Find Todos" },
-- },
-- },
{
"NvChad/nvim-colorizer.lua",
cmd = { "ColorizerToggle", "ColorizerAttachToBuffer", "ColorizerDetachFromBuffer", "ColorizerReloadAllBuffers" },