vis: keys for yazi and fzf with hidden files; vis as default editor (also in yazi)
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
# for ssh logins, install and configure the libpam-umask package.
|
# for ssh logins, install and configure the libpam-umask package.
|
||||||
#umask 022
|
#umask 022
|
||||||
|
|
||||||
export EDITOR=nvim
|
export EDITOR=vis
|
||||||
export VISUAL=nvim
|
export VISUAL=vis
|
||||||
|
|
||||||
# if running bash
|
# if running bash
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
|||||||
@@ -150,10 +150,18 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
search(fzf_reload(ripgrep))
|
search(fzf_reload(ripgrep))
|
||||||
end, 'fzf: rg')
|
end, 'fzf: rg')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' hg', function()
|
||||||
|
search(fzf_reload(ripgrep .. ' -.'))
|
||||||
|
end, 'fzf: rg with hidden files')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' ff', function()
|
vis:map(vis.modes.NORMAL, ' ff', function()
|
||||||
search('fd --type f | fzf')
|
search('fd --type f | fzf')
|
||||||
end, 'fzf: files')
|
end, 'fzf: files')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' fh', function()
|
||||||
|
search('fd -H --type f | fzf')
|
||||||
|
end, 'fzf: files with hidden files')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' .', function()
|
vis:map(vis.modes.NORMAL, ' .', function()
|
||||||
local path = vis.win.file.path
|
local path = vis.win.file.path
|
||||||
if path then
|
if path then
|
||||||
@@ -163,7 +171,18 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
else
|
else
|
||||||
search('fd --type f | fzf')
|
search('fd --type f | fzf')
|
||||||
end
|
end
|
||||||
end, 'fzf: current dir files')
|
end, 'fzf in file directory')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' h.', function()
|
||||||
|
local path = vis.win.file.path
|
||||||
|
if path then
|
||||||
|
local dir = path:match('^.*/')
|
||||||
|
local arg = escape_and_quoted(dir)
|
||||||
|
search('fd -H --type f "" ' .. arg .. ' | fzf')
|
||||||
|
else
|
||||||
|
search('fd -H --type f | fzf')
|
||||||
|
end
|
||||||
|
end, 'fzf in file directory with hidden files')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' gf', function()
|
vis:map(vis.modes.NORMAL, ' gf', function()
|
||||||
search('git ls-files | fzf')
|
search('git ls-files | fzf')
|
||||||
@@ -202,6 +221,21 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
vis:command('cd ' .. path)
|
vis:command('cd ' .. path)
|
||||||
end)
|
end)
|
||||||
end, 'fzf change directory')
|
end, 'fzf change directory')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' yy', function()
|
||||||
|
vis:command('!yazi')
|
||||||
|
end, 'yazi')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' y.', function()
|
||||||
|
local path = vis.win.file.path
|
||||||
|
if path then
|
||||||
|
local dir = path:match('^.*/')
|
||||||
|
local arg = escape_and_quoted(dir)
|
||||||
|
vis:command('!cd ' .. arg .. ' && yazi')
|
||||||
|
else
|
||||||
|
vis:command('!yazi')
|
||||||
|
end
|
||||||
|
end, 'yazi in file directory')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ imv = [
|
|||||||
zathura = [
|
zathura = [
|
||||||
{ run = 'zathura "$@"', orphan = true },
|
{ run = 'zathura "$@"', orphan = true },
|
||||||
]
|
]
|
||||||
nvim_cd = [
|
fzf_vis = [
|
||||||
{ run = 'nvim -c "cd $@"', block = true }
|
{ run = 'cd "$@" && fd --type f | fzf --bind "enter:become(vis {})"', block = true }
|
||||||
]
|
]
|
||||||
|
|
||||||
[open]
|
[open]
|
||||||
prepend_rules = [
|
prepend_rules = [
|
||||||
{ mime = "image/*", use = "imv" },
|
{ mime = "image/*", use = "imv" },
|
||||||
{ mime = "application/pdf", use = "zathura" },
|
{ mime = "application/pdf", use = "zathura" },
|
||||||
{ mime = "inode/directory", use = "nvim_cd" }
|
{ mime = "inode/directory", use = "fzf_vis" }
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user