commit bd3c0133c8b2849628afc42b92cce0d8d73f1349
parent 10b50f1b9693f04c8a9fdfb4be26a65a4aba8201
Author: Samuel Walladge <samuel@swalladge.id.au>
Date: Wed, 1 Nov 2017 12:22:27 +1030
add note about line number support for pager
- also update pager config so `cfg_pager` in `.snclirc` will override
`$PAGER`. The rationale with these changes is that if users have
settings in `.snclirc`, they are likely wanting those specifically,
rather than the system-wide EDITOR and PAGER env vars.
Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
@@ -155,6 +155,9 @@ cfg_editor = nvim
# examples:
cfg_editor = nvim {fname} +{line}
cfg_editor = nano +{line}
+
+# this is also supported for the pager:
+cfg_pager = less -c +{line} -N {fname}
```
#### Note Title Format
diff --git a/simplenote_cli/config.py b/simplenote_cli/config.py
@@ -21,7 +21,7 @@ def __init__(self, custom_file=None):
'cfg_format_note_title' : '[%D] %F %-N %T',
'cfg_status_bar' : 'yes',
'cfg_editor' : os.environ['EDITOR'] if 'EDITOR' in os.environ else 'vim {fname} +{line}',
- 'cfg_pager' : 'less -c',
+ 'cfg_pager' : os.environ['PAGER'] if 'PAGER' in os.environ else 'less -c',
'cfg_diff' : 'diff -b -U10',
'cfg_max_logs' : '5',
'cfg_log_timeout' : '5',
diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py
@@ -72,8 +72,6 @@ def get_editor(self):
def get_pager(self):
pager = self.config.get_config('pager')
- if 'PAGER' in os.environ:
- pager = os.environ['PAGER']
if not pager:
self.log('No pager configured!')
return None