c4bb62cd1c7f

Split vimrc
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 03 Oct 2023 13:15:18 -0400
parents fdb4a84069f3
children e7338d0c9900
branches/tags (none)
files .hgsubstate bin/bootstrap.sh bin/csvconcat bin/heic-conv-all fish/config.fish remote/bootstrap.sh remote/vim-colors remote/vimrc remote/vimrc-remote-local stumpwmrc vim/ftplugin/snakemake/folding.vim vim/vimrc vim/vimrc-minimal

Changes

--- a/.hgsubstate	Mon Sep 18 08:57:48 2023 -0400
+++ b/.hgsubstate	Tue Oct 03 13:15:18 2023 -0400
@@ -3,7 +3,7 @@
 b6a8b49e2173ba5a1b34d00e68e0ed8addac3ebd vim/bundle/abolish
 a16a9b63eb85cc0960a7f25c54647ac1f99f3360 vim/bundle/ack
 599e1bb1aee98e563132553cf8b7bc32cb402b75 vim/bundle/badwolf
-24f6d94dd03ba0fdc703265fe281f70cf2b45ba6 vim/bundle/boxdraw
+b7f789f305b1c5b0b4623585e0f10adb417f2966 vim/bundle/boxdraw
 b542a7bc4d9bc5da8fb12e110fe7975131fb57a4 vim/bundle/clam
 8295187ea1210138c0b171d8e3ec3569936f4c1a vim/bundle/commentary
 c6d1fc5e58d689bfb104ff336aeb89d9ef1b48e2 vim/bundle/ctrlp
--- a/bin/bootstrap.sh	Mon Sep 18 08:57:48 2023 -0400
+++ b/bin/bootstrap.sh	Tue Oct 03 13:15:18 2023 -0400
@@ -58,6 +58,7 @@
 ensure_link "src/dotfiles/stumpwm/local-share-stumpwm" ".local/share/stumpwm"
 ensure_link "src/dotfiles/vim"                         ".vim"
 ensure_link "src/dotfiles/vim/vimrc"                   ".vimrc"
+ensure_link "src/dotfiles/vim/vimrc-minimal"           ".vimrc-minimal"
 ensure_link "src/dotfiles/w3m-keymap"                  ".w3m/keymap"
 ensure_link "src/dotfiles/w3m-config"                  ".w3m/config"
 ensure_link "src/dotfiles/weechat"                     ".weechat"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/csvconcat	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+head -n1 "$1"
+tail --quiet -n +2 "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/heic-conv-all	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# from https://github.com/lokarithm/HandyBashCommands/blob/main/heic-converter/heic-converter.sh
+
+if ! command -v heif-convert &> /dev/null
+then
+    echo "heif-convert COMMAND could not be found."
+    echo "Please install 'libheif-examples' first."
+    echo "To install 'libheif-examples', run the following command:"
+    echo "  sudo apt install libheif-examples"
+    exit
+else
+    fileExtension="jpg"
+
+    while getopts :p flag; do
+        case ${flag} in
+            # -p flag: convert heic files to png format instead
+            p) fileExtension="png"
+            ;;
+        esac
+    done
+
+    start_time=$(date +%s.%3N)
+
+    # look for files in current path that contains ".heic" in a case-insensitive manner
+    for file in $( ls | grep -iF ".heic")
+    do
+        echo "Converting file: $file"
+
+        # file extension of current file
+        currFileExtension=`echo $file | grep -iFo "heic"`
+        sedCommand="s/${currFileExtension}/${fileExtension}/g;s/HEIC/${fileExtension}/g"
+
+        #replace original file name by changing the extension from heic to jpg
+        outputFileName=`echo $file | sed -e $sedCommand`
+        heif-convert $file $outputFileName
+    done
+
+    end_time=$(date +%s.%3N)
+
+    elapsed=$(echo "scale=3; $end_time - $start_time" | bc)
+    echo -e "\nElapsed time: \e[32m$elapsed \e[39mmilliseconds."
+
+fi
--- a/fish/config.fish	Mon Sep 18 08:57:48 2023 -0400
+++ b/fish/config.fish	Tue Oct 03 13:15:18 2023 -0400
@@ -10,6 +10,7 @@
 function em; nvim ~/.mutt/muttrc; end
 function es; pushd ~/src/stumpwm; e ~/.stumpwmrc; popd; end
 function ev; nvim ~/.vimrc; end
+function evm; nvim ~/.vimrc-minimal; end
 function eff; nvim ~/.config/fish/functions; end
 function efh; nvim ~/.local/share/fish/fish_history; end # I have visited https://github.com/fish-shell/fish-shell/issues/862 nine thousand times and I'm fucking sick of opening a web browser to figure out where the fuck fish keeps its equivalent of ~/.bash_history
 function essh; nvim ~/.ssh/config; end
--- a/remote/bootstrap.sh	Mon Sep 18 08:57:48 2023 -0400
+++ b/remote/bootstrap.sh	Tue Oct 03 13:15:18 2023 -0400
@@ -22,6 +22,7 @@
 mkdir -p ~/.config/fish
 mkdir -p ~/.config/nvim
 mkdir -p ~/bin
+mkdir -p ~/.vim
 
 ensure_link "src/dotfiles/gitconfig"     ".gitconfig"
 ensure_link "src/dotfiles/gitignore"     ".gitignore"
@@ -30,3 +31,6 @@
 ensure_link "src/dotfiles/ffignore"      ".ffignore"
 ensure_link "src/dotfiles/config.fish"   ".config/fish/config.fish"
 ensure_link "src/dotfiles/hushlogin"     ".hushlogin"
