Updated FAQ (markdown)

Linwei committed 2019-02-19 16:35:40 +08:00
1 parent 1457b69722
commit 582c60ae30
1 file changed
+17 -1
+17 -1
@@ -28,5 +28,21 @@ function j() {
fi
}
```
When you are using `j xxx` it will first try `cd xxx` and then `z xxx` if cd failed.
## How to import data from bash / zsh command history ?
Issue [#46](https://github.com/skywind3000/z.lua/issues/46) ask for a script to import some history path from bash command history after a fresh install of z.lua and [@antonalekseev](https://github.com/antonalekseev) provided two script below:
for bash:
`fc -ln -10000| sed -e 's|^'[[:blank:]]' ||'|grep -o "^cd [~/].*"|sed -e "s|cd ||" -e "s|~|$HOME|" -e 's|\\ | |' -e "s|/$||"|sort|uniq|while read -r d; do test -d "$d" && echo "$d|1|0"; done >> ~/z.lua`
for zsh:
`fc -ln 0|grep -o "^cd [~/].*"|sed -e "s|cd ||" -e "s|~|$HOME|" -e 's|\\ | |' -e "s|/$||"|sort|uniq|while read -r d; do test -d "$d" && echo "$d|1|0"; done >> ~/z.lua`