cterdam's personal computing environment setup for Unix-like (Mac) systems.
-
Download the IBM Plex font.
-
Follow the link to the Github releases page. Download the OpenType font from the latest release.
-
To install, after decompressing, drag all subfolders of the
OpenType
folder to Font Book.
-
-
In terminal, run
xcode-select --install
to download developer tools. -
Follow these steps to set up a new SSH key for this device.
-
Now clone this repo over SSH and destroy the dummy SSH config created in the previous step:
git clone --recursive [email protected]:cterdam/dotfiles.git ~/cterdam/dotfiles rm ~/.ssh/config
-
In Finder, add
~/cterdam
to the side bar. -
Set up terminal appearance by importing
hbpro.terminal
to terminal profiles. -
Install Oh My Zsh.
- After Oh My Zsh is installed and launched, install ZSH theme and plugins.
-
Install Conda.
-
Install Java.
-
Install Golang.
-
Install Node.js.
-
Install Rust.
-
Use the command found on the website. Prepend
sudo
and run it. -
The installer might show some commands to run after installation. You can still run them to avoid any surprises, but the
zshrc
is supposed to take care of configuring the correct paths once activated.
-
-
Install homebrew.
- Upon finishing installation, the script will print a 'Next steps' section which mentions two commands to run in order to add homebrew to PATH. Run them.
-
Now install vim with
brew install vim
.-
MacOS already comes with a builtin distribution of vim, but the default version lacks many key features such as conceal, lua, perl, and python3. The version of vim on homebrew includes these features.
-
Install yarn with
sudo npm install --global yarn
.- This is for markdown-preview, and possibly some COC extensions.
-
Install silicon with
brew install silicon
.- This is for vim-silicon.
-
Install code-minimap with
cargo install --locked code-minimap
- This is for minimap.vim.
-
Install universal-ctags with
brew install --HEAD universal-ctags
- This is for vista.vim.
-
-
Install tmux with
brew install tmux
.-
Also install Tmux Plugin Manager with
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
. -
Don't worry about installing actual plugins for now:
cterdam.tmux.conf
will take care of it.
-
-
We have not dealt with
zshrc
in the new system yet, but the Conda and Oh My Zsh installation scripts should have created one in the home directory. Read it through, but everything there should already be incorporated intocterdam.zshrc
which will be installed later. So just delete it so we can use our own shell script:rm $HOME/.zshrc
-
Now activate the shell scripts:
-
Link
cterdam.zshrc
to the realzshrc
location:ln -s $HOME/cterdam/dotfiles/cterdam.zshrc $HOME/.zshrc
-
Restart shell, then restart again. Now type
Prefix
Shift + I
to install tmux plugins.Prefix
is the tmux prefix, by defaultCtrl+b
.
-
Ensure ownership of vim and COC folders:
sudo chown -R `whoami` $HOME/.vim sudo chown -R $(whoami) $HOME/.config
-
Now run
sudo vim
and it will auto install all plugins, including COC plugins.
-
-
Install Docker.
-
Install JupyterLab Desktop.
-
Install Jekyll for GitHub pages.
-
The link basically says run these:
brew install chruby ruby-install xz ruby-install ruby 3.1.3 ruby -v # 3.1.3p185 or above sudo gem install jekyll
-
-
Install Liberation Fonts.
-
To install, simply download the TTF file from the latest release.
-
This is for the English resume.
-
-
Install MacTeX, the recommended LaTeX distribution for macOS.
-
Test
latexmk
andlatexindent
. Iflatexindent
does not work, install the following packages:sudo cpan install YAML::Tiny File::HomeDir Unicode::GCString
-
-
Install Rime for Chinese input.
-
Rime needs to be used with its plum package manager, which is already incorporated as a submodule.
-
Install all default Rime packages:
cd $HOME/cterdam/dotfiles/plum bash rime-install :all
-
Then install the WU HAN Chinese and Cantonese Soeng-Ping packages:
bash rime-install cterdam/hubehua cterdam/jyutsp
-
Deploy Rime engine. Log out and log back in.
-
-
Install other UNIX tools:
brew install bat git-delta git-lfs less tree tldr shellcheck jq reattach-to-user-namespace coreutils brew install xquartz --cask pip install vim-vint ipython black
reattach-to-user-namespace
is needed for thetmux-yank
plugin.xquartz
is needed for clipboard forwarding with SSH remote.
-
Install Octave with
brew install octave
. -
Install tools for C#:
-
To conveniently open files with vim from Finder, after finishing the above instructions, install MacVim.
-
Open MacVim Preferences, and set "After last window closes" to "Quit MacVim".
-
Open this location in Finder:
cd $CTERDAMRC/fts/dummy open .
-
Select all files, and press
Command + Option + I
. Select MacVim in the "Open with" menu, and click on "Change All...".
-
Files related to personal information are stored in another private repo
cterdam/profile
, incorporated as a submodule in theutility
directory. -
Drag the
utility
folder to the macOS Dock.
-
To use an SSH key to connect to remote:
-
On the server, insert local public keys into this file. Comment lines can start with
#
.vim ~/.ssh/authorized_keys
-
Locally, register an entry in
~/.ssh/config
.- Use
ForwardAgent yes
so the remote can use the local's ssh-agent for things like GitHub, without needing its separate key.
- Use
-
Optionally, make a local executable for connection in
$CTERDAMRC/exe
.
-
-
Optionally, use X11 to forward clipboard content from remote to local:
-
Ensure that remote
/etc/ssh/sshd_config
contains this line:X11Forwarding yes
-
Ensure
xauth
is installed on server. -
If connecting through local macOS, ensure that local connections are made from XQuartz, and that
$DISPLAY
is set. -
Either use
ssh -Y -C
each session, or add these to localssh
config:ForwardX11 yes ForwardX11Timeout 0 Compression yes
-
-
Change the default shell to
zsh
:chsh -s $(which zsh)
-
Clone this repo over SSH:
git clone --recursive [email protected]:cterdam/dotfiles.git ~/cterdam/dotfiles
-
Install Oh My Zsh.
- After Oh My Zsh is installed and launched, install ZSH theme and plugins.
-
Install Conda.
-
Retrieve the installer with
wget
and run it with the default shell. -
When the installer finishes, inspect the paragraph it inserts into the default shell config. Update
cterdam.zshrc
with that conda location.
-
-
Install Tmux Plugin Manager.
-
The install instruction should just amount to cloning a repo into this location:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
-
No need to manually change
~/.tmux.conf
because this is covered in shell scripts.
-
-
Now activate shell scripts:
-
Delete old
zshrc
:rm $HOME/.zshrc
-
Link
cterdam.zshrc
to the realzshrc
location:ln -s $HOME/cterdam/dotfiles/cterdam.zshrc $HOME/.zshrc
-
Restart shell, then restart again. Now type
Prefix
Shift + I
to install tmux plugins.Prefix
is the tmux prefix, by defaultCtrl+b
.
-
-
Install additional packages if they are not already on the cluster:
conda install tmux nodejs rust go npm install yarn conda install -c conda-forge vim bat git-delta tree tldr universal-ctags pip install vim-vint black cargo install --locked code-minimap cargo install silicon
-
On local machine, register remote instance in
~/.ssh/config
:Host <NICKNAME> HostName ec2-12-345-67-890.compute-1.amazonaws.com User ubuntu IdentityFile ~/.ssh/my_key.pem
-
SSH into the instance, then do all the work there.
-
Follow these steps to set up a new SSH key for this device.
-
Now clone this repo over SSH and destroy the dummy SSH config created in the previous step:
git clone --recursive [email protected]:cterdam/dotfiles.git ~/cterdam/dotfiles rm ~/.ssh/config
-
Run the setup script with
bash $HOME/cterdam/dotfiles/server_setup.sh
-
This will automate most of what's in this README file on a Linux environment.
-
C family languages, Anaconda and Java should come pre-installed in Deep Learning AMI. Due to being on a Linux server, this script does not install .NET, Latex, and Rime.
-
After the script finishes, you will be taken to zsh. Manually run the following:
rm $HOME/.*.pre-oh-my-zsh* || true rm $HOME/.zshrc || true ln -s $HOME/cterdam/dotfiles/cterdam.zshrc $HOME/.zshrc
-
Then log out and back in the remote instance. Go to
tmux
and sendPrefix
Shift+I
to install tmux plugins. -
If the local instance is also running
tmux
, then these keys might need to be sent twice in order to reach the remote instance. That is, pressPrefix
Prefix
Shift+I
Shift+I
. The default Prefix fortmux
isCtrl+B
. -
Launch
vim
to install vim plugins. -
Init conda with
conda init zsh
and re-login. -
Install other packages which couldn't be installed without re-sourcing the shell:
gem install jekyll bundler
This section is a summary of native instructions from GitHub found here.
-
Produce a new pair of keys:
ssh-keygen -t ed25519 -C "[email protected]"
Name the key after the device and save it in
~/.ssh
. -
Link that keypair to
cterdam
andcterdam.pub
:ln -s ~/.ssh/<KEY_NAME> ~/.ssh/cterdam ln -s ~/.ssh/<KEY_NAME>.pub ~/.ssh/cterdam.pub
-
Copy the contents of
cterdam.pub
- If on macOS:
cat ~/.ssh/cterdam.pub | pbcopy
And add it to GitHub here both as an Authentication key and as a Signing key.
- If on macOS:
-
Create the
~/.ssh/config
file, and insert this content:Host github.com IdentityFile ~/.ssh/cterdam
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/esc/conda-zsh-completion ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/conda-zsh-completion
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/KellieOwczarczak/conda.plugin.zsh.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/conda
-
Append the new filetype extension name, without the dot, as a new line into
$CTERDAMRC/fts/ftlist
. Do not leave empty lines in the file.- After inserting, sort all lines in the file. This can be done either in vim by
:1,%sort
, or in the shell withsort -o $CTERDAMRC/fts/ftlist{,}
.
- After inserting, sort all lines in the file. This can be done either in vim by
-
Then repopulate the
dummy
folder:repopft $CTERDAMRC/fts/dummy $CTERDAMRC/fts/ftlist
- It may simply create the needed new file(s), or print out other diagnostic messages.
Follow them to fix the
dummy
folder and theftlist
file. If things are complicated, just remove thedummy
directory altogether, and run the command again.
- It may simply create the needed new file(s), or print out other diagnostic messages.
Follow them to fix the
-
Then, follow instructions in this section to register the new filetypes.
-
Conda cannot install.
-
If installation cannot start, change install to for the current user only, as opposed for all users.
-
If installation ultimately fails, change the owner of shell config files to the current user:
sudo chown -R $USER ~/.bash_profile ~/.config/fish/config.fish ~/.tcshrc ~/.xonshrc ~/.zshrc
-
-
After macOS update, some things fall apart. E.g.
git
disappears.- Reinstall Xcode Command Line Tools tools with
xcode-select --install
.
- Reinstall Xcode Command Line Tools tools with
-
COC Java plugin crashes.
- This happens when the language server is started on the same directory multiple
times. Just clear cache with
:CocCommand java.clean.workspace
.
- This happens when the language server is started on the same directory multiple
times. Just clear cache with
-
A different Java version is needed.
-
Any Java LTS version should work just fine, but if for any reason a lower version of Java is needed (e.g. Search Engines course), then the
jdt
forcoc-java
might not work correctly. In that case follow this issue to replace the automatically-downloadedjdt
with an older version which works with lower versions of Java. Specifically,Version 57 of JDT Lang Sever works fine https://download.eclipse.org/jdtls/milestones/0.57.0/ Quick hack for those who are facing this issue Replace all directories/files in ~/.config/coc/extensions/coc-java-data/server with directories/files from above extracted JDT lang server tar.
-
-
Rust installation script needs to alter shell files which are nonexistent.
- Just use the graphic installer. After running the installer, the installed Rust
environment might not be in
$PATH
right away, but the ourzshrc
should take care of that once activated.
- Just use the graphic installer. After running the installer, the installed Rust
environment might not be in
-
Vim installed through brew does not seem to replace system vim.
- Upon finishing installing the brew version, run
which vim
and you might see that it's still the system vim (and not the brew vim) which gets evoked. This is because brew-installed apps are not given priority in PATH. Don't worry about it;cterdam.zshrc
will fix this.
- Upon finishing installing the brew version, run
Use git submodule status --recursive
to see all submodules.
If submodule folders appear empty after cloning, run this to download all submodules (and their submodules, if any):
git submodule update --init --recursive
Note that updating the parent repo will not automatically update submodules. To update
submodules, since git 1.8.2 the option --remote
was added to support updating to
latest tips of remote branches:
git submodule update --recursive --remote
Or, if cloning this parent repo for the first time, run this to ensure you download everything:
git clone --recursive <project url>