2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Rangerの世界: macOSとキーボードで開かれる新しい道(おまけ編)

Last updated at Posted at 2023-08-12

はじめに

前回までの記事(下記ご参照)で、Vimライクなキーボード操作がたのしいファイルマネジャー、Rangerについて掘り下げてきました。

  • その1:Rangerの魅力的なリソースをウェブからピックアップ
  • その2:「終われない問題」への対処法
  • その3:標準機能の中から、特に便利な機能の紹介
  • その4:カスタマイズして便利な機能の紹介

今回はおまけ編で、iTerm2とrangerのカラースキームのご紹介です。

わたしは「気に入った色合いにならないとツールを使いたくない病」なので、新しいツールを使うのに時間がかかってしまいます。rangerの場合は、iTerm2とranger、さらにはvimのカラーをあわせる必要があります。

色の好みは人それぞれなので、「オススメ」ともつよく言いにくいのですが……オススメです。

iTerm

SS 2023-08-12 23.36.19_mos.jpg

  • Theme: Dark (High Contrast)
  • Coloro Presets: Tomorrow Night
  • Transparency: 17
  • Blur: 4
  • Font: PlemolJP35 HS Regular 17pt

いろいろ試した結果、この設定で落ち着きました。

ranger

1ペインビューモード

SS 2023-08-13 0.02.14_mos.jpg

rc.conf
set colorscheme default_modified

マルチペイン用に微調整していますが、ほとんどdefaultカラースキームです。

iTerm2でTomorrow Night、rangerでdefaultが、いい感じの組み合わせだと思っています。

マルチペインビューモード

SS 2023-08-13 0.00.45_mos.jpg

マルチペインモードにしたとき、アクティブタブと非アクティブタブを間違えやすいので、下記に変更しています。

  • アクティブタブの名称の背景を赤色に
  • 非アクティブタブのファイル・フォルダ名を黒色に

手順は下記のとおりです。

まず、~/.config/rangerディレクトリに、colorschemesフォルダを作成します。つづいて、

cp /opt/homebrew/Cellar/ranger/1.9.3_2/lib/python3.11/site-packages/ranger/colorschemes/default.py ~/.config/ranger/colorschemes/default_modified.py

とします。default_modified.pyを下記のように変更します。

~/.config/ranger/colorschemes/default_modified.py
...

if context.inactive_pane:
    # fg = cyan # default
    fg = black # ここの色を変更

...

elif context.tab:
    if context.good:
        # bg = green # default
        bg = red # ここの色を変更

rc.confのカラースキームは、上記のファイルを指定します。

rc.conf
set colorscheme default_modified

Vim in ranger

SS 2023-08-12 23.53.38.jpg

.vimrc
colorscheme slate

iTerm2でTomorrow Night、rangerでdefault、Vimでslateがいい感じの組み合わせと思います。

おわりに

色の好みは人それぞれです。ひとつのオススメとして、iTerm2でTomorrow Night、rangerでdefault、Vimでslateの組み合わせを紹介しました。

また、マルチペインモードでの操作ミスを防ぐため、アクティブタブ・非アクティブタブを判別しやすくする設定方法もご紹介しました。

それでは、ハッピーrangerライフを!

ご参考

一連の記事

  • その1:Rangerの魅力的なリソースをウェブからピックアップ
  • その2:「終われない問題」への対処法
  • その3:標準機能の中から、特に便利な機能の紹介
  • その4:カスタマイズして便利な機能の紹介
  • おまけ:カラースキームのオススメの組み合わせ

環境

  • ranger 1.9.3
  • Python 3.11.4
  • iTerm Build 3.4.19
  • macOS Ventura 13.5
  • MacBook Pro (14-inch, 2021)
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?