My vim configuration
git clone https://github.com/m-col/vim-misc
Files | Refs | Readme

Commit 3cecabc103eb14a2841584d85e44fea8f7a35ac8
Parent: 31cf18b05c5769e9ed5b9e63879963a119f5bf03
Author: Matt Colligan <matthewcolligan@improbable.io>
Date: 2023-06-17 22:22:38 +0100
Committer: Matt Colligan <matthewcolligan@improbable.io>
Committed: 2023-06-17 22:22:38 +0100

git submodule all plugins

vimrc Modified

@@ -16,16 +16,6 @@
 set nocompatible			    " be iMproved, required
 filetype plugin indent on		    " required
 
-Plugin 'dense-analysis/ale'		    " ALE
-Plugin 'neovimhaskell/haskell-vim'	    " better haskell syntax highlighting
-Plugin 'https://gitlab.com/gi1242/vim-emoji-ab.git' " emoji input support
-Plugin 'vmchale/dhall-vim'		    " dhall highlighting
-Plugin 'tpope/vim-fugitive'		    " git plugin
-Plugin 'https://mcol.xyz/code/vim-misc'	    " my vimrc and misc functions 
-Plugin 'https://mcol.xyz/code/tide'	    " tmux ide 
-Plugin 'Yggdroot/indentLine'                " Show indentation lines
-
-
 "------------------------------------------------------------------"
 " General settings                                                 "
 "------------------------------------------------------------------"

start/vim-fugitive Added

@@ -0,0 +1 @@
+Subproject commit 43f18ab9155c853a84ded560c6104e6300ad41da

start/vim-emoji-ab Added

@@ -0,0 +1 @@
+Subproject commit 355094dec7f35ce220811757dbbfc9c66a869458

start/tide Added

@@ -0,0 +1 @@
+Subproject commit 689f8d36961aec8221c1018933c90957a4a33372

start/self/plugin/theme.vim Added

