vim9script if exists("g:loaded_fugitive") command! Gpull Git pull command! Gpush Git push command! -nargs=* Glog Git log --oneline --decorate --graph # Git log --follow -- % # Git log -p --follow -- % endif if exists("g:loaded_swap") omap io (swap-textobject-i) xmap io (swap-textobject-i) omap ao (swap-textobject-a) xmap ao (swap-textobject-a) endif if exists("g:loaded_checkbox") xmap x (CheckboxToggleOp) nmap x (CheckboxToggleOp) omap x (CheckboxToggleOp) nmap xx (CheckboxToggleLineOp) endif if exists("g:loaded_guifont_size") nmap (GUIFontSizeInc) nmap (GUIFontSizeDec) nmap (GUIFontSizeDec) nmap (GUIFontSizeRestore) endif if exists("g:loaded_dir") nnoremap Dir g:dir_actions = [ {text: 'Share with 0x0.st', Action: (items) => { var urls = [] for item in items if item.type != 'dir' && filereadable(item.name) var url = systemlist($'curl -F file=@"{item.name}" http://0x0.st')[-1] add(urls, url) endif endfor setreg("@", urls->join("\n")) setreg("+", urls->join("\n")) echom urls->join("\n") }}, {text: 'Check vim screen dump', Action: (items) => { if len(items) > 1 return endif # TODO: check for path, name and extension: failed/Test_.*\.dump term_dumpdiff(items[0].name, $"../dumps/{items[0].name}") }} ] endif if exists("g:loaded_layout") nnoremap LayoutPrev nnoremap LayoutNext endif if exists("g:loaded_lsp") g:LspOptionsSet({ completionTextEdit: false, showInlayHints: true, showDiagWithVirtualText: true, autoPopulateDiags: true, diagVirtualTextAlign: 'after', }) if executable('clangd') g:LspAddServer([{ name: 'clangd', filetype: ['c', 'cpp'], path: 'clangd', args: ['--background-index'] }]) endif if executable('pylsp') g:LspAddServer([{ name: 'pylsp', filetype: ['python'], path: 'pylsp' }]) endif if executable('netcat') g:LspAddServer([{ name: 'gdscript', filetype: ['gdscript'], path: 'netcat', args: ['127.0.0.1', '6008'], }]) endif endif