eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

Kakoune and Nixos #67

Closed bhougland18 closed 4 years ago

bhougland18 commented 4 years ago

what do you put in the kakrc file if you are running Nixos and downloaded the parinfer-rust using the configuration.nix file? I tried just putting the following line in my kakrc and it is giving me an error:

hook global WinSetOption filetype=(clojure|lisp|scheme|racket) %{ parinfer-enable-window -smart }

Sorry for the newbie question.

eraserhd commented 4 years ago

@bhougland18 I didn't realize this wasn't documented anywhere, so thank you for reporting this.

I just added installation instructions for kakrc+NixOS here. Please let me know if I'm missing anything or could make them clearer.

bhougland18 commented 4 years ago

The instructions are great, I didn't know Nixos had plugin options for Kakoune. This is even better than I hoped. Thank you!

On Mon, Mar 16, 2020 at 10:35 AM Jason Felice notifications@github.com wrote:

Closed #67 https://github.com/eraserhd/parinfer-rust/issues/67.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eraserhd/parinfer-rust/issues/67#event-3133479773, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZANCEUTXIOSRTFMHNUKH3RHY2LPANCNFSM4LMGDVSA .

bhougland18 commented 4 years ago

I added this Nixos layer and I can use it manually, but it doesn't turn on my default when I use clojure even though I have this in my kakrc:

hook global WinSetOption filetype=(clojure|lisp|scheme|racket) %{ parinfer-enable-window -smart }

also, when I use it manually it will only format a selection that I have highlighted. What is the best way to have it continually run in a buffer?

eraserhd commented 4 years ago

This should be enough to make it work. Some questions:

bhougland18 commented 4 years ago

There is an error in the debug buffer, it says:

error running hook WinSetOption(filetype=clojure)/: no such command: 'parinfer-enable-window'

bhougland18 commented 4 years ago

Parinfer works but I am still getting the error in my previous comment above in Kakoune's buffer. Is there an easy fix for this?

eraserhd commented 4 years ago

I'm at a loss, honestly. As far as I can tell, you are doing everything right. Can you test if this happens only when you specify a Clojure file on the command-line (for a new Kakoune session)? e.g.

kak path/to/file.clj

vs.

kak
:edit path/to/file.clj

?

I've been wondering if some of the NixOS wrappers that load plugins might load things differently.