@@ -0,0 +1,78 @@
+"------------------------------------------------------------------"
+" Ricing                                                           "
+"------------------------------------------------------------------"
+
+" statusline
+set laststatus=2			    " always show status bar
+set statusline =
+if $USER == 'root'
+    let hostname = hostname()
+    exec 'set statusline +=%7*\ ' . $USER . '@' . hostname . '\ %*'
+endif
+if ! empty($TMUX)
+    set statusline +=%6*%*
+endif
+
+set statusline +=%1*\ \ %<%F\ \ %*	    " full path
+set statusline +=%2*\ \ %y%*                " file type
+set statusline +=%2*\ %m\ %*                " modified flag
+set statusline +=%3*%{noscrollbar#statusline(12,'\ ','-')}
+set statusline +=%4*%=%*		    " centre padding
+set statusline +=%5*\ \ %l\ /\ %L\ \ %*	    " current / total lines
+set statusline +=%1*\ %n\ %*		    " buffer number 
+
+hi User1 ctermfg=0 ctermbg=5 cterm=none
+hi User2 ctermfg=0 ctermbg=4 cterm=none
+hi User3 ctermfg=0 ctermbg=14 cterm=none
+hi User4 ctermfg=0 ctermbg=2 cterm=none
+hi User5 ctermfg=0 ctermbg=3 cterm=none
+hi User6 ctermfg=3 ctermbg=5 cterm=none
+hi User7 ctermfg=0 ctermbg=9 cterm=none
+
+" tab bar
+hi TabLineFill ctermfg=0 ctermbg=1
+hi TabLine ctermfg=0 ctermbg=13
+hi TabLineSel ctermfg=0 ctermbg=12
+hi Title ctermfg=0 ctermbg=12
+
+" vimdiff  " commented out as it was disrupting git gutter
+"hi DiffAdd      cterm=none ctermfg=0 ctermbg=2
+"hi DiffChange   cterm=none ctermfg=0 ctermbg=4
+"hi DiffText     cterm=none ctermfg=0 ctermbg=6
+"hi DiffDelete   cterm=bold ctermfg=0 ctermbg=1
+
+" folds
+hi Folded ctermbg=8 ctermfg=4 cterm=none
+
+" visual mode highlighting
+hi Visual ctermbg=7 ctermfg=0
+
+" title highlighting needs changing so that text doesn't go invisible due to cursor line
+hi Title ctermfg=3 ctermbg=0
+
+" matched brackets
+hi MatchParen ctermfg=7 cterm=underline ctermbg=0 
+
+" line numbers
+set number relativenumber
+hi LineNr ctermfg=5
+
+" highlight cursor line
+highlight CursorLine ctermbg=8 cterm=bold
+augroup CursorLine
+    au!
+    au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
+    au WinLeave * setlocal nocursorline
+augroup END
+
+" change cursor shape in insert mode
+let &t_SI = "\e[4 q" "underscore
+let &t_EI = "\e[2 q" "block
+augroup myCmds
+    au!
+    autocmd VimEnter * silent !echo -ne "\e[2 q"
+augroup END
+
+" character for split barrier
+set fillchars=vert:\ 
+hi VertSplit cterm=bold term=bold ctermbg=12

start/self/plugin/noscrollbar.vim Added

@@ -0,0 +1,115 @@
+"------------------------------------------------------------------"
+" noscrollbar plugin from github.com/gcavallanti/vim-noscrollbar
+"------------------------------------------------------------------"
+if &cp || exists('g:noscrollbar_loaded')
+  finish
+endif
+
+let g:noscrollbar_loaded = 1
+
+function! noscrollbar#statusline(...)
+    let top_line = line("w0")
+    let bottom_line = line("w$")
+    let current_line = line('.')
+    let lines_count = line('$')
+
+    " Default values
+    let length = 20
+    let tracksymbol = '-'
+    let grippersymbol = '#'
+    let gripperleftsymbols = []
+    let gripperrightsymbols = []
+    let part = 'a'
+
+    if a:0 >= 3
+      let length = a:1
+      let tracksymbol = a:2
+      let grippersymbol = a:3
+    endif
+
+    if a:0 >= 5 && type(a:4) == 3 && type(a:5) == 3
+                \ && len(a:4) == len(a:5) 
+        let gripperleftsymbols = a:4
+        let gripperrightsymbols = a:5
+    endif
+
+    if a:0 >= 6
+      let part = a:6
+    endif
+
+    let scaling = len(gripperleftsymbols) + 1 
+
+    " Compute gripper position and size as if we have scaling times a:1
+    " characters available. Will shrink everything back just before returning 
+    let scrollbar_length = str2nr(length) * scaling
+
+    " Gripper positions are 0 based (0..scrollbar_length-1)
+    let gripper_position = float2nr((top_line - 1.0) / lines_count 
+\       * scrollbar_length)
+    let gripper_length = float2nr(ceil((bottom_line - top_line + 1.0)  
+\       / lines_count * scrollbar_length)) 
+
+    " Users expect to see the scrollbar in the leftmost position only if we
+    " are at the very top of the buffer
+    if (top_line > 1) && (gripper_position == 0)
+        " Since the top line is not visible shift the gripper by one position
+        let gripper_position = 1
+        if (gripper_position + gripper_length > scrollbar_length)
+            " Shrink the gripper if we end up after the end of the scrollbar 
+            let gripper_length = gripper_length - 1
+        endif
+    endif
+
+    if (bottom_line < lines_count) 
+\       && (gripper_position + gripper_length == scrollbar_length)
+        " As before, if the last line is not on the screen but the scrollbar
+        " seems to indicate so then either move the scrollbar position leftwise
+        " by one position or decrease its length
+        if gripper_position > 0
+            let gripper_position = gripper_position - 1
+        else
+            let gripper_length = gripper_length - 1
+        endif
+    endif
+
+    " Shrink everything back to the range [0, a:1)
+    let gripper_position = 1.0 * gripper_position / scaling
+    let gripper_length = 1.0 * gripper_length / scaling
+    let scrollbar_length = 1.0 * scrollbar_length / scaling
+
+    " The left of the gripper is broken in 3 parts.  The left and right are
+    " fractionals in the range [0, len(a:4)). 
+    let gripper_length_left = ceil(gripper_position) - gripper_position
+    " Hackish rounding errors workaround. If `gripper_length
+    " - gripper_lenght_left` is 0.9999.. we force it to 1 before rounding it
+    let gripper_length_middle = floor(round((gripper_length 
+                \ - gripper_length_left)*100.0)/100.0)
+    let gripper_length_right = gripper_length - gripper_length_left 
+                \ - gripper_length_middle
+
+    " Time to assemble the actual scrollbar
+    let scrollbar = ''
+    if part != 'm' && part != 'r'
+        let scrollbar .= repeat(tracksymbol, float2nr(floor(gripper_position)))
+
+        let grippersymbol_index = float2nr(round(gripper_length_left * scaling))
+        if grippersymbol_index != 0
+            let scrollbar .= gripperleftsymbols[grippersymbol_index - 1]
+        endif
+    endif
+    
+    if part != 'l' && part != 'r'
+        let scrollbar .= repeat(grippersymbol, float2nr(gripper_length_middle)) 
+    endif
+
+    if part != 'l' && part != 'm'
+        let grippersymbol_index = float2nr(round(gripper_length_right * scaling))
+        if grippersymbol_index != 0
+            let scrollbar .= gripperrightsymbols[grippersymbol_index - 1]
+        endif
+        let scrollbar .= repeat(tracksymbol, float2nr(scrollbar_length 
+                    \ - ceil(gripper_position + gripper_length)))
+    endif
+
+    return scrollbar
+endfunction

start/self/plugin/keybindings.vim Added

@@ -0,0 +1,128 @@
+"------------------------------------------------------------------"
+" Global keybindings                                               "
+"------------------------------------------------------------------"
+
+" reload current buffer
+"nnoremap <C-l> :e<CR>
+
+" toggle fold
+nnoremap <space> za
+
+" yank to end of line
+nnoremap Y y$
+
+" buffer navigation
+nnoremap <leader>b :ls<CR>:b<space>
+nnoremap <Leader>v :ls<CR>:vert sb<space>
+nnoremap <Leader>j :bnext<CR> 
+nnoremap <Leader>k :bprevious<CR>
+nnoremap <Leader><BS> :w<CR>:bdelete<CR>
+
+" move between tabs
+nnoremap <Leader>n gT
+nnoremap <Leader>m gt
+
+" indent selection
+vnoremap < <gv
+vnoremap > >gv
+
+" quitting and writing shortcuts
+nnoremap QQ :q<CR>
+nnoremap !Q :q!<CR>
+nnoremap QW :wq<CR>
+nnoremap :Q :q
+nnoremap :W :w
+
+" disable K man
+nnoremap K k
+
+" copy and paste system clipboard
+nmap <C-y> "+y
+nmap <C-y><C-y> ms0v$"+y`s
+vmap <C-y> "+y
+imap <C-y> <Esc>"+y
+if exists("$WAYLAND_DISPLAY")
+    xmap "+y y:call system("wl-copy", @")\|echo '' <cr>
+endif
+
+" save read-only file with sudo trick
+cnoremap w!! w !sudo tee > /dev/null %
+
+" move between split views (these are configured by the vim-tmux plugin)
+" except for insert mode:
+"inoremap <silent> <C-H> <Esc>:TmuxNavigateLeft<cr>
+"inoremap <silent> <C-J> <Esc>:TmuxNavigateDown<cr>
+"inoremap <silent> <C-K> <Esc>:TmuxNavigateUp<cr>
+"inoremap <silent> <C-L> <Esc>:TmuxNavigateRight<cr>
+"inoremap <silent> <C-\> <Esc>:TmuxNavigatePrevious<cr>
+nnoremap <C-H> <C-W><C-H>
+nnoremap <C-J> <C-W><C-J>
+nnoremap <C-K> <C-W><C-K>
+nnoremap <C-L> <C-W><C-L>
+inoremap <C-H> <Esc><C-W><C-H>
+inoremap <C-J> <Esc><C-W><C-J>
+inoremap <C-K> <Esc><C-W><C-K>
+inoremap <C-L> <Esc><C-W><C-L>
+
+" move to start or end of line more easily
+nnoremap 0 ^
+nnoremap H 0
+nnoremap L $
+vnoremap H 0
+vnoremap L g_
+
+" resize splits
+nnoremap <silent> <Up> :res -1<CR>
+nnoremap <silent> <Down> :res +1<CR>
+nnoremap <silent> <Left> :vertical resize -5<CR>
+nnoremap <silent> <Right> :vertical resize +5<CR>
+
+" toggle search highlight
+nnoremap <Leader>h :set hlsearch!<CR>
+
+" shortcut to fix lines
+nnoremap <leader>p gqip
+
+" shortcut to vert split
+nnoremap vs :vsp<CR>
+
+" toggle spell checking
+nnoremap <leader>S :setlocal spell! spelllang=en_gb spell?<CR>:echo "zg to add new word"<CR>
+
+" toggle [ ] tick box on current line with ctrl-space
+function! ToggleTodo()
+    let l:line = getline('.')
+    if match(l:line, '\[x\]') != -1
+	let l:line = substitute(l:line, '\[x\]', '\[ \]', '')
+	call setline('.', l:line)
+    elseif match(l:line, '\[ \]') != -1
+	let l:line = substitute(l:line, '\[ \]', '\[x\]', '')
+	call setline('.', l:line)
+    endif
+endfunction
+nnoremap <silent> <C-@> :call ToggleTodo()<CR>
+
+" quickfix navigation
+nnoremap <localleader>cn :cn<CR>
+nnoremap <localleader>cp :cp<CR>
+
+" netrw
+nmap <C-n> :Explore<CR>
+let g:netrw_sort_sequence='[\/]$'
+
+" bind number keys to scroll so i can use foot terminal's alt scrolling
+map <Down> j
+map <Up> k
+
+
+" bind scroll to move cursor up and down
+nnoremap <ScrollWheelDown> <Down>
+nnoremap <ScrollWheelUp> <Up>
+inoremap <ScrollWheelDown> <Down>
+inoremap <ScrollWheelUp> <Up>
+vnoremap <ScrollWheelDown> <Down>
+vnoremap <ScrollWheelUp> <Up>
+
+" ALE navigation
+nmap <silent> <C-S-k> <Plug>(ale_previous_wrap)
+nmap <silent> <C-S-j> <Plug>(ale_next_wrap)

start/self/plugin/indent.vim Added

