From 9e904dacac4cb810d8be57be58b5558b10981ddb Mon Sep 17 00:00:00 2001 From: Jamie Davies Date: Sat, 14 Nov 2015 11:46:57 +0000 Subject: [PATCH] I. Declare. BANKRUPTCY! https://youtu.be/HuGIgf-ICHM --- .dotbot | 1 - .gitignore | 2 - .gitmodules | 6 - .install | 12 - .install.conf.json | 35 -- README.md | 59 --- brew.sh | 47 -- config/fish/config.fish | 105 ----- .../functions/_update_gi_completions.fish | 14 - config/fish/functions/fish_prompt.fish | 39 -- config/fish/functions/gi.fish | 14 - config/fish/virtualfish | 1 - gitconfig | 80 ---- gitignore | 42 -- hushlogin | 1 - latexmkrc | 3 - osx.sh | 109 ----- vim/syntax/fish.vim | 39 -- vimrc | 406 ------------------ wgetrc | 29 -- 20 files changed, 1044 deletions(-) delete mode 160000 .dotbot delete mode 100644 .gitignore delete mode 100644 .gitmodules delete mode 100755 .install delete mode 100644 .install.conf.json delete mode 100644 README.md delete mode 100644 brew.sh delete mode 100644 config/fish/config.fish delete mode 100644 config/fish/functions/_update_gi_completions.fish delete mode 100644 config/fish/functions/fish_prompt.fish delete mode 100644 config/fish/functions/gi.fish delete mode 160000 config/fish/virtualfish delete mode 100644 gitconfig delete mode 100644 gitignore delete mode 100644 hushlogin delete mode 100644 latexmkrc delete mode 100755 osx.sh delete mode 100644 vim/syntax/fish.vim delete mode 100644 vimrc delete mode 100644 wgetrc diff --git a/.dotbot b/.dotbot deleted file mode 160000 index 7200832..0000000 --- a/.dotbot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 72008324653e90adfeb29a91b46ab33b34fd4af7 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 35f60bb..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -irssi/sasl.auth -irssi/saved_colors diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7f4b6fb..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "dotbot"] - path = .dotbot - url = git://github.com/anishathalye/dotbot.git -[submodule "config/fish/virtualfish"] - path = config/fish/virtualfish - url = git://github.com/adambrenecki/virtualfish.git diff --git a/.install b/.install deleted file mode 100755 index 6b272e1..0000000 --- a/.install +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -CONFIG=".install.conf.json" -DOTBOT_DIR=".dotbot" - -DOTBOT_BIN="bin/dotbot" -BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -cd "${BASEDIR}" -git submodule update --init --recursive ${DOTBOT_DIR} - -"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" $@ diff --git a/.install.conf.json b/.install.conf.json deleted file mode 100644 index 4766013..0000000 --- a/.install.conf.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - { - "shell": [ - ["mkdir -p ~/.config/fish ~/.vim/syntax", "Checking folder structure exists"] - ] - }, - { - "clean": [ - "~", - "~/.config/fish", - "~/.vim/syntax" - ] - }, - { - "link": { - "~/.config/fish/config.fish" : "config/fish/config.fish", - "~/.config/fish/virtualfish" : "config/fish/virtualfish/", - "~/.config/fish/functions" : "config/fish/functions/", - "~/.gitconfig" : "gitconfig", - "~/.gitignore" : "gitignore", - "~/.hushlogin" : "hushlogin", - "~/.latexmkrc" : "latexmkrc", - "~/.tmux.conf" : "tmux.conf", - "~/.vim/syntax/fish.vim" : "vim/syntax/fish.vim", - "~/.vimrc" : "vimrc", - "~/.wgetrc" : "wgetrc", - "~/bin" : "bin/" - } - }, - { - "shell": [ - ["git submodule update --init --recursive", "Installing/updating submodules"] - ] - } -] diff --git a/README.md b/README.md deleted file mode 100644 index 410fbb3..0000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Jamie's Dotfiles - -This is a collection of the [dotfiles](http://dotfiles.github.io/) that I use to -set up a system just the way I like it. - -Whilst used primarily on OS X, these dotfiles should also work on a Linux-based -system. Maybe. - -This repo now uses [Dotbot](https://github.com/anishathalye/dotbot) to handle -the installation and management of the dotfiles symlinks. To view the -purpose-built tool that I wrote to manage the files before Dotbot, take a look -at the [my_tool](https://github.com/daviesjamie/dotfiles/tree/my_tool) branch. - -### Naming Convention - -All of the files *without* dots at the start are the actual dotfiles this -repository was created to handle. The dots are correctly prefixed to the names -by Dotbot when they are linked into place. - -The files *with* dots at the start of their names are used in the installation of -the dotfiles and the management of the repository. - -## Installation - -To install these dotfiles on your system, simply: - -``` -$ git clone https://github.com/daviesjamie/dotfiles.git ~/.dotfiles -$ ~/.dotfiles/.install -``` - -This will create a symlink in the correct place in your home directory to each -dotfile. The install script is idempotent - running it multiple times won't -cause any issues, it will just update the git submodules. - -If using the dotfiles in this repository as-is, make sure to update -[`gitconfig`](https://github.com/daviesjamie/dotfiles/blob/master/gitconfig) to -reflect your name and email address! - -### Manual Installation - -If you don't want to use Dotbot to install the dotfiles, then you can manually -create a symlink to each file yourself with the following command: - -``` -$ ln -s ~/.dotfiles/gitignore ~/.gitignore -``` - -Rinse and repeat for each file in this repository that you wish to use. - -## Credits - -Several other projects have provided me with ideas (and sometimes just a little -code!) for this project: - - - Mathias Bynens' [excellent collection of OS - X defaults](https://github.com/mathiasbynens/dotfiles/blob/master/.osx). - - Steve Losh's [detailed and lengthy - dotfiles](https://bitbucket.org/sjl/dotfiles). diff --git a/brew.sh b/brew.sh deleted file mode 100644 index 99a48fa..0000000 --- a/brew.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -# Install homebrew if it isn't already installed -if ! hash brew 2> /dev/null; then - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -fi - -# Use latest package definitions -brew update - -# Upgrade old packages (if any) -brew upgrade - -# Install essential homebrews -brew install fish --HEAD -brew install hub -brew install macvim --with-lua --custom-icons --override-system-vim --HEAD -brew install python -brew install ruby -brew install ssh-copy-id -brew install the_silver_searcher -brew install tree -brew install wget - -# Install essential casks -brew install caskroom/cask/brew-cask -brew cask install caffeine -brew cask install dropbox -brew cask install flux -brew cask install google-chrome -brew cask install hazel -brew cask install kaleidoscope -brew cask install mplayerx -brew cask install skype -brew cask install spotify -brew cask install steam -brew cask install the-unarchiver -brew cask install torbrowser -brew cask install trim-enabler -brew cask install utorrent -brew cask install mactex - -# Remove outdated versions from the Cellar -brew cleanup - -# Link .app files into /Applications -brew linkapps diff --git a/config/fish/config.fish b/config/fish/config.fish deleted file mode 100644 index 98e3f31..0000000 --- a/config/fish/config.fish +++ /dev/null @@ -1,105 +0,0 @@ -# ALIASES ------------------------------------------------------------------ {{{ - -# Directory listings -function l --wraps 'ls'; ls -p $argv; end -function la --wraps 'ls'; ls -Ap $argv; end -function ll --wraps 'ls'; ls -hlp $argv; end -function lla --wraps 'ls'; ls -Alp $argv; end - -# Make a new directory and move into it -function take; mkdir -p $argv; cd $argv; end - -# Dotfiles shortcuts -function reloadf; source ~/.config/fish/config.fish; end -function ef; eval $EDITOR ~/.config/fish/config.fish; reloadf; end -function ev; eval $EDITOR ~/.vimrc; end -function eg; eval $EDITOR ~/.gitconfig; end -function essh; eval $EDITOR ~/.ssh/config; end - -# Git shortcuts -function git; hub $argv; end -function g --wraps 'git' - if test (count $argv) -gt 0 - git $argv - else - git status - end -end - -# Clipboard -function pbc; pbcopy $argv; end -function pbp; pbpaste $argv; end - -# Homebrew shortcuts -function brup; brew update; brew upgrade --all; brew cleanup; end -function cask; brew cask $argv; end - -# LaTeX compilation -function mtex; latexmk -pdf -pvc $argv; end - -# Python shortcuts -function py --wraps 'python'; python $argv; end -function ipy --wraps 'python'; ipython $argv; end - -# Make `sudo !!` work again! -function sudo - if test "$argv" = "!!" - eval command sudo $history[2] - else - command sudo $argv - end -end - -# }}} -# ENVIRONMENT VARIABLES ---------------------------------------------------- {{{ - -function _prepend_to_path -d "Prepend the given dir to PATH if it exists and is not already in it" - if test -d $argv[1] - if not contains $argv[1] $PATH - set -gx PATH "$argv[1]" $PATH - end - end -end - -set -gx PATH "/usr/texbin" -_prepend_to_path "/sbin" -_prepend_to_path "/usr/sbin" -_prepend_to_path "/bin" -_prepend_to_path "/usr/bin" -_prepend_to_path "/usr/local/bin" -_prepend_to_path "/usr/local/opt/ruby/bin" -_prepend_to_path "$HOME/bin" - -set -gx BROWSER open -set -gx EDITOR vim - -# }}} -# PROMPT ------------------------------------------------------------------- {{{ - -# Remove greeting message -set -g fish_greeting - -# Configure __fish_git_prompt -set -g __fish_git_prompt_showdirtystate true -set -g __fish_git_prompt_showstashstate true -set -g __fish_git_prompt_showuntrackedfiles true -set -g __fish_git_prompt_showcolorhints true -set -g __fish_git_prompt_color_branch magenta -set -g __fish_git_prompt_color_flags red -set -g __fish_git_prompt_char_untrackedfiles '?' - -# Configure prompt -set -g __fish_prompt_color_venv yellow -set -g __fish_prompt_color_path cyan -set -g __fish_prompt_color_char normal -set -g __fish_prompt_color_char_error red -set -g __fish_prompt_char_user '→' -set -g __fish_prompt_char_root '⇉' - -# }}} -# VIRTUAL FISH ------------------------------------------------------------- {{{ - -. ~/.config/fish/virtualfish/virtual.fish -. ~/.config/fish/virtualfish/auto_activation.fish - -# }}} diff --git a/config/fish/functions/_update_gi_completions.fish b/config/fish/functions/_update_gi_completions.fish deleted file mode 100644 index 306fe7d..0000000 --- a/config/fish/functions/_update_gi_completions.fish +++ /dev/null @@ -1,14 +0,0 @@ -function _update_gi_completions -d "Update completions for gitignore.io cli tool" - set compl_dir ~/.config/fish/completions - set compl_file "$compl_dir/gi.fish" - - # Download list of ignore types - set -l gi_list (gi list | tr ',' ' ') - if test -z $gi_list - echo "No result returned from gitignore.io" >&2 - return 1 - end - - # Use type list for completions - echo complete -f -c gi -a \"update-completions $gi_list\" >$compl_file -end diff --git a/config/fish/functions/fish_prompt.fish b/config/fish/functions/fish_prompt.fish deleted file mode 100644 index 91ae598..0000000 --- a/config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1,39 +0,0 @@ -function fish_prompt -d "Display the terminal prompt" - # Cache exit status from last command - set -l __last_status $status - - # Set char, based on current user - if not set -q __fish_prompt_char - switch (id -u) - case 0 - set -g __fish_prompt_char $__fish_prompt_char_root - case '*' - set -g __fish_prompt_char $__fish_prompt_char_user - end - end - - # Grab normal color - set -l normal (set_color normal) - - # Add newline before prompt - echo -e '' - - # Display working directory - echo -n -s (set_color $__fish_prompt_color_path) (pwd | sed "s|^$HOME|~|") $normal - - # Display git prompt - __fish_git_prompt ":%s" - - # Display [venv] if in a virtualenv (on a new line, before prompt char) - echo -e '' - if set -q VIRTUAL_ENV - echo -n -s (set_color $__fish_prompt_color_venv) '[' (basename "$VIRTUAL_ENV") ']' $normal ' ' - end - - # Display prompt character (in red if previous command had non-zero exit status) - if test $__last_status -ne 0 - echo -e -n -s (set_color $__fish_prompt_color_char_error) $__fish_prompt_char $normal ' ' - else - echo -e -n -s (set_color $__fish_prompt_color_char) $__fish_prompt_char $normal ' ' - end -end diff --git a/config/fish/functions/gi.fish b/config/fish/functions/gi.fish deleted file mode 100644 index a1b1fed..0000000 --- a/config/fish/functions/gi.fish +++ /dev/null @@ -1,14 +0,0 @@ -function gi -d "command-line interface to gitignore.io" - if test (count $argv) -eq 0 - echo "Usage: gi []|list|update-completions" - return 1 - end - - if test $argv[1] = 'update-completions' - _update_gi_completions - return $status - end - - set -l params (echo $argv|tr ' ' ',') - curl -s https://www.gitignore.io/api/$params -end diff --git a/config/fish/virtualfish b/config/fish/virtualfish deleted file mode 160000 index 17a51b5..0000000 --- a/config/fish/virtualfish +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 17a51b56d88bd1f1826945413790c482032bb8d3 diff --git a/gitconfig b/gitconfig deleted file mode 100644 index 3db3e82..0000000 --- a/gitconfig +++ /dev/null @@ -1,80 +0,0 @@ -[alias] - a = add - branches = branch -a - c = commit - co = checkout - d = difftool - dk = difftool -y -t Kaleidoscope - l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit - remotes = remote -v - s = status - tags = tag -l - uns = reset HEAD - unstage = reset HEAD - untrack = rm --cached - -[color] - branch = auto - diff = auto - grep = auto - interactive = auto - status = auto - ui = auto - -[core] - editor = vim - excludesfile = ~/.gitignore - pager = less -S - -[credential] - helper = osxkeychain - -[diff] - tool = vimdiff - -[difftool] - prompt = false - -[difftool "Kaleidoscope"] - cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" - -[filter "hawser"] - clean = git hawser clean %f - required = true - smudge = git hawser smudge %f - -[filter "lfs"] - clean = git lfs clean %f - required = true - smudge = git lfs smudge %f - -[filter "media"] - clean = git media clean %f - required = true - smudge = git media smudge %f - -[ghi] - token = !security find-internet-password -a daviesjamie -s github.com -l 'ghi token' -w - -[github] - user = daviesjamie - -[merge] - tool = Kaleidoscope - -[mergetool] - keepBackup = false - -[mergetool "Kaleidoscope"] - cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot - trustExitCode = true - -[pull] - rebase = true - -[push] - default = upstream - -[user] - name = Jamie Davies - email = jamie@jamiedavies.me diff --git a/gitignore b/gitignore deleted file mode 100644 index ee0b447..0000000 --- a/gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# Compiled source # -################### -*.com -*.class -*.dll -*.exe -*.o -*.so - -# Packages # -############ -# it's better to unpack these files and commit the raw source -# git has its own built in compression methods -*.7z -*.dmg -*.gz -*.iso -*.rar -*.tar -*.zip - -# Logs and databases # -###################### -*.log -*.sql -*.sqlite - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -Icon? -ehthumbs.db -Thumbs.db - -# Vim generated files # -####################### -*.swp -*~ diff --git a/hushlogin b/hushlogin deleted file mode 100644 index 7d13430..0000000 --- a/hushlogin +++ /dev/null @@ -1 +0,0 @@ -# Disable "Last login..." messages when opening a new shell diff --git a/latexmkrc b/latexmkrc deleted file mode 100644 index 0860075..0000000 --- a/latexmkrc +++ /dev/null @@ -1,3 +0,0 @@ -$pdf_previewer='open -a ~/Applications/Skim.app'; -$clean_ext='paux lox pdfsync out'; -$pdflatex='pdflatex --shell-escape %O %S'; diff --git a/osx.sh b/osx.sh deleted file mode 100755 index dc64920..0000000 --- a/osx.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -# Get administrator privileges -sudo -v - -# Keep administrator privileges until scrpt finishes -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - -################################################################################ -# General -################################################################################ - -# Set computer name -read -p "What is this machine's name?: " name -sudo scutil --set ComputerName $name -sudo scutil --set HostName $name -sudo scutil --set LocalHostName $name -sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string $name - -# Disable the sound effects on boot -sudo nvram SystemAudioVolume=" " - -# Expand save panel by default -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true - -# Expand print panel by default -defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true -defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true - -# Save to disk (not to iCloud) by default -defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false - -# Disable the "Are you sure..." dialog when opening downloaded applications -defaults write com.apple.LaunchServices LSQuarantine -bool false - -# Increase window resize speed for Cocoa applications -defaults write NSGlobalDomain NSAWindowResizeTime -float 0.001 - -# Stop Time Machine from prompting to use new hard drives as backups -defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true - -################################################################################ -# SSDs -################################################################################ - -# Disable local Time Machine snapshots -sudo tmutil disablelocal - -# Disable the sudden motion sensor as it's not useful for SSDs -sudo pmset -a sms 0 - -################################################################################ -# Screen -################################################################################ - -# Enable subpixel font rendering on non-Apple LCDs -defaults write NSGlobalDomain AppleFontSmoothing -int 2 - -################################################################################ -# Finder -################################################################################ - -# Allow text selection in Quick Look -defaults write com.apple.finder QLEnableTextSelection -bool true - -# When searching, search the current folder by default -defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" - -# Disable warning when changing a file extension -defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false - -# Show all filename extensions -defaults write NSGlobalDomain AppleShowAllExtensions -bool true - -# Stop creating .DS_Store files on network drives -defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true - -# Enable AirDrop over Ethernet -defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true - -# Show ~/Library folder -chflags nohidden ~/Library - -# Always expand "General", "Open With" and "Sharing & Permissions" in Get Info -defaults write com.apple.finder FXInfoPanesExpanded -dict \ - General -bool true \ - OpenWith -bool true \ - Privileges -bool true - -################################################################################ -# Dock -################################################################################ - -# Remove the Dock auto-hide delay -defaults write com.apple.dock autohide-delay -float 0 - -################################################################################ -# Kill affected applications -################################################################################ - -# Reset launchpad -[ -e ~/Library/Application\ Support/Dock*.db ] && rm ~/Library/Application\ Support/Dock*.db - -for app in "Dashboard" "Dock" "Finder" "Messages" "SystemUIServer"; do - killall "$app" > /dev/null 2>&1 -done - -echo "Done. May need to logout/restart to apply everything." diff --git a/vim/syntax/fish.vim b/vim/syntax/fish.vim deleted file mode 100644 index 95d4939..0000000 --- a/vim/syntax/fish.vim +++ /dev/null @@ -1,39 +0,0 @@ -" Taken from vim-fish plugin -" http://github.com/dag/vim-fish -if exists('b:current_syntax') - finish -endif - -syntax case match - -syntax keyword fishKeyword begin function end -syntax keyword fishConditional if else switch -syntax keyword fishRepeat while for in -syntax keyword fishLabel case - -syntax match fishComment /#.*/ -syntax match fishSpecial /\\$/ -syntax match fishIdentifier /\$[[:alnum:]_]\+/ -syntax region fishString start=/'/ skip=/\\'/ end=/'/ -syntax region fishString start=/"/ skip=/\\"/ end=/"/ contains=fishIdentifier -syntax match fishCharacter /\v\\[abefnrtv *?~%#(){}\[\]<>&;"']|\\[xX][0-9a-f]{1,2}|\\o[0-7]{1,2}|\\u[0-9a-f]{1,4}|\\U[0-9a-f]{1,8}|\\c[a-z]/ -syntax match fishStatement /\v;\s*\zs\k+>/ -syntax match fishCommandSub /\v\(\s*\zs\k+>/ - -syntax region fishLineContinuation matchgroup=fishStatement - \ start='\v^\s*\zs\k+>' skip='\\$' end='$' - \ contains=fishSpecial,fishIdentifier,fishString,fishCharacter,fishStatement,fishCommandSub - -highlight default link fishKeyword Keyword -highlight default link fishConditional Conditional -highlight default link fishRepeat Repeat -highlight default link fishLabel Label -highlight default link fishComment Comment -highlight default link fishSpecial Special -highlight default link fishIdentifier Identifier -highlight default link fishString String -highlight default link fishCharacter Character -highlight default link fishStatement Statement -highlight default link fishCommandSub fishStatement - -let b:current_syntax = 'fish' diff --git a/vimrc b/vimrc deleted file mode 100644 index 5f527bc..0000000 --- a/vimrc +++ /dev/null @@ -1,406 +0,0 @@ -" BASIC OPTIONS ------------------------------------------------------------ {{{ - -" Use Vim settings, rather than Vi settings (much better!). -set nocompatible - -set autoindent " automatically indent new lines -set autoread " re-read an open file that has changed outside vim -set autowrite " automatically save before commands like :next and :make - -" Allow backspacing over everything in insert mode -set backspace=indent,eol,start - -set cmdheight=2 " use 2 lines for command-line - -" Use '# ' as default comment prefix -setglobal commentstring=#\ %s - -set cursorline " highlight the line the cursor is on - -" Set dictonary -set dictionary+=/usr/share/dict/words - -set display=lastline " display as much as possible of a long last line -set encoding=utf-8 " use utf-8 character set by default -set expandtab " use spaces instead of s -set formatoptions=q " allow formatting of comments with gq -set formatoptions+=n " recognise numbered lists when formatting -set formatoptions+=1 " don't break lines after a one-letter word -set formatoptions+=l " don't automatically format/wrap already too-long lines - -" Remove comment markup when joining lines -if v:version > 703 || v:version == 703 && has("patch541") - set formatoptions+=j -endif - -set foldmethod=marker " use markers for folding -set foldopen+=jump " open folds when jumping (with G, gg, etc.) -set hidden " allow unsaved buffers to exist in the background -set hlsearch " highlight search matches -set incsearch " search incrementally as you type -set laststatus=2 " Always display statusbar, regardless of number of windows -set linebreak " use soft-wrapping on long lines - -" Set list characters (used to display whitespace) -if (&termencoding ==# 'utf-8' || &encoding ==# 'utf-8') && version >= 700 - let &listchars = "tab:\u21e5\u00b7,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u26ad" - let &fillchars = "vert:\u259a,fold:\u00b7" -else - set listchars=tab:>\ ,trail:-,extends:>,precedes:< -endif - -set matchtime=3 " highlight matching parens for 3 seconds -set modelines=0 " explicity turn off vim modelines (for security) -set notimeout " timeout out on keycodes, but not mappings -set number " use line numbers -set scrolloff=5 " keep 5 lines visible around cursor (if possible) - -" If using Fish shell, use bash inside vim -if &shell =~# 'fish$' - set shell=/bin/bash -endif - -set shiftround " when shifting, always use a multiple of shiftwidth -set shiftwidth=4 " set size of an 'indent' to 4 -set showcmd " display incomplete commands at the bottom -set showmatch " show matching brackets -set sidescrolloff=5 " keep 5 characters visible around cursor (if possible) -set smartcase " automatically decide to search with case or not -set smarttab " make adding/removing tabs (spaces) smarter -set softtabstop=4 " set soft tabstop size to 4 - -" Use a spellfile to store a custom dictionary -set spellfile=~/.vim/spell/en.utf-8.add - -set spelllang=en_gb " set spelling to use British English -set splitbelow " always make new splits below, not above -set splitright " always make new splits on the right, not on the left -set synmaxcol=800 " don't highlight lines longer than 800 characters -set tabstop=4 " set hard tabstop size to 4 -set title " update the terminal title with file name -set ttimeout -set ttimeoutlen=10 " wait 10ms for a keycode to complete -set ttyfast " use a fast terminal connection - -" Viminfo settings: -" ! Save and restore global variables starting with an uppercase letter -" '20 Remember marks for 20 most recent files -" <50 Save 50 lines for each register -" s10 Save a maximum of 10kb for each item -" h Disable 'hlsearch' when loading viminfo -if v:version >= 700 - set viminfo=!,'20,<50,s10,h -endif - -set visualbell " use a visual bell instead of annoying beep -set wildmenu " use a menu for command-line completion - -" On completion, complete longest common string and open wildmenu -set wildmode=longest:full,full - -" Don't auto-complete some file types -set wildignore+=*DS_Store*,*.pyc - -" }}} -" ADVANCED OPTIONS --------------------------------------------------------- {{{ - -" Protect home directory permissions during sudo vim -if !empty($SUDO_USER) && $USER !=# $SUDO_USER - set viminfo= - set directory-=~/tmp - set backupdir-=~/tmp -endif - -" Highlight VCS conflicts -match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' - -" Make vim return to the same line when reopening a file -augroup line_return - au! - au BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ execute 'normal! g`"zvzz' | - \ endif -augroup END - -" Strip trailing whitespace on save -autocmd BufWritePre * :%s/\s\+$//e - -" Only show cursorline in normal mode and in the current window -augroup cline - au! - au WinLeave,InsertEnter * set nocursorline - au WinEnter,InsertLeave * set cursorline -augroup END - -" Resize splits when the window is resized -au VimResized * :wincmd = - -" }}} -" TEMPORARY FILES ---------------------------------------------------------- {{{ - -set history=1000 " keep 1000 lines of command line history -set undofile " save undo history to a file -set undoreload=10000 " save 10000 lines of undo history - -set undodir=~/.vim/tmp/undo " save undo files to ~/.vim/tmp/undo -set backupdir=~/.vim/tmp/backup " save backup files to ~/.vim/tmp/backup -set directory=~/.vim/tmp/swap " save swap files to ~/.vim/tmp/swap - -" Create temporary folders if they don't already exist -if !isdirectory( expand( &undodir ) ) - call mkdir( expand( &undodir ), "p" ) -endif -if !isdirectory( expand( &backupdir ) ) - call mkdir( expand( &backupdir ), "p" ) -endif -if !isdirectory( expand( &directory ) ) - call mkdir( expand( &directory ), "p" ) -endif - -" }}} -" FOLDING ------------------------------------------------------------------ {{{ - -set foldlevelstart=0 - -" Use space to toggle folds -nnoremap za - -" }}} -" KEY BINDINGS ------------------------------------------------------------- {{{ - -" Set leader keys -let mapleader="," - -" Stop using the cursor keys once and for all! (Unbind them) -noremap -noremap -noremap -noremap -inoremap -inoremap -inoremap -inoremap - -" Make j and k work on screen lines, not file lines -nnoremap j gj -nnoremap k gk -nnoremap gj j -nnoremap gk k - -" Move between windows a bit easier -noremap h -noremap j -noremap k -noremap l - -" Resize splits more easily -noremap h 10< -noremap j 10- -noremap k 10+ -noremap l 10> - -" Move to next/previous buffers easier -noremap x :bnext -noremap z :bprevious - -" Copying to/from system clipboard -noremap y "*y - -" Clear search highlighting -nnoremap :nohlsearch - -" }}} -" :COMMAND SHORTCUTS ------------------------------------------------------- {{{ - -" Quickly edit main dotfiles -cabbrev ev e $MYVIMRC -cabbrev eg e ~/.gitconfig -cabbrev ef e ~/.config/fish/config.fish -cabbrev essh e ~/.ssh/config -cabbrev vv vsplit $MYVIMRC -cabbrev vg vsplit ~/.gitconfig -cabbrev vf vsplit ~/.config/fish/config.fish -cabbrev vssh vsplit ~/.ssh/config - -" Write to protected file (request sudo) -cabbrev w!! w !sudo tee % - -" Prefer help in vertical splits -cabbrev h vert help - -" }}} -" PLUGINS ------------------------------------------------------------------ {{{ - -" Install with: -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" :PlugInstall - -" Initialise vim-plug -filetype off -call plug#begin('~/.vim/plugged') - -" Colour schemes -Plug 'jonathanfilip/vim-lucius' - -" Tim Pope goodness -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-unimpaired' - -" Editing plugins -Plug 'godlygeek/tabular' -Plug 'sirver/ultisnips' -Plug 'wellle/targets.vim' - -call plug#end() - -" Enable file-specific indenting and plugins -filetype plugin indent on - -" }}} -" COLOUR SCHEME ------------------------------------------------------------ {{{ - -" Enable 256 colours -set t_Co=256 - -" Enable lucius theme -colorscheme lucius -set background=dark - -" }}} -" STATUSLINE --------------------------------------------------------------- {{{ - -function! Color(active, num, content) - if a:active - return '%' . a:num . '*' . a:content . '%*' - else - return a:content - endif -endfunction - -function! Status(winnr) - let stat = '' - let active = winnr() == a:winnr - let buffer = winbufnr(a:winnr) - - let modified = getbufvar(buffer, '&modified') - let readonly = getbufvar(buffer, '&ro') - let filetype = getbufvar(buffer, '&ft') - - " Column number - let stat .= '%1*' . (col(".") / 100 >= 1 ? '%v ' : ' %2v') . ' %*' - - " Filename - let stat .= Color(active, 3, active ? ' [' : ' ') - let stat .= ' %<' - let stat .= '%f' - let stat .= Color(active, 3, active ? ' ]' : ' ') - - - " Modified flag - let stat .= Color(active, 2, modified ? ' +' : '') - - " Read only flag - let stat .= Color(active, 2, readonly ? ' !!' : '') - - " Paste mode flag - if active && &paste - let stat .= ' %2*' . 'P' . '%*' - endif - - " Switch to right side - let stat .= '%=' - - " Filetype - let stat .= Color(active, 3, ' ← ') . filetype . ' ' - - return stat -endfunction - -" Cycle through windows and re-set the statusline -" Used to provide an 'inactive' colourscheme for inactive windows -function! SetStatus() - for nr in range(1, winnr('$')) - call setwinvar(nr, '&statusline', '%!Status('.nr.')') - endfor -endfunction - -" Automatically call SetStatus() when necessary -augroup status - autocmd! - autocmd VimEnter,WinEnter,BufWinEnter,BufUnload * call SetStatus() -augroup END - -" Background colour -hi StatusLine ctermfg=243 guifg=#767676 ctermbg=237 guibg=#3a3a3a -hi StatusLineNC ctermfg=238 guifg=#444444 ctermbg=236 guibg=#303030 - -" Column number colour -hi User1 ctermfg=243 guifg=#767676 ctermbg=236 guibg=#303030 - -" Modified/Read-only/Paste colour -hi User2 ctermfg=197 guifg=#ff005f ctermbg=237 guibg=#3a3a3a - -" [ ] ← colour -hi User3 ctermfg=136 guifg=#af8700 ctermbg=237 guibg=#3a3a3a - -" }}} -" ULTISNIPS ---------------------------------------------------------------- {{{ - -" Use tab to expand snippets -let g:UltiSnipsExpandTrigger='' - -" Use tab and shift+tab for jumping between tabstops/placeholders -let g:UltiSnipsJumpForwardTrigger='' -let g:UltiSnipsJumpBackwardTrigger='' - -" Use vertical split for :UltiSnipsEdit -let g:UltiSnipsEditSplit='vertical' - -" }}} -" GUI / MACVIM ------------------------------------------------------------- {{{ - -if has("gui_running") - set guioptions-=T " Hide toolbar - set guioptions-=rR " Hide right scrollbar - set guioptions-=b " Hide bottom scrollbar - set guioptions-=lL " Hide left scrollbar - set guioptions+=c " Use vim-style prompts instead of popup dialog boxes - - " Set default window size - set columns=100 lines=30 - - " Configure font - set guifont=Anonymous\ Pro - set noantialias -endif - -" }}} -" FILETYPE SPECIFIC SETTINGS ----------------------------------------------- {{{ - -" Fish {{{ - -augroup ft_fish - au! - au BufNewFile,BufRead *.fish setlocal filetype=fish -augroup END - -" }}} -" TeX/LaTeX {{{ - -augroup ft_tex - au! - au FileType tex setlocal spell -augroup END - -" }}} -" Folding Files {{{ -augroup fold_ft - au! - au FileType conf,fish,vim setlocal foldmethod=marker foldmarker={{{,}}} -augroup END -" }}} - -" }}} diff --git a/wgetrc b/wgetrc deleted file mode 100644 index 0fb0877..0000000 --- a/wgetrc +++ /dev/null @@ -1,29 +0,0 @@ -# Use the server-provided last modification date, if available -timestamping = on - -# Do not go up in the directory tree when downloading recursively -no_parent = on - -# Wait 60 seconds before timing out (default is 15 minutes!) -timeout = 60 - -# Retry twice more when a download fails (default is 20!) -tries = 3 - -# Retry even when the connection was refused -retry_connrefused = on - -# Use the last component of a redirection URL for the local file name -trust_server_names = on - -# Follow FTP links -follow_ftp = on - -# Add .html or .css extensions to appropriate documents that lack them -adjust_extension = on - -# Ignore robots.txt -robots = off - -# Print the HTTP and FTP server responses -server_response = on