1
0
Fork 0

lvim and kitty changes

This commit is contained in:
Luca Bilke 2022-07-07 16:23:55 +02:00
parent 6483df7cce
commit a97757fa99
2 changed files with 62 additions and 22 deletions

View File

@ -28,8 +28,18 @@ cmd open ${{
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2|*.tar.gz|*.tgz|*.tar.xz|*.txz|*.zip|*.rar|*.iso)
mntdir="$f-archivemount"
[ ! -d "$mntdir" ] && {
mkdir "$mntdir"
archivemount "$f" "$mntdir"
echo "$mntdir" >> "/tmp/__lf_archivemount_$id"
}
lf -remote "send $id cd \"$mntdir\""
lf -remote "send $id reload"
;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac
}}
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
@ -52,6 +62,16 @@ cmd delete ${{
[ $ans = "y" ] && rm -rf -- $fx
}}
cmd trash ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
printf "%s\n\t" "$fx"
printf "trash?[y/N]"
read ans
[ $ans = "y" ] && trash-put $fx
}}
cmd moveto ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
@ -108,10 +128,33 @@ cmd link %{{
cmd setbg "$1"
cmd bulkrename $vidir
cmd git_branch ${{
git branch | fzf | xargs git checkout
pwd_shell=$(pwd)
lf -remote "send $id updir"
lf -remote "send $id cd \"$pwd_shell\""
}}
cmd on-cd &{{
# display git repository status in your prompt
source /usr/share/git/completion/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=auto
GIT_PS1_SHOWSTASHSTATE=auto
GIT_PS1_SHOWUNTRACKEDFILES=auto
GIT_PS1_SHOWUPSTREAM=auto
GIT_PS1_COMPRESSSPARSESTATE=auto
git=$(__git_ps1 " [GIT BRANCH:> %s]") || true
fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[33;1m$git\033[0m"
lf -remote "send $id set promptfmt \"$fmt\""
}}
cmd paste $cp-p --lf-paste $id
# Bindings
map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
map D delete
map D trash
# map D delete
map E extract
map C copyto
map R rsyncto
@ -138,4 +181,7 @@ map <c-e> down
map <c-y> up
map V push :!$EDITOR<space>
map W $setsid -f $TERMINAL >/dev/null 2>&1
map gb :git_branch
map gp ${{clear; git pull --rebase || true; echo "press ENTER"; read ENTER}}
map gs ${{clear; git status; echo "press ENTER"; read ENTER}}
map gl ${{clear; git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit}}

View File

@ -1,10 +1,16 @@
-- general
lvim.log.level = "warn"
lvim.colorscheme = "tokyonight"
lvim.transparent_window = true
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
vim.opt.undofile = true
vim.opt.titlestring = "%t - nvim"
lvim.log.level = "warn"
lvim.colorscheme = "tokyonight"
vim.g.tokyonight_style = "night"
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
vim.opt.undofile = true
vim.opt.titlestring = "%t - nvim"
-- opts for LF
vim.g.NERDTreeHijackNetrw = 0
vim.g.lf_replace_netrw = 1
vim.g.lf_command_override = 'lf -command "set nopreview" -command "set hidden"'
-- Lualine
lvim.builtin.lualine.style = "none"
@ -296,20 +302,8 @@ lvim.plugins = {
{ "felipec/vim-sanegx",
event = "BufRead",
},
-- { "tpope/vim-surround",
-- keys = { "c", "d", "y" },
-- -- make sure to change the value of `timeoutlen` if it's not triggering correctly, see https://github.com/tpope/vim-surround/issues/117
-- setup = function()
-- vim.opt.timeoutlen = 500
-- end
-- },
{ "ptzz/lf.vim",
requires = "voldikss/vim-floaterm",
config = function()
vim.g.NERDTreeHijackNetrw = 0
vim.g.lf_replace_netrw = 1
vim.g.lf_command_override = 'lf -command "set nopreview" -command "set hidden"'
end,
},
{ "vimwiki/vimwiki" }
}