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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

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