Skip to content

Commit

Permalink
Fixed #18: Added support for multiple syntax highlighting themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
donnemartin committed Sep 22, 2015
1 parent 6cf9b56 commit c21b0e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ Under the hood, `SAWS` is **powered by the AWS CLI** and supports the **same com

![](http://i.imgur.com/xQDpw70.png)

You can control which theme to load for syntax highlighting by updating your `~/.sawsrc` file:

```
# Visual theme. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
# native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
# colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
theme = vim
```

## Auto-Completion of Commands, Subcommands, and Options

`SAWS` provides smart autocompletion as you type. Entering the following command will interactively list and auto-complete all subcommands **specific only** to `ec2`:
Expand Down
3 changes: 2 additions & 1 deletion saws/saws.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def __init__(self):
"""
self.aws_cli = None
self.key_manager = None
self.theme = 'vim'
self.PYGMENTS_CMD = ' | pygmentize -l json'
self.config = Config()
self.config_obj = self.config.read_configuration()
self.theme = self.config_obj['main']['theme']
self.logger = SawsLogger(__name__,
self.config_obj['main']['log_file'],
self.config_obj['main']['log_level']).logger
Expand Down Expand Up @@ -413,6 +413,7 @@ def run_cli(self):
None.
"""
print('Version:', __version__)
print('Theme:', self.theme)
while True:
document = self.aws_cli.run()
self.process_command(document.text)
7 changes: 6 additions & 1 deletion saws/sawsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[main]

# Use color output mode (default is to use simple substring match).
# Visual theme. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
# native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
# colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
theme = vim

# Use color output mode.
color_output = True

# Use fuzzy matching mode for resources (default is to use simple substring match).
Expand Down

0 comments on commit c21b0e1

Please sign in to comment.