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

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

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