blaze-keys 0.3.0

Zsh plugin for blazing fast Zsh commands, providing customizable leader-key combos and project-specific keybinds.
Documentation
use std::{path::PathBuf, sync::Mutex};

use once_cell::sync::Lazy;

pub mod keys;
pub mod nodes;
pub mod shell;
pub mod tui;
pub mod yml;

pub const CONFIG_FILE_NAME: &str = ".blz.yml";
pub const NU_SOURCE_NAME: &str = ".leader_keys.nu";

pub static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
    shellexpand::tilde("~/.config/blaze-keys")
        .to_string()
        .into()
});

#[derive(PartialEq, Copy, Clone)]
pub enum Shell {
    Zsh,
    Nu,
}

pub static SHELL: Mutex<Shell> = Mutex::new(Shell::Zsh);

pub fn is_nushell() -> bool {
    *SHELL.lock().unwrap() == Shell::Nu
}