1 " Copyright (c) 2026 Julian Mendoza;
      2 "
      3 " MIT License
      4 "
      5 " Permission is hereby granted, free of charge, to any person obtaining a copy
      6 " of this software and associated documentation files (the "Software"), to deal
      7 " in the Software without restriction, including without limitation the rights
      8 " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      9 " copies of the Software, and to permit persons to whom the Software is
     10 " furnished to do so, subject to the following conditions:
     11 "
     12 " The above copyright notice and this permission notice shall be included in all
     13 " copies or substantial portions of the Software.
     14 "
     15 " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     16 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     17 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     18 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     19 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     20 " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     21 " SOFTWARE.
     22 
     23 ""
     24 " jmend's vimrc!
     25 "
     26 " Self Link: jmend.io/vimrc
     27 "
     28 " Installing Required Plugins:
     29 "   1. Install vim-plug: https://github.com/junegunn/vim-plug
     30 "   2. Run :PlugInstall
     31 "   3. Restart vim
     32 "
     33 " Self-Documentation:
     34 "   :Wtf commands ~ Show commands set in this vimrc
     35 "   :Wtf mappings ~ Show mappings set in this vimrc
     36 "   :Wtf <tab>    ~ Show other documentation available
     37 "                   (Mostly misc. stuff I find useful to remember)
     38 
     39 " Required here for vim9+
     40 set nocompatible
     41 
     42 " Command Prefix:
     43 "   <leader>      : used for global mappings
     44 "   <localleader> : used for buffer-local mappings
     45 let mapleader = '\'
     46 let maplocalleader = '\'
     47 
+  -    48 +-- 39 lines: System Dependencies:
  48 " System Dependencies: {{{
|    49 let g:jm_vimrc = {}
|    50 
|    51 " Will store documentation
|    52 " Accessible with the :Wtf command
|    53 let g:jm_vimrc.docs = {}
|    54 
|    55 " Map from defined commands to description
|    56 " See :Wtf commands
|    57 let g:jm_vimrc.docs.commands = {}
|    58 
|    59 " Map from defined mappings to description
|    60 " See :Wtf mappings
|    61 let g:jm_vimrc.docs.mappings = {}
|    62 
|    63 " A variety of dependencies on the system
|    64 let g:jm_vimrc.deps = #{
|    65       \   jshell: 'jshell',
|    66       \   curl:   'curl',
|    67       \   blaze:  'blaze',
|    68       \   javap:  'javap',
|    69       \   ag:     'ag',
|    70       \   fish:   'fish',
|    71       \   python: 'python3',
|    72       \ }
|    73 
|    74 " Whether this computer is a mac
|    75 let g:jm_vimrc.is_mac = system('uname -s') =~# 'Darwin'
|    76 
|    77 " Whether python is supported
|    78 let g:jm_vimrc.has_python = has('python3')
|    79 
|    80 " Some system dependencies
|    81 let g:jm_vimrc.deps.JavaClassnameList      = {-> systemlist('fish -c "classpath list-all-classes"')}
|    82 let g:jm_vimrc.deps.ClasspathJarList       = {-> systemlist('fish -c classpath')}
|    83 "let g:jm_vimrc.deps.google_java_executable = 'google-java-format --skip-javadoc-formatting'
|    84 let g:jm_vimrc.deps.google_java_executable = 'google-java-format'
|    85 let g:jm_vimrc.deps.buildozer   = 'fish -c buildozer'
|    86 " }}}
     87 
+  -    88 +-- 29 lines: Playground:
  88 " Playground: {{{
|    89 let s:pg_items = (g:jm_vimrc.is_mac)
|    90       \ ? #{
|    91       \     co: 'Files ~/Playground',
|    92       \     cj: 'Files ~/Playground/jdk/src/java.base/share/classes',
|    93       \     cO: 'Files /opt/homebrew/lib/ocaml/',
|    94       \     pg: 'Files ~/Playground',
|    95       \     n:  'Files ~/Playground/jmendio/n',
|    96       \     v:  'edit ~/.vimrc',
|    97       \   }
|    98       \ : #{
|    99       \     a:  'Files ~/code/abseil-cpp/absl',
|   100       \     co: 'Files ~/code',
|   101       \     cg: 'Files ~/code/guava/guava/src',
|   102       \     cj: 'Files ~/code/jdk/src/java.base/share/classes',
|   103       \     cv: 'Files ~/code/opencv/modules/core',
|   104       \     cp: 'Files ~/code/pandas',
|   105       \     cd: 'Files ~/code/dagger',
|   106       \     cb: 'Files ~/code/basis',
|   107       \     cO: 'Files /usr/lib/ocaml',
|   108       \     j:  'Files ~/junk',
|   109       \     n:  'Files ~/jmendio/n',
|   110       \     v:  'edit ~/.vimrc',
|   111       \   }
|   112 for [key, path] in items(s:pg_items)
|   113   execute printf('nnoremap <leader>e%s :%s<cr>', key, path)
|   114   let g:jm_vimrc.docs.mappings['\e' .. key] = 'Run :' .. path
|   115 endfor
|   116 " }}} Playground
    117 
+  -   118 +-- 87 lines: Plugins (vim-plug):
 118 " Plugins (vim-plug): {{{
