-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: option to disable status emoji
Currently, a status emoji is being displayed in the right prompt of shell. If you have customised your right prompt you may want to disable the status emoji. Closes: #64
- Loading branch information
1 parent
d9b2e95
commit 4eed0a0
Showing
11 changed files
with
76 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env fish | ||
|
||
function _fish_ai_autocomplete --description "Autocomplete the current command using AI." --argument-names command cursor_position | ||
set selected_completion (~/.fish-ai/bin/autocomplete "$command" "$cursor_position" 2> /dev/null) | ||
if test (~/.fish-ai/bin/lookup_setting "debug") = True | ||
set selected_completion (~/.fish-ai/bin/autocomplete "$command" "$cursor_position") | ||
else | ||
set selected_completion (~/.fish-ai/bin/autocomplete "$command" "$cursor_position" 2> /dev/null) | ||
end | ||
echo -n "$selected_completion" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env fish | ||
|
||
function _fish_ai_codify --description "Turn a comment into a command using AI." --argument-names comment | ||
set output (~/.fish-ai/bin/codify "$comment" 2> /dev/null) | ||
if test (~/.fish-ai/bin/lookup_setting "debug") = True | ||
set output (~/.fish-ai/bin/codify "$comment") | ||
else | ||
set output (~/.fish-ai/bin/codify "$comment" 2> /dev/null) | ||
end | ||
echo -n "$output" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env fish | ||
|
||
function _fish_ai_explain --description "Turn a command into a comment using AI." --argument-names command | ||
set output (~/.fish-ai/bin/explain "$command" 2> /dev/null) | ||
if test (~/.fish-ai/bin/lookup_setting "debug") = True | ||
set output (~/.fish-ai/bin/explain "$command") | ||
else | ||
set output (~/.fish-ai/bin/explain "$command" 2> /dev/null) | ||
end | ||
echo -n "$output" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env fish | ||
|
||
function _fish_ai_fix --description "Fix a command using AI." --argument-names previous_command | ||
set output (~/.fish-ai/bin/fix "$previous_command" 2> /dev/null) | ||
if test (~/.fish-ai/bin/lookup_setting "debug") = True | ||
set output (~/.fish-ai/bin/fix "$previous_command") | ||
else | ||
set output (~/.fish-ai/bin/fix "$previous_command" 2> /dev/null) | ||
end | ||
echo -n "$output" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from os import path | ||
import sys | ||
from configparser import ConfigParser | ||
|
||
config = ConfigParser() | ||
config.read(path.expanduser('~/.config/fish-ai.ini')) | ||
|
||
|
||
def lookup_setting(): | ||
print(get_config(sys.argv[1] or '')) | ||
|
||
|
||
def get_config(key): | ||
if not config.has_section('fish-ai'): | ||
# There is no configuration file or the user made a mistake. | ||
# Just return 'None' here to simplify testing. | ||
return None | ||
|
||
active_section = config.get(section='fish-ai', option='configuration') | ||
|
||
if config.has_option(section=active_section, option=key): | ||
return config.get(section=active_section, option=key) | ||
|
||
return config.get(section='fish-ai', option=key, fallback=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters