lf updates for kitty
This commit is contained in:
parent
41164bfb98
commit
70cc3dd1c8
7 changed files with 60 additions and 120 deletions
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ -n "$FIFO_UEBERZUG" ]; then
|
||||
printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG"
|
||||
fi
|
|
@ -8,7 +8,7 @@ set icons
|
|||
set period 1
|
||||
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
|
||||
set previewer ~/.config/lf/preview
|
||||
set cleaner ~/.config/lf/cleaner
|
||||
set cleaner ~/.config/lf/clean
|
||||
|
||||
# cmds/functions
|
||||
cmd open ${{
|
||||
|
|
|
@ -1,76 +1,20 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
file=$1
|
||||
w=$2
|
||||
h=$3
|
||||
x=$4
|
||||
y=$5
|
||||
|
||||
image() {
|
||||
if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
|
||||
printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
|
||||
exit 1
|
||||
else
|
||||
chafa "$1" -s "$4x"
|
||||
fi
|
||||
}
|
||||
filetype="$( file -Lb --mime-type "$file")"
|
||||
|
||||
batorcat() {
|
||||
file="$1"
|
||||
shift
|
||||
if command -v bat > /dev/null 2>&1
|
||||
then
|
||||
bat --color=always --style=plain --pager=never "$file" "$@"
|
||||
else
|
||||
cat "$file"
|
||||
fi
|
||||
}
|
||||
if [[ "$filetype" =~ ^image ]]; then
|
||||
kitty +icat --silent --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))"
|
||||
if [[ "$filetype" =~ ^video ]]; then
|
||||
kitty +icat --silent --transfer-mode file --place "${w}x${h}@${x}x${y}" "$(vidthumb "$file")"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$(printf "%s\n" "$(readlink -f "$1")" | awk '{print tolower($0)}')" in
|
||||
*.tgz|*.tar.gz) tar tzf "$1" ;;
|
||||
*.tar.bz2|*.tbz2) tar tjf "$1" ;;
|
||||
*.tar.txz|*.txz) xz --list "$1" ;;
|
||||
*.tar) tar tf "$1" ;;
|
||||
*.zip|*.jar|*.war|*.ear|*.oxt) unzip -l "$1" ;;
|
||||
*.rar) unrar l "$1" ;;
|
||||
*.7z) 7z l "$1" ;;
|
||||
*.[1-8]) man "$1" | col -b ;;
|
||||
*.o) nm "$1";;
|
||||
*.torrent) transmission-show "$1" ;;
|
||||
*.iso) iso-info --no-header -l "$1" ;;
|
||||
*.odt|*.ods|*.odp|*.sxw) odt2txt "$1" ;;
|
||||
*.doc) catdoc "$1" ;;
|
||||
*.docx) docx2txt "$1" - ;;
|
||||
*.xls|*.xlsx)
|
||||
ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv
|
||||
;;
|
||||
*.wav|*.mp3|*.flac|*.m4a|*.wma|*.ape|*.ac3|*.og[agx]|*.spx|*.opus|*.as[fx]|*.mka)
|
||||
exiftool "$1"
|
||||
;;
|
||||
*.pdf)
|
||||
[ ! -f "${CACHE}.jpg" ] && \
|
||||
pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"
|
||||
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
|
||||
;;
|
||||
*.epub)
|
||||
[ ! -f "$CACHE" ] && \
|
||||
epub-thumbnailer "$1" "$CACHE" 1024
|
||||
image "$CACHE" "$2" "$3" "$4" "$5"
|
||||
;;
|
||||
*.html)
|
||||
[ ! -f "$CACHE" ] && \
|
||||
wkhtmltopdf "$1" - | pdftoppm -jpeg -f 1 -singlefile - "$CACHE"
|
||||
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
|
||||
;;
|
||||
*.avi|*.mp4|*.wmv|*.dat|*.3gp|*.ogv|*.mkv|*.mpg|*.mpeg|*.vob|*.fl[icv]|*.m2v|*.mov|*.webm|*.ts|*.mts|*.m4v|*.r[am]|*.qt|*.divx)
|
||||
[ ! -f "${CACHE}.jpg" ] && \
|
||||
ffmpegthumbnailer -i "$1" -o "${CACHE}.jpg" -s 0 -q 5
|
||||
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
|
||||
;;
|
||||
*.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.gif|*.jfif)
|
||||
image "$1" "$2" "$3" "$4" "$5"
|
||||
;;
|
||||
*.ino)
|
||||
batorcat --language=cpp "$1"
|
||||
;;
|
||||
*)
|
||||
batorcat "$1"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
~/.config/lf/pistol "$file"
|
||||
|
|
|
@ -4,7 +4,7 @@ lvim.colorscheme = "tokyonight"
|
|||
lvim.transparent_window = true
|
||||
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
|
||||
vim.opt.undofile = true
|
||||
vim.opt.titlestring = "%<%F%=%l/%L - nvim"
|
||||
vim.opt.titlestring = "%<%F - nvim"
|
||||
|
||||
-- Lualine
|
||||
lvim.builtin.lualine.style = "none"
|
||||
|
|
|
@ -170,11 +170,6 @@ _G.packer_plugins = {
|
|||
path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["neuron.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/neuron.nvim",
|
||||
url = "https://github.com/oberblastmeister/neuron.nvim"
|
||||
},
|
||||
["nlsp-settings.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/nlsp-settings.nvim",
|
||||
|
@ -186,7 +181,7 @@ _G.packer_plugins = {
|
|||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||
},
|
||||
["numb.nvim"] = {
|
||||
config = { "\27LJ\2\nX\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\2\17show_numbers\2\20show_cursorline\2\nsetup\tnumb\frequire\0" },
|
||||
config = { "\27LJ\2\nX\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\2\20show_cursorline\2\17show_numbers\2\nsetup\tnumb\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
|
@ -325,6 +320,11 @@ _G.packer_plugins = {
|
|||
path = "/home/luca/.local/share/lunarvim/site/pack/packer/opt/vim-sanegx",
|
||||
url = "https://github.com/felipec/vim-sanegx"
|
||||
},
|
||||
vimwiki = {
|
||||
loaded = true,
|
||||
path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/vimwiki",
|
||||
url = "https://github.com/vimwiki/vimwiki"
|
||||
},
|
||||
["which-key.nvim"] = {
|
||||
config = { "\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.which-key\frequire\0" },
|
||||
loaded = false,
|
||||
|
@ -364,50 +364,50 @@ if not vim.g.packer_custom_loader_enabled then
|
|||
vim.g.packer_custom_loader_enabled = true
|
||||
end
|
||||
|
||||
-- Config for: lf.vim
|
||||
time([[Config for lf.vim]], true)
|
||||
try_loadstring("\27LJ\2\nÓ\1\0\0\4\0\a\0\0196\0\0\0009\0\1\0009\0\2\0'\2\3\0)\3\0\0B\0\3\0016\0\0\0009\0\1\0009\0\2\0'\2\4\0)\3\1\0B\0\3\0016\0\0\0009\0\1\0009\0\2\0'\2\5\0'\3\6\0B\0\3\1K\0\1\0006lf -command \"set nopreview\" -command \"set hidden\"\24lf_command_override\21lf_replace_netrw\24NERDTreeHijackNetrw\17nvim_set_var\bapi\bvim\0", "config", "lf.vim")
|
||||
time([[Config for lf.vim]], false)
|
||||
-- Config for: nvim-tree.lua
|
||||
time([[Config for nvim-tree.lua]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.nvimtree\frequire\0", "config", "nvim-tree.lua")
|
||||
time([[Config for nvim-tree.lua]], false)
|
||||
-- Config for: LuaSnip
|
||||
time([[Config for LuaSnip]], true)
|
||||
try_loadstring("\27LJ\2\nñ\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f€\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3€\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0", "config", "LuaSnip")
|
||||
time([[Config for LuaSnip]], false)
|
||||
-- Config for: nvim-cmp
|
||||
time([[Config for nvim-cmp]], true)
|
||||
try_loadstring("\27LJ\2\n`\0\0\3\0\6\0\v6\0\0\0009\0\1\0009\0\2\0\15\0\0\0X\1\5€6\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\18lvim.core.cmp\frequire\bcmp\fbuiltin\tlvim\0", "config", "nvim-cmp")
|
||||
time([[Config for nvim-cmp]], false)
|
||||
-- Config for: project.nvim
|
||||
time([[Config for project.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.project\frequire\0", "config", "project.nvim")
|
||||
time([[Config for project.nvim]], false)
|
||||
-- Config for: alpha-nvim
|
||||
time([[Config for alpha-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0", "config", "alpha-nvim")
|
||||
time([[Config for alpha-nvim]], false)
|
||||
-- Config for: telescope.nvim
|
||||
time([[Config for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.telescope\frequire\0", "config", "telescope.nvim")
|
||||
time([[Config for telescope.nvim]], false)
|
||||
-- Config for: nvim-notify
|
||||
time([[Config for nvim-notify]], true)
|
||||
try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\21lvim.core.notify\frequire\0", "config", "nvim-notify")
|
||||
time([[Config for nvim-notify]], false)
|
||||
-- Config for: lualine.nvim
|
||||
time([[Config for lualine.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0", "config", "lualine.nvim")
|
||||
time([[Config for lualine.nvim]], false)
|
||||
-- Config for: lf.vim
|
||||
time([[Config for lf.vim]], true)
|
||||
try_loadstring("\27LJ\2\nÓ\1\0\0\4\0\a\0\0196\0\0\0009\0\1\0009\0\2\0'\2\3\0)\3\0\0B\0\3\0016\0\0\0009\0\1\0009\0\2\0'\2\4\0)\3\1\0B\0\3\0016\0\0\0009\0\1\0009\0\2\0'\2\5\0'\3\6\0B\0\3\1K\0\1\0006lf -command \"set nopreview\" -command \"set hidden\"\24lf_command_override\21lf_replace_netrw\24NERDTreeHijackNetrw\17nvim_set_var\bapi\bvim\0", "config", "lf.vim")
|
||||
time([[Config for lf.vim]], false)
|
||||
-- Config for: alpha-nvim
|
||||
time([[Config for alpha-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0", "config", "alpha-nvim")
|
||||
time([[Config for alpha-nvim]], false)
|
||||
-- Config for: nvim-autopairs
|
||||
time([[Config for nvim-autopairs]], true)
|
||||
try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.autopairs\frequire\0", "config", "nvim-autopairs")
|
||||
time([[Config for nvim-autopairs]], false)
|
||||
-- Config for: nvim-cmp
|
||||
time([[Config for nvim-cmp]], true)
|
||||
try_loadstring("\27LJ\2\n`\0\0\3\0\6\0\v6\0\0\0009\0\1\0009\0\2\0\15\0\0\0X\1\5€6\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\18lvim.core.cmp\frequire\bcmp\fbuiltin\tlvim\0", "config", "nvim-cmp")
|
||||
time([[Config for nvim-cmp]], false)
|
||||
-- Config for: lualine.nvim
|
||||
time([[Config for lualine.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0", "config", "lualine.nvim")
|
||||
time([[Config for lualine.nvim]], false)
|
||||
-- Config for: project.nvim
|
||||
time([[Config for project.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.project\frequire\0", "config", "project.nvim")
|
||||
time([[Config for project.nvim]], false)
|
||||
-- Config for: nvim-notify
|
||||
time([[Config for nvim-notify]], true)
|
||||
try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\21lvim.core.notify\frequire\0", "config", "nvim-notify")
|
||||
time([[Config for nvim-notify]], false)
|
||||
-- Config for: LuaSnip
|
||||
time([[Config for LuaSnip]], true)
|
||||
try_loadstring("\27LJ\2\nñ\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f€\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3€\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0", "config", "LuaSnip")
|
||||
time([[Config for LuaSnip]], false)
|
||||
-- Config for: nvim-treesitter
|
||||
time([[Config for nvim-treesitter]], true)
|
||||
try_loadstring("\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.treesitter\frequire\0", "config", "nvim-treesitter")
|
||||
time([[Config for nvim-treesitter]], false)
|
||||
-- Config for: nvim-tree.lua
|
||||
time([[Config for nvim-tree.lua]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.nvimtree\frequire\0", "config", "nvim-tree.lua")
|
||||
time([[Config for nvim-tree.lua]], false)
|
||||
|
||||
-- Command lazy-loads
|
||||
time([[Defining lazy-load commands]], true)
|
||||
|
@ -418,9 +418,9 @@ vim.cmd [[augroup packer_load_aucmds]]
|
|||
vim.cmd [[au!]]
|
||||
-- Event lazy-loads
|
||||
time([[Defining lazy-load event autocommands]], true)
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'vim-sanegx', 'diffview.nvim', 'gitsigns.nvim', 'todo-comments.nvim', 'numb.nvim', 'Comment.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufWinEnter * ++once lua require("packer.load")({'bufferline.nvim', 'which-key.nvim', 'toggleterm.nvim'}, { event = "BufWinEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufReadPost * ++once lua require("packer.load")({'nvim-ts-context-commentstring'}, { event = "BufReadPost *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufWinEnter * ++once lua require("packer.load")({'toggleterm.nvim', 'which-key.nvim', 'bufferline.nvim'}, { event = "BufWinEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'Comment.nvim', 'diffview.nvim', 'numb.nvim', 'gitsigns.nvim', 'todo-comments.nvim', 'vim-sanegx'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load event autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
if should_profile then save_profiles() end
|
||||
|
|
|
@ -12,7 +12,7 @@ unsetopt PROMPT_SP
|
|||
|
||||
# Default programs:
|
||||
export EDITOR="lvim"
|
||||
export TERMINAL="st"
|
||||
export TERMINAL="kitty"
|
||||
export BROWSER="librewolf"
|
||||
|
||||
# ~/ Clean-up:
|
||||
|
|
|
@ -54,7 +54,7 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|||
# Use lf to switch directories and bind it to ctrl-o
|
||||
lfcd () {
|
||||
tmp="$(mktemp)"
|
||||
lfrun -last-dir-path="$tmp" "$@"
|
||||
lf -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp" >/dev/null
|
||||
|
|
Loading…
Add table
Reference in a new issue