It is a memo to quickly prepare the minimum fish environment with just a dozen or so lines of copy and paste. Specifically, install and use fish + fisher + Theme + Z + fzf.
I have confirmed it on Ubuntu 20.04, but I think it is the same on Ubuntu 18.04.
At first, I try to do my best with bash, paying attention to time efficiency, such as when I temporarily work in an environment different from usual, but after a few days I can not stand it and spend some time fish I decided to leave it as a memo for myself because it would prepare the environment. Now you can use the console with fish from the first day.
Official remains
sudo apt-add-repository ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish
Default shell to fish
sudo usermod -s /usr/bin/fish dev-user
Now you can start using it. You can also use intermediate completion.
#Install package manager (fisher)
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
#Theme (simnalamburt/install shellder)
fisher install simnalamburt/shellder
#Convenient to move folders (> z [TAB]Jump to history)
fisher install jethrokuan/z
#Fuzz search is super convenient with fzf
sudo apt install -y fzf
sudo apt install -y bat
sudo apt install -y fd-find
alias fd='fdfind' && funcsave fd
alias bat='batcat' && funcsave bat
fisher install PatrickF1/fzf.fish
# (Major jethrokuan/Not using fzf is ctrl-Because r was quite slow)
Installation is now complete. (If the terminal is garbled, refer to Explanation / Supplement: Insert font)
The following is additional information that may be useful after installation.
set -U fish_user_paths <Path to add> $fish_user_paths
It is made persistent without writing it in the configuration file like bash.
set -x <Environment variable name> <value>
alias <New name>='<Original command>' && funcsave <New name>
It is a function to give an alias to a command, but unlike an alias, it is recorded in the history with the original command. You don't have to be confused when operating with multiple people.
abbr -a <New name> <Original command>
https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md
The following themes are installed in this article. It is convenient to know the status of Git at a glance.
Many Fish themes, including the shellder in this article, use emoji fonts. If the characters are garbled, you need to install the fonts on the following site on the OS you are using and change the font settings of the terminal software.
https://github.com/powerline/fonts
I have Ubuntu Mono in it.
If you type "z + [SPACE] + [TAB]" in the terminal, the folder move destination candidates will appear.
It makes it easier to move back and forth between multiple folders.
z+[SPACE]+[TAB]
For the time being, try pressing "** CTRL + f **" in your home directory, and you will see a screen where you can select folders and files in launcher format.
Next, let's press "CTRL + f" at the timing of pressing the "TAB" key for file name completion etc. (for example, "vi [CTRL + f]"). Completion candidates are displayed in launcher format. This is useful, such as displaying a preview of the file in the right pane.
Also, press CTRL + r to display the command history. Unlike the standard fish history command that only displays a list, it is convenient because you can move the cursor with the up and down keys or "CTRL + p" "CTRL + n" to re-execute the history.
I have accumulated various things such as dot file operation and Ansible rule book, but I am searching the net for the installation method because the case handling is complicated. I hope I can graduate with this article.
Recommended Posts