The shortest route to get a cultural fish environment

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.

background

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.

install fish shell

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.

Put theme and plugins and arrange

#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)

Commentary / Supplement

The following is additional information that may be useful after installation.

Add Path

set -U fish_user_paths <Path to add> $fish_user_paths

Add environment variables

It is made persistent without writing it in the configuration file like bash.

set -x <Environment variable name> <value>

Alias ​​setting and persistence

alias <New name>='<Original command>' && funcsave <New name>

Add deployment alias

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>

Find theme

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.

simnalamburt/shellder

687474703a2f2f692e696d6775722e636f6d2f785a4a486771382e706e67.png

Insert Font

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.

How to use Z

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]

How to use fzf

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.

SnapCrab_NoName_2021-1-15_18-21-8_No-00.png

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.

Finally

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

The shortest route to get a cultural fish environment
Create a command to get the work log
I want to get the operation information of yahoo route
Build a Python environment and transfer data to the server
How to get the last (last) value in a list in Python
How to get into the python development environment with Vagrant
Run the program without building a Python environment! !! (How to get started with Google Colaboratory)
The shortest memo for building a python environment that takes less than 5 minutes to work.
How to get all the possible values in a regular expression
Build a Selenium environment on Amazon Linux 2 in the shortest time
How to get the Python version
I want to find the shortest route to travel through all points
The simplest way to build a Spleeter usage environment using Windows
How to get the vertex coordinates of a feature in ArcPy
Cython to try in the shortest
Create a function to get the contents of the database in Go
Calculate the shortest route of a graph with Dijkstra's algorithm and Python
[Linux] Command to get a list of commands executed in the past
[Development environment] How to create a data set close to the production DB
How to build a sphinx translation environment
Give a title to the ipywidgets tab
I want to build a Python environment
Get a local DynamoDB environment with Docker
Get the path to the systemd unit file
How to get a stacktrace in python
To get a local IP address programmatically
How to get colored output to the console
Get the filename of a directory (glob)
Add a Python virtual environment to VSCode
9 Steps to Become a Machine Learning Expert in the Shortest Time [Completely Free]
[NNabla] How to get the output (variable) of the middle layer of a pre-built network
Build a python environment to learn the theory and implementation of deep learning
Use twitter API to get the number of tweets related to a certain keyword
Python script to get a list of input examples for the AtCoder contest
[Python] I tried to get the type name as a string from the type function
Instructions for connecting Google Colab. To the local runtime in a Windows environment
Create a filter to get an Access Token in the Graph API (Flask)
How to get a list of files in the same directory with python
[Introduction to Python] How to get the index of data with a for statement
How to calculate the volatility of a brand
How to share a virtual environment [About requirements.txt]
Introduction to Python Let's prepare the development environment
[Python] Get the files in a folder with Python
The easiest way to get started with Django
Use the latest pip in a virtualenv environment
Use the MediaWiki API to get Wiki information
Get the caller of a function in Python
ffmpeg-Build a python environment and split the video
Get only the subclass elements in a list
Set a fixed IP in the Linux environment
How to get the files in the [Python] folder
Save the object to a file with pickle
[Note] How to create a Ruby development environment
To get the path of the currently running python.exe
I made a tool to get new articles
[Introduction to Algorithm] Find the shortest path [Python3]
A python amateur tries to summarize the list ②
Use pygogo to get the log in json.
[Python] Throw a message to the slack channel
[Wagtail] Add a login page to the Wagtail project
A layman wants to get started with Python