diff options
Diffstat (limited to '.vim/plugin')
| -rw-r--r-- | .vim/plugin/line.vim | 4 | ||||
| -rw-r--r-- | .vim/plugin/packer_compiled.vim | 211 | ||||
| -rw-r--r-- | .vim/plugin/split_term.vim | 11 | ||||
| -rw-r--r-- | .vim/plugin/zettel.vim | 43 |
4 files changed, 257 insertions, 12 deletions
diff --git a/.vim/plugin/line.vim b/.vim/plugin/line.vim index ad25cab..eed5224 100644 --- a/.vim/plugin/line.vim +++ b/.vim/plugin/line.vim @@ -1,3 +1,5 @@ +finish + let g:lightline = {} let g:lightline.enable = { 'statusline': 1, 'tabline': 0 } @@ -20,7 +22,7 @@ let g:lightline.active = { \ 'left': [ \ ['mode', 'paste'], \ ['filename', 'vista'], -\ ['neomake', 'coc', 'ctags', 'obsession'], +\ ['neomake', 'ctags', 'obsession'], \ ], \ 'right': [ \ ['filetype', 'fileencoding', 'fileformat'], diff --git a/.vim/plugin/packer_compiled.vim b/.vim/plugin/packer_compiled.vim new file mode 100644 index 0000000..a40dddd --- /dev/null +++ b/.vim/plugin/packer_compiled.vim @@ -0,0 +1,211 @@ +" Automatically generated packer.nvim plugin loader code + +if !has('nvim') + finish +endif + +lua << END +local plugins = { + ["emmet-vim"] = { + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/emmet-vim" + }, + ["goyo.vim"] = { + commands = { "Goyo" }, + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/goyo.vim" + }, + ["limelight.vim"] = { + commands = { "Limelight" }, + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/limelight.vim" + }, + ["vim-easy-align"] = { + commands = { "EasyAlign" }, + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-easy-align" + }, + ["vim-markdown"] = { + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown" + }, + ["vim-markdown-folding"] = { + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown-folding" + }, + vimtex = { + loaded = false, + only_sequence = false, + only_setup = false, + path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vimtex" + } +} + +local function handle_bufread(names) + for _, name in ipairs(names) do + local path = plugins[name].path + for _, dir in ipairs({ 'ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin' }) do + if #vim.fn.finddir(dir, path) > 0 then + vim.cmd('doautocmd BufRead') + return + end + end + end +end + +_packer_load = nil + +local function handle_after(name, before) + local plugin = plugins[name] + plugin.load_after[before] = nil + if next(plugin.load_after) == nil then + _packer_load({name}, {}) + end +end + +_packer_load = function(names, cause) + local some_unloaded = false + for _, name in ipairs(names) do + if not plugins[name].loaded then + some_unloaded = true + break + end + end + + if not some_unloaded then return end + + local fmt = string.format + local del_cmds = {} + local del_maps = {} + for _, name in ipairs(names) do + if plugins[name].commands then + for _, cmd in ipairs(plugins[name].commands) do + del_cmds[cmd] = true + end + end + + if plugins[name].keys then + for _, key in ipairs(plugins[name].keys) do + del_maps[key] = true + end + end + end + + for cmd, _ in pairs(del_cmds) do + vim.cmd('silent! delcommand ' .. cmd) + end + + for key, _ in pairs(del_maps) do + vim.cmd(fmt('silent! %sunmap %s', key[1], key[2])) + end + + for _, name in ipairs(names) do + if not plugins[name].loaded then + vim.cmd('packadd ' .. name) + if plugins[name].config then + for _i, config_line in ipairs(plugins[name].config) do + loadstring(config_line)() + end + end + + if plugins[name].after then + for _, after_name in ipairs(plugins[name].after) do + handle_after(after_name, name) + vim.cmd('redraw') + end + end + + plugins[name].loaded = true + end + end + + handle_bufread(names) + + if cause.cmd then + local lines = cause.l1 == cause.l2 and '' or (cause.l1 .. ',' .. cause.l2) + vim.cmd(fmt('%s%s%s %s', lines, cause.cmd, cause.bang, cause.args)) + elseif cause.keys then + local keys = cause.keys + local extra = '' + while true do + local c = vim.fn.getchar(0) + if c == 0 then break end + extra = extra .. vim.fn.nr2char(c) + end + + if cause.prefix then + local prefix = vim.v.count and vim.v.count or '' + prefix = prefix .. '"' .. vim.v.register .. cause.prefix + if vim.fn.mode('full') == 'no' then + if vim.v.operator == 'c' then + prefix = '' .. prefix + end + + prefix = prefix .. vim.v.operator + end + + vim.fn.feedkeys(prefix, 'n') + end + + -- NOTE: I'm not sure if the below substitution is correct; it might correspond to the literal + -- characters \<Plug> rather than the special <Plug> key. + vim.fn.feedkeys(string.gsub(string.gsub(cause.keys, '^<Plug>', '\\<Plug>') .. extra, '<[cC][rR]>', '\r')) + elseif cause.event then + vim.cmd(fmt('doautocmd <nomodeline> %s', cause.event)) + elseif cause.ft then + vim.cmd(fmt('doautocmd <nomodeline> %s FileType %s', 'filetypeplugin', cause.ft)) + vim.cmd(fmt('doautocmd <nomodeline> %s FileType %s', 'filetypeindent', cause.ft)) + end +end + +-- Runtimepath customization + +-- Pre-load configuration +-- Post-load configuration +-- Config for: nvim-treesitter +loadstring("\27LJ\1\2/\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\20conf.treesitter\frequire\0")() +-- Config for: nvim-colorizer.lua +loadstring("\27LJ\1\2z\0\0\3\0\4\0\b4\0\0\0%\1\1\0>\0\2\0027\0\2\0)\1\0\0003\2\3\0>\0\3\1G\0\1\0\1\0\6\vrgb_fn\2\tname\2\rRRGGBBAA\1\vhsl_fn\2\tmode\15background\vRRGGBB\2\nsetup\14colorizer\frequire\0")() +-- Config for: galaxyline.nvim +loadstring("\27LJ\1\2$\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\tline\frequire\0")() +-- Config for: nvim-lspconfig +loadstring("\27LJ\1\2(\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\rconf.lsp\frequire\0")() +-- Config for: telescope.nvim +loadstring("\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19conf.telescope\frequire\0")() +-- Conditional loads +-- Load plugins in order defined by `after` +END + +function! s:load(names, cause) abort +call luaeval('_packer_load(_A[1], _A[2])', [a:names, a:cause]) +endfunction + + +" Command lazy-loads +command! -nargs=* -range -bang -complete=file Goyo call s:load(['goyo.vim'], { "cmd": "Goyo", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> }) +command! -nargs=* -range -bang -complete=file Limelight call s:load(['limelight.vim'], { "cmd": "Limelight", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> }) +command! -nargs=* -range -bang -complete=file EasyAlign call s:load(['vim-easy-align'], { "cmd": "EasyAlign", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> }) + +" Keymap lazy-loads + +augroup packer_load_aucmds + au! + " Filetype lazy-loads + au FileType markdown ++once call s:load(['vim-markdown', 'vim-markdown-folding'], { "ft": "markdown" }) + au FileType html ++once call s:load(['emmet-vim'], { "ft": "html" }) + au FileType latex ++once call s:load(['vimtex'], { "ft": "latex" }) + au FileType tex ++once call s:load(['vimtex'], { "ft": "tex" }) + " Event lazy-loads +augroup END diff --git a/.vim/plugin/split_term.vim b/.vim/plugin/split_term.vim deleted file mode 100644 index efb9b86..0000000 --- a/.vim/plugin/split_term.vim +++ /dev/null @@ -1,11 +0,0 @@ -" SplitTerm: quickly pop out a terminal - -" skip this while were testing kassio/neoterm -finish - -" lua require('split_term') -" command! LuaTerm :lua spt_toggle()<CR> - -command! -bang -nargs=* SplitTerm call s:split_term_toggle(<bang>0, <f-args>) -cnoreabbrev spt SplitTerm -cnoreabbrev st SplitTerm diff --git a/.vim/plugin/zettel.vim b/.vim/plugin/zettel.vim new file mode 100644 index 0000000..948bb91 --- /dev/null +++ b/.vim/plugin/zettel.vim @@ -0,0 +1,43 @@ +" markdown extended for bullet journaling and personal wiki-keeping + +if exists('g:loaded_zettel') + finish +endif +let g:loaded_zettel = 1 + +if !exists('g:zettel_root') + let g:zettel_root = expand($HOME.'/wiki') +endif + +if !exists('g:zettel_create_on_empty') + let g:zettel_create_on_emtpy = 1 +endif + +if v:progname =~ 'vimdiff' + let g:zettel_create_on_empty = 0 +endif + +function! <SID>make_new_zettel() + let l:pastebackup = &paste + set nopaste + + 0 put ='---' + read !yq n date $(date -Iseconds) | yq w - title "%:t:r" + put ='---' + call feedkeys('Go', 'n') + + if pastebackup == 0 + set nopaste + endif +endfunction + +command! -nargs=0 NewZettel call <SID>make_new_zettel() + +augroup NewZettel + au! + au BufNewFile *.md + \ if expand('%:p') =~# fnameescape(g:zettel_root).'/.*.md' | + \ call <SID>make_new_zettel() | + \ endif +augroup END + |