Skip to content

yukw777/dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Development Environment Setup

OS Key Mapping

I remap Caps Lock to Left Ctrl.

  • Windows: Use Microsoft PowerToys's Keyboard Manager.
  • Mac: System Preferences => Keyboard => Modifier Keys.
  • Ubuntu: sudo apt install gnome-tweaks => gnome-tweaks => Keyboard & mouse => Additional Layout Options => Ctrl position => Swap Ctrl and Caps Lock.

Editor

Extensions

Key Bindings

Settings

Copy settings.json to the appropriate locations.

Extensions

  • VsVim - Vim Keybindings
  • CSharpier - Auto-format C# code using CSharpier

Key Bindings

First, have VsVim manage the following key bindings:

  • Ctrl+[
  • Ctrl+B
  • Ctrl+F
  • Ctrl+R
  • Ctrl+V
  • Ctrl+W

Second, search for key bindings to bring up the keyboard settings (Environment > Keyboard), then modify the following:

  • Edit.LineUp => Ctrl+K (Text Editor): Move up in the suggestions.
  • Edit.LineDown => Ctrl+J (Text Editor): Move down in the suggestions.

Lastly, copy .vsvimrc to C:\Users\<username>.

Terminal

For MacOS, I use iTerm2, and I modify the key mappings to allow skipping words backward and forward:

(Based on the instructions from this page)

  1. Go to Settings -> Profiles -> Keys.
  2. Set Left Option Key to Esc+.
  3. Go to Key Mappings.
  4. Find or create a key mapping for ⌥←, set Action to be Send Escape Sequence and set Esc+ to be b.
  5. Find or create a key mapping for ⌥→, set Action to be Send Escape Sequence and set Esc+ to be f.

Shell - zsh

Installation

I use zsh with ohmyzsh. Follow the instructions here to install both. I also use the Powerlevel10k theme. Follow the instructions on its README to install. It comes with a nice installation wizard, so it should be quite simple. For Ubuntu, you do need to install the recommended fonts manually, and the instructions are here.

SSH Agent

For MacOS, simply follow the instructions here to add the ssh key to the ssh agent.

For Ubuntu, install keychain (sudo apt install keychain) and add the following at the bottom of ~/.zshrc:

# keychain for Ubuntu
eval `keychain --eval --quiet --agents ssh id_rsa`

CUDA

PyTorch comes packaged with its own CUDA runtime, so you typically don't need to install a separate system-wide CUDA. However, some libraries (e.g. pytorch-geometric) may require a system-wide CUDA installation. You can install CUDA 11.5 by following the commands below:

# Check if nouveau is running
lsmod | grep nou
# If running, disable Nouveau driver
sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo update-initramfs -u
sudo reboot

# You may need to remove the Nvidia drivers installed by the package manager
sudo apt remove --purge '^nvidia-.*'
sudo apt autoremove
sudo reboot

# Install latest CUDA by following the instructions on https://developer.nvidia.com/cuda-downloads

# Remove old installations (if at all) by running one of the commands below (whatever is available)
sudo /usr/local/cuda-x.x/bin/uninstall_cuda_x.x.pl
sudo /usr/local/cuda-x.x/bin/cuda-uninstaller

You may have to add the following to your ~/.zshrc:

# Add CUDA paths
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64

Poetry

By default, poetry is installed in $HOME/.local/bin, so it's a good idea to add the following to your ~/.zshrc:

# Add ~/.local/bin (mostly for Poetry)
export PATH=$PATH:$HOME/.local/bin

.NET

The path for .NET global tools is not automatically added, so you may have to add the following to your ~/.zshrc:

# Add ~/.dotnet/tools for dotnet tools
export PATH=$PATH:$HOME/.dotnet/tools

About

My Development Environment Setup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published