kkga / kks Goto Github PK
View Code? Open in Web Editor NEWHandy Kakoune companion.
License: The Unlicense
Handy Kakoune companion.
License: The Unlicense
As I was not able to find a forum/chat link to this plugin, I decided to share here, something to add to the docs?
Just sharing the bufline I did using kakship + kks
The list of buffers on the top
My dotfiles repo lives in ~/.dotfiles
, so the resulting gitdir session name is -dotfiles
. This wreaks havoc with kak-lsp
and kakoune itself, the former thinking it is a command-line flag, and the latter thinking it's a switch to the command you pass %val{session}
to.
shell stderr: <<<
error: Found argument '-o' which wasn't expected, or isn't valid in this context
USAGE:
kak-lsp --daemonize --kakoune --session <SESSION>
For more information try --help
>>>
Suggested fix
Strip any non-alphanumeric characters from the front of the session name.
To reproduce
evaluate-commands %sh{ kak-lsp --kakoune -s $kak_session }
*debug*
and you will see kak-lsp complain about an unknown command line flag.example: running a script kks-files
as an external command should parse flags and properly set environments variables for the script
kks -s mysession files
$ kak -l
$ kks list
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/kkga/kks/kak.(*Session).Dir(0xc000077cf0)
/home/teddy/src/kks/kak/kak.go:33 +0x8e
github.com/kkga/kks/cmd.(*ListCmd).Run(0xc0001b4320)
/home/teddy/src/kks/cmd/list.go:75 +0x176
github.com/kkga/kks/cmd.Root({0xc0001a8010, 0x0, 0xc000066750})
/home/teddy/src/kks/cmd/root.go:38 +0x689
main.main()
/home/teddy/src/kks/main.go:21 +0xe8
Reason: in kak/kak.go
strings.Split(strings.TrimSpace(string(o)), "\n")
Always returns 1 element slice where the only element is empty string when o == ""
.
Simple fix:
diff --git i/kak/kak.go w/kak/kak.go
index 270ff4..3037f7 100644
--- i/kak/kak.go
+++ w/kak/kak.go
@@ -46,6 +48,9 @@ func (s *Session) Clients() (clients []Client, err error) {
func Sessions() (sessions []Session, err error) {
o, err := exec.Command("kak", "-l").Output()
for _, s := range strings.Split(strings.TrimSpace(string(o)), "\n") {
+ if s == "" {
+ continue
+ }
sessions = append(sessions, Session{s})
}
return
Hey, what do you think of switching to cobra for argument parsing ?
It would allow to add completions for bash/zsh/fish with minimal effort
Not sure how exactly to reproduce it yet, but the ls
command periodically hangs on my M1 Air (21.2.0)
A command like kks send -b '*man bc*' delete-buffer
won't work. Kakoune understands that it needs to delete the buffer *man
.
Version: 0.3.8.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.