diff options
| author | Michal Hanus <hanus.michal@divelit.cz> | 2024-03-02 18:49:55 +0100 |
|---|---|---|
| committer | Michal Hanus <hanus.michal@divelit.cz> | 2024-03-02 18:49:55 +0100 |
| commit | aab38f32e0a02e43565a554d0a76ff65636499b8 (patch) | |
| tree | f3f00df05c63228c69a338e80fd0e7d02986e8cf /plugin | |
| parent | 99353a355321d68ef4fb3c26291084b23e8f4978 (diff) | |
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/abbrev.vim | 3 | ||||
| -rw-r--r-- | plugin/command.vim | 50 | ||||
| -rw-r--r-- | plugin/log-autocmds.vim | 119 |
3 files changed, 0 insertions, 172 deletions
diff --git a/plugin/abbrev.vim b/plugin/abbrev.vim deleted file mode 100644 index 034a7c0..0000000 --- a/plugin/abbrev.vim +++ /dev/null @@ -1,3 +0,0 @@ -" some abbreviations -iabbrev reqire require -iabbrev serveral several diff --git a/plugin/command.vim b/plugin/command.vim deleted file mode 100644 index 68b11f4..0000000 --- a/plugin/command.vim +++ /dev/null @@ -1,50 +0,0 @@ -" Capture output from a command to register @m, to paste, press "mp -command! -nargs=1 -complete=command Redir call utils#CaptureCommandOutput(<q-args>) - -command! -bar -bang -nargs=+ -complete=file Edit call utils#MultiEdit([<f-args>]) -call utils#Cabbrev('edit', 'Edit') - -call utils#Cabbrev('man', 'Man') - -" show current date and time in human readable format -command! -nargs=? Datetime echo utils#iso_time(<q-args>) - -" Convert Markdown file to PDF -command! ToPDF call s:md_to_pdf() - -function! s:md_to_pdf() abort - " check if pandoc is installed - if executable('pandoc') != 1 - echoerr "pandoc not found" - return - endif - - let l:md_path = expand("%:p") - let l:pdf_path = fnamemodify(l:md_path, ":r") .. ".pdf" - - let l:header_path = stdpath('config') . '/resources/head.tex' - - let l:cmd = "pandoc --pdf-engine=xelatex --highlight-style=zenburn --table-of-content " . - \ "--include-in-header=" . l:header_path . " -V fontsize=10pt -V colorlinks -V toccolor=NavyBlue " . - \ "-V linkcolor=red -V urlcolor=teal -V filecolor=magenta -s " . - \ l:md_path . " -o " . l:pdf_path - - if g:is_mac - let l:cmd = l:cmd . '&& open ' . l:pdf_path - endif - - if g:is_win - let l:cmd = l:cmd . '&& start ' . l:pdf_path - endif - - " echomsg l:cmd - - let l:id = jobstart(l:cmd) - - if l:id == 0 || l:id == -1 - echoerr "Error running command" - endif -endfunction - -" json format -command! -range JSONFormat <line1>,<line2>!python -m json.tool diff --git a/plugin/log-autocmds.vim b/plugin/log-autocmds.vim deleted file mode 100644 index 0b2b489..0000000 --- a/plugin/log-autocmds.vim +++ /dev/null @@ -1,119 +0,0 @@ -command! LogAutocmds call s:log_autocmds_toggle() - -function! s:log_autocmds_toggle() - augroup LogAutocmd - autocmd! - augroup END - - let l:date = strftime('%F', localtime()) - let s:activate = get(s:, 'activate', 0) ? 0 : 1 - if !s:activate - call s:log('Stopped autocmd log (' . l:date . ')') - return - endif - - call s:log('Started autocmd log (' . l:date . ')') - augroup LogAutocmd - for l:au in s:aulist - silent execute 'autocmd' l:au '* call s:log(''' . l:au . ''')' - endfor - augroup END -endfunction - -function! s:log(message) - silent execute '!echo "' - \ . strftime('%T', localtime()) . ' - ' . a:message . '"' - \ '>> /tmp/vim_log_autocommands' -endfunction - -" These are deliberately left out due to side effects -" - SourceCmd -" - FileAppendCmd -" - FileWriteCmd -" - BufWriteCmd -" - FileReadCmd -" - BufReadCmd -" - FuncUndefined - -let s:aulist = [ - \ 'BufNewFile', - \ 'BufReadPre', - \ 'BufRead', - \ 'BufReadPost', - \ 'FileReadPre', - \ 'FileReadPost', - \ 'FilterReadPre', - \ 'FilterReadPost', - \ 'StdinReadPre', - \ 'StdinReadPost', - \ 'BufWrite', - \ 'BufWritePre', - \ 'BufWritePost', - \ 'FileWritePre', - \ 'FileWritePost', - \ 'FileAppendPre', - \ 'FileAppendPost', - \ 'FilterWritePre', - \ 'FilterWritePost', - \ 'BufAdd', - \ 'BufCreate', - \ 'BufDelete', - \ 'BufWipeout', - \ 'BufFilePre', - \ 'BufFilePost', - \ 'BufEnter', - \ 'BufLeave', - \ 'BufWinEnter', - \ 'BufWinLeave', - \ 'BufUnload', - \ 'BufHidden', - \ 'BufNew', - \ 'SwapExists', - \ 'FileType', - \ 'Syntax', - \ 'EncodingChanged', - \ 'TermChanged', - \ 'VimEnter', - \ 'GUIEnter', - \ 'GUIFailed', - \ 'TermResponse', - \ 'QuitPre', - \ 'VimLeavePre', - \ 'VimLeave', - \ 'FileChangedShell', - \ 'FileChangedShellPost', - \ 'FileChangedRO', - \ 'ShellCmdPost', - \ 'ShellFilterPost', - \ 'CmdUndefined', - \ 'SpellFileMissing', - \ 'SourcePre', - \ 'VimResized', - \ 'FocusGained', - \ 'FocusLost', - \ 'CursorHold', - \ 'CursorHoldI', - \ 'CursorMoved', - \ 'CursorMovedI', - \ 'WinEnter', - \ 'WinLeave', - \ 'TabEnter', - \ 'TabLeave', - \ 'CmdwinEnter', - \ 'CmdwinLeave', - \ 'InsertEnter', - \ 'InsertChange', - \ 'InsertLeave', - \ 'InsertCharPre', - \ 'TextChanged', - \ 'TextChangedI', - \ 'ColorScheme', - \ 'RemoteReply', - \ 'QuickFixCmdPre', - \ 'QuickFixCmdPost', - \ 'SessionLoadPost', - \ 'MenuPopup', - \ 'CompleteDone', - \ 'User', - \ ] - |
