Comments (9)
I've tried to do it, but can't see the proper way of how I should parse output for each git process running in the background, and put it to the single buffer as sorted list of plugin-per-line-status.
I'm currently little busy with adding post-update "do: ..."
hooks to rebuild kak-lsp for example, and I think that this feature is little more important right now, but thanks for the tips.
from plug.kak.
I think that I'll make it in relative simple way. Just log messages which plugin gets an update, which is installed. Maybe some time later it will evolve into interactive buffer with logs, errors, etc etc.
from plug.kak.
@alexherbo2 I want to show info about what's plug.kak
is doing in *plug*
buffer. For example, buffer is formatted like so:
andreyorst/plug.kak: Update available
delapouite/kakoune-text-objects: Up to date
occivink/kakoune-vertical-selection: Up to date
occivink/kakoune-gdb: Up to date
andreyorst/base16-gruvbox.kak: Update available
andreyorst/fzf.kak: Up to date
TeddyDD/kakoune-edit-or-dir: Up to date
ul/kak-lsp: Up to date
andreyorst/powerline.kak: Up to date
andreyorst/smarttab.kak: Up to date
alexherbo2/auto-pairs.kak: Up to date
alexherbo2/replace.kak: Up to date
alexherbo2/move-line.kak: Up to date
occivink/kakoune-snippets: Up to date
occivink/kakoune-find: Up to date
I want to execute plug-update
and see how changes affect this fifo buffer. Should I just modify a fifo file with sed, or there's a better/proper way?
from plug.kak.
I don’t understand, a FIFO is a named pipe, you can’t modify the file with sed
.
from plug.kak.
I don't understand it either, how to update it then?
from plug.kak.
For example, i have two plugins in my config, but they're not installed. I call plug-list
command and is opens a buffer *plug*
with FIFO displayed in it with this contents:
ul/kak-lsp: Not installed
alexherbo2/move-line.kak: Not installed
Now I execute plug-update
. I want this to be reflected in *plug*
buffer like so:
ul/kak-lsp: Installing
alexherbo2/move-line.kak: Installing
After plugins are installed, post-install hooks are being run:
ul/kak-lsp: Running post-update hooks
alexherbo2/move-line.kak: Done
And after everything is done, *plug*
buffer content is:
ul/kak-lsp: Done
alexherbo2/move-line.kak: Done
Can I achieve this with FIFO? I've already made an interactive plug-list
and plug-fifo-operate
commands, I just need to understand how to update it properly. I guess I can reconstruct it fully every time, but this would be performance impact.
from plug.kak.
# Options
declare-option str-list plugins P L U G I N S
# Faces
set-face global PlugPlugin attribute
set-face global PlugMessage string
# Highlighters
add-highlighter shared/plug group
add-highlighter shared/plug/message regex ^([^:]+):\h+([^\n]+)$ 1:PlugPlugin 2:PlugMessage
# File-type
hook global BufCreate \Q*plug* %{
set-option buffer filetype plug
}
hook -group plug-highlight global WinSetOption filetype=plug %{
add-highlighter window/plug ref plug
hook -always -once window WinSetOption filetype=.* %{
remove-highlighter window/plug
}
}
# Update
define-command plug-update %{
edit -scratch *plug*
evaluate-commands -buffer *plug* -save-regs '"' %{
set-register dquote %sh{
eval "set -- $kak_opt_plugins"
printf '%s: Processing\n' $@
}
execute-keys '%R'
}
nop %sh{ {
message() {
plugin=$1
message=$2
printf '
evaluate-commands -buffer *plug* -save-regs "/""" %%{
set-register / %%(^%s:\\h+)
set-register dquote %%(%s)
execute-keys /<ret>lGlR
}
' "$plugin" "$message" | kak -p $kak_session
sleep 0.2
}
eval "set -- $kak_opt_plugins"
index=0
for plugin in $@; do
message $plugin Installing
if test $((index % 2)) = 0; then
message $plugin 'Running post-update hooks'
fi
message $plugin Done
index=$((index + 1))
done
} < /dev/null > /dev/null 2>&1 & }
}
If you need the message
function in other commands, source
expansion returns the path of the script being sourced.
rc/plug.sh
message() {
…
}
rc/plug.kak
nop %sh{
rc=$(dirname $kak_source)
. $rc/plug.sh
message "$plugin" "$message"
}
from plug.kak.
Thanks for the input, I'll try it
from plug.kak.
from plug.kak.
Related Issues (20)
- ensure: document deferred loading HOT 5
- nasty errors with `plug http://.../` (final slash) HOT 1
- plug-chain problems HOT 4
- plug theme HOT 3
- double .git stripping HOT 2
- jobs unhack HOT 4
- installing from plug-list doesn't respect plugin options HOT 3
- renaming plugin folders HOT 13
- Add option to skip rebuilding and load prebuilt plugin configuration HOT 1
- Errors in config blocks don't get brought to the user's attention HOT 2
- git URLs for private repos HOT 1
- No indication when the `do` block fails HOT 4
- Branch Specification adds a signifiant delay in startup time HOT 1
- File system loop detected HOT 5
- Check for URL scheme when searching for an URL in the plguin name HOT 5
- Suggestions for plugin authors? HOT 4
- demand doesn't work without a final %{} HOT 2
- Plugin status breaks if reflog empty HOT 3
- Enchance plug-list representation of manually loaded plugins
- defer block not works as expected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plug.kak.