惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
SecWiki News
SecWiki News
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
Project Zero
Project Zero
WordPress大学
WordPress大学
NISL@THU
NISL@THU
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
Martin Fowler
Martin Fowler
C
Cybersecurity and Infrastructure Security Agency CISA
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
小众软件
小众软件
I
Intezer
A
Arctic Wolf
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
O
OpenAI News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
Latest news
Latest news
G
GRAHAM CLULEY
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V2EX - 技术
V2EX - 技术
Stack Overflow Blog
Stack Overflow Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 最新话题
博客园 - Franky
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
P
Proofpoint News Feed
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
F
Full Disclosure
Security Latest
Security Latest

wentao's blog

解决armbian更新报不能验证个别公钥 快速查找PowerShell的历史命令 denote 利用PowerShell来进行端口连通性测试 wezterm的workspace配置 PSReadLine最强PowerShell模块 读《万千微尘纷坠心田》 Emacs添加腾讯会议连接 一个新的终端模拟器WezTerm
nyagos增加zoxide的支持
wentao写点代码,解决点问题。 douban github twitter Spotify telegram · 2023-04-27 · via wentao's blog

介绍

zoxide 提供了 z jump 的功能.能够记录就访问的路径,并通过其中的关键词快速的定位到你想要的文件夹.

nyagos 是一个支持使用 lua 配置的 shell. 快速、稳定.但是使用圈子很小.

zoxide 提供了常见的 shell 整合,在 nyagos 下面没有相关的支持.

步骤

由于主要是自用,简单的通过 luanyagos.alias 功能实现了一个简单的版本.

其中 z 跳转的时候只支持一个参数.

nyagos.alias.z = function (args)
    local rest = args[1]
    local path = rest
    if (string.len(rest) > 1) then
        path = nyagos.eval("zoxide query --exclude '".. (nyagos.getwd()) .."' -- " .. rest)
    end

    nyagos.chdir(path)
end
nyagos.alias.zi=function(args)
    local rest = args[1]
    if rest==nil then
        rest = ""
    end
    path = nyagos.eval("zoxide query -i -- " .. rest .. "| fzf" )
    nyagos.chdir(path)
end

利用 postexechook 功能,实现了自动更新 zoxide 数据.

nyagos.postexechook = function(args)
      if "cd" == args[1] then
          nyagos.eval("zoxide add -- " .. nyagos.getwd())
      end
end