System Configuration

Destroy another computer?  Got a new one?  No matter.  Here's what you need.

General Desktop

1. Get Google Chrome.

2. Setup Passwords for Google Two-Step Verification (You'll have to enter your Google password to continue through that link to the destination.)
You'll want application passwords for Chrome Sync and others.

3. FTP with FileZilla, and compress/extract with 7 Zip.

4. Get Paint.NET (Or visit pixlr.)
Don't forget the plugins you like:

Also consider the other plugins you mentioned. Here is a backup of the effects.

Porting Documents

1. The Usual Suspects: For every user account, including Public: "My Documents", "Downloads", "Music", "Pictures", "ThrowMeAway"

2. APPDATA: See what needs to be copied from %APPDATA%, for example Minecraft saves.

3. The Registry: PuTTY save files are at [HKEY_CURRENT_USER\Software\SimonTatham]. Speaking of PuTTY, don't forget to copy your public keys. (You know where they are.)

4. The Root: See what needs to be copied from the root, for example:

5. Individual App Setting Exports: IDEs, like UltraEdit and Eclipse may have custom ways to export settings. (In UltraEdit, go to Advanced -> Export Settings... and Backup/Restore User Customizations....)

6. Task Scheduler: Copy the scheduling of the encryption and backup tasks you've set for yourself.

7. The Cloud: Done. Makes you grateful for the cloud, eh?

8. Deauthorize the Old Computer: Steam, iTunes, stuff like that.

Development Environment

1. Get Python and a compatible win32all module and editor.
If that win32all link went stale, try sourceforge.
Consider one of these IDEs, depending on the target.

Some modules you may be interested in:

2. Get Cygwin.

Module to consider installing:

  • Archive:
    • unzip
  • Net:
    • curl
    • rsync
    • libssh2-devel
    • libssh2_1
    • openssh
  • Editors: vim
  • Devel:
    • ctags
    • cscope
    • gcc-core
    • gcc-g++
    • gcc4 (req. for compiling matplotlib)
    • git
    • mingw-gcc-core
    • mingw-gcc-g++
    • libgfortran3 (req. by numpy)
    • libjpeg8 (req. for PIL and maybe pillow)
    • liblapack0 (req. by numpy)
    • libquadmath0 (req. by numpy)
    • libncurses-devel
    • libncursesw-devel (not there for 64-bit version?)
    • make
    • mercurial
  • Libs:
    • librsync-devel (for Duplicityi)
    • librsync1 (for Duplicity)
    • libuuid-devel (for cygwin64 pip. binutils also needed.)
    • libX11-devel (for PIL and Pillow)
  • Python:
    • python
    • python3
    • numpy
    • python-setuptools (req. by numpy)
  • Utils:
    • patch

Right-click on the Cygwin window, select Looks→Cursor→Block.

To install boto and Pillow (if PIL is a problem because of X11/Xlib.h)...

$ curl >
$ python
$ pip install Pillow
$ pip install boto

Use cygcheck to check dependencies.

If you're going to install cpanm, for installing CPAN modules, make sure you have some of the tools it uses, like "make".

.bashrc (or .bash_profile if you don't need it for ssh, for example)
if [[ $(uname -s) != Darwin* ]] && [ -f /etc/bashrc ]; then
    # Fedora but not Macintosh requires explicit sourcing of /etc/bashrc
    # On Debian, it's /etc/bash.bashrc, but it doesn't have to be sourced here.
    . /etc/bashrc

if [[ -n $SSH_CLIENT ]]; then
    export PS1='$(if [ $? -eq 0 ]; then echo -e "\[\e[32m\]\xe2\x9c\x93"; \
    else echo -e "\[\e[31m\]\xe2\x9c\x97"; fi) \[\e[38;5;242m\]\h:\w$\[\e[0m\] '
    export PS1='$(if [ $? -eq 0 ]; then echo -e "\[\e[32m\]\xe2\x9c\x93"; \
    else echo -e "\[\e[31m\]\xe2\x9c\x97"; fi) \[\e[38;5;242m\]\w$\[\e[0m\] '

set -o vi

add_to_path() {
    if [ -d "$1" ] && [[ ! $PATH =~ (^|:)$1(:|$) ]]; then

# if this is a CygWin .bashrc, then set CygWin's commands first in PATH
# because link.exe and find.exe exist in Windows's path.
# Add /usr/lib/lapack at the end so python's numpy can find lapack_lite
# (Note: BSD bash, used by OS X doesn't have the "substr" test for expr.)
if [[ $(uname -s) == CYGWIN* ]]; then
    PATH=${PATH//":/usr/local/bin:/usr/bin"/} # delete any instances in middle
    add_to_path /usr/lib/lapack
    ulimit -n 1024 # for "duplicity"

# If you think this is hard to read,
# change the color of directories in the ls command 
if [[ $(uname -s) == Darwin* ]]; then
    export LSCOLORS=gxfxcxdxbxegedabagacad
    export CLICOLOR=1
    # After executing: dircolors -p > .dircolors
    # Lighten the color of directories from blue to light blue
    # sed -i '/# directory/c\DIR 00;36 # directory' .dircolors
    if [ -x /usr/bin/dircolors ]; then
        test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
        alias ls='ls --color=auto'

export P4DIFF='vim -d'  # Override from the command line: "P4DIFF=; p4 diff"
export CSCOPE_EDITOR=vim

# Add to PATH only if not already in PATH.
add_to_path $HOME/bin

alias findinchppfiles="find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) -print0 | xargs -0 grep -nI"
alias findinpyfiles="find . -name \*.py -print0 | xargs -0 grep -nI"

alias clip="expand | cut -b1-\$COLUMNS"

# For httpie:
alias https='http --default-scheme=https'

if [ -f $HOME/.localrc ]; then
    source $HOME/.localrc
  • Maybe get and run startxnosh.bat if you install the xinit module. Then running tools like xcalc from a PuTTY ssh connection with X11 forwarding checked will work. An alternative to that is Xming.

3. Configure or Install vim. (Here's a vim Cheat Sheet)

Ensure that vim supports the Python interpreter. (YouTube video.)

$ vim --version | grep +python

If it doesn't, then ensure you've got the required modules. (Mostly the same as listed above for PuTTY.) Then execute the following:

$ git clone --depth 1
$ cd vim/src
$ ./configure --enable-pythoninterp --with-features=huge --prefix=$HOME/opt/vim
$ make && make install
$ mkdir -p $HOME/bin 
$ cd $HOME/bin
$ ln -s $HOME/opt/vim/bin/vim; ln -s $HOME/opt/vim/bin/vim vi
$ which vim
$ vim --version | grep +python

Note: If you choose to install the gvim binary onto a Microsoft Windows machine, the .vimrc file is named, _vimrc, and might reside in C:\Program Files\Vim. The colors, autoload and bundle directories reside within a vimfiles directory there.

Make the .vim_undo directory with one of the two following commands. The last one is for GVim on Windows, since Windows won't let you start a directory name with a dot. Run the command from cygwin.

$ mkdir $HOME/.vim_undo
$ mkdir `cygpath -u $USERPROFILE`/.vim_undo

Set the font by editing your .gvimrc (or _gvimrc) file like so: :e $MYGVIMRC

" set guifont=Consolas:h10
set guifont=Courier\ New:h10
.vimrc (Even more tips.)

Install or download your .vimrc file from the dotfiles git repo.

" Version 2018-05-12.1 - knd remove comments on same line as remaps
set nocompatible    " Use Vim defaults, forget compatibility with vi.
set bs=2            " allow backspacing over everything in insert mode
set wildmenu        " Allows command-line completion with tab
set autoindent      " Copy indent from current line when starting a new line
set smartindent     " Do smart auto indenting when starting  new line
set smarttab        " Honor 'shiftwidth', 'tabstop' or 'softtabstop'
set hlsearch        " highlight all matches for previous search
set nofoldenable    " start unfolded
set foldlevel=0
set nowrap          " no wrapping text lines on the screen (exceptions below)
set sidescroll=5
set listchars+=tab:>-,precedes:<,extends:> " indicators of long lines

if v:version >= 703
  " Do save the undo tree to file, but not in the local directory.
  " Don't forget to mkdir ~/.vim_undo
  set undodir=~/.vim_undo,.
  set undofile        " undo even after closing and reopening a file

" The following two lines set the use of perl regex, aka "very magic"
nnoremap / /\v
vnoremap / /\v

" Make j and k move to the next row, not file line
nnoremap j gj
nnoremap k gk

" From Steve Losh:
" Map jk to ESC in insert mode
inoremap jk <esc>
" inoremap kj <esc>

" clear search highlights
nnoremap <cr> :noh<cr><cr>

" Commented out because I want tags searches to always be case sensitive.
" Override with \c anywhere in your search.
"set ignorecase      " If you enter all lowercase, it's case insensitive,
"set smartcase       " if you use mixed-case terms, it's case sensitive.

syntax on

" If you think this is hard to read,
" change the color of comments in vim, or
" use another color scheme like desert or peaksea
set t_Co=256
if v:version >= 703
  set colorcolumn=80
if has('gui_running') " Didn't work: if &term != 'builtin_gui'
  " Light backgrounds for GUI experiences
  set background=light
  " colorscheme peaksea                        " install peaksea
  colorscheme tolerable                        " install tolerable
  if v:version >= 703
    highlight ColorColumn ctermbg=255 guibg=#F6F6F6
  highlight StatusLine   ctermfg=17 ctermbg=Gray " override scheme (overridden by powerline)
  highlight StatusLineNC ctermfg=20 ctermbg=LightGray" override scheme
  set lines=50 columns=100
  " Dark backgrounds for tty experiences
  set background=dark
  colorscheme desert                           " install desert
  if v:version >= 703
    highlight ColorColumn ctermbg=234 guibg=Black " dark gray (or 17, dark blue)
  highlight StatusLine   ctermfg=20 ctermbg=Gray " override scheme (overridden by powerline)
  highlight StatusLineNC ctermfg=17 ctermbg=DarkGray" override scheme
" highlight Comment     term=bold ctermfg=Blue ctermbg=0 guifg=SlateBlue guibg=Black

" set mouse=v     " visual mode, not working great for PuTTY

set tags=tags;/

set history=50
set ruler
if has('statusline')
  set laststatus=2
  set statusline=%<%f\   " Filename
  set statusline+=%w%h%m%r " Options
  "set statusline+=%{fugitive#statusline()} " Git
  "set statusline+=\ [%{&ff}/%Y]            " filetype
  "set statusline+=\ [%{getcwd()}]          " current dir
  "set statusline+=\ [A=\%03.3b/H=\%02.2B]  " ASCII / Hexadecimal value of char
  set statusline+=%=%-14.(%l,%c%V%)\ %p%%   " Right aligned file nav info

set encoding=utf-8

" I don't set comma for mapleader because it's useful for reverse-finding.
" let mapleader = ","
" let g:mapleader = ","

nmap <leader>w :w!<cr>         " Fast saving
" I use relative number for cursor movement.
nmap <leader>r :set relativenumber!<cr>
nmap <leader>n :set number!<cr>

" Useful mappings for managing tabs
nmap <leader>th <esc>:tabprevious<cr>
nmap <leader>tl <esc>:tabnext<cr>
nmap <leader>tn :tabnew
nmap <leader>to :tabonly<cr>
nmap <leader>tc :tabclose<cr>
nmap <leader>tm :tabmove
" Opens a new tab with the current buffer's path
nmap <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/

" pastetoggle
nmap <leader>p :set invpaste paste?<cr>

nmap <leader>e :NERDTreeToggle %:p:h<cr>    " install nerdtree (e for Explore)
nmap <leader>l :TlistToggle<cr>           " install taglist
nmap <leader>bd :Bdelete<cr>              " install vim-bbye

" Visual mode mappings

" map sort function to a key
vnoremap <leader>s :sort<cr>

"easier moving of code blocks
vnoremap < <gv
vnoremap > >gv

" If too many file system events are getting triggered.
set nobackup       " ~ files
set nowritebackup  " Don't write buff to temp, delete orig, rename temp to orig
set noswapfile     " .swp files

" Allow tags to open another buffer even if this one is modified
set hidden

" Switch between source and header files
function! SwitchSourceHeader()
  let s:ext  = expand("%:e")
  let s:base = expand("%:t:r")
  let s:cmd  = "find " . s:base
  if (s:ext == "cpp" || s:ext == "c")
    if findfile(s:base . ".h"  ) != "" | exe s:cmd . ".h"   | return | en
    if findfile(s:base . ".hpp") != "" | exe s:cmd . ".hpp" | return | en
    if findfile(s:base . ".cpp") != "" | exe s:cmd . ".cpp" | return | en
    if findfile(s:base . ".c"  ) != "" | exe s:cmd . ".c"   | return | en

" Demonstrates a way to look in a mirror directory
" function! OpenOther()
"    if expand("%:e") == "cpp"
"      exe "split" fnameescape(expand("%:p:r:s?src?include?").".h")
"    elseif expand("%:e") == "h"
"      exe "split" fnameescape(expand("%:p:r:s?include?src?").".cpp")
"    endif
" endfunc

" Delete trailing white space on save, useful for Python and CoffeeScript ;)
function! DeleteTrailingWS()
  exe "normal mz"
  exe "normal `z"

function! OpenInOtherWindow()
  if winnr('$') == 1
    exe "wincmd F"
    let curNum = winnr()
    let oldBuf = bufnr( "%" )
    if curNum == 1
      let othNum = 2
      let othNum = 1
    exe "normal! gF"
    let newBuf = bufnr( "%" )
    let newLine = line(".")
    exe 'hide buf' oldBuf
    exe othNum . "wincmd w"
    exe 'hide buf' newBuf
    exe "normal! " . newLine . "G"

nmap <silent> <leader>F :call OpenInOtherWindow()<cr>

if has("autocmd")
  autocmd! BufWritePost .vimrc source %           " re-source this file when saved.
  autocmd BufWrite *.py :call DeleteTrailingWS()  " Delete trailing whitespace
  " Don't let smartindent unindent the # character in Python files
  autocmd FileType python  inoremap # X<c-h>#
  autocmd FileType c,cpp,python,php,brs  set expandtab " Use spaces instead of tabs
  autocmd Filetype make    setl noexpandtab       " ...not for files that use tabs.

  " Use the vim command %retab before applying the following
  " two with files that have 8-space tabs.
  autocmd FileType c,cpp,python,php  set tabstop=4
  autocmd FileType c,cpp,python,php  set shiftwidth=4

  autocmd FileType python  set foldmethod=indent  " 'za' to fold
  autocmd FileType python  set foldlevel=99

  autocmd FileType c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
  autocmd FileType c,cpp set foldmethod=syntax

  " autocmd FileType roku :let g:airline_extensions = []
  " autocmd FileType roku :let g:airline_section_warning = airline#section#create([])
  autocmd FileType roku :let g:airline#extensions#whitespace#enabled = 0

  if v:version >= 703
    " I toggle out of relative number when Vim's focus is lost, because
    " if I'm not editing, then I may be referring to errors with line numbers.
    autocmd FocusLost * if &relativenumber | set number | endif
    autocmd FocusGained * if &number | set relativenumber | endif

  " Since I have the undo tree saved to disk now (see above), I might prefer to
  " automatically save the file when focus is lost.
  " autocmd FocusLost * silent! wa

  autocmd BufRead *.txt set tw=78                  " Limit width of text to 78 chars
  autocmd BufRead *.txt set wrap linebreak nolist  " "soft" wrap of existing lines
  autocmd BufRead README set wrap linebreak nolist " "soft" wrap of existing lines

  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  \   exe "normal! g'\"" |
  \ endif

" This requires vim to be compiled with +python
" Use auto complete in insert mode with ctrl-x, ctrl-o
" See :help new-omni-completion for more.
filetype plugin on
set omnifunc=syntaxcomplete#Complete
" Auto completion via ctrl-space (instead of ctrl-x ctrl-o)
" set omnifunc=pythoncomplete#Complete
" inoremap <Nul> <C-x><C-o>

" This function attempts to reuse the same scratch
" buffer over and over, so you always see output in
" the same location in your window layout.
function! ExecuteFileIntoScratchBuffer()
  let f=expand("%:p")
  let cur_win = winnr()
  if buflisted("_vim_output")
    exe bufwinnr("_vim_output") . "wincmd w"
    let cur_win = cur_win+1
  setlocal buftype=nofile
  setlocal bufhidden=delete
  setlocal noswapfile
  silent file _vim_output
  execute '.! "'.f.'"'
  exe cur_win . "wincmd w"
nmap <F5> :call ExecuteFileIntoScratchBuffer()<cr>

" Execute a selection of code
" Use Visual to select a range and then hit ctrl-h to execute it.
if has("python")
python << EOL
import vim
def EvaluateCurrentRange():
vnoremap <C-h> :py EvaluateCurrentRange()<cr>

" cscope
if has("cscope")
    set cscopetag  " Use both cscope and ctag for 'ctrl-]'
    set csto=1     " 0=cscope first; 1=ctags first
    set cscopeverbose

" I use 12p Roboto Mono from
" On iTerm2, Preferences -> Profiles -> Text -> Font

" When using vim-powerline
let g:Powerline_symbols = 'fancy'

" When using vim-airline
let g:airline_powerline_fonts = 1
let g:airline_theme = 'powerlineish'
let g:airline#extensions#wordcount#enabled = 0
" let g:airline_exclude_filetypes = []

" Install Pathogen for this next call to work
call pathogen#infect()

Use a color scheme you like, like desert, peaksea or tolerable.

$ mkdir -p ~/.vim/colors
$ curl -LSso ~/.vim/colors/desert.vim \
$ curl -LSso ~/.vim/colors/peaksea.vim \
$ curl -LSso ~/.vim/colors/tolerable.vim \

Install some modules. Start with Pathogen to manage the modules.

$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ curl -LSso ~/.vim/autoload/pathogen.vim \

Now you can install any plugin into a .vim/bundle/plugin-name/ folder.

For example, install powerline.

$ cd ~/.vim/bundle
$ git clone --depth 1 git://
$ cd ~/.vim/bundle/vim-powerline/doc; vim -c ":helptags ."

If you use a light background, put this colorscheme in bundle/vim-powerline/autoload/Powerline/Colorschemes/default.vim.

taglist is indispensable. Check the link for further instructions regarding interaction with ctags if you don't already have it set up. (To do: See why Mir Nazim recommended tagbar instead. Also investigate Jedi.)

$ cd ~/.vim/bundle
$ curl >
$ unzip -d taglist
$ rm
$ cd ~/.vim/bundle/taglist/doc; vim -c ":helptags ."

nerdtree is another good candidate.

$ cd ~/.vim/bundle
$ curl -OL
$ unzip
$ rm
$ mv nerdtree-master/ nerdtree
$ cd ~/.vim/bundle/nerdtree/doc; vim -c ":helptags ."

Install :Bdelete from vim-bbye. vim-bbye installs an improved :Bclose script for deleting buffers without losing your window layout.

$ cd ~/.vim/bundle
$ curl -OL
$ unzip
$ rm
$ mv vim-bbye-master/ bbye

If you want the ability to open files with a line number as given by grep -n, use file-line. And if you want to use * and # in visual mode, use visual-star-search.

$ mkdir ~/.vim/plugin
$ curl -LSso ~/.vim/plugin/file-line.vim \
$ curl -LSso ~/.vim/plugin/visual-star-search.vim \

command-t was recommended by Steve Losh. But it requires vim to have been compiled with Ruby support.

$ vim --version | grep +ruby

Most filetypes should have correct syntax coloring, but just in case, you could add it yourself. For example, for yaml, you'd get yaml.vim. You'll need to create a new filetype in your .vimrc file, and add an entry to read your syntax file, too.

  autocmd BufRead,BufNewFile *.yaml set filetype=yaml
  autocmd! Syntax yaml source $VIM/yaml.vim

And install the syntax file...

$ curl -LSso ~/.vim/yaml.vim \

4. Configure Sublime Text.

  1. Register it with your key. (See your email or wiki page.)
  2. Install Package Control.
  3. Install CTags support.
  4. Install Open-Include.
  5. Consider GutterColor for CSS files.
    "color_scheme": "Packages/Color Scheme - Default/Slush & Poppies.tmTheme",
    "draw_white_space": "none",
    "draw_indent_guides": false,
    "line_numbers": false,
    "default_line_ending": "unix",
    "word_wrap": false,
    "translate_tabs_to_spaces": true
Default.sublime-keymap - User
    { "keys": ["ctrl+l"],
      "command": "toggle_setting",
      "args": { "setting": "line_numbers" }

    "tag_file" : "tags",
            "path": "src",
            "folder_exclude_patterns": ["obj"],
            "file_exclude_patterns": ["tags"]
            "name": "Custom Make",
            "shell_cmd": "make all -j8",
	    "working_dir": "$project_path",
	    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
	    "windows": { 
		"shell_cmd": "C:/cygwin64/bin/bash --login $project_base_name/build"

5. Get WinMerge.

6. Get Eclipse.

7. Get SVN for home.

8. Get Fiddler2 for a web debugging proxy outside Firefox.

9. To Access SharePoint from FireFox.
Go to your Firefox address bar and type about:config.  Find the key called network.automatic-ntlm-auth.trusted-uris. Set that key's value to a comma separated list of servers for which you want NTLM authentication.


1. Get Mozilla Firefox.
Your favorite themes were Winestripe or StrataStripe, but things are different in Firefox 4.  Get the Add-ons you love:

Consider some of these good ideas. Consider setting the following about:config parameters:
browser.tabs.tabMinWidth 75
browser.tabs.closeButtons 3
browser.urlbar.hideGoButton true

2. Inkscape for vector graphics. (I need to test this out.)

3. PDF creation: PDF Creator and reading: Foxit.

4. Fraps for recording desktop video.

5. Use Soluto to check boot speed and crash problems.

6. Sync Outlook to Google Calendar with gSyncit. ( Calendar Sync by pppindia is an alternative.)

7. Microsoft Security Essentials, as mentioned in a 2011-11-24 email exchange with Alan Henry.

8. Enable Remote Desktop.

9. Prey. (If your new computer is a laptop, that is.) Remember to leave a Guest Account available for the thief to use, so that Prey has a chance to checkin.

© 2006-2014, David Blume