diff --git a/AUTHORS b/AUTHORS index 79c650c5d..bf9a3b226 100644 --- a/AUTHORS +++ b/AUTHORS @@ -146,6 +146,7 @@ Contributors: * Charbel Jacquin (charbeljc) * Devadathan M B (devadathanmb) * Charalampos Stratakis + * Laszlo Bimba (bimlas) Creator: -------- diff --git a/pgcli/main.py b/pgcli/main.py index 9ce15135d..3002736ae 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -267,6 +267,8 @@ def __init__( self.query_history = [] + self.auto_suggest = c["main"].as_bool("auto_suggest") + # Initialize completer smart_completion = c["main"].as_bool("smart_completion") keyword_casing = c["main"]["keyword_casing"] @@ -1070,7 +1072,7 @@ def get_continuation(width, line_number, is_soft_wrap): # Render \t as 4 spaces instead of "^I" TabsProcessor(char1=" ", char2=" "), ], - auto_suggest=AutoSuggestFromHistory(), + auto_suggest=AutoSuggestFromHistory() if self.auto_suggest else None, tempfile_suffix=".sql", # N.b. pgcli's multi-line mode controls submit-on-Enter (which # overrides the default behaviour of prompt_toolkit) and is diff --git a/pgcli/pgclirc b/pgcli/pgclirc index 35ff41c5a..569705564 100644 --- a/pgcli/pgclirc +++ b/pgcli/pgclirc @@ -5,6 +5,9 @@ # possible completions will be listed. smart_completion = True +# Enable auto suggestions (like Fish shell). +auto_suggest = True + # Display the completions in several columns. (More completions will be # visible.) wider_completion_menu = False