summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-22 03:17:46 +0100
committerhut <hut@lavabit.com>2013-02-22 03:19:28 +0100
commit58247b857f861c057158ec3ecab89f3dffcfe290 (patch)
tree283c35c9d5b06abd8432f9ea4e12b09d72661e51 /ranger
parent33aeef8e9fe3891723a2d2fe450859c46cb572ab (diff)
downloadranger-58247b857f861c057158ec3ecab89f3dffcfe290.tar.gz
core.main: added RANGER_LOAD_DEFAULT_RC environment variable
this fixes the problem that examples/plugin_skip_default_rc doesn't
work, because plugins are loaded after the rc.conf.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rc.conf4
-rw-r--r--ranger/core/main.py5
2 files changed, 3 insertions, 6 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index f5effe2d..bfb2d457 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -3,8 +3,8 @@
 # To change them, it is recommended to create the file
 # ~/.config/ranger/rc.conf and add your custom commands there.
 #
-# If you copy this whole file there, you may want to install the plugin
-# "plugins/plugin_skip_default_rc.py" to avoid loading the rc.conf twice.
+# If you copy this whole file there, you may want to set the environment
+# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
 #
 # The purpose of this file is mainly to define keybindings and settings.
 # For running more complex python code, please create a plugin in "plugins/" or
diff --git a/ranger/core/main.py b/ranger/core/main.py
index fbdb3bcd..dc35b47e 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -8,8 +8,6 @@ The main function responsible to initialize the FM object and stuff.
 import os.path
 import sys
 
-load_default_config = True
-
 def main():
     """initialize objects and run the filemanager"""
     import locale
@@ -234,7 +232,6 @@ def parse_arguments():
 
 
 def load_settings(fm, clean):
-    global load_default_config
     from ranger.core.actions import Actions
     import ranger.core.shared
     import ranger.api.commands
@@ -264,7 +261,7 @@ def load_settings(fm, clean):
         custom_conf = fm.confpath('rc.conf')
         default_conf = fm.relpath('config', 'rc.conf')
 
-        if load_default_config:
+        if os.environ.get('RANGER_LOAD_DEFAULT_RC', 0) != 'FALSE':
             fm.source(default_conf)
         if os.access(custom_conf, os.R_OK):
             fm.source(custom_conf)
span> ^
6849d7f ^
b34b873 ^
f755d1d ^


















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76