LoginSignup
0
1

More than 3 years have passed since last update.

WSLのおすすめ設定(Hyperを使っていけ)

Last updated at Posted at 2019-12-21

はじめに

最近wslの環境を自宅のゲーム用PCにも導入し始めたのですが,「あれ,Hyperどんな設定だったっけ?」となりました.
WSLの色々いじったところも忘れてしまったのでメモ用です.

加えて人に推していく際にここ見るといいよっていうの探すの面倒じゃねって思い始めてきましたので自分のここ見とけ!みたいなところがあればね,楽じゃんってことで書きます.

基本的には参考サイトのコピペまとめが多いです.

環境

  • Windows 10
  • WSL

今回必要な環境の情報はこれくらいですかね
持ち運び用の開発PCではwslを,デスクトップではwsl2を使用しています.

変更点

vim

.vimrcがなかったら作ってください

.vimrc
set fenc=utf-8
set nobackup
set noswapfile
set autoread
set hidden
set showcmd
set number
set cursorline
set cursorcolumn
set virtualedit=onemore
set visualbell
set showmatch
set laststatus=2
syntax enable
set list listchars=tab:\▸\-
set expandtab
set tabstop=2
set ignorecase
set smartcase
set wrapscan
set incsearch
set hlsearch
nmap <Esc><Esc> :nohlscdearch<CR><Esc>

正直cursorculumnは邪魔です
あと expandtablist listcharsはどっちかにしましょう
このままだとexpandtabが優先されてset listした意味ないですから

dircolors

lsしたときのWSLのデフォの色々見にくいところ多くねってことで変えていきましょう.
dircolorsを利用することで文字の色を変更することができます.

# LSカラー設定ファイルを出力
$ dircolors -p > ~/.dircolors
$ vim ~/.dircolors
.dircolors
- OTHER_WRITABLE 34;42
+ OTHER_WRITABLE 35

色の設定

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

Hyper

Ctrl + ,してください

.hyper.js

@@ 31, 33
+ opacity: 0.8,

@@ 41
- cursorBlink: false,
+ cursorBlink: true,

@@ 95,124
+ MaterialTheme: {
+   theme: 'Palenight',
+   backgroundOpacity: '0.5',
+   accentColor: '#64FFDA',
+   vibrancy: 'dark'
+   },
+   
+   overlay: {
+     alwaysOnTop: true,
+     animate: true,
+     hasShadow: false,
+     hideDock: false,
+     hideOnBlue: false,
+     hotkeys: {
+       open: ['Control+Shift+O'],
+       close: [],
+     },
+     position: 'top',
+     primaryDisplay: true,
+     resizable: true,
+     size: {
+       width: 0.4,
+       height: 0.4
+     },
+     startAlone: false,
+     startup: false,
+     tray: true,
+     unique: false
+   },

@@ 181, 189
+ plugins: [
+  'hyperterm-material',
+  'hyper-statusline',
+  'hyper-search',
+  'hyper-tab-icons-plus',
+  'hyper-overlay',
+  'hyper-transparent-bg',
+  'hyperlinks',
+  'hyper-opacity',
+ ],

透過の試行錯誤で色々いらないところありそうだけど書いておけば動きます...

hypercwdはなんかで悪さ起こして動かねえってなったから消した記憶があります.

hyper-searchいれてるけど動かないんですよね...
hotkey指定してもダメだから待ってますって感じです.

.bashrc

lsは最初から色々定義してくれてるがwslはいいですね.
別になくても自分で書きますが

.bashrc

@@ 60, 62
-   PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
- else
-   PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

+   PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ '
+  else
+   PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ '

@@
+ cdls () {
+   \cd "$@" && ls
+ }
+ alias cd='cdls'

+ # hyper
+ case "$TERM" in
+ xterm*|rxvt*)
+   PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007"'
+   show_command_in_title_bar()
+     {
+     case "$BASH_COMMAND" in
+       *\033]0*)
+           ;;
+       *)
+           echo -ne "\033]0;${BASH_COMMAND} - ${PWD##*/}\007"
+           ;;
+     esac
+   }
+   trap show_command_in_title_bar DEBUG
+   ;;
+ *)
+   ;;
+ esac

さいごに

マジでこれコピペしておけば見た目だけはできる感が出てくると思いますよ,マジで

見た目から入るのも大事です.

Hyperのところなんかはコードブロックをdiffで書く必要あったのかなって思いますが行数のところが大事なのでそうしてます.

参考

0
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
0
1