在Zsh中实现快速路径跳转,
之前已经介绍了z.lua(Zsh配置快速路径跳转)。今天看到了另一个zsh的插件zoxide,
它是用rust语言写的,所以效率上应当是更高的。至于为什么会由z.lua切换到zoxide,
这里我也想不出更好的理由,但是大家可以参考文章zoxide VS
z.lua和zsh-z VS
zoxide, 今天我是做为尝试而切换到zoxide,
当然z.lua依然优秀。
zoxide 简介
zoxide is a
smarter cd command, inspired by z and autojump.
It remembers which directories you use most frequently, so you can
"jump" to them in just a few keystrokes.zoxide works on all major
shells.
Getting started
1 2 3 4 5 6 7 8 9 10 11 12
z foo # cd into highest ranked directory matching foo z foo bar # cd into highest ranked directory matching foo and bar z foo / # cd into a subdirectory starting with foo
z ~/foo # z also works like a regular cd command z foo/ # cd into relative path z .. # cd one level up z - # cd into previous directory
zi foo # cd with interactive selection (using fzf)
z foo<SPACE><TAB> # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only)
Installation
install zoxide
1
sudo pacman -S zoxide
Configure
~/.zshrc
1 2 3 4 5 6
# set for zsh-z-git # source /usr/share/zsh/plugins/zsh-z/zsh-z.plugin.zsh # set for z.lua 功能上不如zsh-z-git完善 # eval "$(lua /usr/share/z.lua/z.lua --init zsh enhanced once)" # set for zoxide instead of z.lua eval"$(zoxide init zsh)"
packer.nvim:
packer.nvim is currently unmaintained. For the time being (as of August,
2023), it is recommended to use one of the following plugin managers
instead: lazy.nvim or pckr.nvim
paq-nvim: Paq is a
Neovim package manager written in Lua.
neopm:Plugin manager for
neovim, pre-alpha stage. Expect breaking changes.
dep: A versatile,
declarative and correct neovim package manager in Lua. Originally
written for personal use by luaneko.
optpack.nvim:
This is a neovim plugin manager that uses only opt package.
pact.nvim: pact is
a semver focused, pessimistic plugin manager for Neovim.
vim-plug:A
minimalist Vim plugin manager.Just one file with no dependencies. Super
easy to set up.
Vundle.vim:Vundle is
short for Vim bundle and is a Vim plugin manager.
pathogen.vim:Manage
your 'runtimepath' with ease. In practical terms, pathogen.vim makes it
super easy to install plugins and runtime files in their own private
directories.
dein.vim: Dein.vim
is a dark powered Vim/Neovim plugin manager.
volt: Multi-platform
CLI tool managing Vim plugin life
Nvim has no direct connection to the system clipboard. Instead it
depends on a |provider| which transparently uses shell commands to
communicate with the system clipboard or any other clipboard
"backend".
"Paste" is a separate concept from |clipboard|: paste means "dump a
bunch of text to the editor", whereas clipboard provides features like
|quote+| to get and set the OS clipboard directly. For example,
middle-click or CTRL-SHIFT-v (macOS: CMD-v) in your terminal is "paste",
not "clipboard": the terminal application (Nvim) just gets a stream of
text, it does not interact with the clipboard directly.