👏

EndeavourOS の CUI 環境を整えて作業効率を高める

2024/10/08に公開

zsh の導入

$ pacman -Ss zsh
extra/grml-zsh-config 0.19.2-1
    grml's zsh setup
extra/zsh 5.9-1
    A very advanced and programmable command interpreter (shell) for UNIX
extra/zsh-doc 5.9-1
    Info, HTML and PDF format of the ZSH documentation
community/powerline 2.8.2-4
    Statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome, i3 and
    Qtile
community/python-click-completion 0.5.2-6
    Add or enhance bash, fish, zsh and powershell completion in Click
community/zsh-autosuggestions 0.7.0-1
    Fish-like autosuggestions for zsh
community/zsh-completions 0.33.0-1
    Additional completion definitions for Zsh
community/zsh-history-substring-search 1.0.2-1
    ZSH port of Fish history search (up arrow)
community/zsh-lovers 0.9.1-3
    A collection of tips, tricks and examples for the Z shell.
community/zsh-syntax-highlighting 0.7.1-1
    Fish shell like syntax highlighting for Zsh
community/zsh-theme-powerlevel10k 1.16.1-1
    Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.
community/zshdb 1.1.2-1
    A debugger for zsh scripts.
sudo pacman -S zsh

再起動します。

This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~).  This function can help you with a few settings that should
make your use of the shell easier.

You can:

(q)  Quit and do nothing.  The function will be run again next time.

(0)  Exit, creating the file ~/.zshrc containing just a comment.
     That will prevent this function being run again.

(1)  Continue to the main menu.

--- Type one of the keys in parentheses ---

設定は最低限でいいので 0 を指定しました。

peco のインストール

% sudo pacman -Ss peco
[sudo] password for ymidori: 
community/peco 0.5.10-4
    Simplistic interactive filtering tool
% sudo pacman -S peco

ghq のインストール

% yay -Ss ghq        
aur/mkrepo 0.1.3-1 (+0 0.00) 
    Create repo directory for ghq style
aur/ghq-gst 5.0.4-1 (+1 0.00) 
    a simple toolbox that offers additional commands over ghq enabled environment
aur/ghq-bin 1.3.0-1 (+3 0.11) 
    Remote repository management made easy. Pre-compiled.
aur/ghq 1.3.0-1 (+11 0.26) 
    Remote repository management made easy
% yay -S ghq

dotfiles を ghq で取得する
※自分用なので上手く動かない場合は適宜書き換えてください。

ghq get git@github.com:ymidori/dotfiles.git

dotfiles のディレクトリに cd で移動して

install.sh

tmux を導入する

sudo pacman -S tmux

tmux を使用したときにタブ補完をするとコマンドの最初の2文字がのこって重複する現象が起きました。

  • 例:ls 時にタブを押したとき
% ls

ここでタブを押すと

% lsls Documents
Desktop/                  Pictures/ 

このように lsls となってしまう

同じ現象が起きている人を発見
https://did2memo.net/2017/06/04/ubuntu-16-04-zsh-tab-ls-lsls-locale/

どうやら、locale の設定が上手く行っていないことが原因っぽい

localectl set-locale LANG=en_US.UTF-8

こちらを実行し、再起動したら解決した。

Discussion