+ensure_link "src/dotfiles/vimrc"         ".vimrc"
+ensure_link "src/dotfiles/vim-colors"    ".vim/colors"
+ensure_link "src/dotfiles/vimrc-remote-local" ".vimrc_remote_local"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remote/vim-colors	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,1 @@
+../vim/bundle/badwolf/colors/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remote/vimrc	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,1 @@
+../vim/vimrc-minimal
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remote/vimrc-remote-local	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,1 @@
+colorscheme badwolf
--- a/stumpwmrc	Mon Sep 18 08:57:48 2023 -0400
+++ b/stumpwmrc	Tue Oct 03 13:15:18 2023 -0400
@@ -769,6 +769,7 @@
   ("H-F8" "screen-external"))
 
 (define-top-keys ;; layout
+  ("s-H-o" "only")
   ("s-H-t" "restore-from-file thirds")
   ("s-H-m" "restore-from-file dev")
   ("s-H-s" "restore-from-file streaming")
--- a/vim/ftplugin/snakemake/folding.vim	Mon Sep 18 08:57:48 2023 -0400
+++ b/vim/ftplugin/snakemake/folding.vim	Tue Oct 03 13:15:18 2023 -0400
@@ -9,16 +9,25 @@
 
     let thisline = getline(a:lnum)
 
-    " blank lines end folds
+    " two blank lines end folds
     if thisline =~? '\v^\s*$'
+        if ActualPreviousLineNonblank(a:lnum)
+            return "="
+        endif
         return '-1'
     " start fold on top level rules or python objects
     elseif thisline =~? '\v^(rule|def|checkpoint|class)'
         return ">1"
     elseif thisline =~? '\v^\S'
-        if PreviousLineIndented(a:lnum) && NextRuleIndented(a:lnum)
-            return ">1"
+        if IsEmpty(a:lnum+1)
+            if IsEmpty(a:lnum+2)
+                return ">1"
+            endif
         endif
+        return "0"
+        " if PreviousLineIndented(a:lnum) && NextRuleIndented(a:lnum)
+        "     return ">1"
+        " endif
     endif
 
     return "="
@@ -59,3 +68,35 @@
 
     return 0
 endfunction
+
+function! ActualPreviousLineNonblank(lnum)
+    let current = a:lnum - 1
+
+    if current >= 1
+        let thisline = getline(current)
+        if thisline =~? '\v^\s*\S'
+            return 1
+        else
+            return 0
+        endif
+    endwhile
+
+    return 0
+endfunction
+
+function! IsEmpty(lnum)
+    let numlines = line('$')
+    if a:lnum > numlines
+        return 0
+    elseif a:lnum < 1
+        return 0
+    else
+        let thisline = getline(a:lnum)
+        if thisline =~? '\v^$'
+            return 1
+        else
+            return 0
+        endif
+    endif
+endfunction
+
--- a/vim/vimrc	Mon Sep 18 08:57:48 2023 -0400
+++ b/vim/vimrc	Tue Oct 03 13:15:18 2023 -0400
@@ -2,8 +2,9 @@
 " Author: Steve Losh <steve@stevelosh.com>
 " Source: https://hg.stevelosh.com/dotfiles/file/tip/vim/vimrc
 
+" See also vimrc-minimal for the rest of this.
+
 " Preamble ---------------------------------------------------------------- {{{
-"
 set shell=/bin/bash\ --login
 
 filetype off
@@ -12,39 +13,12 @@
 set nocompatible
 
 " }}}
-" Basic options ----------------------------------------------------------- {{{
-
-set modelines=0
-set autoindent
-set showmode
-set showcmd
-set hidden
-set visualbell
-set ttyfast
-set ruler
-set backspace=indent,eol,start
-set nonumber
-set norelativenumber
-set laststatus=2
-set history=1000
-set undofile
-set undoreload=10000
-set list
-set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮
-set lazyredraw
-set matchtime=3
-set showbreak=↪
-set splitbelow
-set splitright
-set autowrite
-set autoread
-set shiftround
-set title
-set linebreak
-set colorcolumn=+1
-set diffopt+=vertical
-
-" Spelling
+" Load Minimal ------------------------------------------------------------ {{{
+
+source ~/.vimrc-minimal
+
+" }}}
+" Spelling ---------------------------------------------------------------- {{{
 "
 " There are three dictionaries I use for spellchecking:
 "
@@ -63,136 +37,9 @@
 set spellfile=~/.vim/custom-dictionary.utf-8.add,~/.vim-local-dictionary.utf-8.add
 nnoremap zG 2zg
 
-" Don't try to highlight lines longer than 500 characters.
-set synmaxcol=500
-
-" Time out on key codes but not mappings.
-" Basically this makes terminal Vim work sanely.
-set notimeout
-set ttimeout
-set ttimeoutlen=10
-
-" Make Vim able to edit crontab files again.
-set backupskip=/tmp/*,/private/tmp/*"
-
-" Better Completion
-set complete=.,w,b,u,t
-set completeopt=longest,menuone
-inoremap <c-o> <c-x><c-o>
-
-" Save when losing focus
-au FocusLost * :silent! wall
-
-" Leader
-let mapleader = ","
-let maplocalleader = "\\"
-
-" Cursorline {{{
-" Only show cursorline in the current window and in normal mode.
-
-augroup cline
-    au!
-    au WinLeave,InsertEnter * set nocursorline
-    au WinEnter,InsertLeave * set cursorline
-augroup END
-
 " }}}
-" cpoptions+=J, dammit {{{
-
-" Something occasionally removes this.  If I manage to find it I'm going to
-" comment out the line and replace all its characters with 'FUCK'.
-augroup twospace
-    au!
-    au BufRead * :set cpoptions+=J
-augroup END
-
-" }}}
-" Trailing whitespace {{{
-" Only shown when not in insert mode so I don't go insane.
-
-augroup trailing
-    au!
-    au InsertEnter * :set listchars-=trail:⌴
-    au InsertLeave * :set listchars+=trail:⌴
-augroup END
-
-" }}}
-" Wildmenu completion {{{
-
-set wildmenu
-set wildmode=list:longest
-
-set wildignore+=.hg,.git,.svn                    " Version control
-set wildignore+=*.aux,*.out,*.toc                " LaTeX intermediate files
-set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg   " binary images
-set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
-set wildignore+=*.spl                            " compiled spelling word lists
-set wildignore+=*.sw?                            " Vim swap files
-set wildignore+=*.DS_Store                       " OSX bullshit
-
-set wildignore+=*.luac                           " Lua byte code
-
-set wildignore+=migrations                       " Django migrations
-set wildignore+=*.pyc                            " Python byte code
-
-set wildignore+=*.orig                           " Merge resolution files
-
-set wildignore+=*.fasl                           " Lisp FASLs
-set wildignore+=*.dx64fsl                        " CCL
-set wildignore+=*.lx64fsl                        " CCL
-
-" }}}
-" Line Return {{{
-
-" Make sure Vim returns to the same line when you reopen a file.
-" Thanks, Amit
-augroup line_return
-    au!
-    au BufReadPost *
-        \ if line("'\"") > 0 && line("'\"") <= line("$") |
-        \     execute 'normal! g`"zvzz' |
-        \ endif
-augroup END
-
-" }}}
-" Tabs, spaces, wrapping {{{
-
-set tabstop=8
-set shiftwidth=4
-set softtabstop=4
-set expandtab
-set wrap
-set textwidth=80
-set formatoptions=qrn1j
-set colorcolumn=+1
-
-" }}}
-" Backups {{{
-
-set backup                        " enable backups
-set noswapfile                    " it's 2013, Vim.
-
-set undodir=~/.vim/tmp/undo//     " undo files
-set backupdir=~/.vim/tmp/backup// " backups
-set directory=~/.vim/tmp/swap//   " swap files
-
-" Make those folders automatically 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
-
-" }}}
-" Color scheme {{{
-
-syntax on
-set termguicolors
-set background=dark
+" Color scheme ------------------------------------------------------------ {{{
+
 let g:badwolf_tabline = 2
 let g:badwolf_html_link_underline = 0
 colorscheme goodwolf
@@ -208,80 +55,8 @@
 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
 
 " }}}
-
-" }}}
-" Abbreviations & Digraphs ------------------------------------------------ {{{
-
-iabbrev todo TODO
-
-silent! digr -. 8230 "U+2026=…    HORIZONTAL ELLIPSIS
-silent! digr !, 8816 "U+2270=≰    NEITHER LESS-THAN NOR EQUAL TO
-silent! digr !. 8817 "U+2271=≱    NEITHER GREATER-THAN NOR EQUAL TO
-silent! digr es 8337 "U+2091=ₑ    SUBSCRIPT E
-silent! digr xs 8339 "U+2093=ₓ    SUBSCRIPT X
-silent! digr ls 8343 "U+2097=ₗ    SUBSCRIPT L
-silent! digr ms 8344 "U+2098=ₗ    SUBSCRIPT M
-silent! digr ns 8345 "U+2099=ₙ    SUBSCRIPT N
-silent! digr ps 8346 "U+209A=ₚ    SUBSCRIPT P
-silent! digr ss 8347 "U+209B=ₛ    SUBSCRIPT S
-silent! digr ts 8348 "U+209C=ₜ    SUBSCRIPT T
-silent! digr >< 8652 "U+21cc=⇌    EQUILIBRIUM
-silent! digr o+ 8853 "U+2295=⊕    CIRCLED PLUS
-silent! digr -^ 8593 "U+2191=↑    UPWARDS ARROW
-
-silent! digr -- 8212 "U+2014=—    EM DASH
-
-silent! digr // 9585 "U+2571=╱    BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
-silent! digr \\ 9586 "U+2572=╲    BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
-
-silent! digr \|\| 8214 "U+2016=‖  DOUBLE VERTICAL LINE
-
-silent! digr ~~ 8967  "U+2307=⌇   WAVY LINE
-
-" }}}
 " Convenience mappings ---------------------------------------------------- {{{
 
-" Fuck you, help key.
-noremap  <F1> :checktime<cr>
-inoremap <F1> <esc>:checktime<cr>
-
-" Stop it, hash key.
-inoremap # X<BS>#
-
-" Kill window
-nnoremap K :q<cr>
-
-" Save
-nnoremap s :w<cr>
-
-" Man
-nnoremap M K
-
-" Clean up windows
-nnoremap - :wincmd =<cr>
-
-" Toggle line numbers
-nnoremap <leader>n :setlocal number!<cr>
-
-" Sort lines
-nnoremap <leader>s vip:sort<cr>
-vnoremap <leader>s :sort<cr>
-
-" Tabs
-nnoremap <leader>( :tabprev<cr>
-nnoremap <leader>) :tabnext<cr>
-
-" My garbage brain can't ever remember digraph codes
-inoremap <c-k><c-k> <esc>:help digraph-table<cr>
-
-" Wrap
-" mnemonic: less' -S command/option
-nnoremap <leader>S :set wrap!<cr>
-
-" Inserting blank lines
-" I never use the default behavior of <cr> and this saves me a keystroke...
-nnoremap <cr> o<esc>
-
 " Copying/pasting text to the system clipboard.
 noremap  <leader>p "+p
 vnoremap <leader>y "+y
@@ -296,21 +71,6 @@
 nnoremap <leader>o "zyiW:call Open(@z)<cr>
 vnoremap <leader>o "zy:call Open(@z)<cr>
 
-" Delete to black hole register
-nnoremap dD "_dd
-vnoremap D "_d
-
-" Yank to end of line
-nnoremap Y y$
-
-" Reselect last-pasted text
-nnoremap gv `[v`]
-
-" I constantly hit "u" in visual mode when I mean to "y". Use "gu" for those rare occasions.
-" From https://github.com/henrik/dotfiles/blob/master/vim/config/mappings.vim
-vnoremap u <nop>
-vnoremap gu u
-
 " Rebuild Ctags (mnemonic RC -> CR -> <cr>)
 nnoremap <leader><cr> :silent !myctags >/dev/null 2>&1 &<cr>:redraw!<cr>
 
@@ -319,164 +79,9 @@
                         \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
                         \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
 
-" Clean trailing whitespace
-nnoremap <leader>ww mz:%s/\s\+$//<cr>:let @/=''<cr>`z
-
 " Send visual selection to paste.stevelosh.com
 vnoremap <leader>P :w !pb && open `pbpaste`<cr>
 
-" Select entire buffer
-nnoremap vaa ggvGg_
-nnoremap Vaa ggVG
-
-" Fix from spellcheck
-" I can never remember if it's zg or z=, and the wrong one adds the word to
-" the DB (lol), so fuck it, just add an easier mapping.
-nnoremap zz z=
-nnoremap z= :echo "use zz you idiot"<cr>
-
-" "Uppercase word" mapping.
-"
-" This mapping allows you to press <c-u> in insert mode to convert the current
-" word to uppercase.  It's handy when you're writing names of constants and
-" don't want to use Capslock.
-"
-" To use it you type the name of the constant in lowercase.  While your
-" cursor is at the end of the word, press <c-u> to uppercase it, and then
-" continue happily on your way:
-"
-"                            cursor
-"                            v
-"     max_connections_allowed|
-"     <c-u>
-"     MAX_CONNECTIONS_ALLOWED|
-"                            ^
-"                            cursor
-"
-" It works by exiting out of insert mode, recording the current cursor location
-" in the z mark, using gUiw to uppercase inside the current word, moving back to
-" the z mark, and entering insert mode again.
-"
-" Note that this will overwrite the contents of the z mark.  I never use it, but
-" if you do you'll probably want to use another mark.
-inoremap <C-u> <esc>mzgUiw`za
-
-" Panic Button
-nnoremap <f9> mzggg?G`z
-
-" zt is okay for putting something at the top of the screen, but when I'm
-" writing prose I often want to put something at not-quite-the-top of the
-" screen.  zh is "zoom to head level"
-nnoremap zh mzzt10<c-u>`z
-
-" Diffoff
-nnoremap <leader>D :diffoff!<cr>
-
-" Formatting, TextMate-style
-nnoremap Q gqip
-vnoremap Q gq
-
-" Reformat line.
-" I never use l as a macro register anyway.
-nnoremap ql gqq
-
-" Indent/dedent/autoindent what you just pasted.
-nnoremap <lt>> V`]<
-nnoremap ><lt> V`]>
-nnoremap =- V`]=
-
-" Keep the cursor in place while joining lines
-nnoremap J mzJ`z
-
-" Join an entire paragraph.
-"
-" Useful for writing GitHub comments in actual Markdown and then translating it
-" to their bastardized version of Markdown.
-nnoremap <leader>j mzvipJ`z
-
-" Split line (sister to [J]oin lines)
-" The normal use of S is covered by cc, so don't worry about shadowing it.
-nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
-
-" Substitute
-nnoremap <c-s> :%s/
-vnoremap <c-s> :s/
-
-" Marks and Quotes
-noremap ' `
-noremap æ '
-noremap ` <C-^>
-
-" Select (charwise) the contents of the current line, excluding indentation.
-" Great for pasting Python lines into REPLs.
-nnoremap vv ^vg_
-
-" Typos
-command! -bang E e<bang>
-command! -bang Q q<bang>
-command! -bang W w<bang>
-command! -bang QA qa<bang>
-command! -bang Qa qa<bang>
-command! -bang Wa wa<bang>
-command! -bang WA wa<bang>
-command! -bang Wq wq<bang>
-command! -bang WQ wq<bang>
-command! -bang Wqa wqa<bang>
-
-" Unfuck my screen
-nnoremap U :syntax sync fromstart<cr>:redraw!<cr>
-
-" Zip Right
-"
-" Moves the character under the cursor to the end of the line.  Handy when you
-" have something like:
-"
-"     foo
-"
-" And you want to wrap it in a method call, so you type:
-"
-"     println()foo
-"
-" Once you hit escape your cursor is on the closing paren, so you can 'zip' it
-" over to the right with this mapping.
-"
-" This should preserve your last yank/delete as well.
-nnoremap zl :let @z=@"<cr>x$p:let @"=@z<cr>
-
-" Indent from insert mode
-" has to be imap because we want to be able to use the "go-indent" mapping
-imap <c-l> <c-o>gi
-
-" Diff Navigation
-nnoremap ]d ]c
-nnoremap [d [c
-
-" Typo navigation
-nnoremap ]z ]S
-nnoremap [z [S
-nnoremap ]Z ]Sz=
-nnoremap [Z [Sz=
-
-" Header Lines
-nnoremap <leader>- o<esc>80a-<esc>kJ079lD
-
-" Insert Mode Completion {{{
-
-inoremap <c-f> <c-x><c-f>
-inoremap <c-]> <c-x><c-]>
-inoremap <c-l> <c-x><c-l>
-
-" }}}
-
-" Window Resizing {{{
-" right/up : bigger
-" left/down : smaller
-nnoremap <m-right> :vertical resize +3<cr>
-nnoremap <m-left> :vertical resize -3<cr>
-nnoremap <m-up> :resize +3<cr>
-nnoremap <m-down> :resize -3<cr>
-" }}}
-
 " }}}
 " Quick editing ----------------------------------------------------------- {{{
 
@@ -492,7 +97,8 @@
 nnoremap <leader>eln :vsplit ~/lab/README.markdown<cr>
 nnoremap <leader>eq :vsplit ~/Dropbox/quotes.txt<cr>Gzz
 nnoremap <leader>et :vsplit ~/.tmux.conf<cr>
-nnoremap <leader>ev :vsplit ~/.vimrc<cr>
+nnoremap <leader>evf :vsplit ~/.vimrc<cr>
+nnoremap <leader>evm :vsplit ~/.vimrc-minimal<cr>
 
 " }}}
 " Status Line ------------------------------------------------------------- {{{
@@ -604,189 +210,6 @@
 " set statusline+=%=
 
 " }}}
-" Searching and movement -------------------------------------------------- {{{
-
-" Use sane regexes.
-nnoremap / /\v
-vnoremap / /\v
-
-set ignorecase
-set smartcase
-set incsearch
-set showmatch
-set hlsearch
-set gdefault
-
-set scrolloff=5
-set sidescroll=1
-set sidescrolloff=10
-
-set virtualedit+=block
-
-noremap <silent> <leader><space> :noh<cr>:call clearmatches()<cr>
-
-runtime macros/matchit.vim
-map <tab> %
-silent! unmap [%
-silent! unmap ]%
-
-" Made D behave
-nnoremap D d$
-
-" Don't move on *
-" I'd use a function for this but Vim clobbers the last search when you're in
-" a function so fuck it, practicality beats purity.
-nnoremap <silent> * :let stay_star_view = winsaveview()<cr>*:call winrestview(stay_star_view)<cr>
-
-" Jumping to tags.
-"
-" Basically, <c-]> jumps to tags (like normal) and <c-\> opens the tag in a new
-" split instead.
-"
-" Both of them will align the destination line to the upper middle part of the
-" screen.  Both will pulse the cursor line so you can see where the hell you
-" are.  <c-\> will also fold everything in the buffer and then unfold just
-" enough for you to see the destination line.
-"
-function! JumpTo(jumpcommand)
-    execute a:jumpcommand
-    call FocusLine()
-    Pulse
-endfunction
-function! JumpToInSplit(jumpcommand)
-    execute "normal! \<c-w>v"
-    execute a:jumpcommand
-    Pulse
-endfunction
-
-function! JumpToTag()
-    call JumpTo("normal! \<c-]>")
-endfunction
-function! JumpToTagInSplit()
-    call JumpToInSplit("normal \<c-]>")
-endfunction
-
-nnoremap <c-]> :silent! call JumpToTag()<cr>
-nnoremap <c-\> :silent! call JumpToTagInSplit()<cr>
-
-" Keep search matches in the middle of the window.
-nnoremap n nzzzv
-nnoremap N Nzzzv
-
-" Same when jumping around
-nnoremap g; g;zz
-nnoremap g, g,zz
-nnoremap <c-o> <c-o>zz
-
-" Easier to type, and I never use the default behavior.
-noremap H ^
-noremap L $
-vnoremap L g_
-
-" Heresy
-inoremap <c-a> <esc>I
-inoremap <c-e> <esc>A
-cnoremap <c-a> <home>
-cnoremap <c-e> <end>
-
-" go indent
-nnoremap gi mzVap=`z
-nnoremap gI mzgg=G`z
-
-" Fix linewise visual selection of various text objects
-nnoremap VV V
-nnoremap Vit vitVkoj
-nnoremap Vat vatV
-nnoremap Vab vabV
-nnoremap VaB vaBV
-
-" Directional Keys {{{
-
-" It's 2013.
-noremap j gj
-noremap k gk
-noremap gj j
-noremap gk k
-
-" Easy buffer navigation
-noremap <C-h> <C-w>h
-noremap <C-j> <C-w>j
-noremap <C-k> <C-w>k
-noremap <C-l> <C-w>l
-
-noremap <leader>v <C-w>v
-
-" }}}
-" Visual Mode */# from Scrooloose {{{
-
-function! s:VSetSearch()
-  let temp = @@
-  norm! gvy
-  let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
-  let @@ = temp
-endfunction
-
-vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o>
-vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o>
-
-" }}}
-" List navigation {{{
-
-nnoremap <left>  :cprev<cr>zvzz
-nnoremap <right> :cnext<cr>zvzz
-nnoremap <up>    :lprev<cr>zvzz
-nnoremap <down>  :lnext<cr>zvzz
-
-" }}}
-
-" }}}
-" Folding ----------------------------------------------------------------- {{{
-
-set foldlevelstart=0
-
-" Space to toggle folds.
-nnoremap <Space> za
-vnoremap <Space> za
-
-" Make zO recursively open whatever fold we're in, even if it's partially open.
-nnoremap zO zczO
-
-" "Focus" the current line.  Basically:
-"
-" 1. Close all folds.
-" 2. Open just the folds containing the current line.
-" 3. Move the line to a bit (25 lines) down from the top of the screen.
-" 4. Pulse the line.
-"
-" This mapping wipes out the z mark, which I never use.
-"
-" I use :sus for the rare times I want to actually background Vim.
-function! FocusLine()
-    let oldscrolloff = &scrolloff
-    set scrolloff=0
-    execute "keepjumps normal! mzzMzvzt25\<c-y>`z:Pulse\<cr>"
-    let &scrolloff = oldscrolloff
-endfunction
-nnoremap <c-z> :call FocusLine()<cr>
-
-function! MyFoldText() " {{{
-    let line = getline(v:foldstart)
-
-    let nucolwidth = &fdc + &number * &numberwidth
-    let windowwidth = winwidth(0) - nucolwidth - 3
-    let foldedlinecount = v:foldend - v:foldstart
-
-    " expand tabs into spaces
-    let onetab = strpart('          ', 0, &tabstop)
-    let line = substitute(line, '\t', onetab, 'g')
-
-    let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
-    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
-    return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
-endfunction " }}}
-set foldtext=MyFoldText()
-
-" }}}
 " Filetype-specific ------------------------------------------------------- {{{
 
 " Assembly {{{
@@ -2558,68 +1981,6 @@
 " }}}
 
 " }}}
-" Text objects ------------------------------------------------------------ {{{
-
-" Folds {{{
-
-onoremap if :<c-u>normal! [zv]z<cr>
-onoremap af :<c-u>normal! [zV]z<cr>
-vnoremap if :<c-u>normal! ]zv[z<cr>
-vnoremap af :<c-u>normal! ]zV[z<cr>
-
-" }}}
-" Shortcut for [] {{{
-
-onoremap ir i[
-onoremap ar a[
-vnoremap ir i[
-vnoremap ar a[
-
-" }}}
-" Numbers {{{
-
-" Motion for numbers.  Great for CSS.  Lets you do things like this:
-"
-" margin-top: 200px; -> daN -> margin-top: px;
-"              ^                          ^
-" TODO: Handle floats.
-
-onoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
-xnoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
-onoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
-xnoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
-onoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
-xnoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
-
-function! s:NumberTextObject(whole)
-    let num = '\v[0-9]'
-
-    " If the current char isn't a number, walk forward.
-    while getline('.')[col('.') - 1] !~# num
-        normal! l
-    endwhile
-
-    " Now that we're on a number, start selecting it.
-    normal! v
-
-    " If the char after the cursor is a number, select it.
-    while getline('.')[col('.')] =~# num
-        normal! l
-    endwhile
-
-    " If we want an entire word, flip the select point and walk.
-    if a:whole
-        normal! o
-
-        while col('.') > 1 && getline('.')[col('.') - 2] =~# num
-            normal! h
-        endwhile
-    endif
-endfunction
-
-" }}}
-
-" }}}
 " Mini-plugins ------------------------------------------------------------ {{{
 " Stuff that should probably be broken out into plugins, but hasn't proved to be
 " worth the time to do so just yet.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/vimrc-minimal	Tue Oct 03 13:15:18 2023 -0400
@@ -0,0 +1,667 @@
+" .vimrc-minimal
+" Author: Steve Losh <steve@stevelosh.com>
+" Source: https://hg.stevelosh.com/dotfiles/file/tip/vim/vimrc
+
+" A minimal subset of my vimrc settings, suitable for syncing on its own to
+" a server so I have some basic settings, but don't have to install the whole
+" hog.
+
+" Preamble ---------------------------------------------------------------- {{{
+
+set shell=/bin/bash\ --login
+
+" }}}
+" Basic options ----------------------------------------------------------- {{{
+
+set modelines=0
+set autoindent
+set showmode
+set showcmd
+set hidden
+set visualbell
+set ttyfast
+set ruler
+set backspace=indent,eol,start
+set nonumber
+set norelativenumber
+set laststatus=2
+set history=1000
+set undofile
+set undoreload=10000
+set list
+set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮
+set lazyredraw
+set matchtime=3
+set showbreak=↪
+set splitbelow
+set splitright
+set autowrite
+set autoread
+set shiftround
+set title
+set linebreak
+set colorcolumn=+1
+set diffopt+=vertical
+
+" Don't try to highlight lines longer than 500 characters.
+set synmaxcol=500
+
+" Time out on key codes but not mappings.
+" Basically this makes terminal Vim work sanely.
+set notimeout
+set ttimeout
+set ttimeoutlen=10
+
+" Make Vim able to edit crontab files again.
+set backupskip=/tmp/*,/private/tmp/*"
+
+" Better Completion
+set complete=.,w,b,u,t
+set completeopt=longest,menuone
+inoremap <c-o> <c-x><c-o>
+
+" Save when losing focus
+au FocusLost * :silent! wall
+
+" Leader
+let mapleader = ","
+let maplocalleader = "\\"
+
+" Cursorline {{{
+" Only show cursorline in the current window and in normal mode.
+
+augroup cline
+    au!
+    au WinLeave,InsertEnter * set nocursorline
+    au WinEnter,InsertLeave * set cursorline
+augroup END
+
+" }}}
+" cpoptions+=J, dammit {{{
+
+" Something occasionally removes this.  If I manage to find it I'm going to
+" comment out the line and replace all its characters with 'FUCK'.
+augroup twospace
+    au!
+    au BufRead * :set cpoptions+=J
+augroup END
+
+" }}}
+" Trailing whitespace {{{
+" Only shown when not in insert mode so I don't go insane.
+
+augroup trailing
+    au!
+    au InsertEnter * :set listchars-=trail:⌴
+    au InsertLeave * :set listchars+=trail:⌴
+augroup END
+
+" }}}
+" Wildmenu completion {{{
+
+set wildmenu
+set wildmode=list:longest
+
+set wildignore+=.hg,.git,.svn                    " Version control
+set wildignore+=*.aux,*.out,*.toc                " LaTeX intermediate files
+set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg   " binary images
+set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
+set wildignore+=*.spl                            " compiled spelling word lists
+set wildignore+=*.sw?                            " Vim swap files
+set wildignore+=*.DS_Store                       " OSX bullshit
+
+set wildignore+=*.luac                           " Lua byte code
+
+set wildignore+=migrations                       " Django migrations
+set wildignore+=*.pyc                            " Python byte code
+
+set wildignore+=*.orig                           " Merge resolution files
+
+set wildignore+=*.fasl                           " Lisp FASLs
+set wildignore+=*.dx64fsl                        " CCL
+set wildignore+=*.lx64fsl                        " CCL
+
+" }}}
+" Line Return {{{
+
+" Make sure Vim returns to the same line when you reopen a file.
+" Thanks, Amit
+augroup line_return
+    au!
+    au BufReadPost *
+        \ if line("'\"") > 0 && line("'\"") <= line("$") |
+        \     execute 'normal! g`"zvzz' |
+        \ endif
+augroup END
+
+" }}}
+" Tabs, spaces, wrapping {{{
+
+set tabstop=8
+set shiftwidth=4
+set softtabstop=4
+set expandtab
+set wrap
+set textwidth=80
+set formatoptions=qrn1j
+set colorcolumn=+1
+
+" }}}
+" Backups {{{
+
+set backup                        " enable backups
+set noswapfile                    " it's 2013, Vim.
+
+set undodir=~/.vim/tmp/undo//     " undo files
+set backupdir=~/.vim/tmp/backup// " backups
+set directory=~/.vim/tmp/swap//   " swap files
+
+" Make those folders automatically 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
+
+" }}}
+" Color scheme {{{
+
+syntax on
+set termguicolors
+set background=dark
+
+" }}}
+
+" }}}
+" Abbreviations & Digraphs ------------------------------------------------ {{{
+
+iabbrev todo TODO
+
+silent! digr -. 8230 "U+2026=…    HORIZONTAL ELLIPSIS
+silent! digr !, 8816 "U+2270=≰    NEITHER LESS-THAN NOR EQUAL TO
+silent! digr !. 8817 "U+2271=≱    NEITHER GREATER-THAN NOR EQUAL TO
+silent! digr es 8337 "U+2091=ₑ    SUBSCRIPT E
+silent! digr xs 8339 "U+2093=ₓ    SUBSCRIPT X
+silent! digr ls 8343 "U+2097=ₗ    SUBSCRIPT L
+silent! digr ms 8344 "U+2098=ₗ    SUBSCRIPT M
+silent! digr ns 8345 "U+2099=ₙ    SUBSCRIPT N
+silent! digr ps 8346 "U+209A=ₚ    SUBSCRIPT P
+silent! digr ss 8347 "U+209B=ₛ    SUBSCRIPT S
+silent! digr ts 8348 "U+209C=ₜ    SUBSCRIPT T
+silent! digr >< 8652 "U+21cc=⇌    EQUILIBRIUM
+silent! digr o+ 8853 "U+2295=⊕    CIRCLED PLUS
+silent! digr -^ 8593 "U+2191=↑    UPWARDS ARROW
+
+silent! digr -- 8212 "U+2014=—    EM DASH
+
+silent! digr // 9585 "U+2571=╱    BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
+silent! digr \\ 9586 "U+2572=╲    BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
+
+silent! digr \|\| 8214 "U+2016=‖  DOUBLE VERTICAL LINE
+
+silent! digr ~~ 8967  "U+2307=⌇   WAVY LINE
+
+" }}}
+" Convenience mappings ---------------------------------------------------- {{{
+
+" Fuck you, help key.
+noremap  <F1> :checktime<cr>
+inoremap <F1> <esc>:checktime<cr>
+
+" Stop it, hash key.
+inoremap # X<BS>#
+
+" Kill window
+nnoremap K :q<cr>
+
+" Save
+nnoremap s :w<cr>
+
+" Man
+nnoremap M K
+
+" Clean up windows
+nnoremap - :wincmd =<cr>
+
+" Toggle line numbers
+nnoremap <leader>n :setlocal number!<cr>
+
+" Sort lines
+nnoremap <leader>s vip:sort<cr>
+vnoremap <leader>s :sort<cr>
+
+" Tabs
+nnoremap <leader>( :tabprev<cr>
+nnoremap <leader>) :tabnext<cr>
+
+" My garbage brain can't ever remember digraph codes
+inoremap <c-k><c-k> <esc>:help digraph-table<cr>
+
+" Wrap
+" mnemonic: less' -S command/option
+nnoremap <leader>S :set wrap!<cr>
+
+" Inserting blank lines
+" I never use the default behavior of <cr> and this saves me a keystroke...
+nnoremap <cr> o<esc>
+
+" Delete to black hole register
+nnoremap dD "_dd
+vnoremap D "_d
+
+" Yank to end of line
+nnoremap Y y$
+
+" Reselect last-pasted text
+nnoremap gv `[v`]
+
+" I constantly hit "u" in visual mode when I mean to "y". Use "gu" for those rare occasions.
+" From https://github.com/henrik/dotfiles/blob/master/vim/config/mappings.vim
+vnoremap u <nop>
+vnoremap gu u
+
+" Clean trailing whitespace
+nnoremap <leader>ww mz:%s/\s\+$//<cr>:let @/=''<cr>`z
+
+" Select entire buffer
+nnoremap vaa ggvGg_
+nnoremap Vaa ggVG
+
+" Fix from spellcheck
+" I can never remember if it's zg or z=, and the wrong one adds the word to
+" the DB (lol), so fuck it, just add an easier mapping.
+nnoremap zz z=
+nnoremap z= :echo "use zz you idiot"<cr>
+
+" "Uppercase word" mapping.
+"
+" This mapping allows you to press <c-u> in insert mode to convert the current
+" word to uppercase.  It's handy when you're writing names of constants and
+" don't want to use Capslock.
+"
+" To use it you type the name of the constant in lowercase.  While your
+" cursor is at the end of the word, press <c-u> to uppercase it, and then
+" continue happily on your way:
+"
+"                            cursor
+"                            v
+"     max_connections_allowed|
+"     <c-u>
+"     MAX_CONNECTIONS_ALLOWED|
+"                            ^
+"                            cursor
+"
+" It works by exiting out of insert mode, recording the current cursor location
+" in the z mark, using gUiw to uppercase inside the current word, moving back to
+" the z mark, and entering insert mode again.
+"
+" Note that this will overwrite the contents of the z mark.  I never use it, but
+" if you do you'll probably want to use another mark.
+inoremap <C-u> <esc>mzgUiw`za
+
+" Wrap Toggle
+nnoremap <f9> :set nowrap!<cr>
+
+" zt is okay for putting something at the top of the screen, but when I'm
+" writing prose I often want to put something at not-quite-the-top of the
+" screen.  zh is "zoom to head level"
+nnoremap zh mzzt10<c-u>`z
+
+" Diffoff
+nnoremap <leader>D :diffoff!<cr>
+
+" Formatting, TextMate-style
+nnoremap Q gqip
+vnoremap Q gq
+
+" Reformat line.
+" I never use l as a macro register anyway.
+nnoremap ql gqq
+
+" Indent/dedent/autoindent what you just pasted.
+nnoremap <lt>> V`]<
+nnoremap ><lt> V`]>
+nnoremap =- V`]=
+
+" Keep the cursor in place while joining lines
+nnoremap J mzJ`z
+
+" Join an entire paragraph.
+"
+" Useful for writing GitHub comments in actual Markdown and then translating it
+" to their bastardized version of Markdown.
+nnoremap <leader>j mzvipJ`z
+
+" Split line (sister to [J]oin lines)
+" The normal use of S is covered by cc, so don't worry about shadowing it.
+nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
+
+" Substitute
+nnoremap <c-s> :%s/
+vnoremap <c-s> :s/
+
+" Marks and Quotes
+noremap ' `
+noremap æ '
+noremap ` <C-^>
+
+" Select (charwise) the contents of the current line, excluding indentation.
+" Great for pasting Python lines into REPLs.
+nnoremap vv ^vg_
+
+" Typos
+command! -bang E e<bang>
+command! -bang Q q<bang>
+command! -bang W w<bang>
+command! -bang QA qa<bang>
+command! -bang Qa qa<bang>
+command! -bang Wa wa<bang>
+command! -bang WA wa<bang>
+command! -bang Wq wq<bang>
+command! -bang WQ wq<bang>
+command! -bang Wqa wqa<bang>
+
+" Unfuck my screen
+nnoremap U :syntax sync fromstart<cr>:redraw!<cr>
+
+" Zip Right
+"
+" Moves the character under the cursor to the end of the line.  Handy when you
+" have something like:
+"
+"     foo
+"
+" And you want to wrap it in a method call, so you type:
+"
+"     println()foo
+"
+" Once you hit escape your cursor is on the closing paren, so you can 'zip' it
+" over to the right with this mapping.
+"
+" This should preserve your last yank/delete as well.
+nnoremap zl :let @z=@"<cr>x$p:let @"=@z<cr>
+
+" Diff Navigation
+nnoremap ]d ]c
+nnoremap [d [c
+
+" Typo navigation
+nnoremap ]z ]S
+nnoremap [z [S
+nnoremap ]Z ]Sz=
+nnoremap [Z [Sz=
+
+" Header Lines
+nnoremap <leader>- o<esc>80a-<esc>kJ079lD
+
+" Insert Mode Completion
+inoremap <c-f> <c-x><c-f>
+inoremap <c-]> <c-x><c-]>
+inoremap <c-l> <c-x><c-l>
+
+" Window Resizing
+" right/up : bigger
+" left/down : smaller
+nnoremap <m-right> :vertical resize +3<cr>
+nnoremap <m-left> :vertical resize -3<cr>
+nnoremap <m-up> :resize +3<cr>
+nnoremap <m-down> :resize -3<cr>
+
+" }}}
+" Searching and movement -------------------------------------------------- {{{
+
+" Use sane regexes.
+nnoremap / /\v
+vnoremap / /\v
+
+set ignorecase
+set smartcase
+set incsearch
+set showmatch
+set hlsearch
+set gdefault
+
+set scrolloff=5
+set sidescroll=1
+set sidescrolloff=10
+
+set virtualedit+=block
+
+noremap <silent> <leader><space> :noh<cr>:call clearmatches()<cr>
+
+runtime macros/matchit.vim
+map <tab> %
+silent! unmap [%
+silent! unmap ]%
+
+" Made D behave
+nnoremap D d$
+
+" Don't move on *
+" I'd use a function for this but Vim clobbers the last search when you're in
+" a function so fuck it, practicality beats purity.
+nnoremap <silent> * :let stay_star_view = winsaveview()<cr>*:call winrestview(stay_star_view)<cr>
+
+" Jumping to tags.
+"
+" Basically, <c-]> jumps to tags (like normal) and <c-\> opens the tag in a new
+" split instead.
+"
+" Both of them will align the destination line to the upper middle part of the
+" screen.  Both will pulse the cursor line so you can see where the hell you
+" are.  <c-\> will also fold everything in the buffer and then unfold just
+" enough for you to see the destination line.
+"
+function! JumpTo(jumpcommand)
+    execute a:jumpcommand
+    call FocusLine()
+    Pulse
+endfunction
+function! JumpToInSplit(jumpcommand)
+    execute "normal! \<c-w>v"
+    execute a:jumpcommand
+    Pulse
+endfunction
+
+function! JumpToTag()
+    call JumpTo("normal! \<c-]>")
+endfunction
+function! JumpToTagInSplit()
+    call JumpToInSplit("normal \<c-]>")
+endfunction
+
+nnoremap <c-]> :silent! call JumpToTag()<cr>
+nnoremap <c-\> :silent! call JumpToTagInSplit()<cr>
+
+" Keep search matches in the middle of the window.
+nnoremap n nzzzv
+nnoremap N Nzzzv
+
+" Same when jumping around
+nnoremap g; g;zz
+nnoremap g, g,zz
+nnoremap <c-o> <c-o>zz
+
+" Easier to type, and I never use the default behavior.
+noremap H ^
+noremap L $
+vnoremap L g_
+
+" Heresy
+inoremap <c-a> <esc>I
+inoremap <c-e> <esc>A
+cnoremap <c-a> <home>
+cnoremap <c-e> <end>
+
+" go indent
+nnoremap gi mzVap=`z
+nnoremap gI mzgg=G`z
+
+" Fix linewise visual selection of various text objects
+nnoremap VV V
+nnoremap Vit vitVkoj
+nnoremap Vat vatV
+nnoremap Vab vabV
+nnoremap VaB vaBV
+
+
+" Directional Keys {{{
+
+" It's 2013.
+noremap j gj
+noremap k gk
+noremap gj j
+noremap gk k
+
+" Easy buffer navigation
+noremap <C-h> <C-w>h
+noremap <C-j> <C-w>j
+noremap <C-k> <C-w>k
+noremap <C-l> <C-w>l
+
+noremap <leader>v <C-w>v
+
+" }}}
+" Visual Mode */# from Scrooloose {{{
+
+function! s:VSetSearch()
+  let temp = @@
+  norm! gvy
+  let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
+  let @@ = temp
+endfunction
+
+vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o>
+vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o>
+
+" }}}
+" List navigation {{{
+
+nnoremap <left>  :cprev<cr>zvzz
+nnoremap <right> :cnext<cr>zvzz
+nnoremap <up>    :lprev<cr>zvzz
+nnoremap <down>  :lnext<cr>zvzz
+
+" }}}
+
+" }}}
+" Folding ----------------------------------------------------------------- {{{
+
+set foldlevelstart=0
+
+" Space to toggle folds.
+nnoremap <Space> za
+vnoremap <Space> za
+
+" Make zO recursively open whatever fold we're in, even if it's partially open.
+nnoremap zO zczO
+
+" "Focus" the current line.  Basically:
+"
+" 1. Close all folds.
+" 2. Open just the folds containing the current line.
+" 3. Move the line to a bit (25 lines) down from the top of the screen.
+" 4. Pulse the line.
+"
+" This mapping wipes out the z mark, which I never use.
+"
+" I use :sus for the rare times I want to actually background Vim.
+function! FocusLine()
+    let oldscrolloff = &scrolloff
+    set scrolloff=0
+    execute "keepjumps normal! mzzMzvzt25\<c-y>`z:Pulse\<cr>"
+    let &scrolloff = oldscrolloff
+endfunction
+nnoremap <c-z> :call FocusLine()<cr>
+
+function! MyFoldText() " {{{
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    " expand tabs into spaces
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+    return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
+endfunction " }}}
+set foldtext=MyFoldText()
+
+" }}}
+" Text objects ------------------------------------------------------------ {{{
+
+" Folds {{{
+
+onoremap if :<c-u>normal! [zv]z<cr>
+onoremap af :<c-u>normal! [zV]z<cr>
+vnoremap if :<c-u>normal! ]zv[z<cr>
+vnoremap af :<c-u>normal! ]zV[z<cr>
+
+" }}}
+" Shortcut for [] {{{
+
+onoremap ir i[
+onoremap ar a[
+vnoremap ir i[
+vnoremap ar a[
+
+" }}}
+" Numbers {{{
+
+" Motion for numbers.  Great for CSS.  Lets you do things like this:
+"
+" margin-top: 200px; -> daN -> margin-top: px;
+"              ^                          ^
+" TODO: Handle floats.
+
+onoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
+xnoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
+onoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
+xnoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
+onoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
+xnoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
+
+function! s:NumberTextObject(whole)
+    let num = '\v[0-9]'
+
+    " If the current char isn't a number, walk forward.
+    while getline('.')[col('.') - 1] !~# num
+        normal! l
+    endwhile
+
+    " Now that we're on a number, start selecting it.
+    normal! v
+
+    " If the char after the cursor is a number, select it.
+    while getline('.')[col('.')] =~# num
+        normal! l
+    endwhile
+
+    " If we want an entire word, flip the select point and walk.
+    if a:whole
+        normal! o
+
+        while col('.') > 1 && getline('.')[col('.') - 2] =~# num
+            normal! h
+        endwhile
+    endif
+endfunction
+
+" }}}
+
+" }}}
+" Optional Remote-Local Vimrc --------------------------------------------- {{{
+
+if filereadable(expand('~/.vimrc_remote_local'))
+    source ~/.vimrc_remote_local
+endif
+
+" }}}