I made a neovim plugin
Iβve slowly adding more and more lua functions into my neovim configuration,
and recently I noticed a pattern for a class of functions that reach out to run
shell commands that can be abstracted away.
https://youtu.be/8m5ipBuopPU
Telegraph.nvim # [1]
Check out the project readme [2]
for the most up to date details on the plugin itself.
Motivation # [3]
I want a simple way to make remaps into shell commands that can open new tmux
windows, popups, or just run a command with context from the editor.
For example I want to make remaps to do things like open the current file in lookatme.
# vim :terminal
nnoremap <leader>s <cmd>Telegraph pipx run lookatme {filepath} --live-reload --style gruvbox-dark<cmd>
# tmux session
nnoremap <leader><leader>s <cmd>lua require'telegraph'.telegraph({cmd='pipx run lookatme {filepath} --live-reload --style gruvbox-dark', how='tmux'})<CR>
# tmux popup
nnoremap <leader><leader>S <cmd>lua require'telegraph'.telegraph({cmd='pipx run lookatme {filepath...