├── .config └── ranger │ ├── colorschemes │ ├── __init__.py │ ├── __init__.pyc │ ├── __init__.pyo │ ├── __pycache__ │ │ ├── __init__.cpython-39.opt-1.pyc │ │ ├── __init__.cpython-39.pyc │ │ ├── default.cpython-39.opt-1.pyc │ │ ├── default.cpython-39.pyc │ │ ├── jungle.cpython-39.opt-1.pyc │ │ ├── jungle.cpython-39.pyc │ │ └── snow.cpython-39.opt-1.pyc │ ├── default.py │ ├── default.pyc │ ├── default.pyo │ ├── jungle.py │ ├── jungle.pyc │ ├── jungle.pyo │ ├── snow.py │ └── zenburn.py │ ├── commands.py │ ├── commands_full.py │ ├── plugins │ ├── __init__.py │ ├── __init__.pyc │ ├── __init__.pyo │ └── __pycache__ │ │ ├── __init__.cpython-39.opt-1.pyc │ │ └── __init__.cpython-39.pyc │ ├── rc.conf │ ├── rifle.conf │ └── scope.sh ├── .vim ├── .netrwhist ├── .vim │ ├── .netrwhist │ ├── autoload │ │ └── plug.vim │ └── vimrc ├── autoload │ └── plug.vim └── vimrc ├── .zshrc ├── README.md ├── i3wm ├── .config │ ├── dunst │ │ └── dunstrc │ ├── i3 │ │ └── config │ ├── polybar │ │ ├── config │ │ └── launch.sh │ ├── rofi │ │ ├── config.rasi │ │ └── material.rasi │ └── variety │ │ ├── .firstrun │ │ ├── .last_change_time │ │ ├── .version │ │ ├── Downloaded │ │ ├── .variety_download_folder │ │ ├── Bing │ │ │ ├── OHR.ContainerShip_ZH-CN0850122021_1920x1080.jpg │ │ │ ├── OHR.Italica_ZH-CN1692906751_1920x1080.jpg │ │ │ ├── OHR.IvishakRiver_ZH-CN1464216156_1920x1080.jpg │ │ │ ├── OHR.TheNationaDay_ZH-CN5381900085_1920x1080.jpg │ │ │ ├── OHR.WoodBison_ZH-CN0663388789_1920x1080.jpg │ │ │ └── state.json │ │ ├── Earth View │ │ │ └── state.json │ │ ├── Unsplash │ │ │ └── state.json │ │ ├── flickr_user_www_flickr_com_photos_peter_levi__user_id_93647178_N00_ │ │ │ └── state.json │ │ └── nasa_apod │ │ │ ├── CG4_Rolland_4000.jpg │ │ │ ├── LDN1471_HubbleSchmidt_1024.jpg │ │ │ ├── QuadrantidsOrion_Horalek_1500.jpg │ │ │ ├── StarlinkTrails_Filter_2048.jpg │ │ │ ├── TallestCliff_Voyager2_1002.jpg │ │ │ ├── giantsummerAPOD.jpg │ │ │ ├── ic410_WISEantonucci_1824.jpg │ │ │ └── state.json │ │ ├── Favorites │ │ ├── 0c0f3f16880511ebb6edd017c2d2eca2.jpg │ │ ├── 0p9vpm.jpg │ │ ├── 0pqm59.jpg │ │ ├── 132m93.jpg │ │ ├── 247402b1880511ebb6edd017c2d2eca2.jpg │ │ ├── 2kjegy.png │ │ ├── 2kvq6y.jpg │ │ ├── 39pq7d.png │ │ ├── 39y276.jpg │ │ ├── 43vgyn.jpg │ │ ├── 43vvmv.jpg │ │ ├── 454545445454545.png │ │ ├── 45d2y5.jpg │ │ ├── 4v9k3l.jpg │ │ ├── 4vwopn.jpg │ │ ├── 4yxdxk.png │ │ ├── 5wxyj1.jpg │ │ ├── 5wxyp1.png │ │ ├── 63d383a3881311ebb6edd017c2d2eca2.jpg │ │ ├── 6a57e460209041e9b64605936c2ee0d7.jpg │ │ ├── 6krlzl.jpg │ │ ├── 7394.jpg │ │ ├── 792a4b6934fc491b81342206e3192e59.png │ │ ├── 83qoyy.jpg │ │ ├── 876c45d95c8e4acf97fbfdc8c998cba5.jpg │ │ ├── 8bb5c5863294421bb517c4754b3e0ace.jpg │ │ ├── 8x286k.jpg │ │ ├── 9489fd7f49cf4998a706c5539a1d8ccc.jpg │ │ ├── 96gqz8.jpg │ │ ├── ba41a32b219e4b40ad055bbb52935896.jpg │ │ ├── bbc58c3d998d4f389fdae649334873f7.jpg │ │ ├── cd2e73d2880511ebb6edd017c2d2eca2.jpg │ │ ├── d5gego.jpg │ │ ├── ea581833bb3743ce9dde81e4531e2fbd.png │ │ ├── eolmrl.jpg │ │ ├── g8elpq.jpg │ │ ├── j58rrm.jpg │ │ ├── j5k25y.jpg │ │ ├── j82zmm.jpg │ │ ├── lm6yrq.png │ │ ├── lmkxe2.png │ │ ├── lmxlr2.jpg │ │ ├── n66x2w.jpg │ │ ├── nr7vg7.png │ │ ├── oxxw29.jpg │ │ ├── r2g7rm.jpg │ │ ├── r7ll71.png │ │ ├── x1qxwo.jpg │ │ ├── x4g5qn.jpg │ │ ├── ymkpv7.jpg │ │ └── 下载.png │ │ ├── history.txt │ │ ├── scripts │ │ ├── get_wallpaper │ │ └── set_wallpaper │ │ ├── ui.conf │ │ ├── variety.conf │ │ ├── variety_latest_default.conf │ │ └── wallpaper │ │ └── wallpaper.jpg.txt └── .vim │ ├── .netrwhist │ ├── autoload │ └── plug.vim │ └── vimrc └── kde └── .config ├── kdeglobals ├── kglobalshortcutsrc └── lattedockrc /.config/ranger/colorschemes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__init__.py -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__init__.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__init__.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__init__.pyo -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/__init__.cpython-39.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/__init__.cpython-39.opt-1.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/default.cpython-39.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/default.cpython-39.opt-1.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/default.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/default.cpython-39.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/jungle.cpython-39.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/jungle.cpython-39.opt-1.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/jungle.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/jungle.cpython-39.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/__pycache__/snow.cpython-39.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/__pycache__/snow.cpython-39.opt-1.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/default.py: -------------------------------------------------------------------------------- 1 | # This file is part of ranger, the console file manager. 2 | # License: GNU GPL version 3, see the file "AUTHORS" for details. 3 | 4 | from __future__ import (absolute_import, division, print_function) 5 | 6 | from ranger.gui.colorscheme import ColorScheme 7 | from ranger.gui.color import ( 8 | black, blue, cyan, green, magenta, red, white, yellow, default, 9 | normal, bold, reverse, dim, BRIGHT, 10 | default_colors, 11 | ) 12 | 13 | 14 | class Default(ColorScheme): 15 | progress_bar_color = blue 16 | 17 | def use(self, context): # pylint: disable=too-many-branches,too-many-statements 18 | fg, bg, attr = default_colors 19 | 20 | if context.reset: 21 | return default_colors 22 | 23 | elif context.in_browser: 24 | if context.selected: 25 | attr = reverse 26 | else: 27 | attr = normal 28 | if context.empty or context.error: 29 | bg = red 30 | if context.border: 31 | fg = default 32 | if context.media: 33 | if context.image: 34 | fg = yellow 35 | else: 36 | fg = magenta 37 | if context.container: 38 | fg = red 39 | if context.directory: 40 | attr |= bold 41 | fg = blue 42 | fg += BRIGHT 43 | elif context.executable and not \ 44 | any((context.media, context.container, 45 | context.fifo, context.socket)): 46 | attr |= bold 47 | fg = green 48 | fg += BRIGHT 49 | if context.socket: 50 | attr |= bold 51 | fg = magenta 52 | fg += BRIGHT 53 | if context.fifo or context.device: 54 | fg = yellow 55 | if context.device: 56 | attr |= bold 57 | fg += BRIGHT 58 | if context.link: 59 | fg = cyan if context.good else magenta 60 | if context.tag_marker and not context.selected: 61 | attr |= bold 62 | if fg in (red, magenta): 63 | fg = white 64 | else: 65 | fg = red 66 | fg += BRIGHT 67 | if not context.selected and (context.cut or context.copied): 68 | attr |= bold 69 | fg = black 70 | fg += BRIGHT 71 | # If the terminal doesn't support bright colors, use dim white 72 | # instead of black. 73 | if BRIGHT == 0: 74 | attr |= dim 75 | fg = white 76 | if context.main_column: 77 | # Doubling up with BRIGHT here causes issues because it's 78 | # additive not idempotent. 79 | if context.selected: 80 | attr |= bold 81 | if context.marked: 82 | attr |= bold 83 | fg = yellow 84 | if context.badinfo: 85 | if attr & reverse: 86 | bg = magenta 87 | else: 88 | fg = magenta 89 | 90 | if context.inactive_pane: 91 | fg = cyan 92 | 93 | elif context.in_titlebar: 94 | if context.hostname: 95 | fg = red if context.bad else green 96 | elif context.directory: 97 | fg = blue 98 | elif context.tab: 99 | if context.good: 100 | bg = green 101 | elif context.link: 102 | fg = cyan 103 | attr |= bold 104 | fg += BRIGHT 105 | 106 | elif context.in_statusbar: 107 | if context.permissions: 108 | if context.good: 109 | fg = cyan 110 | elif context.bad: 111 | fg = magenta 112 | if context.marked: 113 | attr |= bold | reverse 114 | fg = yellow 115 | fg += BRIGHT 116 | if context.frozen: 117 | attr |= bold | reverse 118 | fg = cyan 119 | fg += BRIGHT 120 | if context.message: 121 | if context.bad: 122 | attr |= bold 123 | fg = red 124 | fg += BRIGHT 125 | if context.loaded: 126 | bg = self.progress_bar_color 127 | if context.vcsinfo: 128 | fg = blue 129 | attr &= ~bold 130 | if context.vcscommit: 131 | fg = yellow 132 | attr &= ~bold 133 | if context.vcsdate: 134 | fg = cyan 135 | attr &= ~bold 136 | 137 | if context.text: 138 | if context.highlight: 139 | attr |= reverse 140 | 141 | if context.in_taskview: 142 | if context.title: 143 | fg = blue 144 | 145 | if context.selected: 146 | attr |= reverse 147 | 148 | if context.loaded: 149 | if context.selected: 150 | fg = self.progress_bar_color 151 | else: 152 | bg = self.progress_bar_color 153 | 154 | if context.vcsfile and not context.selected: 155 | attr &= ~bold 156 | if context.vcsconflict: 157 | fg = magenta 158 | elif context.vcsuntracked: 159 | fg = cyan 160 | elif context.vcschanged: 161 | fg = red 162 | elif context.vcsunknown: 163 | fg = red 164 | elif context.vcsstaged: 165 | fg = green 166 | elif context.vcssync: 167 | fg = green 168 | elif context.vcsignored: 169 | fg = default 170 | 171 | elif context.vcsremote and not context.selected: 172 | attr &= ~bold 173 | if context.vcssync or context.vcsnone: 174 | fg = green 175 | elif context.vcsbehind: 176 | fg = red 177 | elif context.vcsahead: 178 | fg = blue 179 | elif context.vcsdiverged: 180 | fg = magenta 181 | elif context.vcsunknown: 182 | fg = red 183 | 184 | return fg, bg, attr 185 | -------------------------------------------------------------------------------- /.config/ranger/colorschemes/default.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/default.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/default.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/default.pyo -------------------------------------------------------------------------------- /.config/ranger/colorschemes/jungle.py: -------------------------------------------------------------------------------- 1 | # This file is part of ranger, the console file manager. 2 | # License: GNU GPL version 3, see the file "AUTHORS" for details. 3 | 4 | from __future__ import (absolute_import, division, print_function) 5 | 6 | from ranger.colorschemes.default import Default 7 | from ranger.gui.color import green, red, blue 8 | 9 | 10 | class Scheme(Default): 11 | progress_bar_color = green 12 | 13 | def use(self, context): 14 | fg, bg, attr = Default.use(self, context) 15 | 16 | if context.directory and not context.marked and not context.link \ 17 | and not context.inactive_pane: 18 | fg = green 19 | 20 | if context.in_titlebar and context.hostname: 21 | fg = red if context.bad else blue 22 | 23 | return fg, bg, attr 24 | 25 | -------------------------------------------------------------------------------- /.config/ranger/colorschemes/jungle.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/jungle.pyc -------------------------------------------------------------------------------- /.config/ranger/colorschemes/jungle.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/colorschemes/jungle.pyo -------------------------------------------------------------------------------- /.config/ranger/colorschemes/snow.py: -------------------------------------------------------------------------------- 1 | # This file is part of ranger, the console file manager. 2 | # License: GNU GPL version 3, see the file "AUTHORS" for details. 3 | 4 | from __future__ import (absolute_import, division, print_function) 5 | 6 | from ranger.gui.colorscheme import ColorScheme 7 | from ranger.gui.color import default_colors, reverse, bold, BRIGHT 8 | 9 | 10 | class Snow(ColorScheme): 11 | 12 | def use(self, context): 13 | fg, bg, attr = default_colors 14 | 15 | if context.reset: 16 | pass 17 | 18 | elif context.in_browser: 19 | if context.selected: 20 | attr = reverse 21 | if context.directory: 22 | attr |= bold 23 | fg += BRIGHT 24 | 25 | elif context.highlight: 26 | attr |= reverse 27 | 28 | elif context.in_titlebar and context.tab and context.good: 29 | attr |= reverse 30 | 31 | elif context.in_statusbar: 32 | if context.loaded: 33 | attr |= reverse 34 | if context.marked: 35 | attr |= reverse 36 | 37 | elif context.in_taskview: 38 | if context.selected: 39 | attr |= bold 40 | fg += BRIGHT 41 | if context.loaded: 42 | attr |= reverse 43 | 44 | return fg, bg, attr 45 | 46 | -------------------------------------------------------------------------------- /.config/ranger/colorschemes/zenburn.py: -------------------------------------------------------------------------------- 1 | # Ivaylo Kuzev , 2014 2 | # Zenburn like colorscheme for https://github.com/hut/ranger . 3 | 4 | # default colorscheme. 5 | # Copyright (C) 2009-2013 Roman Zimbelmann 6 | # This software is distributed under the terms of the GNU GPL version 3. 7 | 8 | from ranger.gui.colorscheme import ColorScheme 9 | from ranger.gui.color import default_colors, reverse, bold, normal, default 10 | 11 | 12 | # pylint: disable=too-many-branches,too-many-statements 13 | class Zenburn(ColorScheme): 14 | progress_bar_color = 108 15 | 16 | def use(self, context): 17 | fg, bg, attr = default_colors 18 | 19 | if context.reset: 20 | return default_colors 21 | 22 | elif context.in_browser: 23 | if context.selected: 24 | attr = reverse 25 | else: 26 | attr = normal 27 | if context.empty or context.error: 28 | fg = 174 29 | bg = 235 30 | if context.border: 31 | fg = 248 32 | if context.image: 33 | fg = 109 34 | if context.video: 35 | fg = 66 36 | if context.audio: 37 | fg = 116 38 | if context.document: 39 | fg = 151 40 | if context.container: 41 | attr |= bold 42 | fg = 174 43 | if context.directory: 44 | attr |= bold 45 | fg = 223 46 | elif context.executable and not \ 47 | any((context.media, context.container, 48 | context.fifo, context.socket)): 49 | attr |= bold 50 | fg = 108 51 | if context.socket: 52 | fg = 180 53 | attr |= bold 54 | if context.fifo or context.device: 55 | fg = 144 56 | if context.device: 57 | attr |= bold 58 | if context.link: 59 | fg = 223 if context.good else 116 60 | bg = 234 61 | if context.bad: 62 | bg = 235 63 | if context.tag_marker and not context.selected: 64 | attr |= bold 65 | if fg in (174, 95): 66 | fg = 248 67 | else: 68 | fg = 174 69 | if not context.selected and (context.cut or context.copied): 70 | fg = 108 71 | bg = 234 72 | if context.main_column: 73 | if context.selected: 74 | attr |= bold 75 | if context.marked: 76 | attr |= bold 77 | fg = 223 78 | if context.badinfo: 79 | if attr & reverse: 80 | bg = 95 81 | else: 82 | fg = 95 83 | 84 | elif context.in_titlebar: 85 | attr |= bold 86 | if context.hostname: 87 | fg = 174 if context.bad else 180 88 | elif context.directory: 89 | fg = 223 90 | elif context.tab: 91 | if context.good: 92 | bg = 180 93 | elif context.link: 94 | fg = 116 95 | 96 | elif context.in_statusbar: 97 | if context.permissions: 98 | if context.good: 99 | fg = 108 100 | elif context.bad: 101 | fg = 174 102 | if context.marked: 103 | attr |= bold | reverse 104 | fg = 223 105 | if context.message: 106 | if context.bad: 107 | attr |= bold 108 | fg = 174 109 | if context.loaded: 110 | bg = self.progress_bar_color 111 | if context.vcsinfo: 112 | fg = 116 113 | attr &= ~bold 114 | if context.vcscommit: 115 | fg = 144 116 | attr &= ~bold 117 | 118 | if context.text: 119 | if context.highlight: 120 | attr |= reverse 121 | 122 | if context.in_taskview: 123 | if context.title: 124 | fg = 116 125 | 126 | if context.selected: 127 | attr |= reverse 128 | 129 | if context.loaded: 130 | if context.selected: 131 | fg = self.progress_bar_color 132 | else: 133 | bg = self.progress_bar_color 134 | 135 | if context.vcsfile and not context.selected: 136 | attr &= ~bold 137 | if context.vcsconflict: 138 | fg = 95 139 | elif context.vcschanged: 140 | fg = 174 141 | elif context.vcsunknown: 142 | fg = 174 143 | elif context.vcsstaged: 144 | fg = 108 145 | elif context.vcssync: 146 | fg = 108 147 | elif context.vcsignored: 148 | fg = default 149 | 150 | elif context.vcsremote and not context.selected: 151 | attr &= ~bold 152 | if context.vcssync: 153 | fg = 108 154 | elif context.vcsbehind: 155 | fg = 174 156 | elif context.vcsahead: 157 | fg = 116 158 | elif context.vcsdiverged: 159 | fg = 95 160 | elif context.vcsunknown: 161 | fg = 174 162 | 163 | return fg, bg, attr 164 | 165 | -------------------------------------------------------------------------------- /.config/ranger/commands.py: -------------------------------------------------------------------------------- 1 | # This is a sample commands.py. You can add your own commands here. 2 | # 3 | # Please refer to commands_full.py for all the default commands and a complete 4 | # documentation. Do NOT add them all here, or you may end up with defunct 5 | # commands when upgrading ranger. 6 | 7 | # A simple command for demonstration purposes follows. 8 | # ----------------------------------------------------------------------------- 9 | 10 | from __future__ import (absolute_import, division, print_function) 11 | 12 | # You can import any python module as needed. 13 | import os 14 | 15 | # You always need to import ranger.api.commands here to get the Command class: 16 | from ranger.api.commands import Command 17 | 18 | 19 | # Any class that is a subclass of "Command" will be integrated into ranger as a 20 | # command. Try typing ":my_edit" in ranger! 21 | class my_edit(Command): 22 | # The so-called doc-string of the class will be visible in the built-in 23 | # help that is accessible by typing "?c" inside ranger. 24 | """:my_edit 25 | 26 | A sample command for demonstration purposes that opens a file in an editor. 27 | """ 28 | 29 | # The execute method is called when you run this command in ranger. 30 | def execute(self): 31 | # self.arg(1) is the first (space-separated) argument to the function. 32 | # This way you can write ":my_edit somefilename". 33 | if self.arg(1): 34 | # self.rest(1) contains self.arg(1) and everything that follows 35 | target_filename = self.rest(1) 36 | else: 37 | # self.fm is a ranger.core.filemanager.FileManager object and gives 38 | # you access to internals of ranger. 39 | # self.fm.thisfile is a ranger.container.file.File object and is a 40 | # reference to the currently selected file. 41 | target_filename = self.fm.thisfile.path 42 | 43 | # This is a generic function to print text in ranger. 44 | self.fm.notify("Let's edit the file " + target_filename + "!") 45 | 46 | # Using bad=True in fm.notify allows you to print error messages: 47 | if not os.path.exists(target_filename): 48 | self.fm.notify("The given file does not exist!", bad=True) 49 | return 50 | 51 | # This executes a function from ranger.core.acitons, a module with a 52 | # variety of subroutines that can help you construct commands. 53 | # Check out the source, or run "pydoc ranger.core.actions" for a list. 54 | self.fm.edit_file(target_filename) 55 | 56 | # The tab method is called when you press tab, and should return a list of 57 | # suggestions that the user will tab through. 58 | # tabnum is 1 for and -1 for by default 59 | def tab(self, tabnum): 60 | # This is a generic tab-completion function that iterates through the 61 | # content of the current directory. 62 | return self._tab_directory_content() 63 | 64 | # 中使用 fzf 65 | class fzf_select(Command): 66 | """ 67 | :fzf_select 68 | Find a file using fzf. 69 | With a prefix argument to select only directories. 70 | 71 | See: https://github.com/junegunn/fzf 72 | """ 73 | 74 | def execute(self): 75 | import subprocess 76 | import os 77 | from ranger.ext.get_executables import get_executables 78 | 79 | if 'fzf' not in get_executables(): 80 | self.fm.notify('Could not find fzf in the PATH.', bad=True) 81 | return 82 | 83 | fd = None 84 | if 'fdfind' in get_executables(): 85 | fd = 'fdfind' 86 | elif 'fd' in get_executables(): 87 | fd = 'fd' 88 | 89 | if fd is not None: 90 | hidden = ('--hidden' if self.fm.settings.show_hidden else '') 91 | exclude = "--no-ignore-vcs --exclude '.git' --exclude '*.py[co]' --exclude '__pycache__'" 92 | only_directories = ('--type directory' if self.quantifier else '') 93 | fzf_default_command = '{} --follow {} {} {} --color=always'.format( 94 | fd, hidden, exclude, only_directories 95 | ) 96 | else: 97 | hidden = ('-false' if self.fm.settings.show_hidden else r"-path '*/\.*' -prune") 98 | exclude = r"\( -name '\.git' -o -iname '\.*py[co]' -o -fstype 'dev' -o -fstype 'proc' \) -prune" 99 | only_directories = ('-type d' if self.quantifier else '') 100 | fzf_default_command = 'find -L . -mindepth 1 {} -o {} -o {} -print | cut -b3-'.format( 101 | hidden, exclude, only_directories 102 | ) 103 | 104 | env = os.environ.copy() 105 | env['FZF_DEFAULT_COMMAND'] = fzf_default_command 106 | env['FZF_DEFAULT_OPTS'] = '--height=40% --layout=reverse --ansi --preview="{}"'.format(''' 107 | ( 108 | batcat --color=always {} || 109 | bat --color=always {} || 110 | cat {} || 111 | tree -ahpCL 3 -I '.git' -I '*.py[co]' -I '__pycache__' {} 112 | ) 2>/dev/null | head -n 100 113 | ''') 114 | 115 | fzf = self.fm.execute_command('fzf --no-multi', env=env, 116 | universal_newlines=True, stdout=subprocess.PIPE) 117 | stdout, _ = fzf.communicate() 118 | if fzf.returncode == 0: 119 | selected = os.path.abspath(stdout.strip()) 120 | if os.path.isdir(selected): 121 | self.fm.cd(selected) 122 | else: 123 | self.fm.select_file(selected) 124 | -------------------------------------------------------------------------------- /.config/ranger/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/plugins/__init__.py -------------------------------------------------------------------------------- /.config/ranger/plugins/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/plugins/__init__.pyc -------------------------------------------------------------------------------- /.config/ranger/plugins/__init__.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/plugins/__init__.pyo -------------------------------------------------------------------------------- /.config/ranger/plugins/__pycache__/__init__.cpython-39.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/plugins/__pycache__/__init__.cpython-39.opt-1.pyc -------------------------------------------------------------------------------- /.config/ranger/plugins/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuriousLearnerDev/Configuration/d27daada7fd0b9af1c3344a1e157036742e8e359/.config/ranger/plugins/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /.config/ranger/rifle.conf: -------------------------------------------------------------------------------- 1 | # vim: ft=cfg 2 | # 3 | # This is the configuration file of "rifle", ranger's file executor/opener. 4 | # Each line consists of conditions and a command. For each line the conditions 5 | # are checked and if they are met, the respective command is run. 6 | # 7 | # Syntax: 8 | # , , ... = command 9 | # 10 | # The command can contain these environment variables: 11 | # $1-$9 | The n-th selected file 12 | # $@ | All selected files 13 | # 14 | # If you use the special command "ask", rifle will ask you what program to run. 15 | # 16 | # Prefixing a condition with "!" will negate its result. 17 | # These conditions are currently supported: 18 | # match | The regexp matches $1 19 | # ext | The regexp matches the extension of $1 20 | # mime | The regexp matches the mime type of $1 21 | # name | The regexp matches the basename of $1 22 | # path | The regexp matches the absolute path of $1 23 | # has | The program is installed (i.e. located in $PATH) 24 | # env | The environment variable "variable" is non-empty 25 | # file | $1 is a file 26 | # directory | $1 is a directory 27 | # number | change the number of this command to n 28 | # terminal | stdin, stderr and stdout are connected to a terminal 29 | # X | A graphical environment is available (darwin, Xorg, or Wayland) 30 | # 31 | # There are also pseudo-conditions which have a "side effect": 32 | # flag | Change how the program is run. See below. 33 | # label