cetus 0.1.33 → 0.1.34
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/bin/cetus +33 -47
- data/cetus.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 443d16e21b148f67cc9f5e946cd30c208849851d3f00d61654f9397608d9efc2
|
4
|
+
data.tar.gz: e313ebd0039f87472eff95115a56484bb2fa298e2a94783ea52bdeb804fcaeed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc89827c004339856387fa481fd88ae15bf5a0d0eb0ae75fc4a7837ea055adc9f19e96b6ac128897c2655beeaedc0bdbbc72b023155b0dbd1ee9322f0ae818c1
|
7
|
+
data.tar.gz: b72d9d557dba6c150720362053ba247df1745c018a53c387ef857f63d2b6937931f59668b2fa2b518456a6972353f228cc975e8c760ebecf00f4a07faf1ecd8e
|
data/bin/cetus
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Author: rkumar http://github.com/rkumar/cetus/
|
7
7
|
# Date: 2013-02-17 - 17:48
|
8
8
|
# License: GPL
|
9
|
-
# Last update: 2019-04-10
|
9
|
+
# Last update: 2019-04-10 11:18
|
10
10
|
# --------------------------------------------------------------------------- #
|
11
11
|
# cetus.rb Copyright (C) 2012-2019 rahul kumar
|
12
12
|
# == CHANGELOG
|
@@ -39,7 +39,7 @@ require 'logger'
|
|
39
39
|
# alias c=~/bin/cetus.rb
|
40
40
|
# c
|
41
41
|
|
42
|
-
VERSION = '0.1.
|
42
|
+
VERSION = '0.1.34.0'.freeze
|
43
43
|
CONFIG_PATH = ENV['XDG_CONFIG_HOME'] || File.join(ENV['HOME'], '.config')
|
44
44
|
CONFIG_FILE = "#{CONFIG_PATH}/cetus/conf.yml".freeze
|
45
45
|
|
@@ -67,6 +67,7 @@ $bindings = {
|
|
67
67
|
'.' => 'pop_dir',
|
68
68
|
':' => 'subcommand',
|
69
69
|
"'" => 'goto_bookmark',
|
70
|
+
'"' => 'file_starting_with',
|
70
71
|
'/' => 'enter_regex',
|
71
72
|
'M-p' => 'prev_page',
|
72
73
|
'M-n' => 'next_page',
|
@@ -704,14 +705,14 @@ end
|
|
704
705
|
# numbers represent quick bookmarks
|
705
706
|
# if bookmark exists, go to else create it.
|
706
707
|
def resolve_numeric_key key
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
708
|
+
d = $bookmarks[key]
|
709
|
+
if d
|
710
|
+
change_dir d
|
711
|
+
return
|
712
|
+
end
|
712
713
|
|
713
|
-
|
714
|
-
|
714
|
+
set_bookmark key
|
715
|
+
message "Created bookmark #{key}."
|
715
716
|
end
|
716
717
|
|
717
718
|
def set_bookmark key, dir=Dir.pwd
|
@@ -1342,38 +1343,20 @@ def goto_home_dir
|
|
1342
1343
|
change_dir '~'
|
1343
1344
|
end
|
1344
1345
|
|
1345
|
-
## This actually filters, in zfm it goes to that entry since we have a cursor there
|
1346
|
-
#
|
1347
|
-
def goto_entry_starting_with(fc = nil)
|
1348
|
-
unless fc
|
1349
|
-
print 'Entries starting with: '
|
1350
|
-
fc = get_char
|
1351
|
-
end
|
1352
|
-
return if fc.size != 1
|
1353
|
-
|
1354
|
-
## this is wrong and duplicates the functionality of /
|
1355
|
-
# It shoud go to cursor of item starting with fc
|
1356
|
-
$patt = "^#{fc}"
|
1357
|
-
end
|
1358
1346
|
|
1359
1347
|
# Goes to directory bookmarked with number or upper case char.
|
1360
1348
|
# If lower case character given, then go to first file starting with char.
|
1361
|
-
def goto_bookmark
|
1349
|
+
def goto_bookmark key=nil
|
1362
1350
|
unless key
|
1363
|
-
|
1351
|
+
clear_last_line
|
1364
1352
|
print 'Enter bookmark char: '
|
1365
1353
|
key = get_char
|
1366
1354
|
end
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
change_dir d
|
1371
|
-
else
|
1372
|
-
perror "#{key} not a bookmark"
|
1373
|
-
end
|
1355
|
+
d = $bookmarks[key]
|
1356
|
+
if d
|
1357
|
+
change_dir d
|
1374
1358
|
else
|
1375
|
-
#
|
1376
|
-
file_starting_with key
|
1359
|
+
perror "#{key} not a bookmark. "
|
1377
1360
|
end
|
1378
1361
|
end
|
1379
1362
|
|
@@ -1480,7 +1463,7 @@ def view_bookmarks
|
|
1480
1463
|
puts
|
1481
1464
|
print 'Enter bookmark to goto: '
|
1482
1465
|
key = get_char
|
1483
|
-
goto_bookmark(key)
|
1466
|
+
goto_bookmark(key)
|
1484
1467
|
end
|
1485
1468
|
|
1486
1469
|
# MENU MAIN
|
@@ -1575,7 +1558,7 @@ def toggle_menu
|
|
1575
1558
|
'*' => :toggle_selection_mode,
|
1576
1559
|
v: :visual_mode_toggle,
|
1577
1560
|
t: :toggle_truncate_from,
|
1578
|
-
:
|
1561
|
+
e: :toggle_enhanced_list
|
1579
1562
|
}
|
1580
1563
|
|
1581
1564
|
_, menu_text = menu 'Toggle Menu', h
|
@@ -1656,8 +1639,8 @@ def toggle_menu
|
|
1656
1639
|
else
|
1657
1640
|
:center
|
1658
1641
|
end
|
1642
|
+
message "Truncate long filenames from: #{@truncate_from}"
|
1659
1643
|
end
|
1660
|
-
message "Truncate long filenames from: #{@truncate_from}"
|
1661
1644
|
end
|
1662
1645
|
|
1663
1646
|
def order_menu
|
@@ -1954,17 +1937,18 @@ end
|
|
1954
1937
|
## accept a character to save this dir as a bookmark
|
1955
1938
|
def create_bookmark
|
1956
1939
|
|
1957
|
-
|
1940
|
+
clear_last_line
|
1941
|
+
print 'Enter A-Z, a-z or 0-9 to create a bookmark: '
|
1958
1942
|
# print "\e[?25h" # unhide cursor
|
1959
1943
|
key = get_char
|
1960
1944
|
# print "\e[?25l" # hide cursor
|
1961
|
-
if key =~ /^[0-9A-
|
1945
|
+
if key =~ /^[0-9A-Za-z]$/
|
1962
1946
|
# $bookmarks[key] = "#{Dir.pwd}:#{$cursor}"
|
1963
1947
|
set_bookmark key
|
1964
1948
|
$modified = true
|
1965
|
-
message "Created bookmark #{key}"
|
1949
|
+
message "Created bookmark #{key} for #{File.basename(Dir.pwd)}."
|
1966
1950
|
else
|
1967
|
-
perror 'Bookmark must be
|
1951
|
+
perror 'Bookmark must be alpha character or number.'
|
1968
1952
|
end
|
1969
1953
|
# redraw
|
1970
1954
|
end
|
@@ -2121,8 +2105,7 @@ end
|
|
2121
2105
|
# but prints on next line.FIXME 2019-03-24 - 00:08
|
2122
2106
|
def perror text
|
2123
2107
|
clear_last_line
|
2124
|
-
|
2125
|
-
print "#{RED}#{text}. Press a key.#{CLEAR}"
|
2108
|
+
print "\r#{RED}#{text}. Press a key.#{CLEAR}"
|
2126
2109
|
get_char
|
2127
2110
|
end
|
2128
2111
|
|
@@ -2746,10 +2729,12 @@ def visual_block_clear
|
|
2746
2729
|
end
|
2747
2730
|
|
2748
2731
|
# ------------- file matching methods --------------------------------#
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2732
|
+
def file_starting_with first_char=nil
|
2733
|
+
unless first_char
|
2734
|
+
clear_last_line
|
2735
|
+
print "\rEnter first char: "
|
2736
|
+
first_char = get_char
|
2737
|
+
end
|
2753
2738
|
ix = return_next_match(method(:file_matching?), "^#{first_char}")
|
2754
2739
|
goto_line ix if ix
|
2755
2740
|
end
|
@@ -3244,7 +3229,8 @@ def clear_last_line
|
|
3244
3229
|
# \e[33;41m - set color of status_line
|
3245
3230
|
# %*s - set blank spaces for entire line
|
3246
3231
|
# \e[m - reset text mode
|
3247
|
-
|
3232
|
+
# \r - bring to start of line since callers will print.
|
3233
|
+
print "\e[33;4%sm%*s\e[m\r" % [$status_color || '1', $gcols, " "]
|
3248
3234
|
end
|
3249
3235
|
|
3250
3236
|
# print right aligned
|
data/cetus.gemspec
CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'cetus'
|
9
|
-
spec.version = '0.1.
|
9
|
+
spec.version = '0.1.34'
|
10
10
|
spec.authors = ['Rahul Kumar']
|
11
11
|
spec.email = ['oneness.univ@gmail.com']
|
12
12
|
spec.description = %q{lightning fast file navigator}
|