@@ -0,0 +1,13 @@
+"------------------------------------------------------------------
+"  Indentation of entire file
+"------------------------------------------------------------------
+
+"function! IndentFile()
+"    mkview
+"    let l:win_view = winsaveview()
+"    :normal! gg=G
+"    silent loadview
+"    call winrestview(l:win_view)
+"endfunction
+"
+"nnoremap <C-i> :call IndentFile()<CR>

start/self/plugin/folds.vim Added

@@ -0,0 +1,34 @@
+"------------------------------------------------------------------"
+" Global folding rules
+"------------------------------------------------------------------"
+
+
+" format folded section header text
+function! GenericFoldText()
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+    return line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
+endfunction
+set foldtext=GenericFoldText()
+
+
+"function! GenericFolds()
+"    if match(getline(v:lnum), '^\s*' . &commentstring[0] . &commentstring[0]) >=0
+"	return ">1"
+"    else
+"	return "="
+"    endif
+"endfunction
+"
+"
+"set foldmethod=expr
+"set foldexpr=GenericFolds()

start/self/plugin/bclose.vim Added

@@ -0,0 +1,87 @@
+"------------------------------------------------------------------"
+" :bclose                                                          "
+"------------------------------------------------------------------"
+
+" Delete buffer while keeping window layout (don't close buffer's windows).
+" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
+if v:version < 700 || exists('loaded_bclose') || &cp
+    finish
+endif
+let loaded_bclose = 1
+if !exists('bclose_multiple')
+    let bclose_multiple = 1
+endif
+
+" Display an error message.
+function! s:Warn(msg)
+    echohl ErrorMsg
+    echomsg a:msg
+    echohl NONE
+endfunction
+
+" Command ':Bclose' executes ':bd' to delete buffer in current window.
+" The window will show the alternate buffer (Ctrl-^) if it exists,
+" or the previous buffer (:bp), or a blank buffer if no previous.
+" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
+" An optional argument can specify which buffer to close (name or number).
+function! s:Bclose(bang, buffer)
+    if empty(a:buffer)
+	let btarget = bufnr('%')
+    elseif a:buffer =~ '^\d\+$'
+	let btarget = bufnr(str2nr(a:buffer))
+    else
+	let btarget = bufnr(a:buffer)
+    endif
+    if btarget < 0
+	call s:Warn('No matching buffer for '.a:buffer)
+	return
+    endif
+    if empty(a:bang) && getbufvar(btarget, '&modified')
+	call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
+	return
+    endif
+    " Numbers of windows that view target buffer which we will delete.
+    let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
+    if !g:bclose_multiple && len(wnums) > 1
+	call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
+	return
+    endif
+    let wcurrent = winnr()
+    for w in wnums
+	execute w.'wincmd w'
+	let prevbuf = bufnr('#')
+	if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
+	    buffer #
+	else
+	    bprevious
+	endif
+	if btarget == bufnr('%')
+	    " Numbers of listed buffers which are not the target to be deleted.
+	    let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
+	    " Listed, not target, and not displayed.
+	    let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
+	    " Take the first buffer, if any (could be more intelligent).
+	    let bjump = (bhidden + blisted + [-1])[0]
+	    if bjump > 0
+		execute 'buffer '.bjump
+	    else
+		execute 'enew'.a:bang
+	    endif
+	endif
+    endfor
+    silent! execute 'bdelete'.a:bang.' '.btarget
+    silent! execute wcurrent.'wincmd w'
+endfunction
+command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('<bang>', '<args>')
+
+
+
+
+
+if v:servername == "VIMLAB"
+    nnoremap <buffer> <silent> <BS> <Plug>Kwbd
+else
+    autocmd BufDelete * if len(filter(range(1, bufnr('$')), 'empty(bufname(v:val)) && buflisted(v:val)')) == 1 && v:servername != "VIMLAB" | quit | endif
+endif
+
+nnoremap <silent> <BS> :Bclose<CR>

start/self/plugin/autohighlight.vim Added

@@ -0,0 +1,23 @@
+"------------------------------------------------------------------"
+" Highlight all instances of word under cursor, when idle.
+"------------------------------------------------------------------"
+function! AutoHighlightToggle()
+  let @/ = ''
+  if exists('#auto_highlight')
+    au! auto_highlight
+    augroup! auto_highlight
+    setl updatetime=4000
+    echo 'Highlight current word: off'
+    return 0
+  else
+    augroup auto_highlight
+      au!
+      au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>'
+    augroup end
+    setl updatetime=500
+    echo 'Highlight current word: ON'
+    return 1
+  endif
+endfunction
+
+nnoremap <bar> :if AutoHighlightToggle()<Bar>set hls<Bar>endif<CR>

start/self/ftplugin/vimwiki.vim Added

