mirror of
https://github.com/denisidoro/navi.git
synced 2026-01-23 02:14:19 +00:00
Merge pull request #941 from kit494way/config-delimiter
Allow delimiter variable option to be set from config.yaml
This commit is contained in:
commit
72b0d14589
4 changed files with 8 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ finder:
|
|||
command: fzf # equivalent to the --finder option
|
||||
# overrides: --tac # equivalent to the --fzf-overrides option
|
||||
# overrides_var: --tac # equivalent to the --fzf-overrides-var option
|
||||
# delimiter_var: \s\s+ # equivalent to the --delimiter option that is used with --column option when you extract a column from the selected result for a variable
|
||||
|
||||
# cheats:
|
||||
# paths:
|
||||
|
|
|
|||
|
|
@ -99,6 +99,10 @@ impl Config {
|
|||
.or_else(|| self.yaml.finder.overrides_var.clone())
|
||||
}
|
||||
|
||||
pub fn delimiter_var(&self) -> Option<String> {
|
||||
self.yaml.finder.delimiter_var.clone()
|
||||
}
|
||||
|
||||
pub fn tealdeer(&self) -> bool {
|
||||
self.yaml.client.tealdeer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ pub struct Finder {
|
|||
pub command: FinderChoice,
|
||||
pub overrides: Option<String>,
|
||||
pub overrides_var: Option<String>,
|
||||
pub delimiter_var: Option<String>,
|
||||
}
|
||||
|
||||
fn finder_deserialize<'de, D>(deserializer: D) -> Result<FinderChoice, D::Error>
|
||||
|
|
@ -158,6 +159,7 @@ impl Default for Finder {
|
|||
command: FinderChoice::Fzf,
|
||||
overrides: None,
|
||||
overrides_var: None,
|
||||
delimiter_var: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ impl Opts {
|
|||
overrides: CONFIG.fzf_overrides_var(),
|
||||
suggestion_type: SuggestionType::SingleRecommendation,
|
||||
prevent_select1: false,
|
||||
delimiter: CONFIG.delimiter_var(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue