Closed spenserblack closed 1 year ago
Thanks for your work @spenserblack! I tested both scripts following your instructions and everything seems to work as expected.
Yes, CLIFM_OPTIONS
is just a placeholder for default arguments. $@
could be added to add command line parameters (I guess it's the same as the C-like $argv
in fish).
An install-extensions.fish
script would definitely be nice.
One last thing: please add header information (description, usage, deps, author, license) to both fish functions, just to keep a consistent style among functions/plugins.
Btw, does fish provide some shellcheck
-like function for fish scripts?
Weird, I could've sworn I responded to this yesterday :confused:
An
install-extensions.fish
script would definitely be nice.
Sounds good :+1:
One last thing: please add header information (description, usage, deps, author, license) to both fish functions, just to keep a consistent style among functions/plugins.
Sure :+1:
Btw, does fish provide some
shellcheck
-like function for fish scripts?
Closest I know of is fish -n/--no-execute
, which, as the name implies, doesn't execute, just asserts that the syntax is valid.
Thanks @spenserblack!
Oh, whoops. Should've converted this PR to a draft 😅
https://github.com/spenserblack/clifm/commit/960c89e4f7d4aa4da0ff242a14476d8b16b1574d
No problem. Just create a new PR.
The one thing I didn't translate was
subshell_notice.sh
. The way to accomplish changing the prompt would be to edit$HOME/.config/fish/fish_prompt.fish
. There are multiple built-in prompts, and even the default is pretty complex, so it's not much of a simple copy-and-paste job. Seemed to me like it would be better to refer fish users to documentation than provide code to copy-and-paste for this one.But a simple prompt would be like
Also, I changed
file_picker
to use$argv
instead of passing aCLIFM_OPTIONS
variable. I'm not really sure what the purpose was in the original script, but I'm guessing the intent was to allow somebody to pass additional CLI options with that variable? If so, using$argv
is more idiomatic for fish IMO, since these functions "wrap" clifm.One interesting thing about fish is that it reads from a
$HOME/.config/fish/functions
directory, which means installation is as simple as copying these files to that directory. That opens up the possibility of a script likeinstall-extensions.fish
to automatically copy these files.