@@ -0,0 +1,42 @@
+"""" These commented commands are in vimrc, so ARE active:
+""" split open index of vimwiki.
+"nmap <Leader>wv :vsp<CR><Leader>ww
+
+"""" These commented commands are defaukts, so ARE active:
+""" \ww opens it normally, which is default, in new buffer
+"nmap <Leader>wh Vimwiki2HTML
+"nmap <Leader>whh Vimwiki2HTMLBrowse
+
+" open index wiki in horizontal split	
+nmap <buffer> <Leader>ws :sp<CR><Leader>ww
+
+" go to papers page
+nmap <buffer> <Leader>gp /[[/papers/papers<CR><CR>
+
+" save all as HTML
+nmap <buffer> <Leader>wa :VimwikiAll2HTML<CR>
+nmap <buffer> <Leader>wah :VimwikiAll2HTML<CR>:Vimwiki2HTMLBrowse<CR><CR>
+" save as HTML and quit
+nmap <buffer> <Leader>wq :VimwikiAll2HTML<CR>:wq<CR>
+
+" follow next link
+nmap <buffer> g<CR> /[[<CR><CR>
+
+" paste copied bullet pointed link as title
+nmap <buffer> <Leader>p 0f\|yy<CR>Pdf\|$xx===o<CR>
+
+" open pdf from papers page
+nmap <buffer> <Leader>o 0f\|lvt]y:let a = substitute(@*, ' ', '_', 'g') \| exec "!qpdfview --unique ~/work/research/papers/" . a . ".pdf &"<CR>
+
+" update papers page with new pdf files
+nmap <buffer> <Leader>u :!vimwiki_add_papers.sh<CR>
+
+" run goyo
+nmap <buffer> <Leader>g :Goyo<CR>
+
+
+setlocal wrap
+setlocal linebreak
+setlocal breakindent
+
+nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>

start/self/ftplugin/tex.vim Added

@@ -0,0 +1,11 @@
+setlocal tabstop=4
+setlocal softtabstop=4
+setlocal shiftwidth=4
+setlocal textwidth=110
+setlocal expandtab
+
+nnoremap K :VimtexDocPackage<CR>
+
+nnoremap <localleader>lw :exe 'cexpr system("texcount ' . expand('%') . '")'<CR>:copen<CR>
+
+nnoremap <localleader>c :VimtexCompile<CR>

start/self/ftplugin/sh.vim Added

@@ -0,0 +1 @@
+setlocal textwidth=79

start/self/ftplugin/rst.vim Added

@@ -0,0 +1,8 @@
+setlocal textwidth=79
+"setlocal spell spelllang=en_gb
+nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
+
+
+nnoremap <C-e>t :RivTableCreate<CR>
+nnoremap <C-e>l :RivCreateLink<CR>
+"<C-e>s[1,2,3] will make current line a heading

start/self/ftplugin/python.vim Added

@@ -0,0 +1,5 @@
+setlocal tabstop=4
+setlocal softtabstop=4
+setlocal shiftwidth=4
+setlocal textwidth=88
+setlocal expandtab

start/self/ftplugin/netrw.vim Added

@@ -0,0 +1,2 @@
+map <buffer> h -
+map <buffer> l <CR>

start/self/ftplugin/matlab.vim Added

@@ -0,0 +1 @@
+let g:tmux_cmd = "tmux send -t MATLAB:MATLAB "

start/self/ftplugin/markdown.vim Added

@@ -0,0 +1,43 @@
+setlocal tabstop=4
+setlocal softtabstop=4
+setlocal shiftwidth=4
+setlocal textwidth=101
+setlocal noautoindent
+setlocal nosmartindent
+"setlocal formatoptions+=a
+"setlocal spell spelllang=en_gb
+
+" format folded section header text
+function! GenericFoldText()
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
+    let level = (len(split(line)[0]) - 1) * 3
+    let level_indent = repeat(" ", level)
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - level
+    return level_indent . line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
+endfunction
+setlocal foldtext=GenericFoldText()
+
+
+"function! MarkdownFixParagraph()
+"    let start = line("'{")
+"    let end = line("'}")
+"    let g:ale_markdown_prettier_fix_options =
+"	\ '--prose-wrap=always --print-width=101 --range-start=' . start . ' --range-end=' . end
+"    "ALEFix
+"endfunction
+"
+""nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
+"nnoremap <localleader>c :call MarkdownFixParagraph()<CR>
+
+"let b:ale_lint_on_text_changed = 1
+"let b:ale_fix_on_save = 1
+"let b:ale_lint_delay = 1000

start/self/ftplugin/javascript.vim Added

@@ -0,0 +1,3 @@
+setlocal tabstop=2
+setlocal softtabstop=2
+setlocal shiftwidth=2

start/self/ftplugin/include.vim Added

@@ -0,0 +1 @@
+setlocal filetype=html

start/self/ftplugin/html.vim Added

@@ -0,0 +1,4 @@
+setlocal tabstop=2
+setlocal softtabstop=2
+setlocal shiftwidth=2
+setlocal expandtab

start/self/ftplugin/help.vim Added

@@ -0,0 +1,2 @@
+" this overrides :Bclose in help windows
+nnoremap <buffer> <BS> :bd<CR>

start/self/ftplugin/haskell.vim Added

@@ -0,0 +1,5 @@
+setlocal tabstop=4
+setlocal softtabstop=4
+setlocal shiftwidth=4
+setlocal textwidth=88
+setlocal expandtab

start/self/ftplugin/h.vim Added

@@ -0,0 +1 @@
+setlocal filetype=c

start/self/after/plugin/theme.vim Added

start/self/after/plugin/gitgutter.vim Added

@@ -0,0 +1,16 @@
+""turn off realtime updates for gitgutter but update upon write
+"let g:gitgutter_enabled = 0
+"autocmd! gitgutter CursorHold,CursorHoldI
+"autocmd BufWritePost * GitGutter
+"
+"" gitgutter
+"nmap <localleader>g :GitGutterToggle<CR>
+"nmap gp <Plug>(GitGutterPreviewHunk)
+"nmap gs <Plug>(GitGutterStageHunk)
+"nmap gu <Plug>(GitGutterUndoHunk)
+"nmap [g <Plug>(GitGutterPrevHunk)
+"nmap ]g <Plug>(GitGutterNextHunk)
+"omap ig <Plug>(GitGutterTextObjectInnerPending)
+"omap ag <Plug>(GitGutterTextObjectOuterPending)
+"xmap ig <Plug>(GitGutterTextObjectInnerVisual)
+"xmap ag <Plug>(GitGutterTextObjectOuterVisual)

start/self/after/plugin/emoji-config.vim Added

@@ -0,0 +1,7 @@
+"------------------------------------------------------------------"
+" Config for https://gitlab.com/gi1242/vim-emoji-ab.git
+"------------------------------------------------------------------"
+
+" reload current buffer
+"runtime macros/emojis.vim
+

start/self/after/ftplugin/markdown.vim Added

@@ -0,0 +1,77 @@
+" Identify HTML comment-like blocks as markdown comments
+setlocal comments+=s:<!---,e:-->
+" couldn't get this to work, so just sticking in <br> where needed
+"setlocal comments+=s:![**,e:](
+
+" Folding logic below is derived from the vim-markdown-folding plugin
+function! StackedMarkdownFolds()
+  let thisline = getline(v:lnum)
+  let prevline = getline(v:lnum - 1)
+  let nextline = getline(v:lnum + 1)
+  if thisline =~ '^```.*$' && prevline =~ '^\s*$'  " start of a fenced block
+    return ">2"
+  elseif thisline =~ '^```$' && nextline =~ '^\s*$'  " end of a fenced block
+    return "<2"
+  endif
+
+  if HeadingDepth(v:lnum) > 0
+    return ">1"
+  else
+    return "="
+  endif
+endfunction
+
+function! HeadingDepth(lnum)
+  let level=0
+  let thisline = getline(a:lnum)
+  if thisline =~ '^#\+\s\+'
+    let hashCount = len(matchstr(thisline, '^#\{1,6}'))
+    if hashCount > 0
+      let level = hashCount
+    endif
+  else
+    if thisline != ''
+      let nextline = getline(a:lnum + 1)
+      if nextline =~ '^=\+\s*$'
+        let level = 1
+      elseif nextline =~ '^-\+\s*$'
+        let level = 2
+      endif
+    endif
+  endif
+  if level > 0 && HasSyntaxGroup(a:lnum, '\vmarkdown(Code|Highlight)')
+    " Ignore # or === if they appear within fenced code blocks
+    let level = 0
+  endif
+  return level
+endfunction
+
+function! HasSyntaxGroup(lnum, targetGroup)
+  let syntaxGroup = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
+  for value in syntaxGroup
+    if value =~ a:targetGroup
+        return 1
+    endif
+  endfor
+endfunction
+
+function! s:FoldText()
+  let level = HeadingDepth(v:foldstart)
+  let indent = repeat('#', level)
+  let title = substitute(getline(v:foldstart), '^#\+\s\+', '', '')
+
+  let spaces_1 = repeat(' ', level) . '   '
+  let spaces_2 = repeat(' ', 200)
+
+  return indent.spaces_1.title.spaces_2
+endfunction
+
+setlocal foldmethod=expr
+
+let &l:foldtext = expand('<SID>') . 'FoldText()'
+let &l:foldexpr = 'StackedMarkdownFolds()'
+
+if !exists("b:undo_ftplugin") | let b:undo_ftplugin = '' | endif
+let b:undo_ftplugin .= '
+  \ | setlocal foldmethod< foldtext< foldexpr<
+  \ '

start/self/.DS_Store Added

@@ -0,0 +1 @@
+Bud1�tvSrnlongstartvSrnlong @� @� @� @E�DSDB `� @� @� @
\ No newline at end of file

start/indentLine Added

@@ -0,0 +1 @@
+Subproject commit d15d63bf9c4a74a02470d4bc8ecce53df13e3a75

start/haskell-vim Added

@@ -0,0 +1 @@
+Subproject commit f35d02204b4813d1dbe8b0e98cc39701a4b8e15e

start/dhall-vim Added

@@ -0,0 +1 @@
+Subproject commit 68500ef46ff3706f46c99db3be7a0c8abcf6a3ae

start/ale Added

@@ -0,0 +1 @@
+Subproject commit c0eff9f2f18c5408596ce1e8e43dc7933340e514

config/start/plugin/theme.vim Deleted

@@ -1,78 +0,0 @@
-"------------------------------------------------------------------"
-" Ricing                                                           "
-"------------------------------------------------------------------"
-
-" statusline
-set laststatus=2			    " always show status bar
-set statusline =
-if $USER == 'root'
-    let hostname = hostname()
-    exec 'set statusline +=%7*\ ' . $USER . '@' . hostname . '\ %*'
-endif
-if ! empty($TMUX)
-    set statusline +=%6*%*
-endif
-
-set statusline +=%1*\ \ %<%F\ \ %*	    " full path
-set statusline +=%2*\ \ %y%*                " file type
-set statusline +=%2*\ %m\ %*                " modified flag
-set statusline +=%3*%{noscrollbar#statusline(12,'\ ','-')}
-set statusline +=%4*%=%*		    " centre padding
-set statusline +=%5*\ \ %l\ /\ %L\ \ %*	    " current / total lines
-set statusline +=%1*\ %n\ %*		    " buffer number 
-
-hi User1 ctermfg=0 ctermbg=5 cterm=none
-hi User2 ctermfg=0 ctermbg=4 cterm=none
-hi User3 ctermfg=0 ctermbg=14 cterm=none
-hi User4 ctermfg=0 ctermbg=2 cterm=none
-hi User5 ctermfg=0 ctermbg=3 cterm=none
-hi User6 ctermfg=3 ctermbg=5 cterm=none
-hi User7 ctermfg=0 ctermbg=9 cterm=none
-
-" tab bar
-hi TabLineFill ctermfg=0 ctermbg=1
-hi TabLine ctermfg=0 ctermbg=13
-hi TabLineSel ctermfg=0 ctermbg=12
-hi Title ctermfg=0 ctermbg=12
-
-" vimdiff  " commented out as it was disrupting git gutter
-"hi DiffAdd      cterm=none ctermfg=0 ctermbg=2
-"hi DiffChange   cterm=none ctermfg=0 ctermbg=4
-"hi DiffText     cterm=none ctermfg=0 ctermbg=6
-"hi DiffDelete   cterm=bold ctermfg=0 ctermbg=1
-
-" folds
-hi Folded ctermbg=8 ctermfg=4 cterm=none
-
-" visual mode highlighting
-hi Visual ctermbg=7 ctermfg=0
-
-" title highlighting needs changing so that text doesn't go invisible due to cursor line
-hi Title ctermfg=3 ctermbg=0
-
-" matched brackets
-hi MatchParen ctermfg=7 cterm=underline ctermbg=0 
-
-" line numbers
-set number relativenumber
-hi LineNr ctermfg=5
-
-" highlight cursor line
-highlight CursorLine ctermbg=8 cterm=bold
-augroup CursorLine
-    au!
-    au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
-    au WinLeave * setlocal nocursorline
-augroup END
-
-" change cursor shape in insert mode
-let &t_SI = "\e[4 q" "underscore
-let &t_EI = "\e[2 q" "block
-augroup myCmds
-    au!
-    autocmd VimEnter * silent !echo -ne "\e[2 q"
-augroup END
-
-" character for split barrier
-set fillchars=vert:\ 
-hi VertSplit cterm=bold term=bold ctermbg=12

config/start/plugin/noscrollbar.vim Deleted

@@ -1,115 +0,0 @@
-"------------------------------------------------------------------"
-" noscrollbar plugin from github.com/gcavallanti/vim-noscrollbar
-"------------------------------------------------------------------"
-if &cp || exists('g:noscrollbar_loaded')
-  finish
-endif
-
-let g:noscrollbar_loaded = 1
-
-function! noscrollbar#statusline(...)
-    let top_line = line("w0")
-    let bottom_line = line("w$")
-    let current_line = line('.')
-    let lines_count = line('$')
-
-    " Default values
-    let length = 20
-    let tracksymbol = '-'
-    let grippersymbol = '#'
-    let gripperleftsymbols = []
-    let gripperrightsymbols = []
-    let part = 'a'
-
-    if a:0 >= 3
-      let length = a:1
-      let tracksymbol = a:2
-      let grippersymbol = a:3
-    endif
-
-    if a:0 >= 5 && type(a:4) == 3 && type(a:5) == 3
-                \ && len(a:4) == len(a:5) 
-        let gripperleftsymbols = a:4
-        let gripperrightsymbols = a:5
-    endif
-
-    if a:0 >= 6
-      let part = a:6
-    endif
-
-    let scaling = len(gripperleftsymbols) + 1 
-
-    " Compute gripper position and size as if we have scaling times a:1
-    " characters available. Will shrink everything back just before returning 
-    let scrollbar_length = str2nr(length) * scaling
-
-    " Gripper positions are 0 based (0..scrollbar_length-1)
-    let gripper_position = float2nr((top_line - 1.0) / lines_count 
-\       * scrollbar_length)
-    let gripper_length = float2nr(ceil((bottom_line - top_line + 1.0)  
-\       / lines_count * scrollbar_length)) 
-
-    " Users expect to see the scrollbar in the leftmost position only if we
-    " are at the very top of the buffer
-    if (top_line > 1) && (gripper_position == 0)
-        " Since the top line is not visible shift the gripper by one position
-        let gripper_position = 1
-        if (gripper_position + gripper_length > scrollbar_length)
-            " Shrink the gripper if we end up after the end of the scrollbar 
-            let gripper_length = gripper_length - 1
-        endif
-    endif
-
-    if (bottom_line < lines_count) 
-\       && (gripper_position + gripper_length == scrollbar_length)
-        " As before, if the last line is not on the screen but the scrollbar
-        " seems to indicate so then either move the scrollbar position leftwise
-        " by one position or decrease its length
-        if gripper_position > 0
-            let gripper_position = gripper_position - 1
-        else
-            let gripper_length = gripper_length - 1
-        endif
-    endif
-
-    " Shrink everything back to the range [0, a:1)
-    let gripper_position = 1.0 * gripper_position / scaling
-    let gripper_length = 1.0 * gripper_length / scaling
-    let scrollbar_length = 1.0 * scrollbar_length / scaling
-
-    " The left of the gripper is broken in 3 parts.  The left and right are
-    " fractionals in the range [0, len(a:4)). 
-    let gripper_length_left = ceil(gripper_position) - gripper_position
-    " Hackish rounding errors workaround. If `gripper_length
-    " - gripper_lenght_left` is 0.9999.. we force it to 1 before rounding it
-    let gripper_length_middle = floor(round((gripper_length 
-                \ - gripper_length_left)*100.0)/100.0)
-    let gripper_length_right = gripper_length - gripper_length_left 
-                \ - gripper_length_middle
-
-    " Time to assemble the actual scrollbar
-    let scrollbar = ''
-    if part != 'm' && part != 'r'
-        let scrollbar .= repeat(tracksymbol, float2nr(floor(gripper_position)))
-
-        let grippersymbol_index = float2nr(round(gripper_length_left * scaling))
-        if grippersymbol_index != 0
-            let scrollbar .= gripperleftsymbols[grippersymbol_index - 1]
-        endif
-    endif
-    
-    if part != 'l' && part != 'r'
-        let scrollbar .= repeat(grippersymbol, float2nr(gripper_length_middle)) 
-    endif
-
-    if part != 'l' && part != 'm'
-        let grippersymbol_index = float2nr(round(gripper_length_right * scaling))
-        if grippersymbol_index != 0
-            let scrollbar .= gripperrightsymbols[grippersymbol_index - 1]
-        endif
-        let scrollbar .= repeat(tracksymbol, float2nr(scrollbar_length 
-                    \ - ceil(gripper_position + gripper_length)))
-    endif
-
-    return scrollbar
-endfunction

config/start/plugin/keybindings.vim Deleted

@@ -1,128 +0,0 @@
-"------------------------------------------------------------------"
-" Global keybindings                                               "
-"------------------------------------------------------------------"
-
-" reload current buffer
-"nnoremap <C-l> :e<CR>
-
-" toggle fold
-nnoremap <space> za
-
-" yank to end of line
-nnoremap Y y$
-
-" buffer navigation
-nnoremap <leader>b :ls<CR>:b<space>
-nnoremap <Leader>v :ls<CR>:vert sb<space>
-nnoremap <Leader>j :bnext<CR> 
-nnoremap <Leader>k :bprevious<CR>
-nnoremap <Leader><BS> :w<CR>:bdelete<CR>
-
-" move between tabs
-nnoremap <Leader>n gT
-nnoremap <Leader>m gt
-
-" indent selection
-vnoremap < <gv
-vnoremap > >gv
-
-" quitting and writing shortcuts
-nnoremap QQ :q<CR>
-nnoremap !Q :q!<CR>
-nnoremap QW :wq<CR>
-nnoremap :Q :q
-nnoremap :W :w
-
-" disable K man
-nnoremap K k
-
-" copy and paste system clipboard
-nmap <C-y> "+y
-nmap <C-y><C-y> ms0v$"+y`s
-vmap <C-y> "+y
-imap <C-y> <Esc>"+y
-if exists("$WAYLAND_DISPLAY")
-    xmap "+y y:call system("wl-copy", @")\|echo '' <cr>
-endif
-
-" save read-only file with sudo trick
-cnoremap w!! w !sudo tee > /dev/null %
-
-" move between split views (these are configured by the vim-tmux plugin)
-" except for insert mode:
-"inoremap <silent> <C-H> <Esc>:TmuxNavigateLeft<cr>
-"inoremap <silent> <C-J> <Esc>:TmuxNavigateDown<cr>
-"inoremap <silent> <C-K> <Esc>:TmuxNavigateUp<cr>
-"inoremap <silent> <C-L> <Esc>:TmuxNavigateRight<cr>
-"inoremap <silent> <C-\> <Esc>:TmuxNavigatePrevious<cr>
-nnoremap <C-H> <C-W><C-H>
-nnoremap <C-J> <C-W><C-J>
-nnoremap <C-K> <C-W><C-K>
-nnoremap <C-L> <C-W><C-L>
-inoremap <C-H> <Esc><C-W><C-H>
-inoremap <C-J> <Esc><C-W><C-J>
-inoremap <C-K> <Esc><C-W><C-K>
-inoremap <C-L> <Esc><C-W><C-L>
-
-" move to start or end of line more easily
-nnoremap 0 ^
-nnoremap H 0
-nnoremap L $
-vnoremap H 0
-vnoremap L g_
-
-" resize splits
-nnoremap <silent> <Up> :res -1<CR>
-nnoremap <silent> <Down> :res +1<CR>
-nnoremap <silent> <Left> :vertical resize -5<CR>
-nnoremap <silent> <Right> :vertical resize +5<CR>
-
-" toggle search highlight
-nnoremap <Leader>h :set hlsearch!<CR>
-
-" shortcut to fix lines
-nnoremap <leader>p gqip
-
-" shortcut to vert split
-nnoremap vs :vsp<CR>
-
-" toggle spell checking
-nnoremap <leader>S :setlocal spell! spelllang=en_gb spell?<CR>:echo "zg to add new word"<CR>
-
-" toggle [ ] tick box on current line with ctrl-space
-function! ToggleTodo()
-    let l:line = getline('.')
-    if match(l:line, '\[x\]') != -1
-	let l:line = substitute(l:line, '\[x\]', '\[ \]', '')
-	call setline('.', l:line)
-    elseif match(l:line, '\[ \]') != -1
-	let l:line = substitute(l:line, '\[ \]', '\[x\]', '')
-	call setline('.', l:line)
-    endif
-endfunction
-nnoremap <silent> <C-@> :call ToggleTodo()<CR>
-
-" quickfix navigation
-nnoremap <localleader>cn :cn<CR>
-nnoremap <localleader>cp :cp<CR>
-
-" netrw
-nmap <C-n> :Explore<CR>
-let g:netrw_sort_sequence='[\/]$'
-
-" bind number keys to scroll so i can use foot terminal's alt scrolling
-map <Down> j
-map <Up> k
-
-
-" bind scroll to move cursor up and down
-nnoremap <ScrollWheelDown> <Down>
-nnoremap <ScrollWheelUp> <Up>
-inoremap <ScrollWheelDown> <Down>
-inoremap <ScrollWheelUp> <Up>
-vnoremap <ScrollWheelDown> <Down>
-vnoremap <ScrollWheelUp> <Up>
-
-" ALE navigation
-nmap <silent> <C-S-k> <Plug>(ale_previous_wrap)
-nmap <silent> <C-S-j> <Plug>(ale_next_wrap)

config/start/plugin/indent.vim Deleted

@@ -1,13 +0,0 @@
-"------------------------------------------------------------------
-"  Indentation of entire file
-"------------------------------------------------------------------
-
-"function! IndentFile()
-"    mkview
-"    let l:win_view = winsaveview()
-"    :normal! gg=G
-"    silent loadview
-"    call winrestview(l:win_view)
-"endfunction
-"
-"nnoremap <C-i> :call IndentFile()<CR>

config/start/plugin/folds.vim Deleted

@@ -1,34 +0,0 @@
-"------------------------------------------------------------------"
-" Global folding rules
-"------------------------------------------------------------------"
-
-
-" format folded section header text
-function! GenericFoldText()
-    let line = getline(v:foldstart)
-
-    let nucolwidth = &fdc + &number * &numberwidth
-    let windowwidth = winwidth(0) - nucolwidth - 3
-    let foldedlinecount = v:foldend - v:foldstart
-
-    let onetab = strpart('          ', 0, &tabstop)
-    let line = substitute(line, '\t', onetab, 'g')
-
-    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
-    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
-    return line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
-endfunction
-set foldtext=GenericFoldText()
-
-
-"function! GenericFolds()
-"    if match(getline(v:lnum), '^\s*' . &commentstring[0] . &commentstring[0]) >=0
-"	return ">1"
-"    else
-"	return "="
-"    endif
-"endfunction
-"
-"
-"set foldmethod=expr
-"set foldexpr=GenericFolds()

config/start/plugin/bclose.vim Deleted

@@ -1,87 +0,0 @@
-"------------------------------------------------------------------"
-" :bclose                                                          "
-"------------------------------------------------------------------"
-
-" Delete buffer while keeping window layout (don't close buffer's windows).
-" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
-if v:version < 700 || exists('loaded_bclose') || &cp
-    finish
-endif
-let loaded_bclose = 1
-if !exists('bclose_multiple')
-    let bclose_multiple = 1
-endif
-
-" Display an error message.
-function! s:Warn(msg)
-    echohl ErrorMsg
-    echomsg a:msg
-    echohl NONE
-endfunction
-
-" Command ':Bclose' executes ':bd' to delete buffer in current window.
-" The window will show the alternate buffer (Ctrl-^) if it exists,
-" or the previous buffer (:bp), or a blank buffer if no previous.
-" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
-" An optional argument can specify which buffer to close (name or number).
-function! s:Bclose(bang, buffer)
-    if empty(a:buffer)
-	let btarget = bufnr('%')
-    elseif a:buffer =~ '^\d\+$'
-	let btarget = bufnr(str2nr(a:buffer))
-    else
-	let btarget = bufnr(a:buffer)
-    endif
-    if btarget < 0
-	call s:Warn('No matching buffer for '.a:buffer)
-	return
-    endif
-    if empty(a:bang) && getbufvar(btarget, '&modified')
-	call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
-	return
-    endif
-    " Numbers of windows that view target buffer which we will delete.
-    let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
-    if !g:bclose_multiple && len(wnums) > 1
-	call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
-	return
-    endif
-    let wcurrent = winnr()
-    for w in wnums
-	execute w.'wincmd w'
-	let prevbuf = bufnr('#')
-	if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
-	    buffer #
-	else
-	    bprevious
-	endif
-	if btarget == bufnr('%')
-	    " Numbers of listed buffers which are not the target to be deleted.
-	    let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
-	    " Listed, not target, and not displayed.
-	    let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
-	    " Take the first buffer, if any (could be more intelligent).
-	    let bjump = (bhidden + blisted + [-1])[0]
-	    if bjump > 0
-		execute 'buffer '.bjump
-	    else
-		execute 'enew'.a:bang
-	    endif
-	endif
-    endfor
-    silent! execute 'bdelete'.a:bang.' '.btarget
-    silent! execute wcurrent.'wincmd w'
-endfunction
-command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('<bang>', '<args>')
-
-
-
-
-
-if v:servername == "VIMLAB"
-    nnoremap <buffer> <silent> <BS> <Plug>Kwbd
-else
-    autocmd BufDelete * if len(filter(range(1, bufnr('$')), 'empty(bufname(v:val)) && buflisted(v:val)')) == 1 && v:servername != "VIMLAB" | quit | endif
-endif
-
-nnoremap <silent> <BS> :Bclose<CR>

config/start/plugin/autohighlight.vim Deleted

@@ -1,23 +0,0 @@
-"------------------------------------------------------------------"
-" Highlight all instances of word under cursor, when idle.
-"------------------------------------------------------------------"
-function! AutoHighlightToggle()
-  let @/ = ''
-  if exists('#auto_highlight')
-    au! auto_highlight
-    augroup! auto_highlight
-    setl updatetime=4000
-    echo 'Highlight current word: off'
-    return 0
-  else
-    augroup auto_highlight
-      au!
-      au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>'
-    augroup end
-    setl updatetime=500
-    echo 'Highlight current word: ON'
-    return 1
-  endif
-endfunction
-
-nnoremap <bar> :if AutoHighlightToggle()<Bar>set hls<Bar>endif<CR>

config/start/ftplugin/vimwiki.vim Deleted

@@ -1,42 +0,0 @@
-"""" These commented commands are in vimrc, so ARE active:
-""" split open index of vimwiki.
-"nmap <Leader>wv :vsp<CR><Leader>ww
-
-"""" These commented commands are defaukts, so ARE active:
-""" \ww opens it normally, which is default, in new buffer
-"nmap <Leader>wh Vimwiki2HTML
-"nmap <Leader>whh Vimwiki2HTMLBrowse
-
-" open index wiki in horizontal split	
-nmap <buffer> <Leader>ws :sp<CR><Leader>ww
-
-" go to papers page
-nmap <buffer> <Leader>gp /[[/papers/papers<CR><CR>
-
-" save all as HTML
-nmap <buffer> <Leader>wa :VimwikiAll2HTML<CR>
-nmap <buffer> <Leader>wah :VimwikiAll2HTML<CR>:Vimwiki2HTMLBrowse<CR><CR>
-" save as HTML and quit
-nmap <buffer> <Leader>wq :VimwikiAll2HTML<CR>:wq<CR>
-
-" follow next link
-nmap <buffer> g<CR> /[[<CR><CR>
-
-" paste copied bullet pointed link as title
-nmap <buffer> <Leader>p 0f\|yy<CR>Pdf\|$xx===o<CR>
-
-" open pdf from papers page
-nmap <buffer> <Leader>o 0f\|lvt]y:let a = substitute(@*, ' ', '_', 'g') \| exec "!qpdfview --unique ~/work/research/papers/" . a . ".pdf &"<CR>
-
-" update papers page with new pdf files
-nmap <buffer> <Leader>u :!vimwiki_add_papers.sh<CR>
-
-" run goyo
-nmap <buffer> <Leader>g :Goyo<CR>
-
-
-setlocal wrap
-setlocal linebreak
-setlocal breakindent
-
-nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>

config/start/ftplugin/tex.vim Deleted

@@ -1,11 +0,0 @@
-setlocal tabstop=4
-setlocal softtabstop=4
-setlocal shiftwidth=4
-setlocal textwidth=110
-setlocal expandtab
-
-nnoremap K :VimtexDocPackage<CR>
-
-nnoremap <localleader>lw :exe 'cexpr system("texcount ' . expand('%') . '")'<CR>:copen<CR>
-
-nnoremap <localleader>c :VimtexCompile<CR>

config/start/ftplugin/sh.vim Deleted

@@ -1 +0,0 @@
-setlocal textwidth=79

config/start/ftplugin/rst.vim Deleted

@@ -1,8 +0,0 @@
-setlocal textwidth=79
-"setlocal spell spelllang=en_gb
-nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
-
-
-nnoremap <C-e>t :RivTableCreate<CR>
-nnoremap <C-e>l :RivCreateLink<CR>
-"<C-e>s[1,2,3] will make current line a heading

config/start/ftplugin/python.vim Deleted

@@ -1,5 +0,0 @@
-setlocal tabstop=4
-setlocal softtabstop=4
-setlocal shiftwidth=4
-setlocal textwidth=88
-setlocal expandtab

config/start/ftplugin/netrw.vim Deleted

@@ -1,2 +0,0 @@
-map <buffer> h -
-map <buffer> l <CR>

config/start/ftplugin/matlab.vim Deleted

@@ -1 +0,0 @@
-let g:tmux_cmd = "tmux send -t MATLAB:MATLAB "

config/start/ftplugin/markdown.vim Deleted

@@ -1,43 +0,0 @@
-setlocal tabstop=4
-setlocal softtabstop=4
-setlocal shiftwidth=4
-setlocal textwidth=101
-setlocal noautoindent
-setlocal nosmartindent
-"setlocal formatoptions+=a
-"setlocal spell spelllang=en_gb
-
-" format folded section header text
-function! GenericFoldText()
-    let line = getline(v:foldstart)
-
-    let nucolwidth = &fdc + &number * &numberwidth
-    let windowwidth = winwidth(0) - nucolwidth - 3
-    let foldedlinecount = v:foldend - v:foldstart
-
-    let onetab = strpart('          ', 0, &tabstop)
-    let line = substitute(line, '\t', onetab, 'g')
-
-    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
-    let level = (len(split(line)[0]) - 1) * 3
-    let level_indent = repeat(" ", level)
-    let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - level
-    return level_indent . line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
-endfunction
-setlocal foldtext=GenericFoldText()
-
-
-"function! MarkdownFixParagraph()
-"    let start = line("'{")
-"    let end = line("'}")
-"    let g:ale_markdown_prettier_fix_options =
-"	\ '--prose-wrap=always --print-width=101 --range-start=' . start . ' --range-end=' . end
-"    "ALEFix
-"endfunction
-"
-""nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
-"nnoremap <localleader>c :call MarkdownFixParagraph()<CR>
-
-"let b:ale_lint_on_text_changed = 1
-"let b:ale_fix_on_save = 1
-"let b:ale_lint_delay = 1000

config/start/ftplugin/javascript.vim Deleted

@@ -1,3 +0,0 @@
-setlocal tabstop=2
-setlocal softtabstop=2
-setlocal shiftwidth=2

config/start/ftplugin/include.vim Deleted

@@ -1 +0,0 @@
-setlocal filetype=html

config/start/ftplugin/html.vim Deleted

@@ -1,4 +0,0 @@
-setlocal tabstop=2
-setlocal softtabstop=2
-setlocal shiftwidth=2
-setlocal expandtab

config/start/ftplugin/help.vim Deleted

@@ -1,2 +0,0 @@
-" this overrides :Bclose in help windows
-nnoremap <buffer> <BS> :bd<CR>

config/start/ftplugin/haskell.vim Deleted

@@ -1,5 +0,0 @@
-setlocal tabstop=4
-setlocal softtabstop=4
-setlocal shiftwidth=4
-setlocal textwidth=88
-setlocal expandtab

config/start/ftplugin/h.vim Deleted

@@ -1 +0,0 @@
-setlocal filetype=c

config/start/after/plugin/theme.vim Deleted

config/start/after/plugin/gitgutter.vim Deleted

@@ -1,16 +0,0 @@
-""turn off realtime updates for gitgutter but update upon write
-"let g:gitgutter_enabled = 0
-"autocmd! gitgutter CursorHold,CursorHoldI
-"autocmd BufWritePost * GitGutter
-"
-"" gitgutter
-"nmap <localleader>g :GitGutterToggle<CR>
-"nmap gp <Plug>(GitGutterPreviewHunk)
-"nmap gs <Plug>(GitGutterStageHunk)
-"nmap gu <Plug>(GitGutterUndoHunk)
-"nmap [g <Plug>(GitGutterPrevHunk)
-"nmap ]g <Plug>(GitGutterNextHunk)
-"omap ig <Plug>(GitGutterTextObjectInnerPending)
-"omap ag <Plug>(GitGutterTextObjectOuterPending)
-"xmap ig <Plug>(GitGutterTextObjectInnerVisual)
-"xmap ag <Plug>(GitGutterTextObjectOuterVisual)

config/start/after/plugin/emoji-config.vim Deleted

@@ -1,7 +0,0 @@
-"------------------------------------------------------------------"
-" Config for https://gitlab.com/gi1242/vim-emoji-ab.git
-"------------------------------------------------------------------"
-
-" reload current buffer
-"runtime macros/emojis.vim
-

config/start/after/ftplugin/markdown.vim Deleted

@@ -1,77 +0,0 @@
-" Identify HTML comment-like blocks as markdown comments
-setlocal comments+=s:<!---,e:-->
-" couldn't get this to work, so just sticking in <br> where needed
-"setlocal comments+=s:![**,e:](
-
-" Folding logic below is derived from the vim-markdown-folding plugin
-function! StackedMarkdownFolds()
-  let thisline = getline(v:lnum)
-  let prevline = getline(v:lnum - 1)
-  let nextline = getline(v:lnum + 1)
-  if thisline =~ '^```.*$' && prevline =~ '^\s*$'  " start of a fenced block
-    return ">2"
-  elseif thisline =~ '^```$' && nextline =~ '^\s*$'  " end of a fenced block
-    return "<2"
-  endif
-
-  if HeadingDepth(v:lnum) > 0
-    return ">1"
-  else
-    return "="
-  endif
-endfunction
-
-function! HeadingDepth(lnum)
-  let level=0
-  let thisline = getline(a:lnum)
-  if thisline =~ '^#\+\s\+'
-    let hashCount = len(matchstr(thisline, '^#\{1,6}'))
-    if hashCount > 0
-      let level = hashCount
-    endif
-  else
-    if thisline != ''
-      let nextline = getline(a:lnum + 1)
-      if nextline =~ '^=\+\s*$'
-        let level = 1
-      elseif nextline =~ '^-\+\s*$'
-        let level = 2
-      endif
-    endif
-  endif
-  if level > 0 && HasSyntaxGroup(a:lnum, '\vmarkdown(Code|Highlight)')
-    " Ignore # or === if they appear within fenced code blocks
-    let level = 0
-  endif
-  return level
-endfunction
-
-function! HasSyntaxGroup(lnum, targetGroup)
-  let syntaxGroup = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
-  for value in syntaxGroup
-    if value =~ a:targetGroup
-        return 1
-    endif
-  endfor
-endfunction
-
-function! s:FoldText()
-  let level = HeadingDepth(v:foldstart)
-  let indent = repeat('#', level)
-  let title = substitute(getline(v:foldstart), '^#\+\s\+', '', '')
-
-  let spaces_1 = repeat(' ', level) . '   '
-  let spaces_2 = repeat(' ', 200)
-
-  return indent.spaces_1.title.spaces_2
-endfunction
-
-setlocal foldmethod=expr
-
-let &l:foldtext = expand('<SID>') . 'FoldText()'
-let &l:foldexpr = 'StackedMarkdownFolds()'
-
-if !exists("b:undo_ftplugin") | let b:undo_ftplugin = '' | endif
-let b:undo_ftplugin .= '
-  \ | setlocal foldmethod< foldtext< foldexpr<
-  \ '

.gitmodules Added

@@ -0,0 +1,21 @@
+[submodule "start/ale"]
+	path = start/ale
+	url = https://github.com/dense-analysis/ale
+[submodule "start/tide"]
+	path = start/tide
+	url = https://github.com/m-col/tide
+[submodule "start/haskell-vim"]
+	path = start/haskell-vim
+	url = https://github.com/neovimhaskell/haskell-vim.git
+[submodule "start/vim-emoji-ab"]
+	path = start/vim-emoji-ab
+	url = https://gitlab.com/gi1242/vim-emoji-ab.git
+[submodule "start/dhall-vim"]
+	path = start/dhall-vim
+	url = https://github.com/vmchale/dhall-vim.git
+[submodule "start/vim-fugitive"]
+	path = start/vim-fugitive
+	url = https://github.com/tpope/vim-fugitive
+[submodule "start/indentLine"]
+	path = start/indentLine
+	url = https://github.com/Yggdroot/indentLine