lvim and kitty changes
This commit is contained in:
parent
6483df7cce
commit
a97757fa99
|
@ -28,8 +28,18 @@ cmd open ${{
|
||||||
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
|
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/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
|
||||||
application/pgp-encrypted) $EDITOR $fx ;;
|
application/pgp-encrypted) $EDITOR $fx ;;
|
||||||
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
|
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2|*.tar.gz|*.tgz|*.tar.xz|*.txz|*.zip|*.rar|*.iso)
|
||||||
esac
|
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 ' ' '\ ')"
|
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
|
||||||
|
@ -52,6 +62,16 @@ cmd delete ${{
|
||||||
[ $ans = "y" ] && rm -rf -- $fx
|
[ $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 ${{
|
cmd moveto ${{
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
clear; tput cup $(($(tput lines)/3)); tput bold
|
||||||
set -f
|
set -f
|
||||||
|
@ -108,10 +128,33 @@ cmd link %{{
|
||||||
cmd setbg "$1"
|
cmd setbg "$1"
|
||||||
cmd bulkrename $vidir
|
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
|
# Bindings
|
||||||
map <c-f> $lf -remote "send $id select '$(fzf)'"
|
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 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 E extract
|
||||||
map C copyto
|
map C copyto
|
||||||
map R rsyncto
|
map R rsyncto
|
||||||
|
@ -138,4 +181,7 @@ map <c-e> down
|
||||||
map <c-y> up
|
map <c-y> up
|
||||||
map V push :!$EDITOR<space>
|
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}}
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
-- general
|
-- general
|
||||||
lvim.log.level = "warn"
|
lvim.log.level = "warn"
|
||||||
lvim.colorscheme = "tokyonight"
|
lvim.colorscheme = "tokyonight"
|
||||||
lvim.transparent_window = true
|
vim.g.tokyonight_style = "night"
|
||||||
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
|
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
vim.opt.titlestring = "%t - nvim"
|
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
|
-- Lualine
|
||||||
lvim.builtin.lualine.style = "none"
|
lvim.builtin.lualine.style = "none"
|
||||||
|
@ -296,20 +302,8 @@ lvim.plugins = {
|
||||||
{ "felipec/vim-sanegx",
|
{ "felipec/vim-sanegx",
|
||||||
event = "BufRead",
|
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",
|
{ "ptzz/lf.vim",
|
||||||
requires = "voldikss/vim-floaterm",
|
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" }
|
{ "vimwiki/vimwiki" }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue