Skip to content

Instantly share code, notes, and snippets.

@matthewjberger
Last active December 19, 2016 16:48
Show Gist options
  • Save matthewjberger/085434f0cc8684f2bca5b3629ec66029 to your computer and use it in GitHub Desktop.
Save matthewjberger/085434f0cc8684f2bca5b3629ec66029 to your computer and use it in GitHub Desktop.
Windows Dot Files
[user]
name = Matthew J. Berger
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = [email protected]
smtpserverport = 587
[credential]
username = matthewjberger
helper = cache --timeout 3600
[web]
browser = chrome
[rerere]
# Reuse Recorded Resolution
# allows git to remember how a hunk conflict has been resolved
# and remembers for next time
enabled = 1
autoupdate = 1
[push]
# Only push branches one at a time
default = simple
[color]
ui = auto
[color "branch"]
# Alter coloring by branch
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
ld = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[difftool]
tool = difftool
[github]
user = matthewjberger
token = token
[gitflow "prefix"]
feature = feature-
release = release-
hotfix = hotfix-
support = support-
versiontag = v
[url "https://[email protected]"]
insteadOf = https://github.com
[alias]
# Stage all files
a = add --all
# Modify previous commit
amend = commit -a --amend
# Checkout file
co = checkout
# Create new branch but don't push it to the repo host
cob = checkout -b
# Commit with a message
com = commit -m
# Add and commit all changes
comma = !git add -A && git commit -m
# Clone self repo
cs = "!sh -c \"git clone https://github.com/matthewjberger/$1\" -"
# Clone self repo recursive
csr = "!sh -c \"git clone --recursive https://github.com/matthewjberger/$1\" -"
# Clone user repo
cu = "!sh -c \"git clone https://github.com/$1\" -"
# Clone user repo recursive
cur = "!sh -c \"git clone --recursive https://github.com/$1\" -"
# Use diff so fancy for diffs
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
# Edit config with vim
ec = config --global -e
# Show last commit
last = show --name-status
# Show all commits on all branches in a compact, colorized way
histories = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# Show the commit history in a nice format
history = log --pretty=oneline
# Move current work to a different branch
moveto = "!sh -c \"git stash && git checkout $1 && git stash pop\" -"
# Create new branch and push to repo host
newbranch = "!sh -c \"git checkout -b $1 && git push --set-upstream origin $1\" -"
# Has the same effect as deleting the entire repo and re-cloning
# Except it doesn't delete files in the .gitignore, to be safe
nuke = "!sh -c \"git checkout $1 && git stash -u && git fetch --all && git reset --hard origin/$1 && git clean -df && git submodule update --init --recursive\" -"
# Deletes a submodule
rmsub = "!sh -c \"git rm $1 && rm -rf .git/modules/$1\" -"
# Quick commit to save progress
save = !git add -A && git commit -m 'SAVEPOINT'
# Get the current status
st = status
# Get the concise version of the current status
sts = status -s
# Clean files not under version control
tidy = clean -xdf
# Dry run of git tidy
tidydry = clean -xdn
# Undo commit but keep changes
undo = reset HEAD~1 --mixed
# Unstage all (or specified) files
unstage = reset HEAD --
# Get up to date with the origin (Use if you have local commits)
# This rebases local commits to come after any commits that are pulled down
# --prune removes remote-tracking branches that no longer exist on the remote
# This also ensures submodules are recursively updated
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Update submodules recursively. Point them to latest commit.
upsub = !git submodule init && git submodule update --remote --merge
# Undo commit and discard changes
# Commits everything in working directory and does a hard reset to remove that commit
# This is safer than simply discarding changes for good
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[url "https://github.com/"]
insteadOf = git://github.com/
[help]
autocorrect = 1
AllowBlinking=no
Answerback=
BackgroundColour=0,0,0
BackspaceSendsBS=yes
BellFlash=no
BellSound=no
BellTaskbar=yes
BoldAsFont=no
Charset=UTF-8
ClickTargetMod=shift
ClicksPlaceCursor=no
ClicksTargetApp=yes
Columns=80
ConfirmExit=yes
CopyOnSelect=yes
CtrlAltIsAltGr=no
CursorBlinks=yes
CursorType=line
Font=Hack
FontHeight=12
FontIsBold=no
FontSmoothing=full
ForegroundColour=255,255,255
Locale=en_US
OpaqueWhenFocused=no
Printer=
RightClickAction=menu
Rows=29
ScrollMod=shift
ScrollbackLines=10000
Scrollbar=right
SwitchShortcuts=no
WindowShortcuts=yes
ZoomShortcuts=yes
AltFnShortcuts=no
CopyAsRTF=no
# INFO: http://mintty.googlecode.com/svn/trunk/docs/mintty.1.html#HEAD
Transparency=2
OpaqueWhenFocused=1
FontHeight=11
BoldAsColour=1
Columns=100
Rows=40
# Note: you need xterm-256color
Term=xterm-256color
CursorType=1
# Zenburn scheme - Source: http://slinky.imukuppi.org/zenburnpage/
CursorColour=191,191,191
ForegroundColour=220,220,204
BackgroundColour=63,63,63
Black=63,63,63
Red=112,80,80
Green=96,180,138
Yellow=223,175,143
Blue=80,96,112
Magenta=220,140,195
Cyan=140,208,211
White=220,220,204
BoldBlack=112,144,128
BoldRed=220,163,163
BoldGreen=195,191,159
BoldYellow=240,223,175
BoldBlue=148,191,243
BoldMagenta=236,147,211
BoldCyan=147,224,227
BoldWhite=255,255,255
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; Lazy installation of layers (i.e. layers are installed only when a file
;; with a supported type is opened). Possible values are `all', `unused'
;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
;; lazy install any layer that support lazy installation even the layers
;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
;; installation feature and you have to explicitly list a layer in the
;; variable `dotspacemacs-configuration-layers' to install it.
;; (default 'unused)
dotspacemacs-enable-lazy-installation 'unused
;; If non-nil then Spacemacs will ask for confirmation before installing
;; a layer lazily. (default t)
dotspacemacs-ask-for-lazy-installation t
;; If non-nil layers with lazy install support are lazy installed.
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load.
dotspacemacs-configuration-layers
'(
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
(auto-completion :variables
autocomplete-enable-snippets-in-popup t
autocomplete-enable-sort-by-usage t)
;; asm
;; better-defaults
;; (colors :variables
;; colors-enable-nyan-cat-progress-bar t)
;; (c-c++ :variables
;; c-c++-enable-clang-support t
;; c-c++-default-mode-for-headers 'c++-mode)
emacs-lisp
emoji
;; evil-cleverparens
;; extra-langs
;; fasd
;; games
;; git
;; github
helm
;; html
;; (ibuffer :variables
;; ibuffer-group-buffers-by nil)
;; ipython-notebook
;; (javascript :variables
;; javascript-disable-tern-port-files nil)
;; (latex :variables
;; latex-enable-auto-fill t
;; latex-enable-folding t)
;; lua
(markdown :variables
markdown-live-preview-engine 'vmd)
(org :variables
org-enable-github-support t)
;; (python :variables
;; python-test-runner '(nose pytest))
;; ruby
;; ruby-on-rails
rust
;; search-engine
shaders
(shell :variables
shell-default-height 30
shell-default-position 'bottom
shell-default-shell 'eshell)
;; shell-scripts
semantic
syntax-checking
;; themes-megapack
(version-control :variables
version-control-diff-tool 'diff-hl
version-control-global-margin t)
vim-powerline
;; yaml
)
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'.
dotspacemacs-additional-packages '( cargo writeroom-mode )
;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '()
;; A list of packages that will not be installed and loaded.
dotspacemacs-excluded-packages '()
;; Defines the behaviour of Spacemacs when downloading packages.
;; Possible values are `used', `used-but-keep-unused' and `all'. `used' will
;; download only explicitly used packages and remove any unused packages as
;; well as their dependencies. `used-but-keep-unused' will download only the
;; used packages but won't delete them if they become unused. `all' will
;; download all the packages regardless if they are used or not and packages
;; won't be deleted by Spacemacs. (default is `used')
dotspacemacs-download-packages 'used))
(defun dotspacemacs/init ()
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; If non nil ELPA repositories are contacted via HTTPS whenever it's
;; possible. Set it to nil if you have no way to use HTTPS in your
;; environment, otherwise it is strongly recommended to let it set to t.
;; This variable has no effect if Emacs is launched with the parameter
;; `--insecure' which forces the value of this variable to nil.
;; (default t)
dotspacemacs-elpa-https t
;; Maximum allowed time in seconds to contact an ELPA repository.
dotspacemacs-elpa-timeout 5
;; If non nil then spacemacs will check for updates at startup
;; when the current branch is not `develop'. Note that checking for
;; new versions works via git commands, thus it calls GitHub services
;; whenever you start Emacs. (default nil)
dotspacemacs-check-for-update nil
;; One of `vim', `emacs' or `hybrid'.
;; `hybrid' is like `vim' except that `insert state' is replaced by the
;; `hybrid state' with `emacs' key bindings. The value can also be a list
;; with `:variables' keyword (similar to layers). Check the editing styles
;; section of the documentation for details on available variables.
;; (default 'vim)
dotspacemacs-editing-style 'vim
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
dotspacemacs-verbose-loading nil
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; List of items to show in startup buffer or an association list of
;; the form `(list-type . list-size)`. If nil then it is disabled.
;; Possible values for list-type are:
;; `recents' `bookmarks' `projects' `agenda' `todos'."
dotspacemacs-startup-lists '((recents . 5)
(projects . 7))
;; Default major mode of the scratch buffer (default `text-mode')
dotspacemacs-scratch-mode 'text-mode
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(zenburn
solarized-dark
spacemacs-dark
spacemacs-light)
;; If non nil the cursor color matches the state color in GUI Emacs.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
;; quickly tweak the mode-line size to make separators look not too crappy.
dotspacemacs-default-font '("Hack"
:size 16
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; The leader key accessible in `emacs state' and `insert state'
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in `emacs state' and `insert state'.
;; (default "C-M-m)
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
;; The key used for Emacs commands (M-x) (after pressing on the leader key).
;; (default "SPC")
dotspacemacs-emacs-command-key "SPC"
;; These variables control whether separate commands are bound in the GUI to
;; the key pairs C-i, TAB and C-m, RET.
;; Setting it to a non-nil value, allows for separate commands under <C-i>
;; and TAB or <C-m> and RET.
;; In the terminal, these pairs are generally indistinguishable, so this only
;; works in the GUI. (default nil)
dotspacemacs-distinguish-gui-tab nil
;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
dotspacemacs-remap-Y-to-y$ t
;; If non-nil, the shift mappings `<' and `>' retain visual state if used
;; there. (default t)
dotspacemacs-retain-visual-state-on-shift t
;; If non-nil, J and K move lines up and down when in visual mode.
;; (default nil)
dotspacemacs-visual-line-move-text t
;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
;; (default nil)
dotspacemacs-ex-substitute-global nil
;; Name of the default layout (default "Default")
dotspacemacs-default-layout-name "Default"
;; If non nil the default layout name is displayed in the mode-line.
;; (default nil)
dotspacemacs-display-default-layout t
;; If non nil then the last auto saved layouts are resume automatically upon
;; start. (default nil)
dotspacemacs-auto-resume-layouts nil
;; Size (in MB) above which spacemacs will prompt to open the large file
;; literally to avoid performance issues. Opening a file literally means that
;; no major mode or minor modes are active. (default is 1)
dotspacemacs-large-file-size 1
;; Location where to auto-save files. Possible values are `original' to
;; auto-save the file in-place, `cache' to auto-save the file to another
;; file stored in the cache directory and `nil' to disable auto-saving.
;; (default 'cache)
dotspacemacs-auto-save-file-location 'cache
;; Maximum number of rollback slots to keep in the cache. (default 5)
dotspacemacs-max-rollback-slots 5
;; If non nil, `helm' will try to minimize the space it uses. (default nil)
dotspacemacs-helm-resize nil
;; if non nil, the helm header is hidden when there is only one source.
;; (default nil)
dotspacemacs-helm-no-header nil
;; define the position to display `helm', options are `bottom', `top',
;; `left', or `right'. (default 'bottom)
dotspacemacs-helm-position 'bottom
;; If non nil the paste micro-state is enabled. When enabled pressing `p`
;; several times cycle between the kill ring content. (default nil)
dotspacemacs-enable-paste-transient-state t
;; Which-key delay in seconds. The which-key buffer is the popup listing
;; the commands bound to the current keystroke sequence. (default 0.4)
dotspacemacs-which-key-delay 0.4
;; Which-key frame position. Possible values are `right', `bottom' and
;; `right-then-bottom'. right-then-bottom tries to display the frame to the
;; right; if there is insufficient space it displays it at the bottom.
;; (default 'bottom)
dotspacemacs-which-key-position 'bottom
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
dotspacemacs-loading-progress-bar t
;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX. (default nil)
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up.
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
;; (default nil) (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-inactive-transparency 90
;; If non nil show the titles of transient states. (default t)
dotspacemacs-show-transient-state-title t
;; If non nil show the color guide hint for transient state keys. (default t)
dotspacemacs-show-transient-state-color-guide t
;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters point
;; when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'
;; derivatives. If set to `relative', also turns on relative line numbers.
;; (default nil)
dotspacemacs-line-numbers nil
;; Code folding method. Possible values are `evil' and `origami'.
;; (default 'evil)
dotspacemacs-folding-method 'evil
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
;; (default nil)
dotspacemacs-smartparens-strict-mode t
;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
;; over any automatically added closing parenthesis, bracket, quote, etc
;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
dotspacemacs-smart-closing-parenthesis t
;; Select a scope to highlight delimiters. Possible values are `any',
;; `current', `all' or `nil'. Default is `all' (highlight any scope and
;; emphasis the current one). (default 'all)
dotspacemacs-highlight-delimiters 'all
;; If non nil, advise quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server t
;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
;; (default '("ag" "pt" "ack" "grep"))
dotspacemacs-search-tools '("pt" "ag" "ack" "grep")
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now. (default nil)
dotspacemacs-default-package-repository nil
;; Delete whitespace while saving buffer. Possible values are `all'
;; to aggressively delete empty line and long sequences of whitespace,
;; `trailing' to delete only the whitespace at end of lines, `changed'to
;; delete only whitespace for changed lines or `nil' to disable cleanup.
;; (default nil)
dotspacemacs-whitespace-cleanup 'all
))
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
(setq-default
linum-format "%4d \u2502"
linum-relative-format "%4s \u2502"
c-default-style "bsd"
c-basic-offset 4
tab-width 4
)
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
(add-hook 'prog-mode-hook 'turn-on-evil-mc-mode)
(add-hook 'text-mode-hook 'turn-on-evil-mc-mode)
;; Enable diff checking without having to save
(diff-hl-flydiff-mode)
(define-key evil-normal-state-map "H" "^")
(define-key evil-normal-state-map "L" "$")
(setq-default
diff-hl-side 'right
evil-escape-key-sequence "jk"
rust-enable-racer t)
(setq
vc-follow-symlinks t
flycheck-check-syntax-automatically '(save mode-enabled idle-change)
avy-all-windows 'all-frames
)
;; Perform full-document LaTeX previews
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
;; Disable line wrapping on startup
(add-hook 'hack-local-variables-hook (lambda()(setq truncate-lines t)))
(setq gdb-many-windows t)
(global-set-key [f5] 'gud-cont)
(global-set-key [f7] 'gud-tbreak)
(global-set-key [S-f11] 'gud-finish)
(global-set-key [f9] 'gud-break)
(global-set-key [f10] 'gud-next)
(global-set-key [f11] 'gud-step)
;; Toggle relative line numbers off when not in normal mode
;; TODO: This makes the shell popup glitch. Check buffer type and disable when in shell buffer.
;; (add-hook 'evil-insert-state-entry-hook (lambda()(linum-relative-off
;; (setq linum-format "%4d \u2502"))))
;; (add-hook 'evil-normal-state-entry-hook (lambda()(linum-relative-on)))
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
" Matthew Berger's vimrc
" Plugin List {{{
set nocompatible
filetype off
call plug#begin('~/.vim/bundle/')
Plug 'airblade/vim-gitgutter'
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-airline'
Plug 'christoomey/vim-sort-motion'
Plug 'dahu/vim-fanfingtastic'
Plug 'derekwyatt/vim-fswitch'
Plug 'derekwyatt/vim-protodef'
Plug 'ervandew/supertab'
Plug 'inside/vim-search-pulse'
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/seoul256.vim'
Plug 'junegunn/vim-peekaboo'
Plug 'kien/rainbow_parentheses.vim'
Plug 'lokaltog/vim-easymotion'
Plug 'mattn/webapi-vim' | Plug 'rust-lang/rust.vim'
Plug 'majutsushi/tagbar'
Plug 'raimondi/delimitmate'
Plug 'rdnetto/ycm-generator', { 'branch': 'stable' }
Plug 'rking/ag.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/syntastic'
Plug 'shougo/vimproc.vim' | Plug 'shougo/neoyank.vim' | Plug 'shougo/neomru.vim' | Plug 'shougo/unite.vim'
Plug 'sirver/ultisnips' | Plug 'honza/vim-snippets'
Plug 'sjl/gundo.vim'
Plug 'tikhomirov/vim-glsl'
Plug 'tommcdo/vim-lion'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
" Plug 'valloric/youcompleteme', {'do': './install.py --clang-completer --gocode-completer --racer-completer'}
Plug 'xolox/vim-misc' | Plug 'xolox/vim-easytags'
Plug 'yonchu/accelerated-smooth-scroll'
call plug#end()
" Use Syntax highlighting
syntax on
" Use filetype detection
filetype on
" Customize indentation method using filetype plugins
filetype plugin indent on
"}}}
let mapleader = ","
nnoremap <leader>ev :split $MYVIMRC <CR>
nnoremap <leader>Ev :split $MYVIMRC <CR> :only<cr>
nnoremap <leader>sv :source $MYVIMRC <CR>
nnoremap <leader>ez :split ~/.zshrc<CR>
" Use old regexp engine, vim 7.4+'s new regexp engine makes easytags laggy
set regexpengine=0
let NERDTreeIgnore=['\.o$', '\~$']
" Make all sorts case insensitive
let g:sort_motion_flags = "ui"
nnoremap <leader><ESC> :qa!<CR>;
nnoremap <leader>n :NERDTreeToggle<CR>
nnoremap <leader><SPACE> :w<CR>
" Save and quit files more easily
nnoremap <leader>q ZQ " Quit file without saving
nnoremap <leader>Z ZZ " Save and quit file
set colorcolumn=80
highlight ColorColumn ctermbg=darkgray
match ErrorMsg '\%>80v.\+'
colorscheme seoul256
set background=dark
" Don't move on *
nnoremap * *<C-O>:call search_pulse#Pulse()<CR>
" Keep search matches in the middle of the window and pulse the window
nnoremap n nzzzv:call search_pulse#Pulse()<CR>
nnoremap N Nzzzv:call search_pulse#Pulse()<CR>
nnoremap g; g;zz:call search_pulse#Pulse()<CR>
nnoremap g, g,zz:call search_pulse#Pulse()<CR>
nnoremap <c-o> <c-o>zz:call search_pulse#Pulse()<CR>
" Return to the same line when reopening files
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ endif
augroup END
set splitbelow
set splitright
" easier movement between windows
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" Airline {{{
let g:airline_powerline_fonts=1
" Show airline tabs
"let g:airline#extensions#tabline#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
" }}}
autocmd InsertEnter * silent! :set norelativenumber
autocmd InsertLeave,BufNewFile,VimEnter * silent! :set relativenumber
" Removes trailing spaces
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
"nnoremap <silent> <leader>rtw :call TrimWhiteSpace()<CR>
autocmd FileWritePre * :call TrimWhiteSpace()
autocmd FileAppendPre * :call TrimWhiteSpace()
autocmd FilterWritePre * :call TrimWhiteSpace()
autocmd BufWritePre * :call TrimWhiteSpace()
" zM to open all folds
" zR to close all folds
autocmd Syntax c,cpp,h setlocal foldmethod=indent
autocmd Syntax c,cpp,h normal zR
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
" Open a quickfix window for the last search
nnoremap <silent> <leader>ls :execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>
" Align text
nnoremap <leader>Al :left<cr>
nnoremap <leader>Ac :center<cr>
nnoremap <leader>Ar :right<cr>
vnoremap <leader>Al :left<cr>
vnoremap <leader>Ac :center<cr>
vnoremap <leader>Ar :right<cr>
" Select line and ignore indentation
nnoremap vv ^vg_
" Source
vnoremap <leader>S y:execute @@<CR>
nnoremap <leader>S ^vg_y:execute @@<CR>
" Remap yank register to "
nnoremap "" "0"
" You Complete Me syntax config default
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
" Rust source path
let g:ycm_rust_src_path="/home//Code/rust/src/"
" Gundo
nnoremap <leader>u :GundoToggle<CR>
" Lower cmdline
set cmdheight=1
" Save when losing focus
au FocusLost * :wa<CR>
" Resize splits when the window is resized
au VimResized * :wincmd =
" Use sane regexes
nnoremap / /\v
vnoremap / /\v
" Jump to far left or right of line
noremap H ^
noremap L $
" Move to last non-blank character of line
vnoremap L g_
" Jump to last change
nnoremap gI `.
" Highlight last inserted text
nnoremap gV `[v`]
" Jump to far left or right of line in insert mode
inoremap <c-a> <esc>I
inoremap <c-e> <esc>A"`
" Set F2 to be the paste toggle
nnoremap <F2> :set invpaste paste? <CR>
set pastetoggle=<F2>
" Make zO recursively open whatever fold we're in, even if it's partially
" open.
nnoremap zO zczO
" Set working directory to current file
set autochdir
" Automatically indent
set autoindent
" Define what kind of backspacing is preferred
"indent allow backspacing over autoindent
"eol allow backspacing over line breaks (join lines)
"start allow backspacing over the start of insert; CTRL-W and CTRL-U
set backspace=indent,eol,start
" Always try to confirm
set confirm
" Copy the structure of the existing lines indent when autoindenting a new line.
set copyindent
" Remember up to 200 lines of history
set history=200
" Don't ring on error
set noerrorbells
" Case insensitive searches
set ignorecase
" Number of visual spaces per TAB
set tabstop=4
" Number of spaces in tab when editing
set softtabstop=4
" Number of columns text is indented with when reindenting using << or >>
set shiftwidth=4
" Tabs are spaces
set expandtab
" Show line numbers
set number
" Highlight current line
set cursorline
" Load filetype-specific indent files
filetype indent on
" Visual autocomplete for the command menu
set wildmenu
" Redraw only when we need to
set lazyredraw
" Highlight matching [{()}]
set showmatch
" Search as characters are entered
set incsearch
" Highlight matches
set hlsearch
" Disable swap files
set noswapfile
" Show the line and column number of the cursor position, separated by a comma.
set ruler
" No visual error bells
set t_vb=
" Use file names as title of terminal while editing
set title
" Turn off search highlight
noremap <silent> <leader>/ :nohlsearch<cr>:call clearmatches()<cr>
" Enable folding
set foldenable
" Open most folds by default
set foldlevelstart=10
" 10 nested fold max
set foldnestmax=10
" The spacebar opens and closes folds
nnoremap <space> za
vnoremap <space> za
" Fold based on indent level
set foldmethod=indent
" Use fold markers when editing vim files
au filetype vim set foldmethod=marker
" Enable modelines
set modeline
" Check final line for vim settings specific to file
set modelines=1
" Move vertically by visual line
" Won't skip over 'fake' part of visibly wrapped lines
nnoremap j gj
nnoremap k gk
" Pressing jk quickly will exit insert or visual mode
inoremap jk <ESC>
vnoremap jk <ESC>
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
" Save session (assortment of windows)
" Reopen vim with vim -S
nnoremap <leader>ss :mksession!<CR>
" Open ag.vim
nnoremap <leader>a :Ag<space>
" Use backups
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
" Check file change every 4 seconds ('CursorHold') and reload the buffer upon
" detecting change
set autoread
au CursorHold * checktime
" Fold navigation {{{
nnoremap <silent> <leader>zj :call NextClosedFold('j')<cr>
nnoremap <silent> <leader>zk :call NextClosedFold('k')<cr>
function! NextClosedFold(dir)
let cmd = 'norm!z' . a:dir
let view = winsaveview()
let [l0, l, open] = [0, view.lnum, 1]
while l != l0 && open
exe cmd
let [l0, l] = [l, line('.')]
let open = foldclosed(l) < 0
endwhile
if open
call winrestview(view)
endif
endfunction
"}}}
" Ultisnips and YCM {{{
set completeopt=menuone
let g:ycm_add_preview_to_completeopt = 0
let g:ycm_confirm_extra_conf = 0
" Prevent ultisnips from hijacking the enter key
let g:UltiSnipsExpandTrigger = "<nop>"
" In insert mode, if popup menu is visible, try to expand a snippet when enter
" is pressed,, otherwise send a normal enter keypress
inoremap <expr> <CR> pumvisible() ? "<C-R>=UltiSnips#ExpandSnippetOrJump()<CR>" : "\<CR>"
"}}}
" Unite.vim mappings {{{
" Enable Yank history
let g:unite_source_history_yank_enable=1
let g:unite_enable_start_insert=1
" File finding mappings
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#custom#source('file_rec/async','sorters','sorter_rank', )
let g:unite_enable_start_insert=1
let g:unite_source_history_yank_enable=1
let g:unite_prompt='» '
let g:unite_split_rule = 'botright'
if executable('ag')
let g:unite_source_grep_command='ag'
let g:unite_source_grep_default_opts='--nocolor --nogroup -S -C4'
let g:unite_source_grep_recursive_opt=''
endif
nnoremap <leader>L :<C-u>Unite -no-split -buffer-name=files file_rec/async:!<cr>
nnoremap <leader>f :<C-u>Unite -no-split -buffer-name=files<cr>
nnoremap <leader>r :<C-u>Unite -no-split -buffer-name=mru file_mru<cr>
nnoremap <leader>y :<C-u>Unite -no-split -buffer-name=yank history/yank<cr>
nnoremap <leader>e :<C-u>Unite -no-split -buffer-name=buffer buffer<cr>
nnoremap <leader>Ft :Unite file_rec/async -default-action=tabopen<CR>
nnoremap <leader>Fs :Unite file_rec/async -default-action=split<CR>
nnoremap <leader>Fv :Unite file_rec/async -default-action=vsplit<CR>
" Buffer switching
nnoremap <leader>ss :Unite -quick-match -auto-preview buffer<cr>
" Switch to the file and load it into the current window
nmap <silent> <Leader>of :FSHere<cr>
" Switch to the file and load it into the window on the right
nmap <silent> <Leader>ol :FSRight<cr>
" Switch to the file and load it into a new window split on the right
nmap <silent> <Leader>oL :FSSplitRight<cr>
" Switch to the file and load it into the window on the left
nmap <silent> <Leader>oh :FSLeft<cr>
" Switch to the file and load it into a new window split on the left
nmap <silent> <Leader>oH :FSSplitLeft<cr>
" Switch to the file and load it into the window above
nmap <silent> <Leader>ok :FSAbove<cr>
" Switch to the file and load it into a new window split above
nmap <silent> <Leader>oK :FSSplitAbove<cr>
" Switch to the file and load it into the window below
nmap <silent> <Leader>oj :FSBelow<cr>
" Switch to the file and load it into a new window split below
nmap <silent> <Leader>oJ :FSSplitBelow<cr>
" }}}
" Set the leader key to the spacebar
let mapleader = "\<SPACE>"
" Save the file
nnoremap <leader>fs :w<CR>
" Save all open files
nnoremap <leader>fS :w<CR>
" Jump to far left or right of line
noremap H ^
noremap L $
" Move to last non-blank character of line
vnoremap L g_
" Pressing jk quickly will exit insert or visual mode
inoremap jk <ESC>
vnoremap jk <ESC>
" Select line and ignore indentation
nnoremap vv ^vg_
" Remap yank register to "
nnoremap "" "0"
" Set the leader key to the spacebar
let mapleader = "\<SPACE>"
" Save the file
nnoremap <leader>fs :w<CR>
" Save all open files
nnoremap <leader>fS :w<CR>
" Jump to far left or right of line
noremap H ^
noremap L $
" Move to last non-blank character of line
vnoremap L g_
" Pressing jk quickly will exit insert or visual mode
inoremap jk <ESC>
vnoremap jk <ESC>
" Select line and ignore indentation
nnoremap vv ^vg_
" Remap yank register to "
nnoremap "" "0"
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git history-substring-search zsh-completions zsh-syntax-highlighting)
# User configuration
export PATH=$HOME/bin:/usr/local/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
alias emacs="emacsclientw -c -a ''"
  • To make a shortcut to run spacemacs instantly, starting the server if not started, make a shortcut to emacsclientw in the emacs bin folder, and give it the following arguments:

emacsclientw.exe -c -a "" and assign it the spacemacs icon.

  • The terminal dotfiles are meant to be used with babun which uses zshell and oh-my-zsh.

  • To install the vim plugin manager:

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment