dotfiles/windows
2020-02-28 14:12:40 -05:00
..
bash_profile Big cleanup and more streamlined windows setup 2017-02-18 13:05:08 -05:00
bashrc Add missing dotfiles bin to windows path 2020-02-05 15:04:05 -05:00
gitconfig.platform Update git config for Windows 2017-06-09 16:10:39 -04:00
hosts Update Windows hosts 2020-02-28 14:12:40 -05:00
inputrc Add an inputrc to windows dir 2017-06-10 16:48:16 -04:00
readme.md Update Windows hosts 2020-02-28 14:12:40 -05:00

Windows Setup

  • Turn off hibernation

    • Open admin cmd prompt: powercfg.exe /hibernate off
  • Map caps to left-ctrl using sharpkeys

  • Add custom hosts file

    • Run notepad as administrator
    • Open C:/Windows/System32/Drivers/etc/hosts
    • Add contents of the hosts file from this directory
    • Restart PC
  • Disable the WinSAT task which is used to figure out your Windows performance score. It eats up processor time and is generally useless.

  • Setup a symbol server:

    • Right-click My Computer -> Properties -> Advanced Tab -> Environment Variables
    • Add a new System Variable called _NT_SYMBOL_PATH
    • Set the value to SRV*c:\symbols*http://msdl.microsoft.com/download/symbols, replacing the first path to where you want the symbols to live.
  • Configure crash dump storage location for projects via the registry.

  • Enable security updates this may no longer be an issue

    • If you don't have an antivirus program, or you do but it's not verified by Microsoft, then you will not receive security updates unless you set a key in the registry. Note that Windows Defender counts as a valid antivirus program.

    • Add the following registry key:

      Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" Value="cadca5fe-87d3-4b96-b7fb-a231484277cc" Type="REG_DWORD” Data="0x00000000”

  • Increase TDR setting for GPU Driver

Windows 7 Stuff

Windows 10 Stuff

Setting up Visual Studio

  • Use the backed up VS2015 ISO or download it from https://go.microsoft.com/fwlink/?LinkId=615448&clcid=0x409
  • Pick a custom install directory, e.g. /x/programs/Visual Studio 15
  • Select a custom install and check off the C++ language support.
  • Once installed, open Visual Studio and go to Tools -> Options. Open Debugging -> Symbols and add the path to the cached symbols directory that you set up above under Setup a symbol server.

Setup up Unix-like Shell

  • Install MSYS2 w/ MinGW-w64 to C:\msys64
    • Open C:\msys64\mingw64.exe
    • Run pacman -Syu, then restart the terminal and run pacman -Su.
    • Run pacman -S base-devel mingw-w64-x86_64-toolchain git bc
    • Use C:\Users\<user> as the terminal $HOME by editing C:\msys64\etc\nsswitch.conf and changing the db_home value to windows.
  • You may need to work around an issue with envsubst.exe - you'll know there's a bug if git displays not a valid identifier line 89: export: dashless or rebase complains about new_count.
  • Switch to the shell C:\msys64\msys2.exe going forward.
    • You can also load the shell with a batch file. This allows you to do some setup work, like run vcvarsall.bat, eg.
      REM saved as shell-64.bat
      @echo off
      call "drive:\path\to\visual studio 15\VC\vcvarsall.bat" x64
      REM or you can do:
      REM call "drive:\path\to\visual studio 17\VC\Auxiliary\Build\vcvarsall.bat" x64
      set _NO_DEBUG_HEAP=1
      call C:\msys64\msys2_shell.cmd -mingw64 -use-full-path
      exit
      
      • Now you can make a system32 cmd line shortcut that will be used to launch the batch file. e.g.
        • target: %windir%\System32\cmd.exe /k drive:\path\to\shell-64.bat
        • start in: drive:\some\path
  • Setup git completions for bash:
    • curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

Setting up dev tools

Setting up Vim

Compiling on Windows (optional)

  • Open the shell with C:\msys64\msys2_shell.cmd -- If you don't do this then vim will not compile.

  • Run pacman -S --needed base-devel msys2-devel gawk perl python2 python3 ruby libiconv ncurses-devel libcrypt-devel

  • Clone MSYS2 packages: https://github.com/msys2/MSYS2-packages

  • cd into the vim package

  • Edit PKGBUILD and change the version number to the one you want to build. You can see the available versions at https://github.com/vim/vim

  • Run makepkg

  • If checksums fail then generate new ones: makepkg -g -f -p PKGBUILD, copy the output, edit PKGBUILD and replace the checksums array with the new values.

    • Run makepkg again
    • If it fails to apply a patch then you'll need to make the fixes yourself:
      • Clone vim (https://github.com/vim/vim), cd into vim/src.
      • Modify the file(s) that they failed patch was changing and make the correct fixes.
      • Commit the change.
      • Generate a patch file with git diff commitid1 commitid2 > newpatch.patch
      • Copy the patch to MSYS2-packages/vim and use the same name as the original patch that failed.
      • Regen the pkg checksums and add them to PKGBUILD.
      • Run makepkg again.
  • Once built, install it with pacman -U ${package-name}*.pkg.tar.xz

Configuring

  1. Open Vim and run :PlugInstall to fetch all plugins.
  2. Create a tmp folder for swap files (i.e. set directory and set backupdir). Place these at ~/.vimrc.private so that the main vimrc file can source it. We do it this way so that you can have a tmp folder path that is specific to your setup.
  • First install Rusto. See Setting up Rust below.
  • Setup ripgrep:
    • Open an msvc x64 shell and run cargo install ripgrep. Note the last time I did this I got linker errors saying that it was trying to link an x86 exe in a 64-bit env. I had to run the msvc x86 shell instead.
    • Verify it works by running rg in a shell.

Setting up ctags

Setting up Cygwin

  • Can create symlinks to dotfiles using the git bash shell. The cygwin home directory is likely going to be C:\cygwin\home\<username>.
  • Build rlwrap

Setting up Rust

Setting up Go

Setting up Clojure

Setting up Xbox stuff

  • Install the xbox controller drivers
  • Turn off stats collection
    • cmd-r, msconfig.exe, startup tab, uncheck Microsoft Xbox 360 Accessories.

Turn off various startup processes

  • cmd-r -> msconfig.exe -> startup tab

Setting up Wacom tablet

Software

  • Install tree: pacman -S tree

  • Install Desktop Restore

  • Install Android platform tools to get adb.exe:

    • Download Android commandline tools
    • Unzip to some location.
    • Inside the sdk dir, run $ tools/bin/sdkmanager.bat platform-tools.
    • You can now add the platform-tools dir to your path if you want, or just symlink adb to ~/bin.

Youtube-DL

Firefox

  • If you see jaggy fonts then about about:config and check the value of gfx.font_rendering.cleartype_params.rendering_mode. Mine was -1 by default. Setting it to 5 removed the bad font rendering.

Spotify

  • If you install an older version then you'll need to block the auto updater:
    • Go to %APPDATA%\Spotify and create Spotify_new.exe and Spotify_new.exe.sig
    • Set both as read-only. I did this by denying all permissions to the active user account.
  • Spotify caches song data in C:\Users\<user>\AppData\Local\Spotify\Data and this path cannot be modified within the app settings. This is an issue if your main drive is an SSD, as you want to limit the amount of writes to it and you may not have a lot of free space. The simplest way I found to stop this is to change the Data folder's permissions (under the Security tab) and deny all properties for the user account.