fatty 0.99.0 → 0.99.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.org +11 -29
- data/README.md +2207 -18
- data/README.org +2066 -104
- data/exe/fatty +236 -93
- data/help/help.md +233 -0
- data/lib/fatty/action.rb +3 -7
- data/lib/fatty/actionable.rb +2 -0
- data/lib/fatty/alert.rb +65 -39
- data/lib/fatty/ansi/renderer.rb +26 -6
- data/lib/fatty/ansi.rb +1 -0
- data/lib/fatty/api/alert.rb +15 -0
- data/lib/fatty/api/choose.rb +145 -0
- data/lib/fatty/api/environment.rb +12 -0
- data/lib/fatty/api/keytest.rb +11 -0
- data/lib/fatty/api/menu.rb +104 -0
- data/lib/fatty/api/output.rb +55 -0
- data/lib/fatty/api/progress.rb +24 -0
- data/lib/fatty/api/prompt.rb +77 -0
- data/lib/fatty/api/status.rb +55 -0
- data/lib/fatty/api.rb +38 -0
- data/lib/fatty/callback_environment.rb +74 -0
- data/lib/fatty/colors/color.rb +366 -232
- data/lib/fatty/colors/pairs.rb +2 -0
- data/lib/fatty/command.rb +78 -0
- data/lib/fatty/config.rb +227 -39
- data/lib/fatty/config_files/config.yml +4 -12
- data/lib/fatty/config_files/keydefs.yml +13 -23
- data/lib/fatty/config_files/themes/capuchin_monk.yml +140 -0
- data/lib/fatty/config_files/themes/catppuccin_latte.yml +140 -0
- data/lib/fatty/config_files/themes/catppuccin_mocha.yml +140 -0
- data/lib/fatty/config_files/themes/cyberpunk.yml +141 -0
- data/lib/fatty/config_files/themes/dracula.yml +140 -0
- data/lib/fatty/config_files/themes/everforest_dark.yml +140 -0
- data/lib/fatty/config_files/themes/gruvbox_dark.yml +140 -0
- data/lib/fatty/config_files/themes/gruvbox_light.yml +140 -0
- data/lib/fatty/config_files/themes/mono.yml +119 -47
- data/lib/fatty/config_files/themes/monokai.yml +140 -0
- data/lib/fatty/config_files/themes/nordic.yml +1 -0
- data/lib/fatty/config_files/themes/onedark.yml +140 -0
- data/lib/fatty/config_files/themes/solarized_dark.yml +1 -0
- data/lib/fatty/config_files/themes/solarized_light.yml +140 -0
- data/lib/fatty/config_files/themes/terminal.yml +67 -0
- data/lib/fatty/config_files/themes/tokyo_night.yml +140 -0
- data/lib/fatty/config_files/themes/wordperfect.yml +80 -9
- data/lib/fatty/core_ext/hash.rb +19 -0
- data/lib/fatty/core_ext/string.rb +19 -12
- data/lib/fatty/core_ext.rb +1 -0
- data/lib/fatty/curses/context.rb +86 -84
- data/lib/fatty/curses/event_source.rb +128 -40
- data/lib/fatty/curses/key_decoder.rb +77 -11
- data/lib/fatty/env.rb +21 -20
- data/lib/fatty/help.rb +1 -29
- data/lib/fatty/history/entry.rb +2 -0
- data/lib/fatty/history.rb +17 -14
- data/lib/fatty/input_buffer.rb +71 -47
- data/lib/fatty/input_field.rb +216 -149
- data/lib/fatty/key_event.rb +67 -66
- data/lib/fatty/key_map.rb +54 -16
- data/lib/fatty/keymaps/emacs.rb +40 -6
- data/lib/fatty/log_formats/json.rb +2 -0
- data/lib/fatty/log_formats/text.rb +2 -0
- data/lib/fatty/logger.rb +7 -2
- data/lib/fatty/markdown/ansi_renderer.rb +75 -6
- data/lib/fatty/markdown/render.rb +2 -3
- data/lib/fatty/mouse_event.rb +142 -2
- data/lib/fatty/output_buffer.rb +2 -0
- data/lib/fatty/pager.rb +158 -47
- data/lib/fatty/progress.rb +417 -0
- data/lib/fatty/renderer/curses.rb +340 -184
- data/lib/fatty/renderer/truecolor.rb +266 -163
- data/lib/fatty/renderer.rb +115 -97
- data/lib/fatty/screen.rb +2 -0
- data/lib/fatty/session/alert_session.rb +39 -21
- data/lib/fatty/session/isearch_session.rb +92 -38
- data/lib/fatty/session/keytest_session.rb +105 -85
- data/lib/fatty/session/modal_session.rb +38 -1
- data/lib/fatty/session/output_session.rb +472 -21
- data/lib/fatty/session/popup_session.rb +251 -134
- data/lib/fatty/session/prompt_session.rb +68 -26
- data/lib/fatty/session/search_session.rb +79 -31
- data/lib/fatty/session/shell_session.rb +383 -368
- data/lib/fatty/session/status_session.rb +167 -0
- data/lib/fatty/session.rb +95 -95
- data/lib/fatty/terminal/popup_owner.rb +14 -11
- data/lib/fatty/terminal.rb +515 -813
- data/lib/fatty/themes/loader.rb +4 -2
- data/lib/fatty/themes/manager.rb +4 -0
- data/lib/fatty/themes/registry.rb +2 -0
- data/lib/fatty/themes/resolver.rb +175 -162
- data/lib/fatty/version.rb +1 -1
- data/lib/fatty/viewport.rb +8 -1
- data/lib/fatty.rb +35 -7
- metadata +42 -40
- data/.envrc +0 -2
- data/.simplecov +0 -23
- data/.yardopts +0 -4
- data/CHANGELOG.md +0 -34
- data/Rakefile +0 -15
- data/TODO.org +0 -163
- data/examples/markdown/native-markdown.md +0 -370
- data/examples/markdown/ox-gfm-markdown.md +0 -373
- data/examples/markdown/ox-gfm-markdown.org +0 -376
- data/fatty.gemspec +0 -42
- data/lib/fatty/accept_env.rb +0 -32
- data/lib/fatty/config_files/help.md +0 -120
- data/lib/fatty/config_files/help.org +0 -124
- data/lib/fatty/config_files/themes/wordperfect_light.yml +0 -77
- data/lib/fatty/menu_env.rb +0 -22
- data/lib/fatty/session/input_session.rb +0 -99
- data/lib/fatty/sessions.rb +0 -14
- data/lib/fatty/terminal/progress.rb +0 -374
- data/lib/fatty/view/alert_view.rb +0 -14
- data/lib/fatty/view/cursor_view.rb +0 -18
- data/lib/fatty/view/input_view.rb +0 -9
- data/lib/fatty/view/output_view.rb +0 -9
- data/lib/fatty/view/status_view.rb +0 -14
- data/lib/fatty/view.rb +0 -33
- data/lib/fatty/views.rb +0 -9
- data/sig/fatty.rbs +0 -4
data/lib/fatty/colors/pairs.rb
CHANGED
|
@@ -29,6 +29,7 @@ module Fatty
|
|
|
29
29
|
SEARCH_HIGHLIGHT = 21
|
|
30
30
|
SEARCH_HIGHLIGHT_SECONDARY = 22
|
|
31
31
|
PAGER_STATUS = 23
|
|
32
|
+
LINE_NUMBER = 24
|
|
32
33
|
|
|
33
34
|
POPUP = 30
|
|
34
35
|
POPUP_SELECTION = 31
|
|
@@ -61,6 +62,7 @@ module Fatty
|
|
|
61
62
|
search_input: SEARCH,
|
|
62
63
|
|
|
63
64
|
pager_status: PAGER_STATUS,
|
|
65
|
+
line_number: LINE_NUMBER,
|
|
64
66
|
|
|
65
67
|
popup: POPUP,
|
|
66
68
|
popup_selection: POPUP_SELECTION,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Fatty
|
|
4
|
+
class Command
|
|
5
|
+
attr_reader :target, :action, :payload
|
|
6
|
+
|
|
7
|
+
def initialize(target:, action:, payload: {})
|
|
8
|
+
@target = target.to_sym
|
|
9
|
+
@action = action.to_sym
|
|
10
|
+
@payload = payload || {}
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def inspect
|
|
14
|
+
"Command: @target=#{@target}, @action=#{@action} @payload keys=#{@payload.keys}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.terminal(action, **payload)
|
|
18
|
+
new(target: :terminal, action: action, payload: payload)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.session(id, action, **payload)
|
|
22
|
+
new(target: id, action: action, payload: payload)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.coerce(value)
|
|
26
|
+
case value
|
|
27
|
+
when Command
|
|
28
|
+
value
|
|
29
|
+
when Array
|
|
30
|
+
coerce_array(value)
|
|
31
|
+
else
|
|
32
|
+
raise ArgumentError, "expected command, got #{value.inspect}"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.normalize_list(value)
|
|
37
|
+
result =
|
|
38
|
+
case value
|
|
39
|
+
when nil
|
|
40
|
+
[]
|
|
41
|
+
when Command
|
|
42
|
+
[value]
|
|
43
|
+
when Array
|
|
44
|
+
value.grep(Command)
|
|
45
|
+
else
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
result
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def terminal?
|
|
53
|
+
target == :terminal
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def session?
|
|
57
|
+
!terminal?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def id
|
|
61
|
+
target unless terminal?
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def self.coerce_array(value)
|
|
65
|
+
domain, name, *rest = value
|
|
66
|
+
case domain
|
|
67
|
+
when :terminal
|
|
68
|
+
new(target: :terminal, action: name, payload: { args: rest })
|
|
69
|
+
when :send
|
|
70
|
+
id, action_name, payload = name, *rest
|
|
71
|
+
new(target: id, action: action_name, payload: payload || {})
|
|
72
|
+
else
|
|
73
|
+
raise ArgumentError, "unknown command domain #{domain.inspect}"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
private_class_method :coerce_array
|
|
77
|
+
end
|
|
78
|
+
end
|
data/lib/fatty/config.rb
CHANGED
|
@@ -1,86 +1,274 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
using Fatty::CoreExt::Hash
|
|
4
|
+
|
|
3
5
|
module Fatty
|
|
4
6
|
module Config
|
|
5
7
|
class << self
|
|
6
|
-
attr_reader :progname
|
|
8
|
+
attr_reader :progname, :app_name, :app_config_dir
|
|
7
9
|
attr_accessor :reader
|
|
8
|
-
attr_accessor :dir
|
|
9
10
|
end
|
|
10
11
|
@progname = 'fatty'
|
|
11
12
|
@config = {}
|
|
12
13
|
@reader = nil
|
|
13
14
|
@dir = nil
|
|
14
15
|
|
|
15
|
-
# Read in the general configuration for fatty
|
|
16
|
-
#
|
|
17
|
-
#
|
|
16
|
+
# Read in the general configuration for fatty for certain user-adjustable
|
|
17
|
+
# features of fatty in the per-user config.yml with the per-app config.yml
|
|
18
|
+
# merged. One of the config value sets up logging, including the location
|
|
19
|
+
# of the log file.
|
|
18
20
|
def self.config
|
|
19
|
-
@
|
|
20
|
-
|
|
21
|
+
@config = read_layered("config")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Read in the keydefs.yml config file that maps numeric keycodes returned
|
|
25
|
+
# by curses but not assigned a key name. This merges in the per-app
|
|
26
|
+
# keydefs.yml as well.
|
|
27
|
+
def self.keydefs
|
|
28
|
+
read_layered("keydefs")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Read in the keybindings.yml config file that maps key names (together
|
|
32
|
+
# with any modifiers, shift, ctrl, meta) to action names to be triggered
|
|
33
|
+
# by the key chord. This merges in the per-app keybindings.yml as well.
|
|
34
|
+
def self.keybindings
|
|
35
|
+
base = Array(global_reader.read("keybindings")[:keybindings])
|
|
36
|
+
overlay = Array(read_app("keybindings"))
|
|
37
|
+
base + overlay
|
|
21
38
|
end
|
|
22
39
|
|
|
40
|
+
def self.install_defaults!
|
|
41
|
+
FileUtils.mkdir_p(user_config_dir)
|
|
42
|
+
|
|
43
|
+
Dir.glob(File.join(dist_config_dir, "*")).each do |src|
|
|
44
|
+
next unless File.file?(src)
|
|
45
|
+
|
|
46
|
+
dst = File.join(user_config_dir, File.basename(src))
|
|
47
|
+
Fatty.info("Copying config file #{src} to #{dst}", tag: :config)
|
|
48
|
+
FileUtils.cp(src, dst) unless File.exist?(dst)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
install_default_themes!
|
|
52
|
+
nil
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.install_default_themes!
|
|
56
|
+
FileUtils.mkdir_p(user_themes_dir)
|
|
57
|
+
|
|
58
|
+
Dir.glob(File.join(dist_themes_dir, "*.yml")).each do |src|
|
|
59
|
+
dst = File.join(user_themes_dir, File.basename(src))
|
|
60
|
+
unless File.exist?(dst)
|
|
61
|
+
Fatty.info("Copying theme file #{src} to #{dst}", tag: :theme)
|
|
62
|
+
FileUtils.cp(src, dst)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
nil
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
###########################################################################
|
|
69
|
+
# Accessors
|
|
70
|
+
###########################################################################
|
|
71
|
+
|
|
72
|
+
# The name used for 'fatty' in forming directories such as
|
|
73
|
+
# ~/.config/<progname>
|
|
23
74
|
def self.progname=(name)
|
|
24
75
|
@progname = name || 'fatty'
|
|
25
|
-
|
|
76
|
+
reset_reader!
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# The directory for user's fatty configuration, by default ~/.config/fatty
|
|
80
|
+
def self.dir
|
|
81
|
+
@dir
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# And its setter
|
|
85
|
+
def self.dir=(path)
|
|
86
|
+
@dir = path
|
|
87
|
+
reset_reader!
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Invoke both app-specific setters.
|
|
91
|
+
def self.configure_app(app_name: nil, app_config_dir: nil)
|
|
92
|
+
self.app_name = app_name
|
|
93
|
+
self.app_config_dir = app_config_dir
|
|
94
|
+
nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# The name used by the consuming application to add app-specific
|
|
98
|
+
# configuration. If you use fatty for 10 different REPL-like apps, they
|
|
99
|
+
# can each have independent configuration on top of fatty's global the
|
|
100
|
+
# user configuration.
|
|
101
|
+
def self.app_name=(name)
|
|
102
|
+
@app_name = normalize_app_name(name)
|
|
103
|
+
reset_reader!
|
|
26
104
|
end
|
|
27
105
|
|
|
106
|
+
# By default, the per-app configuration lives in
|
|
107
|
+
# ~/.config/fatty/apps/<app_name>/ but the consuming app may want fatty's
|
|
108
|
+
# config to live in its own config directory. This allows the per-app
|
|
109
|
+
# config directory to be placed elsewhere.
|
|
110
|
+
def self.app_config_dir=(path)
|
|
111
|
+
@app_config_dir = path && File.expand_path(path)
|
|
112
|
+
reset_reader!
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# The per-user config pathname, normally ~/.config/fatty/config.yml
|
|
28
116
|
def self.user_config_path
|
|
29
|
-
@reader ||= FatConfig::Reader.new(progname, user_dir:
|
|
117
|
+
@reader ||= FatConfig::Reader.new(progname, user_dir: user_config_dir)
|
|
30
118
|
reader.config_paths[:user].first || default_user_path('config')
|
|
31
119
|
end
|
|
32
120
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
121
|
+
# The per-user config directory, which falls back to XDG conventions if
|
|
122
|
+
# dir is not set.
|
|
123
|
+
def self.user_config_dir
|
|
124
|
+
dir || File.join(
|
|
125
|
+
ENV.fetch("XDG_CONFIG_HOME", File.expand_path("~/.config")),
|
|
126
|
+
progname,
|
|
127
|
+
)
|
|
36
128
|
end
|
|
37
129
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
130
|
+
# The per-user themes directory, installed below the config directory.
|
|
131
|
+
def self.user_themes_dir
|
|
132
|
+
File.join(user_config_dir, "themes")
|
|
41
133
|
end
|
|
42
134
|
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
def self.
|
|
46
|
-
|
|
135
|
+
# The per-app config directory, either under ~/.config/fatty/apps/<app_name> (by
|
|
136
|
+
# default) or the directory the library consumer sets in app_config_dir.
|
|
137
|
+
def self.app_user_config_dir
|
|
138
|
+
if app_config_dir
|
|
139
|
+
app_config_dir
|
|
140
|
+
elsif app_name
|
|
141
|
+
File.join(user_config_dir, "apps", app_name)
|
|
142
|
+
end
|
|
47
143
|
end
|
|
48
144
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
145
|
+
def self.app_config_path(name = "config")
|
|
146
|
+
return unless app_user_config_dir
|
|
147
|
+
|
|
148
|
+
File.join(app_user_config_dir, "#{name}.yml")
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# The per-app themes directory, either under
|
|
152
|
+
# ~/.config/fatty/apps/<app_name>/themes (by default) or under the themes
|
|
153
|
+
# directory in the config directory the library consumer sets in
|
|
154
|
+
# app_config_dir.
|
|
155
|
+
def self.app_themes_dir
|
|
156
|
+
return unless app_user_config_dir
|
|
157
|
+
|
|
158
|
+
File.join(app_user_config_dir, "themes")
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# The per-user keydefs path name, normally ~/.config/fatty/keydefs.yml
|
|
162
|
+
def self.user_keydefs_path
|
|
163
|
+
@reader ||= FatConfig::Reader.new(progname, user_dir: user_config_dir)
|
|
164
|
+
reader.config_paths("keydefs")[:user].first || default_user_path("keydefs")
|
|
165
|
+
end
|
|
55
166
|
|
|
56
|
-
|
|
57
|
-
|
|
167
|
+
# The per-user keybindings path name, normally ~/.config/fatty/keybindings.yml
|
|
168
|
+
def self.user_keybindings_path
|
|
169
|
+
self.reader ||= FatConfig::Reader.new(progname, user_dir: user_config_dir)
|
|
170
|
+
reader.config_paths("keybindings")[:user].first || default_user_path("keybindings")
|
|
58
171
|
end
|
|
59
172
|
|
|
173
|
+
# The default per-user config pathname for any of the config files, normally
|
|
174
|
+
# ~/.config/fatty/config.yml, ~/.config/fatty/keydefs.yml, etc.
|
|
60
175
|
def self.default_user_path(name = 'config')
|
|
61
176
|
"~/.config/#{progname}/#{name}.yml"
|
|
62
177
|
end
|
|
63
178
|
|
|
64
|
-
|
|
65
|
-
|
|
179
|
+
# The directory where the fatty gem stores the distributed sample config
|
|
180
|
+
# and theme files.
|
|
181
|
+
def self.dist_config_dir
|
|
182
|
+
File.expand_path("config_files", __dir__)
|
|
66
183
|
end
|
|
67
184
|
|
|
68
|
-
|
|
69
|
-
|
|
185
|
+
# The directory where the fatty gem stores the distributed distributed theme
|
|
186
|
+
# files.
|
|
187
|
+
def self.dist_themes_dir
|
|
188
|
+
File.join(dist_config_dir, "themes")
|
|
70
189
|
end
|
|
71
190
|
|
|
72
|
-
|
|
73
|
-
|
|
191
|
+
###########################################################################
|
|
192
|
+
# Helpers
|
|
193
|
+
###########################################################################
|
|
194
|
+
|
|
195
|
+
def self.reset_reader!
|
|
196
|
+
@reader = nil
|
|
197
|
+
@config = {}
|
|
74
198
|
end
|
|
75
199
|
|
|
76
|
-
def self.
|
|
77
|
-
|
|
200
|
+
def self.global_reader
|
|
201
|
+
@reader ||= FatConfig::Reader.new(progname, user_dir: user_config_dir)
|
|
202
|
+
end
|
|
78
203
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
204
|
+
def self.reader_for_dir(path)
|
|
205
|
+
FatConfig::Reader.new(progname, user_dir: path)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def self.read_layered(name)
|
|
209
|
+
base = global_reader.read(name)
|
|
210
|
+
overlay = read_app(name)
|
|
211
|
+
merge_config(base, overlay)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def self.read_app(name)
|
|
215
|
+
path = app_config_path(name)
|
|
216
|
+
return {} unless path
|
|
217
|
+
return {} unless File.exist?(path)
|
|
218
|
+
|
|
219
|
+
YAML.load_file(path, symbolize_names: true) || {}
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def self.merge_config(base, overlay)
|
|
223
|
+
return normalize_config_value(overlay) if blank_config?(base)
|
|
224
|
+
return normalize_config_value(base) if blank_config?(overlay)
|
|
225
|
+
|
|
226
|
+
if base.is_a?(Hash) && overlay.is_a?(Hash)
|
|
227
|
+
base.deep_merge(overlay)
|
|
228
|
+
elsif base.is_a?(Array) && overlay.is_a?(Array)
|
|
229
|
+
base + overlay
|
|
230
|
+
else
|
|
231
|
+
overlay
|
|
82
232
|
end
|
|
83
|
-
nil
|
|
84
233
|
end
|
|
234
|
+
|
|
235
|
+
def self.merge_keybindings(base, overlay)
|
|
236
|
+
return normalize_config_value(overlay) if blank_config?(base)
|
|
237
|
+
return normalize_config_value(base) if blank_config?(overlay)
|
|
238
|
+
|
|
239
|
+
if base.is_a?(Hash) && overlay.is_a?(Hash)
|
|
240
|
+
merged = base.deep_merge(overlay)
|
|
241
|
+
merged[:keybindings] =
|
|
242
|
+
Array(base[:keybindings]) + Array(overlay[:keybindings])
|
|
243
|
+
merged
|
|
244
|
+
elsif base.is_a?(Array) && overlay.is_a?(Array)
|
|
245
|
+
base + overlay
|
|
246
|
+
else
|
|
247
|
+
overlay
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def self.blank_config?(value)
|
|
252
|
+
value.nil? || value == {} || value == []
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def self.normalize_config_value(value)
|
|
256
|
+
value || {}
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def self.normalize_app_name(name)
|
|
260
|
+
text = name.to_s.strip
|
|
261
|
+
text.empty? ? nil : text
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
private_class_method :reset_reader!
|
|
265
|
+
private_class_method :global_reader
|
|
266
|
+
private_class_method :reader_for_dir
|
|
267
|
+
private_class_method :read_layered
|
|
268
|
+
private_class_method :read_app
|
|
269
|
+
private_class_method :merge_config
|
|
270
|
+
private_class_method :blank_config?
|
|
271
|
+
private_class_method :normalize_config_value
|
|
272
|
+
private_class_method :normalize_app_name
|
|
85
273
|
end
|
|
86
274
|
end
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
# What fatty considers a "word" in the input buffer
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
|
|
3
|
+
# A Ruby regexp fragment used *inside* /.../ (not including the slashes).
|
|
4
|
+
# Default if omitted: "[[:alnum:]_]"
|
|
5
|
+
word_char_re: "[[:alnum:]_]"
|
|
6
6
|
|
|
7
|
-
# # treat '.' as part of a word (good for fqdn / ruby constants / filenames)
|
|
8
|
-
# input_buffer:
|
|
9
|
-
# word_chars: "[[:alnum:]_.:-]"
|
|
10
|
-
|
|
11
|
-
input_buffer:
|
|
12
|
-
# A Ruby regexp fragment used *inside* /.../ (not including the slashes).
|
|
13
|
-
# Default if omitted: "[[:alnum:]_]"
|
|
14
|
-
word_chars: "[[:alnum:]_]"
|
|
15
7
|
|
|
16
8
|
# This controls how long (in milliseconds) curses waits after receiving ESC
|
|
17
9
|
# for a second key to interpret it as a meta-key sequence. ncurses defaults
|
|
18
10
|
# to 1000, i.e., a full second, which can make response to a bare ESC key feel
|
|
19
11
|
# really laggy. You can set it to something more reasonable here or by
|
|
20
12
|
# setting the environment variable ESCDELAY in you shell setup.
|
|
21
|
-
esc_delay:
|
|
13
|
+
esc_delay: 0
|
|
22
14
|
|
|
23
15
|
# file: sets the location of the log file, by default at
|
|
24
16
|
# $XDG_STATE_HOME/fatty/fatty.log
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
meta: true
|
|
15
|
-
570:
|
|
16
|
-
key: right
|
|
17
|
-
meta: true
|
|
18
|
-
557:
|
|
19
|
-
key: left
|
|
20
|
-
ctrl: true
|
|
21
|
-
572:
|
|
22
|
-
key: right
|
|
23
|
-
ctrl: true
|
|
1
|
+
tmux:
|
|
2
|
+
555:
|
|
3
|
+
key: left
|
|
4
|
+
meta: true
|
|
5
|
+
570:
|
|
6
|
+
key: right
|
|
7
|
+
meta: true
|
|
8
|
+
557:
|
|
9
|
+
key: left
|
|
10
|
+
ctrl: true
|
|
11
|
+
572:
|
|
12
|
+
key: right
|
|
13
|
+
ctrl: true
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: capuchin_monk
|
|
2
|
+
inherit: null
|
|
3
|
+
markdown_code_theme: gruvbox_dark
|
|
4
|
+
|
|
5
|
+
output:
|
|
6
|
+
fg: "#e8d8b8"
|
|
7
|
+
bg: "#24160f"
|
|
8
|
+
|
|
9
|
+
input:
|
|
10
|
+
fg: "#f5e6c8"
|
|
11
|
+
bg: "#3a261a"
|
|
12
|
+
attrs: [bold]
|
|
13
|
+
|
|
14
|
+
input_suggestion:
|
|
15
|
+
fg: "#9d8063"
|
|
16
|
+
bg: "#3a261a"
|
|
17
|
+
attrs: [dim]
|
|
18
|
+
|
|
19
|
+
cursor:
|
|
20
|
+
fg: "#24160f"
|
|
21
|
+
bg: "#d8a657"
|
|
22
|
+
|
|
23
|
+
region:
|
|
24
|
+
fg: "#24160f"
|
|
25
|
+
bg: "#c98a4a"
|
|
26
|
+
|
|
27
|
+
good:
|
|
28
|
+
fg: "#a9b665"
|
|
29
|
+
bg: "#24160f"
|
|
30
|
+
|
|
31
|
+
info:
|
|
32
|
+
fg: "#e8d8b8"
|
|
33
|
+
bg: "#24160f"
|
|
34
|
+
|
|
35
|
+
warn:
|
|
36
|
+
fg: "#24160f"
|
|
37
|
+
bg: "#d8a657"
|
|
38
|
+
|
|
39
|
+
error:
|
|
40
|
+
fg: "#f5e6c8"
|
|
41
|
+
bg: "#9d3f35"
|
|
42
|
+
|
|
43
|
+
pager_status:
|
|
44
|
+
fg: "#24160f"
|
|
45
|
+
bg: "#a9b665"
|
|
46
|
+
|
|
47
|
+
search_input:
|
|
48
|
+
fg: "#24160f"
|
|
49
|
+
bg: "#d8a657"
|
|
50
|
+
|
|
51
|
+
match_current:
|
|
52
|
+
fg: "#24160f"
|
|
53
|
+
bg: "#d8a657"
|
|
54
|
+
|
|
55
|
+
match_other:
|
|
56
|
+
fg: "#24160f"
|
|
57
|
+
bg: "#b07a4f"
|
|
58
|
+
|
|
59
|
+
popup:
|
|
60
|
+
fg: "#e8d8b8"
|
|
61
|
+
bg: "#3a261a"
|
|
62
|
+
|
|
63
|
+
popup_input:
|
|
64
|
+
fg: "#f5e6c8"
|
|
65
|
+
bg: "#1b100b"
|
|
66
|
+
|
|
67
|
+
popup_counts:
|
|
68
|
+
fg: "#24160f"
|
|
69
|
+
bg: "#e8d8b8"
|
|
70
|
+
|
|
71
|
+
popup_selection:
|
|
72
|
+
fg: "#24160f"
|
|
73
|
+
bg: "#d8a657"
|
|
74
|
+
|
|
75
|
+
popup_frame:
|
|
76
|
+
fg: "#c98a4a"
|
|
77
|
+
bg: "#3a261a"
|
|
78
|
+
border: single
|
|
79
|
+
corners: rounded
|
|
80
|
+
|
|
81
|
+
markdown_h1:
|
|
82
|
+
fg: "#d8a657"
|
|
83
|
+
bg: "#24160f"
|
|
84
|
+
attrs: [bold]
|
|
85
|
+
|
|
86
|
+
markdown_h2:
|
|
87
|
+
fg: "#c98a4a"
|
|
88
|
+
bg: "#24160f"
|
|
89
|
+
attrs: [bold]
|
|
90
|
+
|
|
91
|
+
markdown_h3:
|
|
92
|
+
fg: "#a9b665"
|
|
93
|
+
bg: "#24160f"
|
|
94
|
+
attrs: [bold]
|
|
95
|
+
|
|
96
|
+
markdown_code:
|
|
97
|
+
fg: "#a9b665"
|
|
98
|
+
bg: "#3a261a"
|
|
99
|
+
|
|
100
|
+
markdown_code_gutter:
|
|
101
|
+
fg: "#9d8063"
|
|
102
|
+
bg: "#3a261a"
|
|
103
|
+
attrs: [dim]
|
|
104
|
+
|
|
105
|
+
markdown_strong:
|
|
106
|
+
fg: "#f5e6c8"
|
|
107
|
+
bg: "#24160f"
|
|
108
|
+
attrs: [bold]
|
|
109
|
+
|
|
110
|
+
markdown_emphasis:
|
|
111
|
+
fg: "#e8d8b8"
|
|
112
|
+
bg: "#24160f"
|
|
113
|
+
attrs: [italic]
|
|
114
|
+
|
|
115
|
+
markdown_link:
|
|
116
|
+
fg: "#d8a657"
|
|
117
|
+
bg: "#24160f"
|
|
118
|
+
attrs: [underline]
|
|
119
|
+
|
|
120
|
+
markdown_url:
|
|
121
|
+
fg: "#c98a4a"
|
|
122
|
+
bg: "#24160f"
|
|
123
|
+
|
|
124
|
+
markdown_quote_gutter:
|
|
125
|
+
fg: "#9d8063"
|
|
126
|
+
bg: "#24160f"
|
|
127
|
+
|
|
128
|
+
markdown_highlight:
|
|
129
|
+
fg: "#24160f"
|
|
130
|
+
bg: "#d8a657"
|
|
131
|
+
|
|
132
|
+
markdown_table_header:
|
|
133
|
+
fg: "#f5e6c8"
|
|
134
|
+
bg: "#3a261a"
|
|
135
|
+
attrs: [bold]
|
|
136
|
+
|
|
137
|
+
markdown_hrule:
|
|
138
|
+
fg: "#6f4e37"
|
|
139
|
+
bg: "#24160f"
|
|
140
|
+
attrs: [dim]
|