OSX Catalina: work: Difference between revisions

From wikinotes
 
(22 intermediate revisions by the same user not shown)
Line 2: Line 2:
= Install =
= Install =
<blockquote>
<blockquote>
 
== Graphical Installers/Settings ==
<blockquote>
{|
{|
|-
| [[macports]]
|-
| [[brew]]
|-
|-
| Configure [[terminal.app]]
| Configure [[terminal.app]]
Line 14: Line 11:
|-
|-
| Configure [[easy-move-resize]]
| Configure [[easy-move-resize]]
|-
|}
|}
</blockquote><!-- Programs -->
== Packages ==
<blockquote>
nix packages
<source lang="bash">
nix-env -i \
  cmake \
  ripgrep \
  fzf \
  silver-searcher \
  tree-sitter \
  macvim \
  bat
</source>
brew packages
<source lang="bash">
brew install \
  tmux \
  ipython \
  qutebrowser \
  alacritty \
  universal-ctags \
</source>
gems
<syntaxhighlight lang="bash">
sudo gem install ripper-tags
sudo gem install solargraph
</syntaxhighlight>
neovim
<source lang="bash">
# neovim
brew install neovim  # don't use nix, coc-solargraph requires writable
# neovim nightly (for treesitter)
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
mkdir ~/opt
tar -xvf nvim-macos.tar.gz --skip-components=1 -C ~/opt
</source>


{{ TODO |
tree-sitter
look into "Better Touch Tool", "easy move resize", native solutions.
<syntaxhighlight lang="bash">
# see tree-sitter languages: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages
nvimp -c ":PlugUpdate" -c ':qa!'
 
for lang in python ruby html css typescript tsx yaml json bash javascript nix; do
    nvim -c ":TSInstallSync! ${lang}" -c ":quit"
done
</syntaxhighlight>
</blockquote><!-- Packages -->
</blockquote><!-- Install -->


see here https://superuser.com/questions/53051/altclick-drag-window-resizing-on-a-mac-similar-to-x-windows
= Configuration =
}}
<blockquote>
== MacOS Settings ==
<blockquote>
=== Shell ===
<blockquote>
<source lang="bash">
echo /opt/homebrew/bin/zsh > /etc/shells
chsh  # change shell to /opt/homebrew/bin/zsh
</source>
</blockquote><!-- shell -->


<source lang="yaml">
=== Keyboard ===
<blockquote>
<syntaxhighlight lang="yaml">
Settings > Keyboard:
Settings > Keyboard:
     Shortcuts:
     Shortcuts:
Line 34: Line 95:
             - (Google Chrome) Select Next Tab:  Ctrl+P  # create
             - (Google Chrome) Select Next Tab:  Ctrl+P  # create
             - (Google Chrome) Select Next Tab:  Ctrl+N  # create
             - (Google Chrome) Select Next Tab:  Ctrl+N  # create
            - (All Applications) Zoom:          Super+m # create
        Function Keys:
            - [x] Use F1, F2 as function keys
     Keyboard:
     Keyboard:
         Touchbar shows: F1, F2, etc.
         Touchbar shows: F1, F2, etc.
Line 43: Line 107:
     Text:
     Text:
         [ ] Add period with double-space
         [ ] Add period with double-space
</syntaxhighlight>
</blockquote><!-- Keyboard -->


=== Trackpad ===
<blockquote>
<syntaxhighlight lang="yaml">
Settings > Trackpack:
Settings > Trackpack:
     Scroll & Zoom:
     Scroll & Zoom:
         [ ] Scroll Direction: Natural  # invert mouse direction
         [ ] Scroll Direction: Natural  # invert mouse direction
</syntaxhighlight>
</blockquote><!-- Trackpad -->


=== Mission Control ===
<blockquote>
<syntaxhighlight lang="yaml">
Settings > Mission Control:
Settings > Mission Control:
   - [ ] Automatically rearrange Spaces based on most recent use  # windows stay on assigned workspace
   - [ ] Automatically rearrange Spaces based on most recent use  # windows stay on assigned workspace
</syntaxhighlight>
</blockquote><!-- Mission Control -->
=== Finder ===
<blockquote>
<source lang="yaml">
(taskbar): Finder
  Preferences:
    New Finder Windows Show: 'will'
</source>
</blockquote><!-- finder -->


=== Alacritty ===
<blockquote>
<syntaxhighlight lang="yaml">
(open app): Automator
(open app): Automator
   File > New > Quick Action:
   File > New > Quick Action:
Line 68: Line 156:
       (add):
       (add):
         /Applications/MacPorts/Alacritty.app/Contents/MacOS/alacritty
         /Applications/MacPorts/Alacritty.app/Contents/MacOS/alacritty
</syntaxhighlight>
</blockquote><!-- Alacritty -->


=== Users/Groups ===
<blockquote>
<syntaxhighlight lang="yaml">
Settings > Users and Groups:
Settings > Users and Groups:
   Login Items (tab):
   Login Items (tab):
     - karabiner elements
     - karabiner elements
     - Easy Move+Resize  
     - Easy Move+Resize  
</source>
</syntaxhighlight>
</blockquote><!-- Users/Groups -->


<source lang="yaml">
=== Misc ===
# Shopify Specific
<blockquote>
<syntaxhighlight lang="yaml">
Backup and Sync from Google  # live backup files to google drive
Backup and Sync from Google  # live backup files to google drive
- Screen Saver under 5min
- Screen Saver under 5min
Line 87: Line 182:
       - [x] Find my Mac
       - [x] Find my Mac


- install shopify dev
</syntaxhighlight>
</source>


{{ TODO |
Show sound in menubar
* bind Ctrl+c/v as copy/paste  (from option+c/v)
<source lang="yaml">
* alternatively, consider remapping 'option' as ctrl? most shortcuts seem similar...
Settings:
}}
   Control Center:
 
    Sound: Always show in menubar
<source lang="bash">
nix -i \
  cmake \
  ripgrep \
  fzf \
  silver-searcher \
  tree-sitter \
  alacritty \
  universal-ctags \
</source>
 
<source lang="bash">
brew install \
  tmux \
  ipython \
   qutebrowser \
</source>
 
neovim-nightly
<source lang="bash">
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
mkdir ~/opt
tar -xvf nvim-macos.tar.gz --skip-components=1 -C ~/opt
export PATH=$PATH:/Users/will/opt/bin
nvim
</source>
 
<source lang="bash">
# brew stuff
brew install alacritty
 
 
# enable salt-minion
echo 'master: lavos.ddns.net' > /opt/local/etc/salt/minion
sudo port load salt-minion
 
 
# python-3.7 as default
sudo port select --set python python37
sudo port select --set python3 python37
 
 
# install ropemode
python -m pip install ropemode \
  rope
 
 
# gems
sudo gem install ripper-tags
 
 
# hand off to saltstack
sudo salt-call test.ping
sudo salt-call -l debug --state-output=mixed state.highstate
</source>
</source>
</blockquote><!-- Misc -->
</blockquote><!-- MacOS Settings -->


<source lang="bash">
== dotfiles ==
# ignore ctags file
<blockquote>
git config --global core.excludesfile ~/.gitignore
There's a whole pile in <code>$salt_userfiles</code>.
echo tags > ~/.gitignore
</blockquote><!-- dotfiles -->
 
# {project}
rippertags -R .
</source>


== Rebind Home/End to Beginning/End ==
== Rebind Home/End ==
<blockquote>
{{ TODO |
{{ TODO |
try remapping F13 to insert, so I can use shift+insert }}
try remapping F13 to insert, so I can use shift+insert }}
Line 177: Line 216:
}
}
</source>
</source>
</blockquote><!-- Rebind Home/End -->


== Keyboard Repeat Rate ==
== Keyboard Repeat Rate ==
<blockquote>
{{ TODO |
{{ TODO |
Document the `defaults` command }}
Document the `defaults` command }}
{{ NOTE |
This is a bit fast for my liking. Also appears to require a logout/login
}}


https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x
https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x
Line 190: Line 227:
defaults write -g InitialKeyRepeat -int 10  # (trying 12) normal minimum is 15 (225 ms)
defaults write -g InitialKeyRepeat -int 10  # (trying 12) normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1          # normal minimum is 2 (30 ms)
defaults write -g KeyRepeat -int 1          # normal minimum is 2 (30 ms)
# reboot
</source>
</blockquote><!-- Keyboard Repeat Rate -->
== RepeatKeys instead of hold-for-accent ==
<blockquote>
{{ TODO |
Document the `defaults` command }}
<source lang="bash">
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
</source>
</source>
restart applications to take effect.
</blockquote><!-- RepeatKeys instead of hold-for-accent -->


== Drag/Resize Window with Modkey ==
== Drag/Resize Window with Modkey ==
<blockquote>
* Ctrl + Cmd + Click (Ctrl + win + click)
* Ctrl + Cmd + Click (Ctrl + win + click)


Line 201: Line 253:
defaults delete -g NSWindowShouldDragOnGesture            # disable
defaults delete -g NSWindowShouldDragOnGesture            # disable
</source>
</source>
</blockquote><!-- Drag/Resize Window with Modkey -->


== Disable Hibernate ==
== Disable Hibernation ==
<blockquote>
<source lang="bash">
<source lang="bash">
sudo pmset -a hibernatemode 0  # disable hibernate
sudo pmset -a hibernatemode 0  # disable hibernate
sudo pmset -a hibernatemode 3  # re-enable hibernate
sudo pmset -a hibernatemode 3  # re-enable hibernate
</source>
</source>
</blockquote><!-- Install -->
</blockquote><!-- Disable Hibernation -->
</blockquote><!-- Configuration -->
 
= Hotkeys =
<blockquote>
<source lang="yaml">
finder:
  cmd+shift+.  # show hidden files
</source>
</blockquote><!-- hotkeys -->