|   119 call plug#begin('~/.vim/bundle')
|   120 
|   121 "" Plugins:
|   122 Plug 'morhetz/gruvbox'
|   123 Plug 'tpope/vim-surround'
|   124 Plug 'scrooloose/nerdtree'
|   125 Plug 'godlygeek/tabular'
|   126 if g:jm_vimrc.has_python
|   127   Plug 'SirVer/ultisnips'
|   128   Plug 'Valloric/YouCompleteMe'
|   129 endif
|   130 Plug 'honza/vim-snippets'
|   131 Plug 'junegunn/fzf', {'do': {-> fzf#install()}}
|   132 Plug 'junegunn/fzf.vim'
|   133 Plug 'junegunn/vim-easy-align'
|   134 Plug 'tpope/vim-fugitive'
|   135 Plug 'moll/vim-bbye'
|   136 Plug 'scrooloose/nerdcommenter' " \c<Space> \cc
|   137 Plug 'jiangmiao/auto-pairs'
|   138 Plug 'tpope/vim-repeat'
|   139 Plug 'triglav/vim-visual-increment'
|   140 Plug 'tmhedberg/SimpylFold'
|   141 Plug 'majutsushi/tagbar'
|   142 Plug 'pangloss/vim-javascript'
|   143 Plug 'justinmk/vim-syntax-extra'
|   144 Plug 'jpalardy/vim-slime'
|   145 Plug 'itchyny/lightline.vim'
|   146 Plug 'ap/vim-buftabline'
|   147 Plug 'airblade/vim-gitgutter'
|   148 Plug 'google/vim-maktaba'
|   149 Plug 'google/vim-codefmt'
|   150 Plug 'google/vim-glaive'
|   151 Plug 'frazrepo/vim-rainbow'
|   152 Plug 'AndrewRadev/splitjoin.vim' " gS gJ
|   153 Plug 'AndrewRadev/linediff.vim'
|   154 Plug 'shiracamus/vim-syntax-x86-objdump-d'
|   155 if isdirectory('$OCAML_OCP_INDENT')
|   156   Plug $OCAML_OCP_INDENT
|   157 endif
|   158 if exists("$BASIS")
|   159   Plug $BASIS, { 'rtp': 'vim' }
|   160 else
|   161   Plug 'jmend736/basis', { 'rtp': 'vim' }
|   162 endif
|   163 
|   164 "" Old Plugins:
|   165 " Plug 'vim-scripts/DrawIt'
|   166 " Plug 'cohama/lexima.vim'
|   167 " Plug 'mattn/emmet-vim'
|   168 " Plug 'sheerun/vim-polyglot'
|   169 " Plug 'fatih/vim-go'
|   170 " Plug 'davidhalter/jedi-vim'
|   171 " Plug 'ervandew/supertab'
|   172 " Plug 'w0rp/ale'
|   173 " Plug 'neoclide/coc.nvim', {'branch': 'release'}
|   174 " http://eclim.org
|   175 " Plug 'bazelbuild/vim-ft-bzl'
|   176 " -> https://github.com/bazelbuild/vim-ft-bzl/commit/941fb142f604c254029c2a0852ea7578f08de91a
|   177 " Plug 'nelstrom/vim-markdown-folding'
|   178 " Plug 'romainl/vim-devdocs'
|   179 
|   180 "" Plugins to check out:
|   181 " Plug 'liuchengxu/vista.vim'
|   182 " Plug 'natebosch/vim-lsc'
|   183 " Plug 'chrisbra/NrrwRgn'
|   184 " Plug 'justinmk/vim-sneak'
|   185 " Plug 'romainl/vim-qf'
|   186 " Plug 'romainl/vim-qlist'
|   187 " Plug 'mbbill/undotree'
|   188 " Plug 'wellle/targets.vim'
|   189 call plug#end()
|   190 
|   191 if !exists('g:loaded_plug')
|   192   echoerr "ERROR: vim-plug is REQUIRED https://github.com/junegunn/vim-plug OR :InstallPlug"
|   193   command InstallPlug execute printf('term curl -fLo %s/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', $HOME)
|   194   finish
|   195 endif
|   196 
|   197 
|   198 call glaive#Install()
|   199 
|   200 Glaive codefmt
|   201       \ google_java_executable=`g:jm_vimrc.deps.google_java_executable`
|   202       \ clang_format_style='Google'
|   203 
|   204 " }}} Plugins (Vundle)
    205 
+  -   206 +--105 lines: General Options:
 206 " General Options: {{{
|   207 filetype plugin indent on
|   208 
|   209 set t_Co=256        " Number of colors
|   210 set t_ut=           " Use current background color for clearing
|   211 
|   212 set scrolloff=0     " Minimal number of screen lines to keep above/below cursor
|   213 
|   214 set shell=/bin/bash " Sets the shell to use
|   215 
|   216 set hidden          " Whether to allow modified buffers to be hidden
|   217 
|   218 set tabstop=2       " Number of spaces that a read <Tab> counts for
|   219 set softtabstop=2   " Number of spaces an inserted <Tab> counts for
|   220 set shiftwidth=2    " Sets what >> and << ops do
|   221 set expandtab       " Replace tabs with spaces when editing
|   222 set smarttab        " More reasonable tab actions
|   223 
|   224 set autoindent      " Copy indent from current line when starting a new line
|   225 set smartindent     " Adds indents after {, or 'cinwords'
|   226 
|   227                     " Reasonable backspace functionality
|   228 set backspace=indent,eol,start
|   229 
|   230 set list            " Replace certain characters visually
|   231 set listchars=tab:\>\ ,trail:·,extends:,precedes:|   232 
|   233 set number           " Show line number at cursor,
|   234 set numberwidth=4    " with a column width of 3,
|   235 set relativenumber   " and numbers relative to cursor elsewhere
|   236 set noruler          " Show line/col number (hidden by lightline)
|   237 set showcmd          " Show currently entered command below status
|   238                      " Define status line (hidden by lightline)
|   239 set statusline=%f\ %=L:%l/%L\ %c\ (%p%%)
|   240 
|   241 set wildmenu         " Tab completion for : command
|   242 set wildmode=longest,list,full
|   243 
|   244 set hlsearch         " Highlight search results
|   245 set incsearch        " Highlight while searching
|   246 set foldopen-=search " Whether to open folds when searching
|   247                      " Also see :ToggleFoldOpenSearch
|   248 set foldlevel=999    " Start with all folds open
|   249 
|   250 " Ignore case, unless you use uppercase characters
|   251 set ignorecase
|   252 set smartcase
|   253 
|   254 " Other
|   255 set fileencodings=utf-8
|   256 set tags=tags
|   257 set tags+=/usr/include/**/tags
|   258 set printoptions=number:y,duplex:long,paper:letter
|   259 if g:jm_vimrc.is_mac
|   260   set clipboard=unnamed
|   261 else
|   262   set clipboard=unnamedplus
|   263 endif
|   264 set errorbells
|   265 set laststatus=2
|   266 set cursorline
|   267 set sessionoptions=
|   268       \blank,
|   269       \curdir,
|   270       \folds,
|   271       \help,
|   272       \localoptions,
|   273       \options,
|   274       \tabpages,
|   275       \winsize,
|   276       \terminal
|   277 
|   278 set directory=~/.swaps//
|   279 
|   280 " Some mathematical digraphs
|   281 digraphs el 8712 " Element in
|   282 digraphs in 8712 " Element in
|   283 digraphs ni 8713 " element not in
|   284 digraphs es 8709 " Empty Set
|   285 digraphs ss 8834 " Subset
|   286 digraphs se 8838 " Subset equals
|   287 digraphs ns 8836 " Not subset
|   288 digraphs nS 8840 " Not subset equals
|   289 digraphs nn 8745 " Intersection
|   290 digraphs uu 8746 " Union
|   291 digraphs un 8746 " Union
|   292 digraphs co 8728 " Composition
|   293 digraphs \|> 8614 " Maps to
|   294 digraphs tl 8598 " Diagonal arrow top-left
|   295 digraphs tr 8599 " Diagonal arrow top-right
|   296 digraphs br 8600 " Diagonal arrow bot-right
|   297 digraphs bl 8601 " Diagonal arrow bot-left
|   298 digraphs -u 8593 " Up arrow
|   299 digraphs -d 8595 " down arrow
|   300 digraphs c. 183  " center dot
|   301 digraphs .. 183  " center dot
|   302 digraphs T- 8866  " Turnstile (right) |-
|   303 digraphs -T 8867  " Turnstile (left) -|
|   304 digraphs =v 8659  " Downwards double arrow
|   305 
|   306 " Themes
|   307 colorscheme gruvbox
|   308 syntax enable
|   309 set bg=dark
|   310 " }}} General Settings
    311 
+  -   312 +-- 65 lines: Plugin Settings:
 312 " Plugin Settings: {{{
|   313 
|   314 let g:lightline = {
|   315       \   'active': {
|   316       \     'left': [['mode', 'paste'], ['filename', 'modified']],
|   317       \     'right': [['winlayout', 'winid_bufnr', 'lineinfo'], ['percent', 'foldlevel'], ['readonly']]
|   318       \   },
|   319       \   'inactive': {
|   320       \     'left': [['filename', 'modified']],
|   321       \     'right': [['winlayout', 'winid_bufnr', 'lineinfo'], ['readonly']]
|   322       \   },
|   323       \   'component_type': {
|   324       \     'readonly': 'error',
|   325       \   },
|   326       \   'component': {
|   327       \     'winid_bufnr': '[%{winnr()}/%{win_getid()}(%{Layout()[win_getid()]})]{%{bufnr()}}',
|   328       \     'foldlevel': '%{(&foldenable) ? &foldlevel : "-"}f',
|   329       \   },
|   330       \ }
|   331 
|   332 if !g:jm_vimrc.is_mac
|   333   let $FZF_DEFAULT_COMMAND = 'ag -l'
|   334 endif
|   335 
|   336 let g:html_dynamic_folds = v:true
|   337 
|   338 let g:ycm_auto_trigger = 1
|   339 let g:ycm_disable_signature_help = 1
|   340 let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
|   341 let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
|   342 
|   343 let g:slime_target = "tmux"
|   344 
|   345 " Will disable indent-based markdown code blocks
|   346 let g:bss_markdown_fix = 1
|   347 
|   348 let g:bss_java_fix = 1
|   349 
|   350 let g:markdown_folding = 1
|   351 
|   352 let g:NERDCompactSexyComs = v:true
|   353 let g:NERDCommentEmptyLines = v:true
|   354 let g:NERDDefaultAlign = 'left'
|   355 
|   356 let g:tagbar_sort = v:false
|   357 
|   358 " Use ordinal numbers (2) rather than bufnum (1)
|   359 let g:buftabline_numbers = 2
|   360 let g:buftabline_indicators = v:true
|   361 let g:buftabline_separators = v:false
|   362 
|   363 let g:netre_liststyle=3
|   364 
|   365 let g:tex_flavor='latex'
|   366 
|   367 let g:UltiSnipsExpandTrigger="<tab>"
|   368 let g:UltiSnipsJumpForwardTrigger="<c-j>"
|   369 let g:UltiSnipsJumpBackwardTrigger="<c-z>"
|   370 let g:UltiSnipsEditSplit="vertical"
|   371 
|   372 let g:gitgutter_sign_added = '··'
|   373 let g:gitgutter_sign_modified = '··'
|   374 let g:gitgutter_sign_removed = '·'
|   375 let g:gitgutter_sign_modified_removed = '·'
|   376 " }}} Plugin Settings
    377 
+  -   378 +--153 lines: Keymappings:
 378 " Keymappings: {{{
|   379 "   To understand keys see :h key-notation
|   380 
|   381 " By default, `j` and `k` will move between lines; this means they will skip
|   382 " over multiple lines when lines wrap.
|   383 "
|   384 " Uncomment the 4 lines below so that `j` and `k` move between lines on the
|   385 " screen.
|   386 "nnoremap j gj
|   387 "nnoremap k gk
|   388 "vnoremap j gj
|   389 "vnoremap k gk
|   390 
|   391 " Moving around between windows quickly
|   392 let g:jm_vimrc.docs.mappings['<C-[hjkl]>'] =
|   393       \ 'Move between windows by holding CTRL'
|   394 noremap <C-j> <C-W>j
|   395 noremap <C-k> <C-W>k
|   396 noremap <C-h> <C-W>h
|   397 noremap <C-l> <C-W>l
|   398 
|   399 let g:jm_vimrc.docs.mappings['<C-[←↑↓→]>'] =
|   400       \ 'Move visual selection'
|   401 vnoremap <C-Up> koko
|   402 vnoremap <C-Down> jojo
|   403 vnoremap <C-Left> hoho
|   404 vnoremap <C-Right> lolo
|   405 
|   406 let g:jm_vimrc.docs.mappings['[['] =
|   407       \ 'Enable [[,][,]],[] to operate on non-col-1-{}'
|   408 " From :h object-motions
|   409 nnoremap [[ ?{<CR>w99[{
|   410 nnoremap ][ /}<CR>b99]}
|   411 nnoremap ]] j0[[%/{<CR>
|   412 nnoremap [] k$][%?}<CR>
|   413 
|   414 let g:jm_vimrc.docs.mappings['\q'] =
|   415       \ 'Delete current buffer without changing window layout'
|   416 nnoremap <leader>q :Bdelete<cr>
|   417 
|   418 let g:jm_vimrc.docs.mappings["\\'"] =
|   419       \ 'Open NERDTree (file explorer)'
|   420 nnoremap <leader>' :NERDTreeToggle<cr>
|   421 
|   422 let g:jm_vimrc.docs.mappings['\"'] =
|   423       \ 'Open NERDTree (file explorer) to current file'
|   424 nnoremap <leader>" :NERDTreeFind<cr>
|   425 
|   426 let g:jm_vimrc.docs.mappings['\<Tab>'] =
|   427       \ 'Open Tagbar'
|   428 nnoremap <leader><tab> :TagbarToggle<cr>
|   429 
|   430 let g:jm_vimrc.docs.mappings['<F10>'] =
|   431       \ 'Toggle paste'
|   432 set pastetoggle=<F10>
|   433 
|   434 let g:jm_vimrc.docs.mappings['<F9>'] =
|   435       \ 'Toggle virtualedit=all'
|   436 nnoremap <F9> :let &ve = <C-r>=empty(&ve) ? '"all"' : '""'<cr><cr>
|   437 
|   438 let g:jm_vimrc.docs.mappings['<C-r><C-f>'] =
|   439       \ '[modes:ic] Insert file name root'
|   440 inoremap <C-r><C-f> <C-r>=expand('%:p:t:r')<cr>
|   441 cnoremap <C-r><C-f> <C-r>=expand('%:p:t:r')<cr>
|   442 
|   443 let g:jm_vimrc.docs.mappings['<C-r><C-t>'] =
|   444       \ '[modes:ic] Insert file name root'
|   445 inoremap <C-r><C-t> <C-r>=bss#blaze#BlazeTarget()<cr>
|   446 cnoremap <C-r><C-t> <C-r>=bss#blaze#BlazeTarget()<cr>
|   447 
|   448 let g:jm_vimrc.docs.mappings['<C-p>'] =
|   449       \ 'Fuzzy-search PWD'
|   450 nnoremap <C-p> :Files<cr>
|   451 
|   452 let g:jm_vimrc.docs.mappings['\w'] =
|   453       \ 'Clear search highlights (:nohlsearch)'
|   454 nnoremap <silent> <leader>w :nohlsearch<Bar>:echo<cr>
|   455 
|   456 let g:jm_vimrc.docs.mappings['<F11>'] =
|   457       \ 'Ensure non-syntax toplevel text is spell-checked'
|   458 noremap <F11> :syntax spell toplevel<cr>
|   459 let g:jm_vimrc.docs.mappings['<F12>'] =
|   460       \ 'Toggle spell checking'
|   461 noremap <F12> :setlocal spell! spelllang=en_us<cr>
|   462 
|   463 let g:jm_vimrc.docs.mappings['<Space>l'] =
|   464       \ 'Open Git ("Change [L]ist")'
|   465 nnoremap <leader>l :Git<cr>
|   466 
|   467 let g:jm_vimrc.docs.mappings['<C-w><C-z>'] =
|   468       \ 'Set window height to 10 and fix the height'
|   469 nnoremap <C-w><C-z> :FixHeight 10<cr>
|   470 nnoremap <C-w>z :FixHeight 10<cr>
|   471 
|   472 let g:jm_vimrc.docs.mappings['K'] =
|   473       \ 'Do grep for word under cursor'
|   474 nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
|   475 
|   476 let g:jm_vimrc.docs.mappings['\\'] =
|   477       \ 'Show :tags'
|   478 nnoremap <leader><leader> :tags<cr>
|   479 
|   480 let g:jm_vimrc.docs.mappings['\s'] =
|   481       \ 'Refresh UltSnips snippets'
|   482 nnoremap <leader>s :call UltiSnips#RefreshSnippets()<cr>
|   483 
|   484 let g:jm_vimrc.docs.mappings['\<Space>'] =
|   485       \ 'Toggle foldcolumn'
|   486 nnoremap <leader><space> :let &l:foldcolumn = (&l:foldcolumn) ? 0 : 3<cr>
|   487 
|   488 let g:jm_vimrc.docs.mappings['\a'] =
|   489       \ 'Trigger EasyAlign (See :Wtf ea)'
|   490 xmap <leader>a <Plug>(EasyAlign)
|   491 nmap <leader>a <Plug>(EasyAlign)
|   492 
|   493 let g:jm_vimrc.docs.mappings['\O'] =
|   494       \ 'Run `open %`'
|   495 xmap <leader>O :<C-u>!open %<cr>
|   496 nmap <leader>O :<C-u>!open %<cr>
|   497 
|   498 let g:jm_vimrc.docs.mappings["C-W !"] =
|   499       \ 'Toggle buflisted'
|   500 nnoremap <C-W>l :set buflisted!<cr>
|   501 
|   502 nnoremap <space>c  :YcmCompleter GetType<cr>
|   503 nnoremap <space>cq :YcmCompleter GoToDocumentOutline<cr>
|   504 nnoremap <space>cc :YcmCompleter GoToCallers<cr>
|   505 nnoremap <space>cC :YcmCompleter GoToDefinition<cr>
|   506 nnoremap <space>cf :YcmCompleter FixIt<cr>
|   507 nnoremap <space>cd :YcmCompleter GetDoc<cr>
|   508 nnoremap <space>ct :YcmCompleter GetType<cr>
|   509 
|   510 let g:jm_vimrc.docs.mappings["<space>T"] =
|   511       \ 'Go to java test (and maybe make it)'
|   512 nnoremap <space>T :FindOrMakeJavaTest<cr>
|   513 
|   514 let g:jm_vimrc.docs.mappings['\a[:(]'] =
|   515       \ 'Extra/overriden EasyAlign items'
|   516 let g:easy_align_delimiters = bss#extra#EasyAlignDelimiters()
|   517 
|   518 let g:jm_vimrc.docs.mappings['\[0-9]'] =
|   519       \ 'Switch to buffer (from buftabline)'
|   520 nmap <leader>1 <Plug>BufTabLine.Go(1)
|   521 nmap <leader>2 <Plug>BufTabLine.Go(2)
|   522 nmap <leader>3 <Plug>BufTabLine.Go(3)
|   523 nmap <leader>4 <Plug>BufTabLine.Go(4)
|   524 nmap <leader>5 <Plug>BufTabLine.Go(5)
|   525 nmap <leader>6 <Plug>BufTabLine.Go(6)
|   526 nmap <leader>7 <Plug>BufTabLine.Go(7)
|   527 nmap <leader>8 <Plug>BufTabLine.Go(8)
|   528 nmap <leader>9 <Plug>BufTabLine.Go(9)
|   529 nmap <leader>0 <Plug>BufTabLine.Go(10)
|   530 " }}} Keymappings
    531 
+  -   532 +--226 lines: Commands:
 532 " Commands: {{{
|   533 " Note -bar allows these to be followed by | to chain commands (ie. for autocmds)
|   534 
|   535 " Command :Term ~ Nicer :term API
|   536 " :Term ~ Runs 'shell'
|   537 " :Term [command]... ~ Runs the command in 'shell'
|   538 "
|   539 " This command will reuse the last window, unless it's no longer being used
|   540 " for the terminal buffer. Also, this hides the buffer, in case you leave a
|   541 " terminal window running and don't want to accidentally get stuck in it.
|   542 if !exists('g:jm_term') || !exists('g:jm_terms')
|   543   let g:jm_term = bss#view#TermView()
|   544   let g:jm_terms = {}
|   545 endif
|   546 let g:jm_vimrc.docs.commands['Term'] =
|   547       \ 'Run a terminal command in a reused window'
|   548 command! -nargs=* -complete=shellcmd Term
|   549       \ eval g:jm_term.Run(<q-args>)
|   550 
|   551 let g:jm_vimrc.docs.commands['TermSet'] =
|   552       \ 'Set an option on the term window'
|   553 command! -nargs=* -complete=option TermSet
|   554       \ eval g:jm_term.Exec(printf("setlocal %s", <q-args>))
|   555 
|   556 let g:jm_vimrc.docs.commands['Terms'] =
|   557       \ 'Run a terminal command in a reused named window. Terms [name] [cmd]...'
|   558 command! -nargs=* -complete=shellcmd Terms
|   559       \ eval bss#SetDefault(g:jm_terms, [<f-args>][0], {-> bss#view#TermView()})
|   560       \   .Run([<f-args>][1:]->join(' '))
|   561 
|   562 let g:jm_vimrc.docs.commands['ReplaceR'] =
|   563       \ 'Locally set \r to run :Term with the specified command'
|   564 command! -nargs=+ ReplaceR
|   565       \ nnoremap <buffer> <localleader>r :Term <args><cr>
|   566 
|   567 let g:jm_vimrc.docs.commands['ReplaceRTarget'] =
|   568       \ 'Set \r to bazel target of the current file'
|   569 command! -bar ReplaceRTarget
|   570       \ execute 'ReplaceR' BlazeGuessCommand()
|   571 
|   572 let g:jm_vimrc.docs.commands['StopAllJobs'] =
|   573       \ 'Stop all running jobs'
|   574 command! -bar StopAllJobs eval job_info()->map('job_stop(v:val)')
|   575 
|   576 let g:jm_vimrc.docs.commands['ListAllJobs'] =
|   577       \ 'List all running jobs'
|   578 command! -bar -bang ListAllJobs
|   579       \ call bss#PP(job_info()->filter('<bang>0 || (job_status(v:val) == "run")'))
|   580 
|   581 let g:jm_vimrc.docs.commands['DumpAllJobs'] =
|   582       \ 'List job_infos for all running jobs'
|   583 command! -bar -bang DumpAllJobs
|   584       \ call bss#PP(job_info()->filter('<bang>0 || (job_status(v:val) == "run")')->map('job_info(v:val)'))
|   585 
|   586 let g:jm_vimrc.docs.commands['SetupClasspath'] =
|   587       \ 'Set classpath to jm_vimrc.deps.ClasspathJarList()'
|   588 command! -bar SetupClasspath
|   589       \ let $CLASSPATH = join(g:jm_vimrc.deps.ClasspathJarList(), ':')
|   590 
|   591 let g:jm_vimrc.docs.commands['SetupTargetClasspath'] =
|   592       \ 'Set classpath to blaze target included jars'
|   593 command! -bar SetupTargetClasspath
|   594       \ let $CLASSPATH = s:TargetClasspath()
|   595 
|   596 let g:jm_vimrc.docs.commands['SetupCV'] =
|   597       \ 'Setup $LDFLAGS, $CFLAGS and &path for OpenCV development'
|   598 command! -bar SetupCV
|   599       \ let $LDFLAGS = '-lopencv_core -lopencv_imgcodecs -lopencv_imgproc' |
|   600       \ let $CFLAGS = '-I/usr/include/opencv4' |
|   601       \ let &path ..= ',/usr/include/opencv4,/usr/include/c++/10/'
|   602 
|   603 let g:jm_vimrc.docs.commands['FixHeight'] =
|   604       \ 'Resize window and fix its height'
|   605 command! -nargs=1 FixHeight
|   606       \ resize <args> | set winfixheight
|   607 
|   608 let g:jm_vimrc.docs.commands['SetupTermRainbow'] =
|   609       \ 'Add Rainbow-coloring to terminals'
|   610 command! -bar SetupTermRainbow
|   611       \ autocmd TerminalOpen * RainbowLoad
|   612 
|   613 let g:jm_vimrc.docs.commands['SetupAutoread'] =
|   614       \ 'Enable autoread and add checktime autocmd'
|   615 command! -bar SetupAutoread
|   616       \ set autoread | autocmd FocusGained,BufEnter * checktime
|   617 
|   618 let g:jm_vimrc.docs.commands['RemoveTrailingWhitespace'] =
|   619       \ 'Removes all trailing whitespace from the selected lines'
|   620 command! -range=% RemoveTrailingWhitespace
|   621       \ <line1>,<line2>s/\s\+$//
|   622 
|   623 let g:jm_vimrc.docs.commands['SetupMatchHex'] =
|   624       \ 'Match hex numbers'
|   625 command! -bar SetupMatchHex
|   626       \ match GruvboxAqua /\<0x0*\zs[1-9a-f]\x*\>/
|   627 
|   628 let g:jm_vimrc.docs.commands['SetupMatchNum'] =
|   629       \ 'Match decimal numbers'
|   630 command! -bar SetupMatchNum
|   631       \ match GruvboxAqua /\<\(0x\)\?0*\zs[1-9a-f]\x*\>/
|   632 
|   633 let g:jm_vimrc.docs.commands['RefreshSnippets'] =
|   634       \ 'Refresh ultisnips'
|   635 command! -bar RefreshSnippets
|   636       \ call UltiSnips#RefreshSnippets()
|   637 
|   638 let g:jm_vimrc.docs.commands['Dis'] =
|   639       \ 'Setup terminal for viewing objdump output ($ objdump -d ... | vim +Dis -)'
|   640 command! -bar Dis
|   641       \ setlocal ft=dis buftype=nofile
|   642 
|   643 let g:jm_vimrc.docs.commands['Center'] =
|   644       \ 'Block alignment-preserving :center'
|   645 call bss#draw#block#RegisterCommands()
|   646 
|   647 let g:jm_vimrc.docs.commands['ToggleFoldOpenSearch'] =
|   648       \ 'Toggle search on foldopen option'
|   649 command! ToggleFoldOpenSearch
|   650       \ if stridx(&foldopen, "search") == -1 |
|   651       \   set foldopen+=search |
|   652       \   echo "ENABLED foldopen search" |
|   653       \ else |
|   654       \   set foldopen-=search |
|   655       \   echo "DISABLED foldopen search" |
|   656       \ endif
|   657 
|   658 let g:jm_vimrc.docs.commands['SetupMath'] =
|   659       \ 'Set up abbreviations for math symbols'
|   660 command! SetupMath
|   661       \ execute 'iabbrev <buffer> nn ∩' |
|   662       \ execute 'iabbrev <buffer> uu ∪' |
|   663       \ execute 'iabbrev <buffer> in ∈' |
|   664       \ execute 'iabbrev <buffer> ni ∉' |
|   665       \ execute 'iabbrev <buffer> ss ⊂' |
|   666       \ execute 'iabbrev <buffer> se ⊆' |
|   667       \ execute 'iabbrev <buffer> ns ⊄' |
|   668       \ execute 'iabbrev <buffer> AN ∧' |
|   669       \ execute 'iabbrev <buffer> OR ∨' |
|   670       \ execute 'iabbrev <buffer> es ∅' |
|   671       \ execute 'iabbrev <buffer> => ⇒' |
|   672       \ execute 'iabbrev <buffer> == ⇔' |
|   673       \ execute 'iabbrev <buffer> != ≠' |
|   674       \ execute 'iabbrev <buffer> co ∘' |
|   675       \ execute 'iabbrev <buffer> FA ∀' |
|   676       \ execute 'iabbrev <buffer> TE ∃' |
|   677       \ execute 'iabbrev <buffer> \|> ↦'
|   678 
|   679 let g:jm_vimrc.docs.commands['PyHelp'] =
|   680       \ 'Look-up help for python expression (: PyHelp <pkg> <cls>)'
|   681 command! -nargs=+ -bang PyHelp
|   682       \ call py3eval((<bang>0) ? printf('help(%s)', <q-args>) : printf('help(__import__("%s").%s)', <f-args>))
|   683 
|   684 let g:jm_vimrc.docs.commands['MakeOrSetup'] =
|   685       \ 'Run blaze, make, or create a Makefile with included commands (using ; as separator)'
|   686 command! -nargs=+ MakeOrSetup call s:MakeOrSetup(<q-args>)
|   687 function! s:MakeOrSetup(cmds) abort
|   688   if filereadable('WORKSPACE')
|   689     execute 'Term blaze build' BlazeTarget()
|   690   elseif filereadable('Makefile')
|   691     Term make
|   692   else
|   693     let l:cmds = substitute(a:cmds, '%', expand('%'), 'g')
|   694     let l:lines = split(l:cmds, ';')->map('trim(v:val)')
|   695     let l:cursor = bss#cursor#SaveWithBuf()
|   696     try
|   697       redir > Makefile
|   698       silent echo '.PHONY: all'
|   699       silent echo 'all:'
|   700       for l:cmd in l:lines
|   701         silent echo ' ' .. l:cmd
|   702       endfor
|   703       redir END
|   704       silent edit Makefile
|   705       Term make
|   706     finally
|   707       call l:cursor.Restore()
|   708     endtry
|   709   endif
|   710 endfunction
|   711 
|   712 let g:jm_vimrc.docs.commands['SetupYcmClasspath'] =
|   713       \ 'Create .ycm_extra_conf.py with CLASSPATH'
|   714 command! -bang SetupYcmClasspath
|   715       \ call s:SetupYcmClasspath($CLASSPATH)
|   716 function! s:SetupYcmClasspath(classpath) abort
|   717   let l:classpath = split(a:classpath, ':')
|   718   let l:lines = s:GenerateYcm(l:classpath)
|   719   if filereadable('.ycm_extra_conf.py')
|   720     throw 'ERROR(FileExists): .ycm_extra_conf.py already exists!'
|   721   else
|   722     call writefile(l:lines, '.ycm_extra_conf.py')
|   723     YcmRestartServer
|   724   endif
|   725 endfunction
|   726 function! s:GenerateYcm(classpath) abort
|   727   let l:path = a:classpath
|   728         \->map('string(v:val)')
|   729         \->join(", ")
|   730   let l:lines =<< eval trim END
|   731     def Settings(**kwargs):
|   732         if kwargs["language"] == "java":
|   733             return {{
|   734                 "ls": {{
|   735                   "java.project.referencedLibraries": [{l:path}]
|   736                 }}
|   737             }}
|   738   END
|   739   return l:lines
|   740 endfunction
|   741 
|   742 let g:jm_vimrc.docs.commands['SetupOcamlformat'] =
|   743       \ 'Create a basic .ocamlformat'
|   744 command! SetupOcamlformat call s:SetupOcamlformat()
|   745 function! s:SetupOcamlformat() abort
|   746   if !filereadable('.ocamlformat')
|   747     call writefile(['profile = default'], '.ocamlformat')
|   748   endif
|   749 endfunction
|   750 
|   751 " The Silver Searcher
|   752 if executable('ag')
|   753     " Use ag over grep
|   754     set grepprg=ag\ --nogroup\ --nocolor\ --ignore=tags\ --vimgrep
|   755     set grepformat^=%f:%l:%c:%m
|   756 endif
|   757 " }}} Commands
    758 
+  -   759 +--299 lines: FT-Specific Settings:
 759 " FT-Specific Settings: {{{
|   760 
|   761 " Autocommands are split into filetype `augroup`s, each is separated by
|   762 " filetype. This solves the problem of sourcing the vimrc multiple times
|   763 " causing multiple duplicated autocommands to be set. An augroup is only run
|   764 " once**.
|   765 "
|   766 " These keymappings depend on the filetype, when :filetype on is enabled (as
|   767 " it is earlier in this config), when vim first loads a buffer, it will
|   768 " automatically detect the filetype and set the 'filetype' option (buffer)
|   769 " locally. After this happens, any `FileType` type autocommands are triggered
|   770 "
|   771 " NOTES:
|   772 " ** An augroup doesn't provide this functionality by itself. When you
|   773 " redefine it, it will 'add onto' the original one, in order to clear one, you
|   774 " can add `autocommand!` or `au!` to it (or another with the same name). This
|   775 " is used to make sure that only one version of the autocommand hooks is set
|   776 " per buffer.
|   777 augroup ft_latex
|   778     autocmd!
|   779     autocmd FileType tex setlocal nocursorline
|   780     autocmd FileType tex setlocal tabstop=4 shiftwidth=4
|   781     autocmd FileType tex nnoremap <buffer> <localleader>r
|   782           \ :execute 'Term fish -c "mkt ' .. expand('%') .. '"'<cr>
|   783 augroup END
|   784 
|   785 augroup ft_dot
|   786     autocmd!
|   787     autocmd FileType dot setlocal tabstop=2 shiftwidth=2
|   788     autocmd FileType dot nnoremap <buffer> <localleader>r
|   789           \ :execute 'Term dot -T svg -O' expand('%') <cr>
|   790 augroup END
|   791 
|   792 augroup ft_c
|   793     autocmd!
|   794     autocmd FileType c setlocal tabstop=2 shiftwidth=2
|   795     autocmd FileType c setlocal foldmethod=syntax
|   796     autocmd FileType c nnoremap <buffer> <localleader>r
|   797           \ :Term make<CR>
|   798     autocmd FileType c nnoremap <buffer> <localleader>R
|   799           \ :MakeOrSetup gcc -Wall -O3 -o a.out %; ./a.out; rm a.out<cr>
|   800 augroup END
|   801 
|   802 
|   803 augroup ft_cc
|   804     autocmd!
|   805     autocmd FileType cpp setlocal tabstop=2 shiftwidth=2
|   806     autocmd FileType cpp setlocal foldmethod=syntax
|   807     autocmd FileType cpp nnoremap <buffer> <localleader>t
|   808           \ :term <C-r>=BlazeGuessCommand()<CR>
|   809     autocmd FileType cpp nnoremap <buffer> <localleader>r
|   810           \ :MakeOrSetup
|   811           \   clang++-12 -std=c++17 $(CFLAGS) -o build % $(LDFLAGS);
|   812           \   ./build<CR>
|   813     autocmd FileType cpp nnoremap <buffer> <space>f
|   814           \ :FormatCode<CR>
|   815     autocmd FileType cpp
|   816           \ if exists('g:jm_setup_cpp_cv') |
|   817           \   SetupCV |
|   818           \ endif
|   819     autocmd FileType cpp
|   820           \ if expand('%:p') =~ '/home/jmend/pg' |
|   821           \   silent ReplaceRTarget |
|   822           \ endif
|   823 augroup END
|   824 
|   825 augroup ft_gdb
|   826     autocmd!
|   827     autocmd FileType gdb nnoremap <buffer> <localleader>r
|   828           \ :execute 'Term gdb -q -x' expand('%')<cr>
|   829 augroup END
|   830 
|   831 augroup ft_python
|   832     autocmd!
|   833     autocmd FileType python command! RunPython
|   834           \ execute "Term" g:jm_vimrc.deps.python expand('%')
|   835     autocmd FileType python command! RunPythonTests
|   836           \ execute "Term" g:jm_vimrc.deps.python "-m pytest" expand('%')
|   837     autocmd FileType python command! RunPythonTypechecks
|   838           \ execute "Term" g:jm_vimrc.deps.python "-m mypy --ignore-missing-imports --follow-imports=skip " expand("%")
|   839     autocmd FileType python command! RunPythonMPL
|   840           \ StopAllJobs | eval timer_start(0, {-> execute('RunPython')})
|   841     autocmd FileType python nnoremap <buffer> <localleader>r
|   842           \ :RunPython<cr>
|   843     autocmd FileType python nnoremap <buffer> <localleader>R
|   844           \ :RunPythonTests<cr>
|   845     autocmd FileType python nnoremap <buffer> <localleader>t
|   846           \ :RunPythonTypechecks<cr>
|   847     autocmd FileType python nnoremap <buffer> <space>f
|   848           \ :FormatCode<CR>
|   849 
|   850     autocmd BufNewFile .ycm_extra_conf.py call setline('.', [
|   851           \   'def Settings(**kwargs):',
|   852           \   '    if kwargs["language"] == "java":',
|   853           \   '        return {',
|   854           \   '            "ls": {',
|   855           \   '                "java.project.referencedLibraries": ["~/.jars/*.jar"]',
|   856           \   '            }',
|   857           \   '        }',
|   858           \ ])
|   859 
|   860 
|   861 augroup END
|   862 
|   863 augroup ft_scheme
|   864     autocmd!
|   865     autocmd FileType scheme setlocal colorcolumn=79
|   866     autocmd FileType scheme let g:lisp_rainbow = v:true
|   867     autocmd FileType scheme nnoremap <buffer> <localleader>r
|   868           \ :w<CR> :Term mit-scheme --load % <CR>
|   869 augroup END
|   870 
|   871 augroup ft_java
|   872     autocmd!
|   873     autocmd FileType java
|   874           \ setlocal tabstop=2 softtabstop=2 tabstop=2 shiftwidth=2 smarttab
|   875     autocmd FileType java
|   876           \ setlocal foldmethod=marker foldmarker={,}
|   877     autocmd FileType java nnoremap <space>f :FormatCode<cr>
|   878     autocmd FileType java nnoremap <space>F :set bt=nowrite <bar> FormatCode<cr>
|   879     autocmd FileType java vnoremap <space>f :FormatLines<cr>
|   880     if filereadable('Makefile')
|   881       autocmd FileType java nnoremap <silent> <buffer> <localleader>r
|   882             \ :Term make<cr>
|   883     elseif filereadable('WORKSPACE')
|   884       autocmd FileType java nnoremap <silent> <buffer> <localleader>r
|   885             \ :execute "Term blaze run " .. join(<SID>BlazeTargets(expand("%")), " ")<cr>
|   886     elseif filereadable('gradlew')
|   887       autocmd FileType java nnoremap <silent> <buffer> <localleader>r
|   888             \ :Term ./gradlew test --rerun<cr>
|   889     else
|   890       autocmd FileType java nnoremap <silent> <buffer> <localleader>r
|   891             \ :MakeOrSetup java %<cr>
|   892     endif
|   893     autocmd FileType java nnoremap <silent> <buffer> <localleader>R
|   894           \ :Term ./gradlew run<cr>
|   895     autocmd FileType java let b:surround_99 = "{@code \r}"
|   896 augroup END
|   897 
|   898 augroup ft_kotlin
|   899     autocmd!
|   900     autocmd FileType kotlin
|   901           \ setlocal tabstop=2 softtabstop=2 tabstop=2 shiftwidth=2 smarttab
|   902     if filereadable('Makefile')
|   903       autocmd FileType kotlin nnoremap <silent> <buffer> <localleader>r
|   904             \ :Term make<cr>
|   905     elseif filereadable('gradlew')
|   906       autocmd FileType kotlin nnoremap <silent> <buffer> <localleader>r
|   907             \ :Term ./gradlew test --rerun<cr>
|   908     else
|   909       autocmd FileType kotlin nnoremap <silent> <buffer> <localleader>r
|   910             \ :MakeOrSetup ./gradlew run %<cr>
|   911     endif
|   912     autocmd FileType kotlin nnoremap <silent> <buffer> <localleader>R
|   913           \ :Term ./gradlew run<cr>
|   914 augroup END
|   915 
|   916 augroup ft_jar
|   917   autocmd!
|   918   autocmd FileType jar
|   919         \ call zip#Browse(expand("<amatch>"))
|   920   autocmd FileType jar
|   921         \ setlocal buflisted
|   922 augroup END
|   923 
|   924 augroup ft_class
|   925   autocmd!
|   926   autocmd BufReadCmd *.class
|   927         \ call bss#java#javap#Browse(expand("<amatch>"))
|   928 augroup END
|   929 
|   930 augroup ft_javascript
|   931     autocmd!
|   932     autocmd FileType javascript
|   933           \ setlocal tabstop=2 softtabstop=2 tabstop=2 smarttab
|   934     autocmd FileType javascript nnoremap <buffer> <localleader>r
|   935           \ :execute "Term node " .. expand('%')<cr>
|   936     autocmd FileType javascript nnoremap <buffer> <localleader>R
|   937           \ :Term webpack<CR>
|   938     autocmd FileType javascript nnoremap <buffer> <space>f
|   939           \ :FormatCode<CR>
|   940 augroup END
|   941 
|   942 augroup ft_markdown
|   943     autocmd!
|   944     autocmd FileType markdown set textwidth=72 smartindent autoindent
|   945     autocmd FileType markdown set cinwords+=:
|   946 
|   947     autocmd FileType markdown nnoremap <buffer> ]h :<c-u>call search('\v^#+ ', 'Wz')<cr>
|   948     autocmd FileType markdown nnoremap <buffer> [h :<c-u>call search('\v^#+ ', 'bWz')<cr>
|   949     "autocmd FileType markdown nnoremap <buffer> <leader>r
|   950                 "\ :Term pandoc %:p -s --highlight-style kate --pdf-engine=xelatex -o gen/%:t:r.pdf<cr>
|   951 
|   952     autocmd FileType markdown nnoremap <buffer> <space>l :<c-u>lvimgrep /\v^#+ / %<cr>
|   953 
|   954     autocmd FileType markdown
|   955           \ command! GoToSection call bss#md#GoToSection()
|   956 
|   957     autocmd FileType markdown nnoremap <buffer> <localleader>r
|   958           \ :GoToSection<cr>
|   959 
|   960     autocmd FileType markdown nnoremap <buffer> <localleader>R
|   961           \ :call bss#md#GoToRandomSection()<cr>
|   962           \ :normal zt0<cr>
|   963 
|   964     autocmd FileType markdown command! SetupRPandoc nnoremap <buffer> <localleader>r
|   965           \ :call execute(printf(
|   966           \     "Term pandoc %s -s --highlight-style kate --pdf-engine=xelatex -o %s.pdf",
|   967           \     expand('%:p'),
|   968           \     expand('%:t:r'),
|   969           \   ))<cr>
|   970 
|   971     autocmd FileType markdown command! JmMdQuotesAsComments match GruvboxFg3 /^\s*>.*/
|   972 
|   973     if !exists('g:bss_markdown_fix') || !g:bss_markdown_fix
|   974       " Disable indent-based code blocks, this enables arbitrarily deep
|   975       " indentation of lists
|   976       autocmd FileType markdown syntax clear markdownCodeBlock
|   977       autocmd FileType markdown syntax region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
|   978       autocmd FileType markdown syntax region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
|   979 
|   980       " Fix up the colors
|   981       autocmd FileType markdown highlight link markdownH1 GruvboxRedBold
|   982       autocmd FileType markdown highlight link markdownH2 GruvboxBlueBold
|   983       autocmd FileType markdown highlight link markdownH3 GruvboxGreenBold
|   984       autocmd FileType markdown highlight link markdownH4 GruvboxPurpleBold
|   985 
|   986       " Ensure bold/italics are highlighted
|   987       autocmd FileType markdown highlight link markdownBold GruvboxFg4
|   988       autocmd FileType markdown highlight link markdownBoldDelimiter GruvboxFg4
|   989       autocmd FileType markdown highlight link markdownItalic GruvboxFg2
|   990       autocmd FileType markdown highlight link markdownItalicDelimiter GruvboxFg2
|   991     endif
|   992 augroup END
|   993 
|   994 augroup ft_vim
|   995     autocmd!
|   996     autocmd FileType vim setlocal foldmethod=marker shiftwidth=2
|   997     autocmd FileType vim nnoremap <buffer> <localleader>r
|   998           \ :source %<cr>
|   999     autocmd FileType vim nnoremap K :help <C-r><C-w><CR>
|  1000 augroup END
|  1001 
|  1002 augroup ft_fish
|  1003     autocmd!
|  1004     autocmd FileType fish setlocal tabstop=4 shiftwidth=4 smartindent
|  1005     autocmd FileType fish nnoremap <buffer> <space>f
|  1006           \ :0,$!fish_indent<cr>
|  1007     autocmd FileType fish setlocal omnifunc=bss#fish#Complete
|  1008 augroup END
|  1009 
|  1010 augroup ft_make
|  1011     autocmd!
|  1012     autocmd FileType make nnoremap <buffer> <localleader>r
|  1013           \ :Term make<cr>
|  1014 augroup END
|  1015 
|  1016 augroup ft_ocaml
|  1017     autocmd!
|  1018     autocmd FileType ocaml
|  1019           \ setlocal tabstop=2 softtabstop=2 tabstop=2 smarttab
|  1020     autocmd FileType ocaml nnoremap <space>f :FormatCode<cr>
|  1021     autocmd FileType ocaml vnoremap <space>f :FormatLines<cr>
|  1022     if filereadable('Makefile')
|  1023       autocmd FileType ocaml nnoremap <silent> <buffer> <localleader>r
|  1024             \ :Term make<cr>
|  1025     elseif filereadable('dune-project')
|  1026       autocmd FileType ocaml nnoremap <silent> <buffer> <localleader>r
|  1027             \ :Term dune build<cr>
|  1028     else
|  1029       autocmd FileType ocaml nnoremap <silent> <buffer> <localleader>r
|  1030             \ :execute 'Term ocaml' expand("%")<cr>
|  1031     endif
|  1032     if isdirectory('/usr/bin/ocaml')
|  1033       autocmd FileType ocaml set path+=/usr/lib/ocaml
|  1034     endif
|  1035 augroup END
|  1036 
|  1037 augroup ft_coq
|  1038     autocmd!
|  1039     autocmd FileType coq
|  1040           \ setlocal tabstop=2 softtabstop=2 tabstop=2 smarttab smartindent
|  1041     if filereadable('Makefile')
|  1042       autocmd FileType coq nnoremap <silent> <buffer> <localleader>r
|  1043             \ :Term make<cr>
|  1044     else
|  1045       autocmd FileType coq nnoremap <silent> <buffer> <localleader>r
|  1046             \ :execute 'Term coqc' expand("%")
|  1047             \ <bar> execute 'TermSet ft=coq'<cr>
|  1048     endif
|  1049 augroup END
|  1050 
|  1051 " Use quickfix window when using :make
|  1052 augroup cfg_quickfix_fix
|  1053     autocmd QuickFixCmdPost [^l]* nested cwindow
|  1054     autocmd QuickFixCmdPost    l* nested lwindow
|  1055 augroup end
|  1056 
|  1057 " }}} FT-Specific Settings
   1058 
+  -  1059 +--559 lines: Misc:
1059 " Misc: {{{
|  1060 
|  1061 " :FindImport {Classname}
|  1062 "   Attempt to find and a Java import statement for the {Classname}
|  1063 "     1. Try the `g:jm_vimrc.java_import_cache`
|  1064 "     2. Search the CWD using `ag` for an `import .*\.{ClassName};`
|  1065 "     3. Finally, search `g:jm_vimrc.deps.JavaClassnameList()`
|  1066 "   Alternatively, for C++ do only:
|  1067 "     1. Try the `g:jm_vimrc.cc_import_cache`
|+ |- 1068 +--- 94 lines:
1068 " {{{
|| 1069 let g:jm_vimrc.docs.commands['FindImport'] =
|| 1070       \ 'Given a name, find the corresponding import and add an import statment'
|| 1071 nnoremap <space>t :call <SID>FindImport(expand('<cword>'))<CR>
|| 1072 command -nargs=1 FindImport call <SID>FindImport(<q-args>)
|| 1073 function! s:FindImport(word) abort
|| 1074 
|| 1075   if &filetype ==# 'cpp'
|| 1076     let l:res = g:jm_vimrc.cc_import_cache
|| 1077           \->copy()
|| 1078           \->filter({incl, names -> index(names, a:word) != -1})
|| 1079           \->keys()
|| 1080           \->map({k, incl -> printf("#include %s", incl)})
|| 1081     if len(l:res) == 0
|| 1082       echo "FindImport: `" .. a:word .. "` not found!"
|| 1083     elseif len(l:res) > 1
|| 1084       call maktaba#ui#selector#Create(l:res)
|| 1085             \.WithMappings({'<cr>': [function("s:AddImportCpp")->get("name"), 'Close', 'Add import']})
|| 1086             \.Show()
|| 1087     else
|| 1088       call s:AddImportCpp(l:res[0])
|| 1089     endif
|| 1090     return
|| 1091   endif
|| 1092 
|| 1093   if &filetype !=# 'java'
|| 1094     throw 'ERROR(InvalidFiletype)'
|| 1095     return
|| 1096   endif
|| 1097 
|| 1098   " First try the g:jm_vimrc.java_import_cache
|| 1099   if (has_key(g:jm_vimrc.java_import_cache, a:word))
|| 1100     call s:AddOrSelectImport(get(g:jm_vimrc.java_import_cache, a:word)->mapnew({_, w -> printf('import %s;', w)}))
|| 1101     return
|| 1102   endif
|| 1103 
|| 1104   " Next find an import statement in the current directory
|| 1105   let l:results = printf(
|| 1106           \ '%s --nofilename --nobreak %s',
|| 1107           \ g:jm_vimrc.deps.ag,
|| 1108           \ shellescape(printf('import .+\b%s\b;', a:word)))
|| 1109           \->systemlist()
|| 1110           \->sort()
|| 1111           \->uniq()
|| 1112 
|| 1113   " Finally, fallback to classname list
|| 1114   if empty(l:results)
|| 1115     let l:results = g:jm_vimrc.deps.JavaClassnameList()
|| 1116           \->filter('v:val =~# a:word')
|| 1117           \->map('"import " .. v:val .. ";"')
|| 1118   endif
|| 1119 
|| 1120   call s:AddOrSelectImport(l:results)
|| 1121 endfunction
|| 1122 
|| 1123 function! s:AddOrSelectImport(options) abort
|| 1124   if len(a:options) == 1
|| 1125     call s:AddImport(a:options[0])
|| 1126   elseif len(a:options) > 1
|| 1127     call maktaba#ui#selector#Create(a:options)
|| 1128           \.WithMappings({'<cr>': [function("s:AddImport")->get("name"), 'Close', 'Add import']})
|| 1129           \.Show()
|| 1130   endif
|| 1131 endfunction
|| 1132 
|| 1133 function! s:AddImport(import) abort
|| 1134     let l:result = search(a:import, 'nw')
|| 1135     if l:result == 0
|| 1136       let l:start = search('^import', 'nw')
|| 1137       if l:start == 0
|| 1138         let l:start = search('^package', 'nw')
|| 1139         call append(l:start, [""])
|| 1140         let l:start += 1
|| 1141       endif
|| 1142       call append(l:start, [a:import])
|| 1143       "execute '1,1FormatLines'
|| 1144       echom "Adding: " .. a:import
|| 1145     else
|| 1146       echom "Already Present: " .. a:import
|| 1147     endif
|| 1148 endfunction
|| 1149 
|| 1150 function! s:AddImportCpp(import) abort
|| 1151     let l:result = search(a:import, 'nw')
|| 1152     if l:result == 0
|| 1153       let l:start = search('^#include', 'nw')
|| 1154       call append(l:start, [a:import])
|| 1155       "execute '1,1FormatLines'
|| 1156       echom "Adding: " .. a:import
|| 1157     else
|| 1158       echom "Already Present: " .. a:import
|| 1159     endif
|| 1160 endfunction
|| 1161 " }}}
|  1162 
|  1163 " :Javap {qualified-classname}
|  1164 "   Run `javap` against the provided classname
|+ |- 1165 +--- 40 lines:
1165 " {{{
|| 1166 let g:jm_vimrc.docs.commands['Javap'] =
|| 1167       \ 'Execute Javap and show output with highlighting'
|| 1168 command! -nargs=? -complete=customlist,<SID>JavapComplete -bang
|| 1169         \ Javap call <SID>Javap(<q-args>, "<bang>" ==# '!')
|| 1170 function! s:Javap(arg, search) abort
|| 1171   if empty($CLASSPATH)
|| 1172     SetupClasspath
|| 1173   endif
|| 1174 
|| 1175   " Note: Vim Syntax highlighting doesn't like `\->substitute(...)`
|| 1176   let l:cls = empty(a:arg) ? @" : a:arg
|| 1177   let l:cls = substitute(l:cls, '\(;\|<.\+>\)', '', 'ga')
|| 1178 
|| 1179   if a:search
|| 1180     let l:results = s:JavapComplete(l:cls, v:none, v:none)
|| 1181     if len(l:results) == 1
|| 1182       let l:cls = l:results[0]
|| 1183     else
|| 1184       call maktaba#ui#selector#Create(l:results)
|| 1185             \.WithMappings({'<cr>': [function("s:JavapOpen")->get("name"), 'Close', 'Open window']})
|| 1186             \.Show()
|| 1187       return
|| 1188     endif
|| 1189   endif
|| 1190 
|| 1191   eval g:jm_term
|| 1192         \.Run(join([g:jm_vimrc.deps.javap, l:cls], ' '))
|| 1193         \.Exec('set ft=java')
|| 1194 endfunction
|| 1195 
|| 1196 function! s:JavapComplete(arg_lead, cmd_line, cursor_pos) abort
|| 1197   return g:jm_vimrc.deps.JavaClassnameList()
|| 1198         \->filter('v:val =~# a:arg_lead')
|| 1199 endfunction
|| 1200 
|| 1201 function! s:JavapOpen(cls) abort
|| 1202   execute 'Javap ' .. a:cls
|| 1203 endfunction
|| 1204 " }}}
|  1205 
|  1206 " :MavenSearch {query}
|  1207 " :M {query}
|  1208 "   Run a maven query, and show results in a selector window
|+ |- 1209 +--- 69 lines:
1209 " {{{
|| 1210 let g:jm_vimrc.docs.commands['MavenSearch'] =
|| 1211       \ 'Search maven, then either add a dependecy or download the jar'
|| 1212 command! -nargs=1 MavenSearch call <SID>MavenSearch(<q-args>)
|| 1213 command! -nargs=1 M MavenSearch <args>
|| 1214 function! s:MavenSearch(query) abort
|| 1215   const l:request = {
|| 1216         \   "page": 0,
|| 1217         \   "size": 20,
|| 1218         \   "searchTerm": a:query,
|| 1219         \   "filter": []
|| 1220         \ }
|| 1221   const l:query_url =
|| 1222         \ 'https://central.sonatype.com/api/internal/browse/components'
|| 1223 
|| 1224   const l:query_cmd = join([
|| 1225         \   g:jm_vimrc.deps.curl,
|| 1226         \   '-s',
|| 1227         \   l:query_url,
|| 1228         \   '--json',
|| 1229         \   shellescape(json_encode(l:request))
|| 1230         \ ])
|| 1231 
|| 1232   let l:msg = system(l:query_cmd)
|| 1233   let l:resp = json_decode(l:msg)
|| 1234 
|| 1235   if l:resp.totalResultCount == 0
|| 1236     echom "None found!"
|| 1237     return
|| 1238   endif
|| 1239   let l:components = l:resp.components
|| 1240   const l:mappings = {
|| 1241         \   '<cr>': [function("s:MInsert")->get("name"), 'Close', 'Insert below'],
|| 1242         \   'D': [function("s:MDownload")->get("name"), 'Close', 'Insert below'],
|| 1243         \ }
|| 1244   call maktaba#ui#selector#Create(map(l:components, 'v:val.namespace .. ":" .. v:val.name .. ":" ..  v:val.latestVersionInfo.version'))
|| 1245         \.WithMappings(l:mappings)
|| 1246         \.Show()
|| 1247 endfunction
|| 1248 
|| 1249 function! s:MInsert(msg) abort
|| 1250   let l:spaces = getline('.')->matchstr('^\s*')
|| 1251   call append(line('.'), printf("%simplementation '%s'", l:spaces, a:msg))
|| 1252 endfunction
|| 1253 
|| 1254 function! s:MDownload(msg) abort
|| 1255   let [l:package, l:name, l:version] = split(a:msg, ':')
|| 1256   let l:url_package = substitute(l:package, '\.', '/', 'g')
|| 1257   let l:url = printf('https://repo1.maven.org/maven2/%s/%s/%s/',
|| 1258         \  l:url_package,
|| 1259         \  l:name,
|| 1260         \  l:version)
|| 1261   let l:file = printf('%s-%s.jar', l:name, l:version)
|| 1262   let l:file_url = l:url .. l:file
|| 1263   echom l:url .. l:file
|| 1264 
|| 1265   const l:cmd = join([
|| 1266         \   g:jm_vimrc.deps.curl,
|| 1267         \   '-o',
|| 1268         \   shellescape(l:file),
|| 1269         \   '-s',
|| 1270         \   shellescape(l:file_url),
|| 1271         \ ])
|| 1272   silent call system(l:cmd)
|| 1273   if v:shell_error
|| 1274     echom 'ERROR: Could not download! ' .. l:file_url
|| 1275   endif
|| 1276 endfunction
|| 1277 " }}}
|  1278 
|  1279 " Bazel/Blaze helper functions
|  1280 "
|  1281 "   s:BlazeTargets({fname})
|  1282 "     Return the targets that depend on {fname} directly
|  1283 "
|  1284 "   BlazeTarget()
|  1285 "     Returns the first target for the current file
|  1286 "
|  1287 "   s:TargetClasspath()
|  1288 "     Returns the classpath for BlazeTarget()
|  1289 "
|  1290 "   s:CompleteTargets({arg_lead}, {cmd_line}, {cursor_pos})
|  1291 "     A -complete=customlist compatible function that simply filters the
|  1292 "     commandline against all targets
|  1293 "
|+ |- 1294 +--- 69 lines:
1294 " {{{
|| 1295 function! s:BlazeTargets(fname) abort
|| 1296   let l:query = printf(
|| 1297         \   'same_pkg_direct_rdeps(%s)',
|| 1298         \   fnamemodify(a:fname, ":p:."),
|| 1299         \ )
|| 1300 
|| 1301   let l:command = printf(
|| 1302         \   "%s query '%s'",
|| 1303         \   g:jm_vimrc.deps.blaze,
|| 1304         \   l:query,
|| 1305         \ )
|| 1306   return filter(systemlist(l:command), 'v:val =~# "^//"')
|| 1307 endfunction
|| 1308 
|| 1309 function! BlazeGuessCommand(show = v:false) abort
|| 1310   let l:fname = expand('%:p')
|| 1311 
|| 1312   let l:target = BlazeTarget()
|| 1313   if l:target ==# "???"
|| 1314     echom "Can't find blaze target!"
|| 1315     return "false"
|| 1316   endif
|| 1317 
|| 1318   let l:action = 'build'
|| 1319   if l:fname =~# '\v(_test.cc|Test.java)$' || l:target =~# '\v(_test|Test)$'
|| 1320     let l:action = 'test'
|| 1321   elseif l:fname =~# '\v(main.cc|_bin.cc|Bin.java)$' || l:target =~# '\v(_bin|Bin|main|Main)$'
|| 1322     let l:action = 'run'
|| 1323   elseif l:fname =~# '\v(_bench.cc)$' || l:target =~# '\v(_bench)$'
|| 1324     let l:action = 'run -c opt'
|| 1325   endif
|| 1326 
|| 1327   let l:command = printf(
|| 1328         \   "%s %s %s",
|| 1329         \   g:jm_vimrc.deps.blaze,
|| 1330         \   l:action,
|| 1331         \   l:target,
|| 1332         \ )
|| 1333   if a:show
|| 1334     echom 'Using:' l:command
|| 1335   endif
|| 1336   return l:command
|| 1337 endfunction
|| 1338 
|| 1339 function! BlazeTarget() abort
|| 1340   return get(s:BlazeTargets(expand('%:p')), 0, "???")
|| 1341 endfunction
|| 1342 
|| 1343 function! s:TargetClasspath() abort
|| 1344   let l:target = BlazeTarget()
|| 1345   if l:target ==# "???"
|| 1346     echom "Can't find blaze target!"
|| 1347     return ""
|| 1348   endif
|| 1349 
|| 1350   let l:lines = systemlist(printf('blaze print_action "%s"', l:target))
|| 1351   let l:jars = filter(l:lines, {_, v -> v =~# '^\s\+\(outputjar\|classpath\): "[^"]*"'})
|| 1352         \->map({_, v -> matchlist(v, '"\([^"]*\)"')[1]})
|| 1353   return join(l:jars, ':')
|| 1354 endfunction
|| 1355 
|| 1356 function! s:CompleteTargets(arg_lead, cmd_line, cursor_pos) abort
|| 1357   if a:arg_lead =~ '^//.*'
|| 1358     return systemlist(printf('%s query ... 2>&1', g:jm_vimrc.deps.blaze))
|| 1359           \->filter('v:val =~# "' .. a:arg_lead .. '"')
|| 1360   endif
|| 1361 endfunction
|| 1362 " }}}
|  1363 
|  1364 " :Touch {path}...
|  1365 "   Like `$ touch`, but also create directories if necessary
|+ |- 1366 +--- 16 lines:
1366 " {{{
|| 1367 let g:jm_vimrc.docs.commands['Touch'] =
|| 1368       \ 'Create files and directories'
|| 1369 command! -nargs=* Touch call s:Touch([<f-args>])
|| 1370 function! s:Touch(paths) abort
|| 1371   for l:path in a:paths
|| 1372     let l:dir = fnamemodify(l:path, ':h')
|| 1373     if l:dir !=# '.' && !isdirectory(l:dir)
|| 1374       call system('mkdir -p ' .. shellescape(l:dir))
|| 1375     endif
|| 1376     if !filereadable(l:path)
|| 1377       call system('touch ' .. shellescape(l:path))
|| 1378     endif
|| 1379   endfor
|| 1380 endfunction
|| 1381 " }}}
|  1382 
|  1383 " :CurrentHLGroup
|  1384 "   Print the highlight Group under cursor
|+ |- 1385 +---  8 lines:
1385 " {{{
|| 1386 let g:jm_vimrc.docs.commands['CurrentHLGroup'] =
|| 1387       \ 'Echo name of the highlight group under the cursor'
|| 1388 command! CurrentHLGroup echo s:SyntaxItem()
|| 1389 function! s:SyntaxItem()
|| 1390   return synIDattr(synID(line("."), col("."), 1), "name")
|| 1391 endfunction
|| 1392 " }}}
|  1393 
|  1394 " AsyncExec(fn)
|  1395 "   Call fn() async
|  1396 "
|  1397 " AsyncExec(...)
|  1398 "   Join string arguments and exec async
|+ |- 1399 +---  9 lines:
1399 " {{{
|| 1400 function! s:Async(Fn)
|| 1401   eval timer_start(0, a:Fn)
|| 1402 endfunction
|| 1403 
|| 1404 function! s:AsyncExec(...)
|| 1405   eval s:Async({-> execute(join(map(a:000, function('string'))))})
|| 1406 endfunction
|| 1407 " }}}
|  1408 
|  1409 " ConcealK
|  1410 "   Define conceal rules: eg. ConcealK lambda:λ
|+ |- 1411 +--- 17 lines:
1411 " {{{
|| 1412 let g:jm_vimrc.docs.commands['ConcealK'] =
|| 1413       \ 'Define conceal rules: eg. ConcealK lambda:λ'
|| 1414 command! -complete=expression -nargs=1 ConcealK call <SID>ConcealK(<q-args>)
|| 1415 function! s:ConcealK(repl_str) abort
|| 1416   let l:repl = {}
|| 1417   let l:i = 0
|| 1418   for [l:keyword, l:replacement] in split(a:repl_str, ' ')->map('v:val->split(":")')
|| 1419     let l:i += 1
|| 1420     execute 'syntax keyword'
|| 1421           \ printf('ConcealK%03d', l:i) l:keyword
|| 1422           \ 'conceal' printf('cchar=%s', l:replacement)
|| 1423   endfor
|| 1424   setlocal conceallevel=1
|| 1425   setlocal concealcursor=ni
|| 1426 endfunction
|| 1427 " }}}
|  1428 
|  1429 " ReadExecute
|  1430 "   Execute then read the output of that vim command
|+ |- 1431 +---  5 lines:
1431 " {{{
|| 1432 let g:jm_vimrc.docs.commands['ReadExecute'] =
|| 1433       \ 'Execute then read the output of that vim command'
|| 1434 command! -nargs=* -complete=command ExecuteRead eval append(line('.'), execute(<q-args>)->split("\n"))
|| 1435 " }}}
|  1436 
|  1437 " Bdz
|  1438 "   Run buildozer on current target (or :__pkg__ if none exists)
|+ |- 1439 +---  9 lines:
1439 " {{{
|| 1440 let g:jm_vimrc.docs.commands['Bdz'] =
|| 1441       \ 'Run buildozer on current target (or :__pkg__ if none exists)'
|| 1442 command! -nargs=* Bdz echom
|| 1443       \ system(printf("fish -c \"buildozer '%s' %s\"",
|| 1444       \   join([<f-args>], ' '),
|| 1445       \   BlazeTarget() != '???' ? BlazeTarget() : ':__pkg__'
|| 1446       \ ))
|| 1447 " }}}
|  1448 
|  1449 " JemFormat
|  1450 "   Format lines between "format:`cmd`" to "format: END"
|+ |- 1451 +--- 38 lines:
1451 " {{{
|| 1452 let g:jm_vimrc.docs.commands['JemFormat'] =
|| 1453       \ 'Format lines between "format:`cmd`" to "format: END"'
|| 1454 command! -nargs=* -complete=customlist,<SID>JemFormatComplete JemFormat eval s:JemFormat[<q-args>]()
|| 1455 let s:JemFormat = {
|| 1456       \   ''     : {-> s:JemFormat.format()},
|| 1457       \   'help' : {-> bss#PP(s:JemFormat, v:true)},
|| 1458       \ }
|| 1459 function! s:JemFormatComplete(arglead, cmdline, curpos) abort
|| 1460   return keys(s:JemFormat)->filter({k, v -> !stridx(v, a:arglead)})
|| 1461 endfunction
|| 1462 
|| 1463 function! s:JemFormat.format() abort dict
|| 1464   let command = self.find()
|| 1465   if !empty(command)
|| 1466     silent execute command
|| 1467   endif
|| 1468 endfunction
|| 1469 
|| 1470 function! s:JemFormat.find() abort dict
|| 1471   let [_, num, col; _] = getcurpos()
|| 1472   let start_pat   = '\v.*for' .. 'mat: `([^`]+)`.*'
|| 1473   let end_pat     = '\v.*for' .. 'mat: END.*'
|| 1474   let start_lines = matchbufline(bufnr(), start_pat, 1, num)
|| 1475   let start_line  = bss#Last(start_lines)
|| 1476   let end_line    = start_line
|| 1477         \->bss#Get('lnum')
|| 1478         \->bss#Apply({l -> matchbufline(bufnr(), end_pat, l, '$')})
|| 1479         \->bss#Apply('bss#Last')
|| 1480         \->bss#Or('$')
|| 1481   if start_line is v:none
|| 1482     return ''
|| 1483   endif
|| 1484   let range   = [start_line.lnum + 1, end_line.lnum - 1]->join(',')
|| 1485   let command = substitute(start_line.text, start_pat, '\1', '')
|| 1486   return join([range, command], ' ')
|| 1487 endfunction
|| 1488 " }}}
|  1489 
|  1490 " AppendMarkdownBlock <fname>
|  1491 "   Append the current buffer's lines to the file <fname>.
|  1492 "   Adds an empty line if the last line in <fname> is non-empty.
|  1493 "
|  1494 " SetupAppendMarkdownBlock <fname>
|  1495 "   Setup \r nmap in the current buffer
|  1496 " 
|+ |- 1497 +--- 50 lines:
1497 " {{{
|| 1498 command! -nargs=1 -complete=file SetupAppendMarkdownBlock
|| 1499       \ nnoremap <buffer> \r :AppendMarkdownBlock <args><cr>
|| 1500 command! -nargs=1 -complete=file -range=% AppendMarkdownBlock
|| 1501       \ eval AppendMarkdownBlock(<q-args>, <line1>, <line2>)
|| 1502 command! -nargs=1 -complete=file AppendMarkdownBlockDebug
|| 1503       \ eval AppendMarkdownBlock(<q-args>, 0, '$', v:true)
|| 1504 
|| 1505 function! AppendMarkdownBlock(fname, begin=0, end='$', debug=v:false) abort
|| 1506   let lines = getline(a:begin, a:end)->s:Markdown_lines2codeblock()
|| 1507   if !a:debug
|| 1508     call s:AppendMarkdownBlock_write(a:fname, lines)
|| 1509   else
|| 1510     call s:AppendMarkdownBlock_dump(a:fname, lines)
|| 1511   endif
|| 1512 endfunction
|| 1513 
|| 1514 ""
|| 1515 " Convert a list of lines to a list of codeblock lines.
|| 1516 "
|| 1517 function! s:Markdown_lines2codeblock(lines) abort
|| 1518   let prefix = '```'
|| 1519   let suffix = prefix
|| 1520   return [prefix] + a:lines + [suffix]
|| 1521 endfunction
|| 1522 
|| 1523 
|| 1524 ""
|| 1525 " Add a block to a markdown file.
|| 1526 "
|| 1527 function! s:AppendMarkdownBlock_write(fname, lines) abort
|| 1528   let prefix = (readfile(a:fname)->bss#Last()->empty())
|| 1529         \ ? [] : [""]
|| 1530   call writefile(prefix + a:lines, a:fname, 'a')
|| 1531   echom "Wrote file" a:fname
|| 1532 endfunction
|| 1533 
|| 1534 ""
|| 1535 " Dump debug information.
|| 1536 "
|| 1537 function! s:AppendMarkdownBlock_dump(fname, lines) abort
|| 1538   " Dump debug output
|| 1539   echo 'fname:' a:fname
|| 1540   echo 'lines:'
|| 1541   echo
|| 1542   for l in a:lines
|| 1543     echo '  ' .. l
|| 1544   endfor
|| 1545 endfunction
|| 1546 " }}}
|  1547 
|  1548 " SetupSlimeTarget
|  1549 "   Wrapper for setting the g:slime_target
|+ |- 1550 +--- 17 lines:
1550 " {{{
|| 1551 command! -nargs=? -complete=customlist,s:SetupSlimeTarget_Complete SetupSlimeTarget call s:SetupSlimeTarget(<q-args>)
|| 1552 let s:SlimeTargets = [
|| 1553       \   'tmux',
|| 1554       \   'vimterminal',
|| 1555       \ ]
|| 1556 function! s:SetupSlimeTarget(arg) abort
|| 1557   if empty(a:arg)
|| 1558     echom printf('Current slime target: %s', g:slime_target)
|| 1559   else
|| 1560     let g:slime_target = a:arg
|| 1561   endif
|| 1562 endfunction
|| 1563 function! s:SetupSlimeTarget_Complete(arg, ...) abort
|| 1564   return s:SlimeTargets->filter('stridx(v:val, a:arg) == 0')
|| 1565 endfunction
|| 1566 " }}}
|  1567 
|  1568 function! Layout() abort
|  1569   let layout = winlayout()
|  1570   return s:InvertLayout(layout)
|  1571 endfunction
|  1572 function! s:InvertLayout(l, path=[]) abort
|  1573   if len(a:l) != 2
|  1574     throw "ERROR(InvalidArguments): s:InvertLayout expects only 2-element lists"
|  1575   endif
|  1576   let [kind, val] = a:l
|  1577   if kind ==# 'leaf'
|  1578     return {val: join(a:path, '')}
|  1579   elseif kind ==# 'col'
|  1580     return val
|  1581           \->map('s:InvertLayout(v:val, a:path + ["|"])')
|  1582           \->reduce({a, b -> extend(a, b)})
|  1583   elseif kind ==# 'row'
|  1584     return val
|  1585           \->map('s:InvertLayout(v:val, a:path + ["-"])')
|  1586           \->reduce({a, b -> extend(a, b)})
|  1587   endif
|  1588 endfunction
|  1589 
|  1590 
|  1591 " FindOrMakeJavaTest
|  1592 "   Navigate to the associated Java test of the current file, creating one if
|  1593 "   none exists.
|+ |- 1594 +--- 22 lines:
1594 " {{{
|| 1595 command! FindOrMakeJavaTest call s:FindOrMakeJavaTest()
|| 1596 function! s:FindOrMakeJavaTest() abort
|| 1597   let l:path = expand('%:p:h')
|| 1598   let l:name = expand('%:t:r')
|| 1599   let l:extn = expand('%:t:e')
|| 1600   if l:path =~# ".*/src/main/java/.*"
|| 1601     let l:path = substitute(l:path, "src/main/java", "src/test/java", "")
|| 1602     let l:name .= 'Test'
|| 1603   elseif l:path =~# ".*/src/test/java/.*" && l:name =~# ".*Test$"
|| 1604     let l:path = substitute(l:path, "src/test/java", "src/main/java", "")
|| 1605     let l:name = l:name[:-5]
|| 1606   elseif l:path =~# ".*/java/.*"
|| 1607     let l:path = substitute(l:path, "/java/", "/javatests/", "")
|| 1608     let l:name .= 'Test'
|| 1609   elseif l:path =~# ".*/javatests/.*" && l:name =~# ".*Test$"
|| 1610     let l:path = substitute(l:path, "/javatests/", "/java/", "")
|| 1611     let l:name = l:name[:-5]
|| 1612   endif
|| 1613   execute 'edit' $"{l:path}/{l:name}.{l:extn}"
|| 1614 endfunction
|| 1615 " }}}
|  1616 
|  1617 " }}} Misc
   1618 
+  -  1619 +--  5 lines: Notes
1619 " Notes {{{
|  1620 let s:Wtf = bss#wtf#Initialize()
|  1621 call bss#wtf#AddDict(['mappings', 'm'], g:jm_vimrc.docs.mappings)
|  1622 call bss#wtf#AddDict(['commands', 'c'], g:jm_vimrc.docs.commands)
|  1623 " }}} Notes
   1624 
   1625 " Defines the import cache used for Java import search, if an attempt to
   1626 " resolve the import for a key in this map, the value specified will be
   1627 " imported before trying any other method to find the import.
   1628 " TODO: Switch to a flat list
+  -  1629 +--271 lines: Java Import Cache:
1629 " Java Import Cache: {{{
|  1630 let g:jm_vimrc.java_import_list =<< JAVA_IMPORT_LIST_END
|  1631 com.google.auto.common.AnnotationMirrors
|  1632 com.google.auto.common.AnnotationValues
|  1633 com.google.auto.common.BasicAnnotationProcessor
|  1634 com.google.auto.common.MoreElements
|  1635 com.google.auto.common.MoreTypes
|  1636 com.google.common.base.Stopwatch
|  1637 com.google.common.collect.ImmutableList
|  1638 com.google.common.collect.ImmutableMap
|  1639 com.google.common.collect.ImmutableSet
|  1640 com.google.common.collect.ImmutableTable
|  1641 com.google.common.collect.Lists
|  1642 com.google.common.collect.Streams
|  1643 com.google.common.collect.Table
|  1644 com.google.common.collect.Tables
|  1645 com.google.common.math.Stats
|  1646 com.google.common.math.StatsAccumulator
|  1647 com.google.common.util.concurrent.AbstractExecutionThreadService
|  1648 com.google.common.util.concurrent.AbstractFuture
|  1649 com.google.common.util.concurrent.AbstractScheduledService
|  1650 com.google.common.util.concurrent.AbstractTransformFuture
|  1651 com.google.common.util.concurrent.FutureCallback
|  1652 com.google.common.util.concurrent.Futures
|  1653 com.google.common.util.concurrent.ListenableFuture
|  1654 com.google.common.util.concurrent.ListenableFutureTask
|  1655 com.google.common.util.concurrent.ListenableScheduledFuture
|  1656 com.google.common.util.concurrent.ListenerCallQueue
|  1657 com.google.common.util.concurrent.ListeningExecutorService
|  1658 com.google.common.util.concurrent.ListeningScheduledExecutorService
|  1659 com.google.common.util.concurrent.MoreExecutors
|  1660 com.google.common.util.concurrent.SettableFuture
|  1661 com.google.common.util.concurrent.Uninterruptibles
|  1662 com.squareup.javapoet.ClassName
|  1663 com.squareup.javapoet.CodeBlock
|  1664 com.squareup.javapoet.FieldSpec
|  1665 com.squareup.javapoet.JavaFile
|  1666 com.squareup.javapoet.MethodSpec
|  1667 com.squareup.javapoet.ParameterSpec
|  1668 com.squareup.javapoet.ParameterizedTypeName
|  1669 com.squareup.javapoet.TypeName
|  1670 com.squareup.javapoet.TypeSpec
|  1671 dagger.Binds
|  1672 dagger.BindsInstance
|  1673 dagger.Component
|  1674 dagger.MapKey
|  1675 dagger.Module
|  1676 dagger.Provides
|  1677 dagger.multibindings.ClassKey
|  1678 dagger.multibindings.ElementsIntoSet
|  1679 dagger.multibindings.IntKey
|  1680 dagger.multibindings.IntoMap
|  1681 dagger.multibindings.IntoSet
|  1682 dagger.multibindings.LongKey
|  1683 dagger.multibindings.Multibinds
|  1684 dagger.multibindings.StringKey
|  1685 dagger.producers.Produced
|  1686 dagger.producers.Producer
|  1687 dagger.producers.ProducerModule
|  1688 dagger.producers.Producers
|  1689 dagger.producers.Produces
|  1690 dagger.producers.Production
|  1691 dagger.producers.ProductionComponent
|  1692 dagger.producers.ProductionScope
|  1693 dagger.producers.ProductionSubcomponent
|  1694 dagger.producers.monitoring.ProducerMonitor
|  1695 dagger.producers.monitoring.ProducerToken
|  1696 dagger.producers.monitoring.ProductionComponentMonitor
|  1697 java.io.IOException
|  1698 java.lang.reflect.AnnotatedElement
|  1699 java.lang.reflect.Executable
|  1700 java.lang.reflect.Field
|  1701 java.lang.reflect.GenericDeclaration
|  1702 java.lang.reflect.Method
|  1703 java.lang.reflect.Modifier
|  1704 java.lang.reflect.Type
|  1705 java.nio.file.Files
|  1706 java.nio.file.Path
|  1707 java.util.ArrayList
|  1708 java.util.Arrays
|  1709 java.util.Collection
|  1710 java.util.HashMap
|  1711 java.util.HashSet
|  1712 java.util.Iterator
|  1713 java.util.LinkedList
|  1714 java.util.List
|  1715 java.util.Map
|  1716 java.util.NavigableMap
|  1717 java.util.Optional
|  1718 java.util.OrderedMap
|  1719 java.util.Set
|  1720 java.util.TreeMap
|  1721 java.util.TreeSet
|  1722 java.util.concurrent.ConcurrentHashMap
|  1723 java.util.concurrent.CopyOnWriteArrayList
|  1724 java.util.concurrent.ExecutionException
|  1725 java.util.concurrent.Executor
|  1726 java.util.concurrent.ExecutorService
|  1727 java.util.concurrent.Executors
|  1728 java.util.concurrent.Future
|  1729 java.util.concurrent.ThreadPoolExecutor
|  1730 java.util.concurrent.TimeUnit
|  1731 java.util.concurrent.atomic.AtomicInteger
|  1732 java.util.concurrent.atomic.AtomicLong
|  1733 java.util.concurrent.atomic.LongAdder
|  1734 java.util.function.Consumer
|  1735 java.util.function.Function
|  1736 java.util.function.Predicate
|  1737 java.util.function.Supplier
|  1738 java.util.stream.Collector
|  1739 java.util.stream.Collectors
|  1740 java.util.stream.Stream
|  1741 javax.annotation.processing.AbstractProcessor
|  1742 javax.annotation.processing.Completion
|  1743 javax.annotation.processing.Completions
|  1744 javax.annotation.processing.Filer
|  1745 javax.annotation.processing.FilerException
|  1746 javax.annotation.processing.Generated
|  1747 javax.annotation.processing.Messager
|  1748 javax.annotation.processing.ProcessingEnvironment
|  1749 javax.annotation.processing.Processor
|  1750 javax.annotation.processing.RoundEnvironment
|  1751 javax.annotation.processing.SupportedAnnotationTypes
|  1752 javax.annotation.processing.SupportedOptions
|  1753 javax.annotation.processing.SupportedSourceVersion
|  1754 javax.inject.Inject
|  1755 javax.inject.Named
|  1756 javax.inject.Provider
|  1757 javax.inject.Qualifier
|  1758 javax.inject.Singleton
|  1759 javax.lang.model.element.Element
|  1760 javax.lang.model.element.ElementVisitor
|  1761 javax.lang.model.element.ExecutableElement
|  1762 javax.lang.model.element.Modifier
|  1763 javax.lang.model.element.TypeElement
|  1764 javax.lang.model.type.TypeMirror
|  1765 org.apache.commons.lang3.builder.ReflectionToStringBuilder
|  1766 org.apache.commons.lang3.builder.ToStringStyle
|  1767 org.objectweb.asm.ClassReader
|  1768 org.objectweb.asm.ClassVisitor
|  1769 org.objectweb.asm.ClassWriter
|  1770 org.objectweb.asm.FieldVisitor
|  1771 org.objectweb.asm.MethodVisitor
|  1772 org.objectweb.asm.Opcodes
|  1773 org.objectweb.asm.TypePath
|  1774 org.openjdk.jmh.annotations.AuxCounters
|  1775 org.openjdk.jmh.annotations.Benchmark
|  1776 org.openjdk.jmh.annotations.BenchmarkMode
|  1777 org.openjdk.jmh.annotations.CompilerControl
|  1778 org.openjdk.jmh.annotations.Fork
|  1779 org.openjdk.jmh.annotations.Group
|  1780 org.openjdk.jmh.annotations.GroupThreads
|  1781 org.openjdk.jmh.annotations.Level
|  1782 org.openjdk.jmh.annotations.Measurement
|  1783 org.openjdk.jmh.annotations.Mode
|  1784 org.openjdk.jmh.annotations.OperationsPerInvocation
|  1785 org.openjdk.jmh.annotations.OutputTimeUnit
|  1786 org.openjdk.jmh.annotations.Param
|  1787 org.openjdk.jmh.annotations.Scope
|  1788 org.openjdk.jmh.annotations.Setup
|  1789 org.openjdk.jmh.annotations.State
|  1790 org.openjdk.jmh.annotations.TearDown
|  1791 org.openjdk.jmh.annotations.Threads
|  1792 org.openjdk.jmh.annotations.Timeout
|  1793 org.openjdk.jmh.annotations.Warmup
|  1794 org.openjdk.jmh.infra.BenchmarkParams
|  1795 org.openjdk.jmh.infra.Blackhole
|  1796 org.openjdk.jmh.infra.Control
|  1797 org.openjdk.jmh.infra.IterationParams
|  1798 org.openjdk.jmh.infra.ThreadParams
|  1799 org.openjdk.jmh.results.RunResult
|  1800 org.openjdk.jmh.results.format.ResultFormatType
|  1801 org.openjdk.jmh.runner.Runner
|  1802 org.openjdk.jmh.runner.RunnerException
|  1803 org.openjdk.jmh.runner.options.CommandLineOptionException
|  1804 org.openjdk.jmh.runner.options.CommandLineOptions
|  1805 org.openjdk.jmh.runner.options.Options
|  1806 org.openjdk.jmh.runner.options.OptionsBuilder
|  1807 static com.google.common.collect.ImmutableList.toImmutableList
|  1808 static com.google.common.collect.ImmutableSet.toImmutableSet
|  1809 static com.google.common.truth.Truth.assertThat
|  1810 static com.google.common.truth.Truth.assertWithMessage
|  1811 static com.google.common.util.concurrent.MoreExecutors.directExecutor
|  1812 static java.util.concurrent.TimeUnit.DAYS
|  1813 static java.util.concurrent.TimeUnit.HOURS
|  1814 static java.util.concurrent.TimeUnit.MICROSECONDS
|  1815 static java.util.concurrent.TimeUnit.MILLISECONDS
|  1816 static java.util.concurrent.TimeUnit.MINUTES
|  1817 static java.util.concurrent.TimeUnit.NANOSECONDS
|  1818 static java.util.concurrent.TimeUnit.SECONDS
|  1819 static java.util.stream.Collectors.averagingDouble
|  1820 static java.util.stream.Collectors.averagingInt
|  1821 static java.util.stream.Collectors.averagingLong
|  1822 static java.util.stream.Collectors.collectingAndThen
|  1823 static java.util.stream.Collectors.counting
|  1824 static java.util.stream.Collectors.filtering
|  1825 static java.util.stream.Collectors.flatMapping
|  1826 static java.util.stream.Collectors.groupingBy
|  1827 static java.util.stream.Collectors.joining
|  1828 static java.util.stream.Collectors.mapping
|  1829 static java.util.stream.Collectors.maxBy
|  1830 static java.util.stream.Collectors.minBy
|  1831 static java.util.stream.Collectors.partitioningBy
|  1832 static java.util.stream.Collectors.reducing
|  1833 static java.util.stream.Collectors.summarizingDouble
|  1834 static java.util.stream.Collectors.summarizingInt
|  1835 static java.util.stream.Collectors.summarizingLong
|  1836 static java.util.stream.Collectors.summingDouble
|  1837 static java.util.stream.Collectors.summingInt
|  1838 static java.util.stream.Collectors.summingLong
|  1839 static java.util.stream.Collectors.toCollection
|  1840 static java.util.stream.Collectors.toConcurrentMap
|  1841 static java.util.stream.Collectors.toList
|  1842 static java.util.stream.Collectors.toMap
|  1843 static java.util.stream.Collectors.toSet
|  1844 static java.util.stream.Collectors.toUnmodifiableList
|  1845 static java.util.stream.Collectors.toUnmodifiableMap
|  1846 static java.util.stream.Collectors.toUnmodifiableSet
|  1847 java.net.ServerSocket
|  1848 java.net.Socket
|  1849 java.io.OutputStream
|  1850 com.google.common.flogger.FluentLogger
|  1851 static com.google.common.util.concurrent.Futures.immediateFuture
|  1852 java.util.concurrent.atomic.AtomicReference
|  1853 static com.google.common.util.concurrent.Futures.immediateVoidFuture
|  1854 java.util.concurrent.atomic.AtomicMarkableReference
|  1855 java.util.Random
|  1856 java.time.Instant
|  1857 static com.google.common.base.Preconditions.checkArgument
|  1858 static com.google.common.base.Preconditions.checkNotNull
|  1859 static org.mockito.Mockito.mock
|  1860 static org.mockito.Mockito.verify
|  1861 static org.mockito.ArgumentMatchers.any
|  1862 static org.mockito.Mockito.times
|  1863 static org.mockito.AdditionalMatchers.and
|  1864 static org.mockito.ArgumentMatchers.assertArg
|  1865 JAVA_IMPORT_LIST_END
|  1866 
|  1867 command! AddJavaImport call AddJavaImport(getline('.'))
|  1868 function! AddJavaImport(content) abort
|  1869   let content = a:content
|  1870         \->substitute('^import ', '', '')
|  1871         \->substitute(';$', '', '')
|  1872   if index(g:jm_vimrc.java_import_list, content) != -1
|  1873     echom "Already present:" content
|  1874     return
|  1875   endif
|  1876   let lines = readfile($MYVIMRC)
|  1877   let index = match(lines, '^JAVA_IMPORT_LIST_END$')
|  1878   call insert(lines, content, index)
|  1879   call writefile(lines, $MYVIMRC)
|  1880   echom "Added:" content
|  1881 endfunction
|  1882 
|  1883 function! s:ProcessJavaImportList(import_list) abort
|  1884   let cache = {}
|  1885   for elem in a:import_list
|  1886     let name = slice(elem, strridx(elem, '.') + 1)
|  1887     if has_key(cache, name)
|  1888       call add(cache[name], elem)
|  1889     else
|  1890       let cache[name] = [elem]
|  1891     endif
|  1892   endfor
|  1893   return cache
|  1894 endfunction
|  1895 
|  1896 let g:jm_vimrc.java_import_cache =
|  1897       \ s:ProcessJavaImportList(g:jm_vimrc.java_import_list)
|  1898 
|  1899 " }}} Java Import Cache
   1900 
   1901 
+  -  1902 +--193 lines: C++ Import Cache:
1902 " C++ Import Cache: {{{
|  1903 let g:jm_vimrc.cc_import_cache = {
|  1904       \   '"absl/flags/flag.h"': ['ABSL_FLAG', 'GetFlag'],
|  1905       \   '"absl/flags/declare.h"': ['ABSL_DECLARE_FLAG'],
|  1906       \   '"absl/flags/parse.h"': ['ParseCommandLine'],
|  1907       \   '"absl/flags/usage.h"': ['ProgramUsageMessage', 'SetProgramUsageMessage'],
|  1908       \   '"absl/strings/str_join.h"': ['StrJoin'],
|  1909       \   '"absl/strings/str_cat.h"': ['StrCat'],
|  1910       \   '"absl/strings/str_replace.h"': ['StrReplaceAll'],
|  1911       \   '"absl/strings/str_split.h"': ['StrSplit'],
|  1912       \   '"absl/status/status.h"': ['Status'],
|  1913       \   '"absl/status/statusor.h"': ['StatusOr'],
|  1914       \   '<opencv2/core.hpp>': [
|  1915       \     'Mat',
|  1916       \     'Mat_',
|  1917       \     'Mat1b', 'Mat2b', 'Mat3b', 'Mat4b',
|  1918       \     'Mat1i', 'Mat2i', 'Mat3i', 'Mat4i',
|  1919       \     'Mat1f', 'Mat2f', 'Mat3f', 'Mat4f',
|  1920       \     'Mat1d', 'Mat2d', 'Mat3d', 'Mat4d',
|  1921       \     'Matx',
|  1922       \     'Matx22f', 'Matx33f', 'Matx44f',
|  1923       \     'Matx21f', 'Matx31f', 'Matx41f',
|  1924       \     'Matx22d', 'Matx33d', 'Matx44d',
|  1925       \     'Matx21d', 'Matx31d', 'Matx41d',
|  1926       \     'Vec',
|  1927       \     'Vec1b', 'Vec2b', 'Vec3b', 'Vec4b', 'Vec6b',
|  1928       \     'Vec1i', 'Vec2i', 'Vec3i', 'Vec4i', 'Vec6i',
|  1929       \     'Vec1f', 'Vec2f', 'Vec3f', 'Vec4f', 'Vec6f',
|  1930       \     'Vec1d', 'Vec2d', 'Vec3d', 'Vec4d', 'Vec6d',
|  1931       \     'Scalar_', 'Scalar',
|  1932       \     'Point_', 'Point2i', 'Point2l', 'Point2f', 'Point2d',
|  1933       \     'Point3_', 'Point3i', 'Point3l', 'Point3f', 'Point3d',
|  1934       \     'abs',
|  1935       \     'exp', 'log',
|  1936       \     'pow', 'sqrt',
|  1937       \   ],
|  1938       \   '<opencv2/imgcodecs.hpp>': ['imread', 'imwrite'],
|  1939       \   '<opencv2/imgproc.hpp>': ['circle'],
|  1940       \   '<utility>': [
|  1941       \     'forward', 'declval',
|  1942       \     'move', 'swap', 'exchange',
|  1943       \     'integer_sequence', 'make_integer_sequence',
|  1944       \     'index_sequence', 'make_index_sequence',
|  1945       \     'pair', 'make_pair',
|  1946       \   ],
|  1947       \   '<memory>': ['unique_ptr', 'make_unique'],
|  1948       \   '<vector>': ['vector'],
|  1949       \   '<tuple>': [
|  1950       \     'tuple',
|  1951       \     'tuple_size',
|  1952       \     'tuple_element',
|  1953       \     'get',
|  1954       \   ],
|  1955       \   '<type_traits>': [
|  1956       \     'enable_if', 'conditional',
|  1957       \     'enable_if_t', 'conditional_t',
|  1958       \     'integral_constant', 'bool_constant',
|  1959       \     'true_type', 'false_type',
|  1960       \     'conjunction', 'disjunction', 'negation',
|  1961       \     'conjunction_v', 'disjunction_v', 'negation_v',
|  1962       \     'is_same', 'is_base_of', 'is_convertible',
|  1963       \     'is_same_v', 'is_base_of_v', 'is_convertible_v',
|  1964       \   ],
|  1965       \   '<array>': ['array'],
|  1966       \   '<valarray>': ['valarray'],
|  1967       \   '<cstddef>': [
|  1968       \     'size_t', 'ptrdiff_t', 'nullptr_t',
|  1969       \   ],
|  1970       \   '<future>': [
|  1971       \     'future', 'promise', 'async', 'launch',
|  1972       \   ],
|  1973       \   '<thread>': [
|  1974       \     'thread', 'this_thread', 'yield', 'get_id', 'sleep_for',
|  1975       \   ],
|  1976       \   '<cstdint>': [
|  1977       \     'int8_t', 'int16_t', 'int32_t', 'int64_t',
|  1978       \     'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
|  1979       \   ],
|  1980       \   '<cmath>': [
|  1981       \     'abs',
|  1982       \     'exp', 'log', 'log2', 'log10',
|  1983       \     'pow', 'sqrt', 'hypot',
|  1984       \     'sin', 'cos', 'tan',
|  1985       \     'asin', 'acos', 'atan',
|  1986       \     'sinh', 'cosh', 'tanh',
|  1987       \     'asinh', 'acosh', 'atanh',
|  1988       \     'ceil', 'floor', 'trunc', 'round',
|  1989       \   ],
|  1990       \   '<string>': [
|  1991       \     'string',
|  1992       \     'to_string',
|  1993       \     'stoi', 'stol', 'stoul', 'stoll', 'stoull',
|  1994       \     'stof', 'stod', 'stold',
|  1995       \   ],
|  1996       \   '<map>': ['map'],
|  1997       \   '<unordered_map>': ['unordered_map'],
|  1998       \   '<set>': ['set'],
|  1999       \   '<iostream>': [
|  2000       \     'cout', 'cin', 'cerr',
|  2001       \     'endl',
|  2002       \   ],
|  2003       \   '<ios>': [
|  2004       \     'internal', 'left', 'right',
|  2005       \     'boolalpha', 'showbase', 'showpos',
|  2006       \     'dec', 'hex', 'oct',
|  2007       \     'fixed', 'scientific', 'default',
|  2008       \   ],
|  2009       \   '<format>': ['format'],
|  2010       \   '<iomanip>': [
|  2011       \     'setw',
|  2012       \     'quoted',
|  2013       \   ],
|  2014       \   '<unordered_set>': ['unordered_set'],
|  2015       \   '<optional>': ['optional'],
|  2016       \   '<complex>': ['complex'],
|  2017       \   '<initializer_list>': ['initializer_list'],
|  2018       \   '<numeric>': [
|  2019       \     'iota',
|  2020       \     'accumulate',
|  2021       \     'reduce',
|  2022       \     'inner_product',
|  2023       \     'adjacent_difference',
|  2024       \     'partial_sum',
|  2025       \   ],
|  2026       \   '<cstdlib>': [
|  2027       \     'system',
|  2028       \     'exit',
|  2029       \     'getenv',
|  2030       \     'malloc',
|  2031       \     'free',
|  2032       \     'aligned_malloc',
|  2033       \   ],
|  2034       \   '<random>': [
|  2035       \     'random_device',
|  2036       \     'mt19937',
|  2037       \     'mt19937_64',
|  2038       \     'uniform_real_distribution',
|  2039       \     'uniform_int_distribution',
|  2040       \     'normal_distribution',
|  2041       \   ],
|  2042       \   '<functional>': [
|  2043       \     'function',
|  2044       \     'plus', 'minus', 'multiplies', 'divides',
|  2045       \     'equal_to', 'not_equal_to',
|  2046       \     'greater', 'less', 'greater_equal', 'less_equal',
|  2047       \     'logical_and', 'logical_or', 'logical_not',
|  2048       \     'bit_end', 'bit_or', 'bit_xor', 'bit_not',
|  2049       \   ],
|  2050       \   '<algorithm>': [
|  2051       \
|  2052       \     'all_of', 'any_of', 'none_of',
|  2053       \     'for_each', 'for_each_n',
|  2054       \     'count', 'count_if',
|  2055       \     'mismatch',
|  2056       \     'find', 'find_if', 'find_if_not',
|  2057       \     'find_end', 'find_first_of', 'adjacent_find',
|  2058       \     'search', 'search_n',
|  2059       \
|  2060       \     'copy', 'copy_backward', 'move', 'move_backward', 'copy_n',
|  2061       \     'fill', 'fill_n', 'transform', 'generate', 'generate_n',
|  2062       \     'remove', 'remove_if', 'remove_copy', 'remove_copy_if',
|  2063       \     'replace', 'replace_if', 'replace_copy', 'replace_copy_if',
|  2064       \     'swap', 'swap_ranges', 'swap_iter',
|  2065       \     'reverse', 'reverse_copy', 'rotate',
|  2066       \     'rotate_copy',
|  2067       \     'shuffle',
|  2068       \     'max', 'min', 'max_element', 'min_element', 'minmax',
|  2069       \   ],
|  2070       \   '"absl/algorithm/container.h"': [
|  2071       \
|  2072       \     'c_all_of', 'c_any_of', 'c_none_of',
|  2073       \     'c_for_each', 'c_for_each_n',
|  2074       \     'c_count', 'c_count_if',
|  2075       \     'c_mismatch',
|  2076       \     'c_find', 'c_find_if', 'c_find_if_not',
|  2077       \     'c_find_end', 'c_find_first_of', 'c_adjacent_find',
|  2078       \     'c_search', 'c_search_n',
|  2079       \
|  2080       \     'c_copy', 'c_copy_backward', 'c_move', 'c_move_backward', 'c_copy_n',
|  2081       \     'c_fill', 'c_fill_n', 'c_transform', 'c_generate', 'c_generate_n',
|  2082       \     'c_remove', 'c_remove_if', 'c_remove_copy', 'c_remove_copy_if',
|  2083       \     'c_replace', 'c_replace_if', 'c_replace_copy', 'c_replace_copy_if',
|  2084       \     'c_swap', 'c_swap_ranges', 'c_swap_iter',
|  2085       \     'c_reverse', 'c_reverse_copy', 'c_rotate',
|  2086       \     'c_rotate_copy',
|  2087       \     'c_shuffle',
|  2088       \   ],
|  2089       \   '<iterator>': [
|  2090       \     'istream_iterator',
|  2091       \     'ostream_iterator',
|  2092       \   ],
|  2093       \ }
|  2094 " }}} C++ Import Cache