Open34

[個人開発メモ] Mac/Winで環境設定

sharkysharky

https://www.beeete2.com/blog/?p=1707
これやってしまうと、基本HOME/ENDで行頭行末カーソル移動できるようになるが、
vscodeのキーバインド確認でcmd + -> / cmd + <-になってしまう。。
(おそらくそのように変換しているだけの設定みたい)
いったん外して、他の方法模索してみたい

が、結局この方が使い勝手良いかも。。

sharkysharky

https://memo.brdr.jp/post/156787133366/macのアニメーションを速くすると快適

defaults write com.apple.finder DisableAllAnimations -boolean true; killall Finder
defaults write -g QLPanelAnimationDuration -float 0.15
defaults write com.apple.dock autohide-time-modifier -float 0.15
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock expose-animation-duration -float 0.15
defaults write com.apple.dock workspaces-edge-delay -float 0.15;killall Dock
sharkysharky

一番最初にMacOSのキーボード入力を確認した方が良さそう
Windows風にキーボード操作をするなら日本語-ローマ字入力にした方が良さそう

sharkysharky

シェルをbash(慣れてるから)に切り替えたい
https://hirooooo-lab.com/development/change-mac-shell/
https://qiita.com/key-amb/items/d053ed80590697435650

  • 使用しているシェルの確認
$ echo $SHELL
# zshを利用している
/bin/zsh
# bashを利用している
/bin/bash
# 自分の環境に設定が可能なシェルの一覧を確認
$ cat /etc/shells

$ brew install bash
$ echo '/usr/local/bin/bash' | sudo tee -a /etc/shells
$ chsh -s /opt/homebrew/bin/bash
$ bash --version
## /etc/shells
#/bin/bash #古いバージョンをコメントアウト

↑した後に
$ chsh -s /usr/local/bin/bash
$ chsh -s /opt/homebrew/bin/bash
sharkysharky

https://zenn.dev/asahigamieru/articles/d7cfcdc5af0d5f

==> /usr/bin/sudo /usr/sbin/chown -R nasubi:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at 435e22d18 Merge pull request #12637 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rails-2.13.0
Warning: /opt/homebrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/nasubi/.profile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh


sharkysharky
  • homebrewでインストールしたbashが使われていない
  • zprofileで設定したhomebrewがpath通されてない
  1. ~/.bash_profileにeval "$(/opt/homebrew/bin/brew shellenv)"を追記
  2. source ~/.bash_profileで反映

で解決

sharkysharky


command+`(バッククォート)が押せない!!!!

色々ググったりしたけど、、結局わからず終い。。
↓の環境設定からキーボードの種類をJIS -> ISOに変更すると、、

なぜか認識されるようになった!

sharkysharky

↑の設定だと時間経過で打てなくなった。。
多分macとvscodeの仲がワルイんでしょうね。

元のJISに戻したらうまく反応したので、ちょっと様子を見ることにする

sharkysharky

npm はどうインストールしよう?
n ? nvm ? homebrew ?

sharkysharky

MacのSimulator上で "@" を入力したときに "[" が入力されてまう
https://qiita.com/shungo_m/items/f8a482647de4f9158ee9

↑の設定切り替えでできなかった。。(システム環境設定でキーボードの種類をJISにしてもダメだった)

シミュレーターだと JIS キーボードを使ってても US キーボード配列になるらしいです!
なので shift + 2 で @ が入力できるらしいです

https://qiita.com/kokogento/items/acd3e45b4b9d4f82368f
↑こちらで対応することにした

sharkysharky

win/macのchromeのタブ移動のショートカットキーが異なるのがきになる。。
winの方でmacに合わせてみよう。

https://weekly.ascii.jp/elem/000/002/625/2625104/

Keyconfigがなくなったようなので、代用品を探す

https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck/related?hl=ja

SHORTKEYSとうのがあったので、いったんこれ試してみる

↑ページによっては全然ショートカットキーが反応しない。。これはダメ

他のを探す
⇒ 他のためしてみても、ctrl+alt+rightなどの設定ができなかった。。

↑SHORTKEYSのプラグインで事足りそう!
chrome://extensions/shortcuts で設定可能で、ココで設定すればキーが反応しなくなる事象が改善された!

ctrl+altが割り当てできないので、結局win配列に合わせることした。(JIS割り当てキーボードだし)

sharkysharky

vscode設定を合わせたい

Win

  • cursorWordXXXをAltキーで操作する: Ctrl -> Altに変更
  • cursorHomeをCtrlキーで操作する: Home -> Ctrlに変更
  • cursorEndをCtrlキーで操作する: End -> Ctrlに変更

Mac

  • cursorTopを cmd+Homeで操作する : cmd + ↑ -> cmd + Homeに変更
  • cursorBottomを cmd+Endで操作する : cmd + ↓ -> cmd+Endに変更
  • scrollLineXXXをcmdで操作する
  • 表示: 次or以前のエディターを開く(タブ移動)を cmd+pageup/downで操作する
    • cmd+pageup/down(旧scrollLineUp/Down) -> 削除
sharkysharky

MacのVSCodeだとhomeキーがcmd+leftに変換されるため、(Karabinerの設定上)
いったんKarabinderのPC-Style Home/Endをはずしてみる
(これで他に影響あったかな。。)

MacのGoogleブラウザでtextForcus状態でもHomeキーでScrollTopしてしまう。
これが他のアプリやエディタの設定と差があるので気持ち悪くなってしまう。。

どうしよ。。

PC-Style Home/End
やっぱりこれつけて、vscodeの動きだけちょと我慢。。

sharkysharky

VSCodeでホームポジションから離れずにカーソル移動させたい。
通常のカーソルに加えて、入力補完のときとかも含めて。

VSCode上のキーバインド設定だけだと、入力補完などの際にカーソル移動が効かないので、Karabinderでもとから割り当ててみる。
・Alt + h : ←
・Alt + j : ↓
・Alt + k : ↑
・Alt + l : →

結局、vimの拡張機能を導入する方がよさそうでした。
https://qiita.com/jintz/items/d357478271179c90ffab

sharkysharky

いまはHHKBでホームポジションを崩さないように奮闘中!!