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