This guide is written to help me setup new Windows and Mac machines.
-
Use Rufus to create bootable USB.
-
Use
en_windows_10_multiple_editions_version_1511_x64_dvd_7223712.iso
Make sure you have Windows 10 Anniversary Update available for offline installation.
For installing Windows on MacBook Pro, you need to download Bootcamp.
Install a fresh copy of Windows 10. Make sure you do not enable network connection during or after installation until drivers have been installed.
-
Select custom settings and disable all settings related to Cortana etc
-
Attach flash drive with Windows 10 Anniversary Update iso and install update from it
-
Again disable all Cortana related options in settings
-
Attach flash drive with Bootcamp on it, click on Setup.exe to start driver installation
-
Restart machine
-
Under Keyboard, enable Use all F1, F2… option
-
Under Trackpad, enable Tap To Click and Secondary Tap__
-
Open time and date settings using
control timedate.cpl
-
Set time zone
-
Use 24 hour time format
-
Run
gpedit.msc
-
Go to Computer Configuration → Administrative Templates → Search
-
Disable all Cortana related settings
-
Run
gpedit.msc
-
Go to Computer Configuration → Administrative Templates → OneDrive
-
Disable all OneDrive related settings
-
Install ublock origin for Edge from Store.
-
In Edge settings,
-
Open Microsoft Edge with Previous pages
-
Open new tabs with A blank page
-
Disable offer to save password
-
Enable Send Do Not Track requests
-
Change search engine to Google
-
Note
|
My Windows machine is a MacBook. Left Win is actually Left Cmd key which is right next to the space bar. |
-
Download and install SharpKeys
Use SharpKeys to,
-
Map Caps Lock to Left Ctrl key
-
Map Left Ctrl to Left Win key
-
Map Left Win to Right Ctrl key
To invert the direction of scrolling (natural scrolling on macOS), run following command in PowerShell with administrative privileges.
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\__\__\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\__\__\Device` Parameters FlipFlopHScroll -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopHScroll 1 }
See SuperUser answer for details.
Natural direction of scrolling is how you scroll on iPhone, Android and other touch devices. Content scrolls in the direction of your fingers.
Sometimes I have a hard time to wrap my head around natural versus traditional scrolling. Following is a simple test to figure out if we have been successful in inverting the scroll direction. Basically, content scrolls oppositely to the direction in which you move your fingers on the trackpad. For example, moving fingers up will make content scroll downward.
To test natural vertical scrolling is working,
-
Scroll to the bottom
-
Move your fingers upward on the trackpad
-
If scroll bar does not budge, then vertical scrolling is natural
To test natural horizontal scrolling is working,
-
Scroll to extreme right
-
Move your fingers towards left on the trackpad
-
If scroll bar does not budge then horizontal scrolling is natural
Install following applications
-
Enter 1Password license key
-
Login to Dropbox and start syncing
-
Enter Windows key and activate your copy
Install Scoop.
-
Open Powershell
-
Run
Set-ExecutionPolicy RemoteSigned -scope CurrentUser iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Add scoop
"extras" bucket.
scoop bucket add extras
Add scoop
"versions" bucket.
scoop bucket add versions
This bucket is help for running multiple versions of Python and Ruby on the same machine. For details see Switching Ruby and Python Versions.
Use scoop install
to install following applications,
-
7zip
-
bitwarden
-
calibre
-
clink
-
conemu
-
curl
-
dont-sleep
-
fd
-
ffmpeg
-
fzf
-
git
-
gitextensions
-
github
-
gpg4win
-
llvm
-
neovim
-
nodejs
-
openssh
-
ripgrep
-
ruby
-
sharex
-
shasum
-
slack
-
SumatraPDF
-
synctrayzor
-
vim
-
vlc
-
vscode
-
wget
-
yarn
-
youtube
After installing git
and openssh
, run ssh-keygen
command in Powershell.
PS> mkdir .ssh
PS> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/you//.ssh/id_rsa): [press enter]
Enter passphrase (empty for no passphrase): [type your password]
Enter same passphrase again: [and once more]
...
Add new SSH key to Github account settings. For details see this help article.
Pshazz includes a plugin for SSH that can save your SSH key password in Windows Credential Manager so you don’t need to re-type it every time you push to your Github repo. Install it like this:
scoop install pshazz
You should see a popup asking for your SSH key password. Enter it and check the box to save your password. Back in your Powershell session, you should see an Identity Added message.
Whenever you start a Powershell session from now on, Pshazz will make sure the ssh-agent is running and load your private key using your saved password
To make sure everything’s working, restart Powershell and then run this command
ssh -T [email protected]
After a warning or two, you should see a message like this:
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
Visit Github help for details.
Login to sync account of
-
Firefox Sync account
-
Rambox sync account
-
Install Visual Studio Code Settings Sync Extension by Shan Khan
-
Download synced settings
-
-
Install Atom sync settings package
-
Download synced settings
-
-
Install 1Password extension
-
Login to RescueTime plugin
-
Configure Pray Times plugin
After ruby
is installed, install Asciidoctor
gem install asciidoctor
Update Asciidoctor using
gem update asciidoctor
Open Zeal and install following docsets,
-
Download Qt5 documentation in ZealDocs
-
Open ShareX
-
Click on Destinations
-
Select Imgur for Image Uploader
-
Click on Destination settings…
-
Authorize Imgur
-
Refresh album list
-
Select your album
-
Check Upload images to selected album
-
Press OK
-
-
Click on After capture tasks
-
Select only
-
Upload image to host
-
Delete file locally
-
-
Click After upload tasks
-
Select only
-
Copy URL to clipboard
-
-
Click on Hotkey settings…
-
Capture region to
Ctrl+Shift_4
-
Capture entire screen to
Ctrl+Shift+3
-
Capture active window to
Ctrl+Shift+Space
-
-
Click Options, check
-
Start Minimized
-
Start with Windows
-
-
Click Don’t Sleep, check
-
Minimize to tray if Minimize
-
Minimize to tray if Close
-
See instructions in Add gVim to Context Menu.
-
Install Inconsolata fonts
Create a Repos
directory in %HOMEPATH%
. Clone dotfiles repository.
git clone https://github.com/talha131/dotfiles.git
Start a cmd
tab with administrative privilege in ConEmu. Create symbolic links thusly,
mklink %HOMEPATH%\.gitconfig %HOMEPATH%\Repos\dotfiles\git\gitconfig mklink %HOMEPATH%\.githelper %HOMEPATH%\Repos\dotfiles\git\githelper mklink %HOMEPATH%\bin\diff-highlight %HOMEPATH%\Repos\dotfiles\bin\diff-highlight
Start a cmd
tab with administrative privilege in ConEmu. Create symbolic links thusly,
mklink %APPDATA%\ConEmu.xml %HOMEPATH%\Repos\dotfiles\conemu\ConEmu.xml
To compile LeaderF plugin, I had
-
Install Windows 10 SDK
Note
|
Currently Vim is compiled with Python 3.5.3. For some reason Python installed via scoop is not detected by Vim. |
You should make sure that the
installed Python has the same build and version that Vim has in the output of
:version
command.
Install Python 3.5.3.
Open Vim and check you have Python2, Python3, Ruby, and Lua working, using following commands,
:echo has('python3') :echo has('python') :echo has('ruby') :echo has('lua')
Start cmd
with administrative privilege in ConEmu. Create symbolic links thusly,
mklink %HOMEPATH%\.vimrc %HOMEPATH%\Repos\dotfiles\vim\vimrc mklink /d %HOMEPATH%\.vim\ %HOMEPATH%\Repos\dotfiles\vim\vim\ mklink %LOCALAPPDATA%\nvim\init.vim %HOMEPATH%\Repos\dotfiles\vim\vimrc mklink /d %LOCALAPPDATA%\nvim\colors %HOMEPATH%\Repos\dotfiles\vim\vim\colors
I use Vim-Plug to manage my Vim plugins. To install Vim-Plug, open Powershell and type these commands,
md ~\.vim\autoload
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile($uri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\.vim\autoload\plug.vim"))
Open Vim, ignore errors and issue :PlugInstall!
to install all plugins and
themes.
Restart Vim. This time there should be no errors.
Portable version of Vim from Tuxproject which does not come with an installer. It is not automatically added to the Windows context.
To add gVim to context menu, open registry using regedit
.
-
Navigate to
HKEY_CLASSES_ROOT\*\shell
. -
Add new key
gVim
under it. -
Change value of
Default
toOpen with gVim
-
Add a new string value, named
Icon
. Set it’s value to gVim executable, in this case"C:\Users\talha\scoop\apps\vim\current\gvim.exe"
-
Add a new sub key under
gVim
. Name itcommand
-
Set
command
default value to gVim executable, in this case"C:\Users\talha\scoop\apps\vim\current\gvim.exe" "%1"
See this link for details.
-
Visual Studio 2013
-
Debugging Tools for Windows from Windows 10 SDK online installer.
-
MS Office
-
Setup sync with other computers using SyncTrayzor
-
Open Options
-
Click on Environment
-
Click on Keyboard tab
-
Set shortcut for Options to
Ctrl+,
-
-
-
Click on Build & Run
-
Click on General tab
-
Set project directory to
~\Repos
-
Check Save all files before build
-
-
Click on Qt Versions
-
Add Qt version by clicking Add and navigating to
qmake.exe
. For example,C:\Qt\Qt5.6.2\5.6\msvc2013\bin\qmake.exe
-
-
Click on Compilers tab
-
Make sure MSVC compilers have been auto detected. Otherwise add them manually.
-
-
Click on Debuggers tab
-
If CDB has has not bee auto detected, then add it manually. For example,
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe
-
-
Click on Kits tab
-
Configure Kit for your project
-
-
-
Click on FakeVim
-
General Tab
-
Enable Fake Vim
-
Enable Automatic indentation
-
Smart indentation
-
Expand tabulators
-
Incremental search
-
Use search dialog
-
Use ignore case
-
Show line numbers relative to cursor
-
Check Pass control key
-
-
Download Gruvbox theme for Qt Creator
-
Restart Qt Creator
-
Select Gruvbox theme
-
Set font to Inconsolata
-
Set font size
-
Click on Help
-
Click on About Plugins
-
Enable C++ Beautifier
-
Restart Qt Creator
-
Open Options
-
Click on Beautifier
-
Click on General tab
-
Enable Auto Format on Save
-
Set tool to Clang Format
-
-
Click on Clang Format tab
-
Clink on Use predefined style
-
Select File
-
Select Format entire file if no text is selected
-
-
Use the Windows key + I keyboard shortcut to open the Settings app
-
Click Time & language
-
Click Region & language
-
Under Languages, click Add a language
-
Add Urdu Pakistan
-
Install language pack
-
Download Phonetic Keyboard
-
Install keyboard
-
Remove default Urdu keyboard
-
Use the Windows key + I keyboard shortcut to open the Settings app
-
Click Time & language
-
Click Region & language
-
Under Languages, click Urdu → Options
-
Click on non-phonetic Urdu keyboard
-
Click Remove
-
Download and install fonts from following links,
Notes under this section are currently not in use. I keep them around for probable future use.
Warning
|
This section is not relevant after Windows 10 anniversary update. I did not face issue with Windows update after anniversary update. |
Windows 10 automatic updates messed up device drivers, rendering my machine unstable. I had to reinstall Windows 10 at least 10 times before learning my lesson to not to trust Windows 10 automatic updates.
-
Open
services.msc
-
Stop and disable Windows Update Service
-
Open driver update setting, using
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2
-
Click on Device Installation Settings and disable drivers updates
Help article on How to temporarily prevent a driver update from reinstalling in Windows 10 may be useful, though it didn’t do much for me.
-
Open
gpedit.msc
-
Computer Configuration → Administrative Templates → Windows Components → Windows Update → Configure Automatic Updates
-
Enable Configure Automatic Updates
-
Choose Notify to download and notify to install
Install Windows Update MiniTool and use it to update Windows manually.
Warning
|
Following applications have been replaced by their alternatives or scoop
manages them.
|
-
Install Rambox
-
Enable and Setup
-
Slack
-
Inbox (Personal)
-
Inbox (Work)
-
Gmail (University)
-
WhatsApp
-
Telegram
-
IRC Cloud
-
-
Setup auto reload for Slack
-
Setup Google Calendar
-
Setup Google Spreadsheets
-
-
Install Chocolatey Packages
-
Install Chocolatey
-
-
Install Python2 and Python3
-
Install Ruby
-
CDB debugger for Qt
-
Offline installer is not available
-
Either install it directly or choose to download only
-
Installer will present a menu of features. Select Debugging Tools for Windows (~100MB)
-
Install it manually from download folder, if you had opted for download option
-
-
-
Win32 OpenSSL 1.0.1 Light into Windows System folders
-
-
Navigate and download from
Windows Libraries/Dynamic
folder
-
Important
|
Tuxproject Vim does not include a diff.exe .
diff or Gdiff (in Vim Fugitive) may not work.
On the other hand, Vim Win32
Installer is shipped with diff .
|
Check output of
:!where diff
If the result is empty or Gdiff
is not working then add diff.exe
from Git
installation to your %PATH%
.
Open your Environment Variables, edit %PATH%
to add C:\Program
Files\Git\usr\bin
.
See this Github issue for details.
Note
|
pshazz comes with z that is AutoJump for Powershell.
|
You must have Clink installed before you install AutoJump
To have Gruvbox dark theme like background in cmd
or Git shell, use following color codes:
Color Values | Red | Green | Blue |
---|---|---|---|
Screen Background, |
44 |
44 |
44 |
Screen Text |
218 |
198 |
144 |
Create a folder bin
in %HOMEPATH%
,
mkdir %HOMEPATH%\bin
This folder is referred to as bin
henceforth.
Download following apps and extract them in bin
folder,
Add their path to %PATH%
variable.
To edit %PATH%
variable, open Environment Variables using
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
You can check path of each command using where
command. For example,
> where gvim C:\Users\talha\bin\complete-x64\gvim.exe
You can use it to test each downloaded program is available from %PATH%
.
macOS Recovery installs different versions of macOS depending on the key combination you press while starting up.
Hold down one of these combinations immediately after pressing the power button to turn on your Mac. Release when you see the Apple logo or a spinning globe.
Shortcut | Description |
---|---|
command-R |
Reinstall the latest macOS that was installed on your Mac, without upgrading to a later version.1 |
Option-Command-R |
Upgrade to the latest macOS that is compatible with your Mac.2 |
Shift-Option-Command-R |
Requires macOS Sierra 10.12.4 or later Reinstall the macOS that came with your Mac, or the version closest to it that is still available. |
After finishing installation you may have to download and install macOS Sierra from App Store.
-
Right click on battery icon and select Show Percentage
-
Download Xcode from the App Store
-
Open System Configuration → Trackpad
-
Point & Click
-
Enable Tap to Click
-
Set Click to Light
-
Set Tracking speed to Fast
-
-
Now open Accessibility
-
Mouse & Trackpad → Trackpad Options…
-
Enable dragging with three finger drag
-
-
Login to Dropbox
-
Activate 1Password using license key
-
Enable Firefox sync
-
Make Firefox default browser
-
Sync Visual Studio Code settings
-
Install 1Password browser extension
-
Login to RescueTime
-
Open Preferences
-
General → Preferences → Load preferences from a custom folder
-
Browser to Dropbox folder
-
If asked Do not copy local settings to the folder
-
Restart iTerm2
-
Check if settings have been loaded perfectly
-
sudo vi /etc/shells
-
Add
/usr/local/bin/fish
-
Quit and run
chsh -s /usr/local/bin/fish
pyenv versions pyenv install 2.7.14 pyenv install 3.7.2 pyenv global 3.7.2 2.7.14
pip2 install --upgrade pip pip3 install --upgrade pip pip2 install --upgrade neovim pip3 install --upgrade neovim virtualfish pip-autoremove pre-commit
Create a Repos
directory in ~
. Clone dotfiles repository.
git clone https://github.com/talha131/dotfiles.git
Then issue following commands
rm -r ~/.hammerspoon/ ln -s ~/Repos/dotfiles/hammerspoon/ ~/.hammerspoon/ ln -s ~/Repos/dotfiles/git/gitconfig ~/.gitconfig ln -s ~/Repos/dotfiles/git/githelper ~/.githelper ln -s ~/Repos/dotfiles/bin/diff-highlight ~/bin/diff-highlight ln -s ~/Repos/dotfiles/vim/vimrc ~/.vimrc ln -s ~/Repos/dotfiles/vim/vim ~/.vim ln -s ~/Repos/dotfiles/spacemacs/spacemacs ~/.spacemacs mkdir ~/.config/nvim ln -s ~/Repos/dotfiles/vim/vimrc ~/.config/nvim/init.vim ln -s ~/Repos/dotfiles/vim/coc-settings.json ~/.config/nvim/coc-settings.json
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Create file
mkdir ~/Library/KeyBindings/ touch DefaultKeyBinding.dict
Add to file DefaultKeyBinding.dict
{ "~d" = "deleteWordForward:"; "^w" = "deleteWordBackward:"; "~f" = "moveWordForward:"; "~b" = "moveWordBackward:"; }
Restart applications to use these shortcuts.