Latest revision as of 14:53, 19 April 2024

Install

Graphical Installers/Settings

Configure terminal.app
Configure kinesis savant elite 2 and karabiner
Configure easy-move-resize

Packages

nix packages

nix-env -i \
  cmake \
  ripgrep \
  fzf \
  silver-searcher \
  tree-sitter \
  macvim \
  bat

brew packages

brew install \
  tmux \
  ipython \
  qutebrowser \
  alacritty \
  universal-ctags \

gems

sudo gem install ripper-tags
sudo gem install solargraph

neovim

# neovim
brew install neovim  # don't use nix, coc-solargraph requires writable

# neovim nightly (for treesitter)
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
mkdir ~/opt
tar -xvf nvim-macos.tar.gz --skip-components=1 -C ~/opt

tree-sitter

# see tree-sitter languages: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages
nvimp -c ":PlugUpdate" -c ':qa!'

for lang in python ruby html css typescript tsx yaml json bash javascript nix; do
    nvim -c ":TSInstallSync! ${lang}" -c ":quit"
done

Configuration

MacOS Settings

Shell

echo /opt/homebrew/bin/zsh > /etc/shells
chsh  # change shell to /opt/homebrew/bin/zsh

Keyboard

Settings > Keyboard:
    Shortcuts:
        Spotlight:
          - Show Spotlight Search: Opt + p
        Mission Control:
            [x] Switch to Desktop {1..9}:  Opt + {num}  # (first press Ctrl+up, create 9x spaces)
            [ ] Show Desktop (disable F11)
        App Shortcuts:
            - (All Applications) Close Tab:     Ctrl+W  # create
            - (Google Chrome) Select Next Tab:  Ctrl+P  # create
            - (Google Chrome) Select Next Tab:  Ctrl+N  # create
            - (All Applications) Zoom:          Super+m # create
        Function Keys:
            - [x] Use F1, F2 as function keys
    Keyboard:
        Touchbar shows: F1, F2, etc.
    App Shortcuts:
        Modifier Keys:   # NOTE: choose your keyboard from the dropdown
            Caps Lock: Control
            Option:    Command
            Command:   Option
    Text:
        [ ] Add period with double-space

Trackpad

Settings > Trackpack:
    Scroll & Zoom:
        [ ] Scroll Direction: Natural  # invert mouse direction

Mission Control

Settings > Mission Control:
  - [ ] Automatically rearrange Spaces based on most recent use  # windows stay on assigned workspace

Finder

(taskbar): Finder
  Preferences:
    New Finder Windows Show: 'will'

Alacritty

(open app): Automator
  File > New > Quick Action:
    - drag (Library > Run Shellscript) into window
    - input: None
    - shellscript: open -n "/Applications/MacPorts/Alacritty.app/Contents/MacOS/alacritty"
  File > Save: 'Alacritty'
Settings > Keyboard:
  Shortcuts:
    Services:
      General:
        Alacritty: Win+Shift+'

 Settings > Security & Privacy:
   Privacy:
     Full Disk Access:
       (add):
         /Applications/MacPorts/Alacritty.app/Contents/MacOS/alacritty

Users/Groups

Settings > Users and Groups:
  Login Items (tab):
    - karabiner elements
    - Easy Move+Resize

Misc

Backup and Sync from Google  # live backup files to google drive
- Screen Saver under 5min
- Always ask password on screen saver
- hot corner for screen saver

(apple) > System Preferences:
  - internet accounts:
    - icloud:
      - [x] Find my Mac

Show sound in menubar

Settings:
  Control Center:
     Sound: Always show in menubar

dotfiles

There's a whole pile in $salt_userfiles.

Rebind Home/End

TODO:

try remapping F13 to insert, so I can use shift+insert

# ~/Library/KeyBindings/DefaultKeyBinding.dict
{
  "\UF729"  = moveToBeginningOfParagraph:; // home
  "\UF72B"  = moveToEndOfParagraph:; // end
  "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
  "$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
  "^\UF729" = moveToBeginningOfDocument:; // ctrl-home
  "^\UF72B" = moveToEndOfDocument:; // ctrl-end
  "^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
  "^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}

Keyboard Repeat Rate

TODO:

Document the `defaults` command

https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x

defaults write -g InitialKeyRepeat -int 10  # (trying 12) normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1          # normal minimum is 2 (30 ms)
# reboot

RepeatKeys instead of hold-for-accent

TODO:

Document the `defaults` command

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

restart applications to take effect.

Drag/Resize Window with Modkey

  • Ctrl + Cmd + Click (Ctrl + win + click)


# requires reboot
defaults write -g NSWindowShouldDragOnGesture -bool true  # enable
defaults delete -g NSWindowShouldDragOnGesture            # disable

Disable Hibernation

sudo pmset -a hibernatemode 0  # disable hibernate
sudo pmset -a hibernatemode 3  # re-enable hibernate

Hotkeys

finder:
  cmd+shift+.  # show hidden files