Skip to content
yusekiya edited this page Jul 21, 2022 · 7 revisions

How to setup

Windows (WSL2)

Set up WSL2

  1. Start PowerShell as administrator
  2. Install WSL with wsl --install
  3. Reboot by following the instruction
  4. Setup ubuntu on WSL
  5. (Optional) Lift memory limit; add the following lines to C:\Users\<username>\.wslconfig
    [wsl2]
    memory=<memsize such as 4GB>
    

Install VSCode

  1. Download installer from the official site
  2. Install VSCode
  3. Reboot to make "code" command available
  4. Install git (for GitLens extension)
  5. Turn on Settings Sync

Set up Windows Terminal

  1. Open settings from the down button next to the "create tab" button
  2. Create profile for Ubuntu
  3. Change the default profile to Ubuntu
  4. Change Starting Directory for the Ubuntu profile to "\wsl$\Ubuntu\home<username>"`
  5. Change font, color scheme, and so on.

Example of Ubuntu profile

// In the `profiles` section
{
    "guid": "{..omitted..}",
    "hidden": false,
    "name": "Ubuntu",
    "source": "Windows.Terminal.Wsl",
    "startingDirectory": "\\\\wsl$\\Ubuntu\\home\\<username>",
    // "font": {
    //     "face": "Fira Code",
    //     "size": 10,
    //     "weight": "normal"
    // },
    "fontFace": "Fira Code",
    "fontSize": 10,
    "antialiasingMode": "cleartype",
    "useAcrylic": true,
    "padding" : "5, 10, 5, 5",
    "acrylicOpacity": 0.8,
    "cursorShape": "filledBox",
    "cursorColor" : "#ffffff",
    "colorScheme": "Nord"
}

Example of color scheme

// In the `schemes` list
{
    "name" : "Nord",

    "background": "#2E3440",
    "foreground": "#E5E9F0",

    "cursorColor": "#EBCB8B",
    "selectionBackground": "#434C5E",

    "black": "#3B4252",
    "blue": "#81A1C1",
    "cyan": "#88C0D0",
    "green": "#8FBCBB",
    "purple": "#B48EAD",
    "red": "#BF616A",
    "white": "#D8DEE9",
    "yellow": "#EBCB8B",

    "brightBlack": "#3B4252",
    "brightBlue": "#5E81AC",
    "brightCyan": "#88C0D0",
    "brightGreen": "#A3BE8C",
    "brightPurple": "#B48EAD",
    "brightRed": "#D08770",
    "brightWhite": "#E5E9F0",
    "brightYellow": "#EBCB8B"
}

windows (MSYS2)

Copy config files to home directory

  • Install msys2 under the C: drive

  • Uncomment rem set MSYS=winsymlinks:nativestrict in /{msys2,mingw32,mingw64}_shell.bat to enable to create symbolic link

  • Run the any .bat script as administrator, and execute the following commands

    $ cd ~
    $ pacman -S git
    $ git clone https://github.com/yusekiya/dotfiles.git
    $ ./dotfiles/setup.sh

Additional manual setup

  • Install pacman packages

    $ pacman -S $(< ~/.pacman_pkglist)
  • Setup with dropbox (option)

    • Make symbolic link to DROPBOX/HOME/*
    • Copy DROPBOX/my_script/* to ~/bin
  • Install aspell through graphical installer (aspell in MSYS2 repo is aborted when dealing with TeX file)

    Install directory must be C:\opt to work with emacs.

  • Build packages under .pkgbuild by executing makepkg.sh in each package directory

  • Download libgnutls-28.dll and its dependencies to an directory in $PATH (cf. NTEmacs64)

  • Setup for git

    • Modify permissions of git hooks under ~/.git_template/hooks if necessary

      $ chmod 755 ~/.git_template/hooks/*
    • Make ~/.gitconfig.local and describe git settings which is not made public

  • Install tmux plugin manager

    $ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  • Setup python development environment

    • Install anaconda to under ~/opt/anaconda

    • Make sure that the following packages are installed

      • numpy
      • scipy
      • pandas
      • sympy
      • matplotlib
      • cython
      • numba
      • jedi
      • numpydoc
      • pylint
    • Install the following packages through pip:

      • grip
      • epc
    • Install numdifftools through conda

      $ conda install -c https://conda.anaconda.org/pbrod numdifftools
  • Setup color syntax for less

    • Pygments

      • Install Pygments and solarized theme

        $ pip install Pygments
        $ pip install pygments-style-solarized
      • Install filter function

        $ curl -L -o /usr/local/bin/lessfilter https://gist.githubusercontent.com/yusekiya/cdf28e6a4e85d855fafa/raw/95bc1e594a00a2f03d911fc13a2c70985c3054f9/lessfilter
        # Add executable permission if necessary
        $ chmod 755 /usr/local/bin/lessfilter
    • Source-highlight on MSYS2 (mingw64)

      It seems to be faster than Pygments (not yet confirmed)

      • Build and install

        $ cd ~/src
        $ git clone git://git.savannah.gnu.org/src-highlite.git
        $ cd src-highlight
        $ autoreconf -i
        $ mkdir build
        $ cd build
        # make sure that the directory /mingw64/local exists
        $ ../configure --with-boost-libdir=/mingw64/lib --prefix=/mingw64/local
        $ make
        $ make install
      • Apply solarized theme source-highlight-solarized

        $ cd ~/src
        $ git clone https://github.com/jrunning/source-highlight-solarized.git
        $ cd source-highlight-solarized
        $ curl -LO https://gist.githubusercontent.com/yusekiya/d11e2fcffdbcf9b6da00/raw/1eb6d73a854dabbd643e5ac9b42dfde9009667a7/esc-solarized.style.diff
        $ patch < esc-solarized.style.diff
        $ rename -- "-solarized" "" esc*
        $ mv -f -S .bak esc.style esc.outlang /mingw64/local/share/source-highlight
  • Install TeXlive

  • Install atom

    Setup atom with sync-settings

  • Install 'gomi' command (if necessary)

    $ curl -L -o ~/bin/gomi.exe https://github.com/b4b4r07/gomi/releases/download/v0.1.6/gomi_windows_amd64.exe

OS X

See here.