├── .config ├── chromium-flags.conf ├── cmus │ ├── rc │ └── themes │ │ └── gruvbox-dark.theme ├── hypr │ ├── hyprland.conf │ ├── hyprpaper.conf │ └── scripts │ │ ├── screenshot-selection.sh │ │ ├── screenshot.sh │ │ └── xdg-portal-hyprland.sh ├── keyd ├── kitty │ ├── current-theme.conf │ └── kitty.conf ├── mako │ └── config ├── nvim │ ├── .gitignore │ ├── .neoconf.json │ ├── LICENSE │ ├── README.md │ ├── header.txt │ ├── init.lua │ ├── lazy-lock.json │ ├── lua │ │ ├── config │ │ │ ├── autocmds.lua │ │ │ ├── keymaps.lua │ │ │ ├── lazy.lua │ │ │ └── options.lua │ │ └── plugins │ │ │ ├── LuaSnip.lua │ │ │ ├── alpha.lua │ │ │ ├── colorizer.lua │ │ │ ├── example.lua │ │ │ ├── mason.lua │ │ │ ├── noice.lua │ │ │ ├── nvim-cmp.lua │ │ │ ├── telescope.lua │ │ │ ├── treesitter.lua │ │ │ └── wakatime.lua │ └── stylua.toml ├── ranger │ ├── .gitignore │ ├── colorschemes │ │ └── custom.py │ ├── commands.py │ ├── commands_full.py │ ├── plugins │ │ └── .gitignore │ ├── rc.conf │ ├── rifle.conf │ └── scope.sh ├── swaylock │ └── config ├── waybar │ ├── checkupdate.sh │ ├── config │ ├── config.sway │ └── style.css ├── wlogout │ ├── config │ ├── icons │ │ ├── hibernate.svg │ │ ├── lock.svg │ │ ├── logout.svg │ │ ├── reboot.svg │ │ ├── shutdown.svg │ │ └── suspend.svg │ └── style.css └── wofi │ ├── config │ └── style.css ├── .local └── bin │ ├── lsi │ └── sf-mirror ├── .screenshots ├── ss-1.png ├── ss-2.png ├── ss-3.png └── ss-4.png ├── .wallpapers └── neon.png ├── .zshrc └── README.md /.config/chromium-flags.conf: -------------------------------------------------------------------------------- 1 | --force-dark-mode 2 | --enable-features=WebUIDarkMode 3 | -------------------------------------------------------------------------------- /.config/cmus/rc: -------------------------------------------------------------------------------- 1 | set output_plugin=alsa 2 | set dsp.alsa.device=default 3 | set mixer.alsa.device=default 4 | set mixer.alsa.channel=Master 5 | -------------------------------------------------------------------------------- /.config/cmus/themes/gruvbox-dark.theme: -------------------------------------------------------------------------------- 1 | ### cmus gruvbox theme - Maciej Sypien 2 | ### {{{ 3 | # bottom command line 4 | set color_cmdline_bg=235 5 | set color_cmdline_fg=223 6 | 7 | # partials 8 | set color_error=167 9 | set color_info=214 10 | set color_separator=239 11 | 12 | # bottom status bar 13 | set color_statusline_bg=237 14 | set color_statusline_fg=223 15 | 16 | # bottom status with currently displayed track 17 | set color_titleline_bg=72 18 | set color_titleline_fg=236 19 | 20 | # center/main window 21 | set color_win_bg=235 22 | set color_win_fg=243 23 | set color_win_dir=243 24 | set color_win_cur=108 25 | set color_win_cur_sel_bg=72 26 | set color_win_cur_sel_fg=237 27 | 28 | # selected 29 | set color_win_sel_bg=237 30 | set color_win_sel_fg=246 31 | 32 | # inactive current selected (currently played) 33 | set color_win_inactive_cur_sel_bg=72 34 | set color_win_inactive_cur_sel_fg=237 35 | 36 | # inactive selected (active album) 37 | set color_win_inactive_sel_bg=237 38 | set color_win_inactive_sel_fg=243 39 | 40 | # top player bar 41 | set color_win_title_bg=142 42 | set color_win_title_fg=235 43 | ### }}} 44 | 45 | -------------------------------------------------------------------------------- /.config/hypr/hyprland.conf: -------------------------------------------------------------------------------- 1 | # See https://wiki.hyprland.org/Configuring/Monitors/ 2 | monitor=,preferred,auto,auto 3 | 4 | # Source a file (multi-file configs) 5 | # source = ~/.config/hypr/myColors.conf 6 | 7 | # Some default env vars. 8 | env = GDK_BACKEND=wayland 9 | env = QT_QPA_PLATFORM,wayland 10 | env = SDL_VIDEODRIVER,wayland 11 | env = CLUTTER_BACKEND,wayland 12 | env = XDG_CURRENT_DESKTOP,Hyprland 13 | env = XDG_SESSION_TYPE,wayland 14 | env = XDG_SESSION_DESKTOP,Hyprland 15 | env = QT_AUTO_SCREEN_SCALE_FACTOR,1 16 | env = QT_QPA_PLATFORM,wayland;xcb 17 | env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 18 | env = QT_QPA_PLATFORMTHEME,qt5ct 19 | env = GTK_THEME,Sweet-Dark 20 | env = XCURSOR_THEME,"Capitaine Cursors" 21 | env = XCURSOR_SIZE,24 22 | 23 | # See https://wiki.hyprland.org/Configuring/Keywords/ for more 24 | 25 | # Execute your favorite apps at launch 26 | exec-once = $HOME/.config/hypr/scripts/xdg-portal-hyprland.sh 27 | exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 28 | exec-once = hyprpaper & mako & waybar 29 | 30 | # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ 31 | input { 32 | kb_layout = us 33 | kb_variant = 34 | kb_model = 35 | kb_options = 36 | kb_rules = 37 | 38 | follow_mouse = 1 39 | 40 | touchpad { 41 | natural_scroll = no 42 | } 43 | 44 | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. 45 | } 46 | 47 | general { 48 | # See https://wiki.hyprland.org/Configuring/Variables/ for more 49 | 50 | gaps_in = 5 51 | gaps_out = 0 52 | border_size = 2 53 | col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg 54 | col.inactive_border = rgba(595959aa) 55 | 56 | layout = dwindle 57 | } 58 | 59 | decoration { 60 | # See https://wiki.hyprland.org/Configuring/Variables/ for more 61 | 62 | rounding = 5 63 | 64 | blur { 65 | size = 7 66 | passes = 4 67 | new_optimizations = true 68 | } 69 | 70 | drop_shadow = yes 71 | shadow_range = 4 72 | shadow_render_power = 3 73 | col.shadow = rgba(1a1a1aee) 74 | } 75 | 76 | animations { 77 | enabled = yes 78 | 79 | # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more 80 | 81 | bezier = myBezier, 0.05, 0.9, 0.1, 1.05 82 | 83 | animation = windows, 1, 5, myBezier 84 | animation = windowsOut, 1, 5, default, popin 80% 85 | animation = border, 1, 10, default 86 | animation = borderangle, 1, 8, default 87 | animation = fade, 1, 7, default 88 | animation = workspaces, 1, 5, default 89 | animation = specialWorkspace, 1, 5, myBezier, slidevert 90 | } 91 | 92 | dwindle { 93 | # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more 94 | pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below 95 | preserve_split = yes # you probably want this 96 | } 97 | 98 | master { 99 | # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more 100 | new_is_master = true 101 | } 102 | 103 | gestures { 104 | # See https://wiki.hyprland.org/Configuring/Variables/ for more 105 | workspace_swipe = off 106 | } 107 | 108 | # Example per-device config 109 | # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more 110 | device { 111 | name = epic-mouse-v1 112 | sensitivity = -0.5 113 | } 114 | 115 | # Example windowrule v1 116 | # windowrule = float, ^(kitty)$ 117 | # Example windowrule v2 118 | # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ 119 | # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more 120 | 121 | windowrulev2 = float,class:^(Lxappearance)$ 122 | windowrulev2 = opacity 0.8 0.8,title:^(rofi)(.*)$ 123 | windowrulev2 = opacity 0.8 0.8,class:^(kitty)$ 124 | windowrulev2 = opacity 0.8 0.8,class:^(wofi)$ 125 | windowrulev2 = opacity 0.8 0.8,class:^(thunar)$ 126 | windowrulev2 = maximize,class:^(winbox.exe)$ 127 | # windowrulev2 = maximize,class:^(chromium)$ 128 | # windowrulev2 = noanim,class:^(kitty)$ 129 | windowrulev2 = maximize,title:^(nvim)$ 130 | windowrulev2 = float,class:^(org.telegram.desktop|vlc)$ 131 | windowrulev2 = float,title:^(ranger)$ 132 | windowrulev2 = size 60% 80%,class:^(org.telegram.desktop|vlc)$ 133 | windowrulev2 = size 60% 80%,title:^(Open Files|ranger)$ 134 | windowrulev2 = center,class:^(org.telegram.desktop|Open Files|ranger|vlc)$ 135 | windowrulev2 = opacity 0.8 0.8,title:^(Open Files|ranger)$ 136 | windowrulev2 = opacity 1 1,class:^(kitty)$,title:^(nvim)(.*)$ # disable opacity while opening neovim 137 | # windowrulev2 = bordercolor rgb(000000) rgb(000000),fullscreen:1 138 | windowrulev2 = noborder,fullscreen:1 # remove border on fullscreen 139 | layerrule = blur,gtk-layer-shell 140 | 141 | # See https://wiki.hyprland.org/Configuring/Keywords/ for more 142 | $mainMod = SUPER 143 | 144 | # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more 145 | bind = $mainMod, Return, exec, kitty 146 | bind = $mainMod, Q, killactive, 147 | bind = $mainMod SHIFT, Q, exec, wlogout -p layer-shell 148 | bind = $mainMod, M, exit, 149 | bind = $mainMod, F, fullscreen, 1 150 | bind = $mainMod, G, togglegroup, 151 | bind = $mainMod, P, exec, $HOME/.config/hypr/scripts/screenshot.sh 152 | bind = $mainMod, space, togglespecialworkspace 153 | bind = $mainMod SHIFT, N, exec, kitty -e nvim 154 | bind = $mainMod SHIFT, space, movetoworkspace, special 155 | bind = $mainMod SHIFT, X, movetoworkspace, 1 156 | bind = $mainMod SHIFT, P, exec, $HOME/.config/hypr/scripts/screenshot-selection.sh 157 | bind = $mainMod, backslash, exec, kitty -e ranger 158 | # bind = $mainMod, E, exec, dolphin 159 | bind = $mainMod, V, togglefloating, 160 | # bind = $mainMod, R, exec, wofi --show drun 161 | # bind = $mainMod, D, exec, $HOME/.config/rofi/launcher.sh 162 | bind = $mainMod, D, exec, wofi --conf=$HOME/.config/wofi/config 163 | # bind = $mainMod, P, pseudo, # dwindle 164 | bind = $mainMod, S, togglesplit, # dwindle 165 | 166 | # Move focus with vim like 167 | bind = $mainMod, l, movefocus, l 168 | bind = $mainMod, h, movefocus, r 169 | bind = $mainMod, k, movefocus, u 170 | bind = $mainMod, j, movefocus, d 171 | 172 | # Switch workspaces with mainMod + [0-9] 173 | bind = $mainMod, 1, workspace, 1 174 | bind = $mainMod, 2, workspace, 2 175 | bind = $mainMod, 3, workspace, 3 176 | bind = $mainMod, 4, workspace, 4 177 | bind = $mainMod, 5, workspace, 5 178 | bind = $mainMod, 6, workspace, 6 179 | bind = $mainMod, 7, workspace, 7 180 | bind = $mainMod, 8, workspace, 8 181 | bind = $mainMod, 9, workspace, 9 182 | bind = $mainMod, 0, workspace, 10 183 | 184 | # Move active window to a workspace with mainMod + SHIFT + [0-9] 185 | bind = $mainMod SHIFT, 1, movetoworkspace, 1 186 | bind = $mainMod SHIFT, 2, movetoworkspace, 2 187 | bind = $mainMod SHIFT, 3, movetoworkspace, 3 188 | bind = $mainMod SHIFT, 4, movetoworkspace, 4 189 | bind = $mainMod SHIFT, 5, movetoworkspace, 5 190 | bind = $mainMod SHIFT, 6, movetoworkspace, 6 191 | bind = $mainMod SHIFT, 7, movetoworkspace, 7 192 | bind = $mainMod SHIFT, 8, movetoworkspace, 8 193 | bind = $mainMod SHIFT, 9, movetoworkspace, 9 194 | bind = $mainMod SHIFT, 0, movetoworkspace, 10 195 | 196 | # Scroll through existing workspaces with mainMod + scroll 197 | bind = $mainMod, mouse_down, workspace, e+1 198 | bind = $mainMod, mouse_up, workspace, e-1 199 | 200 | # Move/resize windows with mainMod + LMB/RMB and dragging 201 | bindm = $mainMod, mouse:272, movewindow 202 | bindm = $mainMod, mouse:273, resizewindow 203 | 204 | # Minimize steam instead of killing 205 | # if [ "$(hyprctl activewindow -j | jq -r ".class")" = "Steam" ]; then 206 | # xdotool getactivewindow windowunmap 207 | # else 208 | # hyprctl dispatch killactive "" 209 | # fi 210 | 211 | # Screenshot 212 | # bind = $mainMod, P, exec, grim -t png "${HOME}/Pictures/screenshots/screenshot-`date +%F-%T`.png" 213 | -------------------------------------------------------------------------------- /.config/hypr/hyprpaper.conf: -------------------------------------------------------------------------------- 1 | preload = ~/.wallpapers/neon.png 2 | wallpaper = HDMI-A-1, ~/.wallpapers/neon.png 3 | splash = true 4 | -------------------------------------------------------------------------------- /.config/hypr/scripts/screenshot-selection.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE_NAME="screenshot-$(date +%F-%T).png" 4 | FILE_PATH="${HOME}/Pictures/screenshots/${FILE_NAME}" 5 | grim -t png -g "$(slurp)" "${FILE_PATH}" 6 | notify-send 'Screenshot' -i "${FILE_PATH}" "${FILE_NAME}" 7 | -------------------------------------------------------------------------------- /.config/hypr/scripts/screenshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE_NAME="screenshot-$(date +%F-%T).png" 4 | FILE_PATH="${HOME}/Pictures/screenshots/${FILE_NAME}" 5 | grim -t png "${FILE_PATH}" 6 | notify-send 'Screenshot' -i "${FILE_PATH}" "${FILE_NAME}" 7 | -------------------------------------------------------------------------------- /.config/hypr/scripts/xdg-portal-hyprland.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sleep 1 4 | killall -e xdg-desktop-portal-hyprland 5 | killall -e xdg-desktop-portal-wlr 6 | killall xdg-desktop-portal 7 | /usr/lib/xdg-desktop-portal-hyprland & 8 | sleep 2 9 | /usr/lib/xdg-desktop-portal & 10 | 11 | systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP 12 | dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=Hyprland 13 | -------------------------------------------------------------------------------- /.config/keyd: -------------------------------------------------------------------------------- 1 | /etc/keyd -------------------------------------------------------------------------------- /.config/kitty/current-theme.conf: -------------------------------------------------------------------------------- 1 | ## name: Cherry Midnight 2 | ## author: nullxception 3 | ## license: GPLv3 4 | ## upstream: https://github.com/nullxception/cherry-kde/raw/main/kitty/cherry-midnight.conf 5 | 6 | foreground #bdc3df 7 | background #101017 8 | selection_foreground #101017 9 | selection_background #bdc3df 10 | 11 | cursor #bdc3df 12 | cursor_text_color #101017 13 | url_color #85b6ff 14 | 15 | tab_bar_background #101017 16 | active_tab_foreground #bdc3df 17 | active_tab_background #33333f 18 | inactive_tab_foreground #dedeff 19 | inactive_tab_background #101017 20 | 21 | color0 #33333f 22 | color1 #ff568e 23 | color2 #64de83 24 | color3 #efff73 25 | color4 #73a9ff 26 | color5 #946ff7 27 | color6 #62c6da 28 | color7 #dedeff 29 | color8 #43435a 30 | color9 #ff69a2 31 | color10 #73de8a 32 | color11 #f3ff85 33 | color12 #85b6ff 34 | color13 #a481f7 35 | color14 #71c2d9 36 | color15 #ebebff 37 | -------------------------------------------------------------------------------- /.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:foldmethod=marker 2 | 3 | font_family Hack Nerd Font Mono 4 | font_size 11 5 | cursor_shape block 6 | cursor_blink_interval -1 7 | 8 | # mappings 9 | map ctrl+shift+h previous_tab 10 | map ctrl+shift+l next_tab 11 | map alt+1 goto_tab 1 12 | map alt+2 goto_tab 2 13 | map alt+3 goto_tab 3 14 | map alt+4 goto_tab 4 15 | map alt+5 goto_tab 5 16 | map alt+6 goto_tab 6 17 | map alt+7 goto_tab 7 18 | map alt+8 goto_tab 8 19 | map alt+9 goto_tab 9 20 | 21 | # scroll 22 | map shift+up scroll_line_up 23 | map shift+page_up scroll_page_up 24 | map shift+down scroll_line_down 25 | map shift+page_down scroll_page_down 26 | 27 | # title 28 | # title "{title} hehe" 29 | tab_title_template "{index}: {title.replace('nvim', ' Neovim').replace('nabak@arch:', '󰋜 ')}" 30 | 31 | # [window] 32 | # set-title-format = "{window_title} -- kitty" 33 | 34 | window_padding_width 4 35 | # BEGIN_KITTY_THEME 36 | # Cherry Midnight 37 | include current-theme.conf 38 | # END_KITTY_THEME 39 | -------------------------------------------------------------------------------- /.config/mako/config: -------------------------------------------------------------------------------- 1 | font="Lucida Grande 10" 2 | 3 | #background-color=#303643 4 | #text-color=#f7f8f9 5 | #border-size=0 6 | #border-radius=#12px 7 | progress-color=#fa5aa4 8 | sort=-time 9 | layer=overlay 10 | background-color=#383f4e 11 | text-color=#f7f8f9 12 | border-size=0 13 | border-radius=12 14 | max-icon-size=64 15 | default-timeout=5000 16 | ignore-timeout=1 17 | 18 | [urgency=low] 19 | #border-color=#cccccc 20 | 21 | [urgency=normal] 22 | #border-color=#d08770 23 | 24 | [urgency=high] 25 | #border-color=#bf616a 26 | default-timeout=0 27 | 28 | [category=mpd] 29 | default-timeout=2000 30 | group-by=category 31 | -------------------------------------------------------------------------------- /.config/nvim/.gitignore: -------------------------------------------------------------------------------- 1 | tt.* 2 | .tests 3 | doc/tags 4 | debug 5 | .repro 6 | foo.* 7 | *.log 8 | data 9 | -------------------------------------------------------------------------------- /.config/nvim/.neoconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "neodev": { 3 | "library": { 4 | "enabled": true, 5 | "plugins": true 6 | } 7 | }, 8 | "neoconf": { 9 | "plugins": { 10 | "lua_ls": { 11 | "enabled": true 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.config/nvim/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /.config/nvim/README.md: -------------------------------------------------------------------------------- 1 | # 💤 LazyVim 2 | 3 | A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). 4 | Refer to the [documentation](https://lazyvim.github.io/installation) to get started. 5 | -------------------------------------------------------------------------------- /.config/nvim/header.txt: -------------------------------------------------------------------------------- 1 | 2 | / \ //\ 3 | |\___/| / \// \\ 4 | /0 0 \__ / // | \ \ 5 | / / \/_/ // | \ \ 6 | @_^_@'/ \/_ // | \ \ 7 | //_^_/ \/_ // | \ \ 8 | ( //) | \/// | \ \ 9 | ( / /) _|_ / ) // | \ _\ 10 | ( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-. 11 | (( / / )) ,-{ _ `-.|.-~-. .~ `. 12 | (( // / )) '/\ / ~-. _ .-~ .-~^-. \ 13 | (( /// )) `. { } / \ \ 14 | (( / )) .----~-.\ \-' .~ \ `. \^-. 15 | ///.----..> \ _ -~ `. ^-` ^-_ 16 | ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~ 17 | /.-~ 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -------------------------------------------------------------------------------- /.config/nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LazyVim": { "branch": "main", "commit": "fb1f29c32c516601b4074d113202482769ef030e" }, 3 | "LuaSnip": { "branch": "master", "commit": "45a4e899ca8f54936fe32ead6bba65f2a8d42e12" }, 4 | "SchemaStore.nvim": { "branch": "main", "commit": "cd5c2a0db954011fcbeac7bbbc0c7ae9e23626e3" }, 5 | "alpha-nvim": { "branch": "main", "commit": "e4fc5e29b731bdf55d204c5c6a11dc3be70f3b65" }, 6 | "bufferline.nvim": { "branch": "main", "commit": "09b18b89ad2a2c2258a10bc06747f01bc1a42d0d" }, 7 | "catppuccin": { "branch": "main", "commit": "e0dd3f9bb1513c98ab4ef9404ea26e18babf858a" }, 8 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 9 | "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, 10 | "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, 11 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 12 | "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, 13 | "dressing.nvim": { "branch": "master", "commit": "e6eff7a5a950a853c3903d906dbcea03f778db5f" }, 14 | "flash.nvim": { "branch": "main", "commit": "c92ecbff98fdc8770c283aa3934349e6889195dd" }, 15 | "friendly-snippets": { "branch": "main", "commit": "8f5db6c5b691a6bbaa5dabd9afeb164ef8a06d04" }, 16 | "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, 17 | "gitsigns.nvim": { "branch": "main", "commit": "5a04466685008f29c71fa5ec25d421deb1c83fea" }, 18 | "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, 19 | "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" }, 20 | "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, 21 | "mason-lspconfig.nvim": { "branch": "main", "commit": "828a538ac8419f586c010996aefa5df6eb7c250b" }, 22 | "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, 23 | "mini.ai": { "branch": "main", "commit": "5218ea75e635df78a807bc9d5a7162594fb76d02" }, 24 | "mini.animate": { "branch": "main", "commit": "b0978ee3dd0dafd644d0bc6c37c396dbe8658342" }, 25 | "mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" }, 26 | "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, 27 | "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, 28 | "mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" }, 29 | "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, 30 | "neo-tree.nvim": { "branch": "v3.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, 31 | "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, 32 | "neodev.nvim": { "branch": "main", "commit": "17e89aabab209d7cdd3a205dce0678894fb3ffcd" }, 33 | "noice.nvim": { "branch": "main", "commit": "26394ed09d47160a493d4e9e754f5f78d4556a6b" }, 34 | "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, 35 | "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, 36 | "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, 37 | "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, 38 | "nvim-lspconfig": { "branch": "master", "commit": "db3081ab19458325f2d5f775ba908e4fd9744469" }, 39 | "nvim-navic": { "branch": "master", "commit": "e6da6f74d89de65258ea7e98e22103ff5de6dcf5" }, 40 | "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, 41 | "nvim-spectre": { "branch": "master", "commit": "6edac44e10b94b88bf3067fae937915172a3f825" }, 42 | "nvim-treesitter": { "branch": "master", "commit": "51ea343f705a89326cff8dd7a0542d7fe0e6699a" }, 43 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" }, 44 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" }, 45 | "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, 46 | "persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" }, 47 | "plenary.nvim": { "branch": "master", "commit": "1a6a7c929628566cf406aa7da1d048a1ddc7e9a8" }, 48 | "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, 49 | "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "65565c62963579897d28390dbd1ba8fb15ba545f" }, 50 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, 51 | "telescope.nvim": { "branch": "master", "commit": "2ea8dcd17b4f9b7714354965a28ae4fef4139c71" }, 52 | "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, 53 | "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, 54 | "trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" }, 55 | "typescript.nvim": { "branch": "main", "commit": "de304087e6e49981fde01af8ccc5b21e8519306f" }, 56 | "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, 57 | "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, 58 | "vim-wakatime": { "branch": "master", "commit": "018fa9a80c27ccf2a8967b9e27890372e5c2fb4f" }, 59 | "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } 60 | } -------------------------------------------------------------------------------- /.config/nvim/lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 3 | -- Add any additional keymaps here 4 | local opt = { silent = true, noremap = true } 5 | local map = vim.api.nvim_set_keymap 6 | 7 | map("n", "fg", ':lua require("telescope.builtin").live_grep()', opt) 8 | map("n", "bco", ":BufferLineCloseOthers", opt) 9 | map("i", "", "A", opt) 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | -- bootstrap lazy.nvim 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | 9 | require("lazy").setup({ 10 | spec = { 11 | -- add LazyVim and import its plugins 12 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 13 | -- import any extras modules here 14 | { import = "lazyvim.plugins.extras.lang.typescript" }, 15 | { import = "lazyvim.plugins.extras.lang.json" }, 16 | { import = "lazyvim.plugins.extras.ui.mini-animate" }, 17 | { import = "lazyvim.plugins.extras.lang.tailwind" }, 18 | { import = "lazyvim.plugins.extras.util.project" }, 19 | { import = "lazyvim.plugins.extras.linting.eslint" }, 20 | { import = "lazyvim.plugins.extras.formatting.prettier" }, 21 | { "akinsho/git-conflict.nvim", version = "*", config = true }, 22 | -- import/override with your plugins 23 | { import = "plugins" }, 24 | }, 25 | defaults = { 26 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 27 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 28 | lazy = false, 29 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 30 | -- have outdated releases, which may break your Neovim install. 31 | version = false, -- always use the latest git commit 32 | -- version = "*", -- try installing the latest stable version for plugins that support semver 33 | }, 34 | install = { colorscheme = { "tokyonight", "habamax" } }, 35 | checker = { enabled = true }, -- automatically check for plugin updates 36 | ui = { 37 | border = "rounded", 38 | }, 39 | performance = { 40 | rtp = { 41 | -- disable some rtp plugins 42 | disabled_plugins = { 43 | "gzip", 44 | -- "matchit", 45 | -- "matchparen", 46 | "netrwPlugin", 47 | "tarPlugin", 48 | "tohtml", 49 | "tutor", 50 | "zipPlugin", 51 | }, 52 | }, 53 | }, 54 | }) 55 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/LuaSnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "L3MON4D3/LuaSnip", 3 | keys = function() 4 | return {} 5 | end, 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "goolord/alpha-nvim", 3 | opts = function() 4 | require("alpha.term") 5 | 6 | local dashboard = require("alpha.themes.dashboard") 7 | 8 | dashboard.section.header.val = " 𝕟 𝕖 𝕠 𝕧 𝕚 𝕞 " 9 | 10 | dashboard.section.terminal.command = "lolcat " .. os.getenv("HOME") .. "/.config/nvim/header.txt" 11 | dashboard.section.terminal.width = 75 12 | dashboard.section.terminal.height = 20 13 | dashboard.section.terminal.opts.redraw = true 14 | 15 | dashboard.section.buttons.val = { 16 | dashboard.button("p", " " .. " Projects", ":Telescope projects "), 17 | dashboard.button("f", " " .. " Find file", ":Telescope find_files "), 18 | dashboard.button("n", " " .. " New file", ":ene startinsert "), 19 | dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), 20 | dashboard.button("g", " " .. " Find text", ":Telescope live_grep "), 21 | dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), 22 | dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() ]]), 23 | dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy"), 24 | dashboard.button("q", " " .. " Quit", ":qa"), 25 | } 26 | 27 | for _, button in ipairs(dashboard.section.buttons.val) do 28 | button.opts.hl = "AlphaButtons" 29 | button.opts.hl_shortcut = "AlphaShortcut" 30 | end 31 | 32 | dashboard.section.header.opts.hl = "AlphaHeader" 33 | dashboard.section.buttons.opts.hl = "AlphaButtons" 34 | dashboard.section.footer.opts.hl = "AlphaFooter" 35 | dashboard.opts.layout[1].val = 8 36 | 37 | dashboard.config.layout = { 38 | { type = "padding", val = 1 }, 39 | dashboard.section.terminal, 40 | { type = "padding", val = 5 }, 41 | dashboard.section.header, 42 | { type = "padding", val = 2 }, 43 | dashboard.section.buttons, 44 | { type = "padding", val = 1 }, 45 | dashboard.section.footer, 46 | } 47 | 48 | return dashboard 49 | end, 50 | } 51 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "norcalli/nvim-colorizer.lua", 3 | opts = { 4 | "css", 5 | "scss", 6 | "sass", 7 | "javascript", 8 | "html", 9 | "pug", 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/example.lua: -------------------------------------------------------------------------------- 1 | -- since this is just an example spec, don't actually load anything here and return an empty spec 2 | -- stylua: ignore 3 | if true then return {} end 4 | 5 | -- every spec file under config.plugins will be loaded automatically by lazy.nvim 6 | -- 7 | -- In your plugin files, you can: 8 | -- * add extra plugins 9 | -- * disable/enabled LazyVim plugins 10 | -- * override the configuration of LazyVim plugins 11 | return { 12 | -- add gruvbox 13 | { "ellisonleao/gruvbox.nvim" }, 14 | 15 | -- Configure LazyVim to load gruvbox 16 | { 17 | "LazyVim/LazyVim", 18 | opts = { 19 | colorscheme = "gruvbox", 20 | }, 21 | }, 22 | 23 | -- change trouble config 24 | { 25 | "folke/trouble.nvim", 26 | -- opts will be merged with the parent spec 27 | opts = { use_diagnostic_signs = true }, 28 | }, 29 | 30 | -- disable trouble 31 | { "folke/trouble.nvim", enabled = false }, 32 | 33 | -- add symbols-outline 34 | { 35 | "simrat39/symbols-outline.nvim", 36 | cmd = "SymbolsOutline", 37 | keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, 38 | config = true, 39 | }, 40 | 41 | -- override nvim-cmp and add cmp-emoji 42 | { 43 | "hrsh7th/nvim-cmp", 44 | dependencies = { "hrsh7th/cmp-emoji" }, 45 | ---@param opts cmp.ConfigSchema 46 | opts = function(_, opts) 47 | local cmp = require("cmp") 48 | opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) 49 | end, 50 | }, 51 | 52 | -- change some telescope options and a keymap to browse plugin files 53 | { 54 | "nvim-telescope/telescope.nvim", 55 | keys = { 56 | -- add a keymap to browse plugin files 57 | -- stylua: ignore 58 | { 59 | "fp", 60 | function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, 61 | desc = "Find Plugin File", 62 | }, 63 | }, 64 | -- change some options 65 | opts = { 66 | defaults = { 67 | layout_strategy = "horizontal", 68 | layout_config = { prompt_position = "top" }, 69 | sorting_strategy = "ascending", 70 | winblend = 0, 71 | }, 72 | }, 73 | }, 74 | 75 | -- add telescope-fzf-native 76 | { 77 | "telescope.nvim", 78 | dependencies = { 79 | "nvim-telescope/telescope-fzf-native.nvim", 80 | build = "make", 81 | config = function() 82 | require("telescope").load_extension("fzf") 83 | end, 84 | }, 85 | }, 86 | 87 | -- add pyright to lspconfig 88 | { 89 | "neovim/nvim-lspconfig", 90 | ---@class PluginLspOpts 91 | opts = { 92 | ---@type lspconfig.options 93 | servers = { 94 | -- pyright will be automatically installed with mason and loaded with lspconfig 95 | pyright = {}, 96 | }, 97 | }, 98 | }, 99 | 100 | -- add tsserver and setup with typescript.nvim instead of lspconfig 101 | { 102 | "neovim/nvim-lspconfig", 103 | dependencies = { 104 | "jose-elias-alvarez/typescript.nvim", 105 | init = function() 106 | require("lazyvim.util").on_attach(function(_, buffer) 107 | -- stylua: ignore 108 | vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) 109 | vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) 110 | end) 111 | end, 112 | }, 113 | ---@class PluginLspOpts 114 | opts = { 115 | ---@type lspconfig.options 116 | servers = { 117 | -- tsserver will be automatically installed with mason and loaded with lspconfig 118 | tsserver = {}, 119 | }, 120 | -- you can do any additional lsp server setup here 121 | -- return true if you don't want this server to be setup with lspconfig 122 | ---@type table 123 | setup = { 124 | -- example to setup with typescript.nvim 125 | tsserver = function(_, opts) 126 | require("typescript").setup({ server = opts }) 127 | return true 128 | end, 129 | -- Specify * to use this function as a fallback for any server 130 | -- ["*"] = function(server, opts) end, 131 | }, 132 | }, 133 | }, 134 | 135 | -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, 136 | -- treesitter, mason and typescript.nvim. So instead of the above, you can use: 137 | { import = "lazyvim.plugins.extras.lang.typescript" }, 138 | 139 | -- add more treesitter parsers 140 | { 141 | "nvim-treesitter/nvim-treesitter", 142 | opts = { 143 | ensure_installed = { 144 | "bash", 145 | "html", 146 | "javascript", 147 | "json", 148 | "lua", 149 | "markdown", 150 | "markdown_inline", 151 | "python", 152 | "query", 153 | "regex", 154 | "tsx", 155 | "typescript", 156 | "vim", 157 | "yaml", 158 | }, 159 | }, 160 | }, 161 | 162 | -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above 163 | -- would overwrite `ensure_installed` with the new value. 164 | -- If you'd rather extend the default config, use the code below instead: 165 | { 166 | "nvim-treesitter/nvim-treesitter", 167 | opts = function(_, opts) 168 | -- add tsx and treesitter 169 | vim.list_extend(opts.ensure_installed, { 170 | "tsx", 171 | "typescript", 172 | }) 173 | end, 174 | }, 175 | 176 | -- the opts function can also be used to change the default opts: 177 | { 178 | "nvim-lualine/lualine.nvim", 179 | event = "VeryLazy", 180 | opts = function(_, opts) 181 | table.insert(opts.sections.lualine_x, "😄") 182 | end, 183 | }, 184 | 185 | -- or you can return new options to override all the defaults 186 | { 187 | "nvim-lualine/lualine.nvim", 188 | event = "VeryLazy", 189 | opts = function() 190 | return { 191 | --[[add your custom lualine config here]] 192 | } 193 | end, 194 | }, 195 | 196 | -- use mini.starter instead of alpha 197 | { import = "lazyvim.plugins.extras.ui.mini-starter" }, 198 | 199 | -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc 200 | { import = "lazyvim.plugins.extras.lang.json" }, 201 | 202 | -- add any tools you want to have installed below 203 | { 204 | "williamboman/mason.nvim", 205 | opts = { 206 | ensure_installed = { 207 | "stylua", 208 | "shellcheck", 209 | "shfmt", 210 | "flake8", 211 | }, 212 | }, 213 | }, 214 | 215 | -- Use for completion and snippets (supertab) 216 | -- first: disable default and behavior in LuaSnip 217 | { 218 | "L3MON4D3/LuaSnip", 219 | keys = function() 220 | return {} 221 | end, 222 | }, 223 | -- then: setup supertab in cmp 224 | { 225 | "hrsh7th/nvim-cmp", 226 | dependencies = { 227 | "hrsh7th/cmp-emoji", 228 | }, 229 | ---@param opts cmp.ConfigSchema 230 | opts = function(_, opts) 231 | local has_words_before = function() 232 | unpack = unpack or table.unpack 233 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 234 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 235 | end 236 | 237 | local luasnip = require("luasnip") 238 | local cmp = require("cmp") 239 | 240 | opts.mapping = vim.tbl_extend("force", opts.mapping, { 241 | [""] = cmp.mapping(function(fallback) 242 | if cmp.visible() then 243 | cmp.select_next_item() 244 | -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 245 | -- they way you will only jump inside the snippet region 246 | elseif luasnip.expand_or_jumpable() then 247 | luasnip.expand_or_jump() 248 | elseif has_words_before() then 249 | cmp.complete() 250 | else 251 | fallback() 252 | end 253 | end, { "i", "s" }), 254 | [""] = cmp.mapping(function(fallback) 255 | if cmp.visible() then 256 | cmp.select_prev_item() 257 | elseif luasnip.jumpable(-1) then 258 | luasnip.jump(-1) 259 | else 260 | fallback() 261 | end 262 | end, { "i", "s" }), 263 | }) 264 | end, 265 | }, 266 | } 267 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "williamboman/mason.nvim", 3 | opts = function(_, opts) 4 | vim.list_extend(opts.ensure_installed, { 5 | "eslint-lsp", 6 | "html-lsp", 7 | "json-lsp", 8 | "lua-language-server", 9 | "prettierd", 10 | "tailwindcss-language-server", 11 | "typescript-language-server", 12 | "vue-language-server", 13 | }) 14 | 15 | opts.ui = { 16 | border = "rounded", 17 | } 18 | end, 19 | } 20 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/noice.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/noice.nvim", 4 | opts = function(_, opts) 5 | opts.presets = { 6 | bottom_search = true, 7 | command_palette = true, 8 | long_message_to_split = true, 9 | inc_rename = true, 10 | lsp_doc_border = true, 11 | -- border = { style = "rounded" }, 12 | } 13 | end, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "hrsh7th/nvim-cmp", 3 | dependencies = { 4 | "hrsh7th/cmp-emoji", 5 | }, 6 | ---@param opts cmp.ConfigSchema 7 | opts = function(_, opts) 8 | local has_words_before = function() 9 | unpack = unpack or table.unpack 10 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 11 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 12 | end 13 | 14 | local luasnip = require("luasnip") 15 | local cmp = require("cmp") 16 | 17 | opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) 18 | 19 | opts.window = { 20 | completion = cmp.config.window.bordered(), 21 | documentation = cmp.config.window.bordered(), 22 | } 23 | 24 | opts.mapping = vim.tbl_extend("force", opts.mapping, { 25 | [""] = cmp.mapping(function(fallback) 26 | if cmp.visible() then 27 | cmp.select_next_item() 28 | -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 29 | -- they way you will only jump inside the snippet region 30 | elseif luasnip.expand_or_jumpable() then 31 | luasnip.expand_or_jump() 32 | elseif has_words_before() then 33 | cmp.complete() 34 | else 35 | fallback() 36 | end 37 | end, { "i", "s" }), 38 | [""] = cmp.mapping(function(fallback) 39 | if cmp.visible() then 40 | cmp.select_prev_item() 41 | elseif luasnip.jumpable(-1) then 42 | luasnip.jump(-1) 43 | else 44 | fallback() 45 | end 46 | end, { "i", "s" }), 47 | }) 48 | end, 49 | } 50 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "telescope.nvim", 3 | dependencies = { 4 | "nvim-telescope/telescope-fzf-native.nvim", 5 | build = "make", 6 | config = function() 7 | require("telescope").load_extension("fzf") 8 | end, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | vim.list_extend(opts.ensure_installed, { 6 | "bash", 7 | "css", 8 | "gitignore", 9 | "html", 10 | "javascript", 11 | "json", 12 | "lua", 13 | "markdown", 14 | "markdown_inline", 15 | "php", 16 | "pug", 17 | "python", 18 | "query", 19 | "regex", 20 | "scss", 21 | "sql", 22 | "tsx", 23 | "typescript", 24 | "vim", 25 | "vue", 26 | "yaml", 27 | }) 28 | end, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/wakatime.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "wakatime/vim-wakatime", 3 | } 4 | -------------------------------------------------------------------------------- /.config/nvim/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 -------------------------------------------------------------------------------- /.config/ranger/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | __init__.py 3 | -------------------------------------------------------------------------------- /.config/ranger/colorschemes/custom.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 bold 8 | 9 | 10 | class Scheme(Default): 11 | progress_bar_color = 13 12 | 13 | def use(self, context): 14 | fg, bg, attr = Default.use(self, context) 15 | 16 | if context.in_browser: 17 | if context.border: 18 | fg = 237 19 | 20 | if context.document: 21 | fg = 195 22 | 23 | if context.directory: 24 | attr |= bold 25 | fg = 14 26 | 27 | # if context.container: 28 | # bg = 196 29 | # fg = 196 30 | 31 | # if context.inactive_pane: 32 | # bg = 196 33 | # fg = 196 34 | 35 | return fg, bg, attr 36 | -------------------------------------------------------------------------------- /.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 | 125 | -------------------------------------------------------------------------------- /.config/ranger/commands_full.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This file is part of ranger, the console file manager. 3 | # This configuration file is licensed under the same terms as ranger. 4 | # =================================================================== 5 | # 6 | # NOTE: If you copied this file to /etc/ranger/commands_full.py or 7 | # ~/.config/ranger/commands_full.py, then it will NOT be loaded by ranger, 8 | # and only serve as a reference. 9 | # 10 | # =================================================================== 11 | # This file contains ranger's commands. 12 | # It's all in python; lines beginning with # are comments. 13 | # 14 | # Note that additional commands are automatically generated from the methods 15 | # of the class ranger.core.actions.Actions. 16 | # 17 | # You can customize commands in the files /etc/ranger/commands.py (system-wide) 18 | # and ~/.config/ranger/commands.py (per user). 19 | # They have the same syntax as this file. In fact, you can just copy this 20 | # file to ~/.config/ranger/commands_full.py with 21 | # `ranger --copy-config=commands_full' and make your modifications, don't 22 | # forget to rename it to commands.py. You can also use 23 | # `ranger --copy-config=commands' to copy a short sample commands.py that 24 | # has everything you need to get started. 25 | # But make sure you update your configs when you update ranger. 26 | # 27 | # =================================================================== 28 | # Every class defined here which is a subclass of `Command' will be used as a 29 | # command in ranger. Several methods are defined to interface with ranger: 30 | # execute(): called when the command is executed. 31 | # cancel(): called when closing the console. 32 | # tab(tabnum): called when is pressed. 33 | # quick(): called after each keypress. 34 | # 35 | # tab() argument tabnum is 1 for and -1 for by default 36 | # 37 | # The return values for tab() can be either: 38 | # None: There is no tab completion 39 | # A string: Change the console to this string 40 | # A list/tuple/generator: cycle through every item in it 41 | # 42 | # The return value for quick() can be: 43 | # False: Nothing happens 44 | # True: Execute the command afterwards 45 | # 46 | # The return value for execute() and cancel() doesn't matter. 47 | # 48 | # =================================================================== 49 | # Commands have certain attributes and methods that facilitate parsing of 50 | # the arguments: 51 | # 52 | # self.line: The whole line that was written in the console. 53 | # self.args: A list of all (space-separated) arguments to the command. 54 | # self.quantifier: If this command was mapped to the key "X" and 55 | # the user pressed 6X, self.quantifier will be 6. 56 | # self.arg(n): The n-th argument, or an empty string if it doesn't exist. 57 | # self.rest(n): The n-th argument plus everything that followed. For example, 58 | # if the command was "search foo bar a b c", rest(2) will be "bar a b c" 59 | # self.start(n): Anything before the n-th argument. For example, if the 60 | # command was "search foo bar a b c", start(2) will be "search foo" 61 | # 62 | # =================================================================== 63 | # And this is a little reference for common ranger functions and objects: 64 | # 65 | # self.fm: A reference to the "fm" object which contains most information 66 | # about ranger. 67 | # self.fm.notify(string): Print the given string on the screen. 68 | # self.fm.notify(string, bad=True): Print the given string in RED. 69 | # self.fm.reload_cwd(): Reload the current working directory. 70 | # self.fm.thisdir: The current working directory. (A File object.) 71 | # self.fm.thisfile: The current file. (A File object too.) 72 | # self.fm.thistab.get_selection(): A list of all selected files. 73 | # self.fm.execute_console(string): Execute the string as a ranger command. 74 | # self.fm.open_console(string): Open the console with the given string 75 | # already typed in for you. 76 | # self.fm.move(direction): Moves the cursor in the given direction, which 77 | # can be something like down=3, up=5, right=1, left=1, to=6, ... 78 | # 79 | # File objects (for example self.fm.thisfile) have these useful attributes and 80 | # methods: 81 | # 82 | # tfile.path: The path to the file. 83 | # tfile.basename: The base name only. 84 | # tfile.load_content(): Force a loading of the directories content (which 85 | # obviously works with directories only) 86 | # tfile.is_directory: True/False depending on whether it's a directory. 87 | # 88 | # For advanced commands it is unavoidable to dive a bit into the source code 89 | # of ranger. 90 | # =================================================================== 91 | 92 | from __future__ import (absolute_import, division, print_function) 93 | 94 | from collections import deque 95 | import os 96 | import re 97 | 98 | from ranger.api.commands import Command 99 | 100 | 101 | class alias(Command): 102 | """:alias 103 | 104 | Copies the oldcommand as newcommand. 105 | """ 106 | 107 | context = 'browser' 108 | resolve_macros = False 109 | 110 | def execute(self): 111 | if not self.arg(1) or not self.arg(2): 112 | self.fm.notify('Syntax: alias ', bad=True) 113 | return 114 | 115 | self.fm.commands.alias(self.arg(1), self.rest(2)) 116 | 117 | 118 | class echo(Command): 119 | """:echo 120 | 121 | Display the text in the statusbar. 122 | """ 123 | 124 | def execute(self): 125 | self.fm.notify(self.rest(1)) 126 | 127 | 128 | class cd(Command): 129 | """:cd [-r] 130 | 131 | The cd command changes the directory. 132 | If the path is a file, selects that file. 133 | The command 'cd -' is equivalent to typing ``. 134 | Using the option "-r" will get you to the real path. 135 | """ 136 | 137 | def execute(self): 138 | if self.arg(1) == '-r': 139 | self.shift() 140 | destination = os.path.realpath(self.rest(1)) 141 | if os.path.isfile(destination): 142 | self.fm.select_file(destination) 143 | return 144 | else: 145 | destination = self.rest(1) 146 | 147 | if not destination: 148 | destination = '~' 149 | 150 | if destination == '-': 151 | self.fm.enter_bookmark('`') 152 | else: 153 | self.fm.cd(destination) 154 | 155 | def _tab_args(self): 156 | # dest must be rest because path could contain spaces 157 | if self.arg(1) == '-r': 158 | start = self.start(2) 159 | dest = self.rest(2) 160 | else: 161 | start = self.start(1) 162 | dest = self.rest(1) 163 | 164 | if dest: 165 | head, tail = os.path.split(os.path.expanduser(dest)) 166 | if head: 167 | dest_exp = os.path.join(os.path.normpath(head), tail) 168 | else: 169 | dest_exp = tail 170 | else: 171 | dest_exp = '' 172 | return (start, dest_exp, os.path.join(self.fm.thisdir.path, dest_exp), 173 | dest.endswith(os.path.sep)) 174 | 175 | @staticmethod 176 | def _tab_paths(dest, dest_abs, ends_with_sep): 177 | if not dest: 178 | try: 179 | return next(os.walk(dest_abs))[1], dest_abs 180 | except (OSError, StopIteration): 181 | return [], '' 182 | 183 | if ends_with_sep: 184 | try: 185 | return [os.path.join(dest, path) for path in next(os.walk(dest_abs))[1]], '' 186 | except (OSError, StopIteration): 187 | return [], '' 188 | 189 | return None, None 190 | 191 | def _tab_match(self, path_user, path_file): 192 | if self.fm.settings.cd_tab_case == 'insensitive': 193 | path_user = path_user.lower() 194 | path_file = path_file.lower() 195 | elif self.fm.settings.cd_tab_case == 'smart' and path_user.islower(): 196 | path_file = path_file.lower() 197 | return path_file.startswith(path_user) 198 | 199 | def _tab_normal(self, dest, dest_abs): 200 | dest_dir = os.path.dirname(dest) 201 | dest_base = os.path.basename(dest) 202 | 203 | try: 204 | dirnames = next(os.walk(os.path.dirname(dest_abs)))[1] 205 | except (OSError, StopIteration): 206 | return [], '' 207 | 208 | return [os.path.join(dest_dir, d) for d in dirnames if self._tab_match(dest_base, d)], '' 209 | 210 | def _tab_fuzzy_match(self, basepath, tokens): 211 | """ Find directories matching tokens recursively """ 212 | if not tokens: 213 | tokens = [''] 214 | paths = [basepath] 215 | while True: 216 | token = tokens.pop() 217 | matches = [] 218 | for path in paths: 219 | try: 220 | directories = next(os.walk(path))[1] 221 | except (OSError, StopIteration): 222 | continue 223 | matches += [os.path.join(path, d) for d in directories 224 | if self._tab_match(token, d)] 225 | if not tokens or not matches: 226 | return matches 227 | paths = matches 228 | 229 | return None 230 | 231 | def _tab_fuzzy(self, dest, dest_abs): 232 | tokens = [] 233 | basepath = dest_abs 234 | while True: 235 | basepath_old = basepath 236 | basepath, token = os.path.split(basepath) 237 | if basepath == basepath_old: 238 | break 239 | if os.path.isdir(basepath_old) and not token.startswith('.'): 240 | basepath = basepath_old 241 | break 242 | tokens.append(token) 243 | 244 | paths = self._tab_fuzzy_match(basepath, tokens) 245 | if not os.path.isabs(dest): 246 | paths_rel = self.fm.thisdir.path 247 | paths = [os.path.relpath(os.path.join(basepath, path), paths_rel) 248 | for path in paths] 249 | else: 250 | paths_rel = '' 251 | return paths, paths_rel 252 | 253 | def tab(self, tabnum): 254 | from os.path import sep 255 | 256 | start, dest, dest_abs, ends_with_sep = self._tab_args() 257 | 258 | paths, paths_rel = self._tab_paths(dest, dest_abs, ends_with_sep) 259 | if paths is None: 260 | if self.fm.settings.cd_tab_fuzzy: 261 | paths, paths_rel = self._tab_fuzzy(dest, dest_abs) 262 | else: 263 | paths, paths_rel = self._tab_normal(dest, dest_abs) 264 | 265 | paths.sort() 266 | 267 | if self.fm.settings.cd_bookmarks: 268 | paths[0:0] = [ 269 | os.path.relpath(v.path, paths_rel) if paths_rel else v.path 270 | for v in self.fm.bookmarks.dct.values() for path in paths 271 | if v.path.startswith(os.path.join(paths_rel, path) + sep) 272 | ] 273 | 274 | if not paths: 275 | return None 276 | if len(paths) == 1: 277 | return start + paths[0] + sep 278 | return [start + dirname + sep for dirname in paths] 279 | 280 | 281 | class chain(Command): 282 | """:chain ; ; ... 283 | 284 | Calls multiple commands at once, separated by semicolons. 285 | """ 286 | resolve_macros = False 287 | 288 | def execute(self): 289 | if not self.rest(1).strip(): 290 | self.fm.notify('Syntax: chain ; ; ...', bad=True) 291 | return 292 | for command in [s.strip() for s in self.rest(1).split(";")]: 293 | self.fm.execute_console(command) 294 | 295 | 296 | class shell(Command): 297 | escape_macros_for_shell = True 298 | 299 | def execute(self): 300 | if self.arg(1) and self.arg(1)[0] == '-': 301 | flags = self.arg(1)[1:] 302 | command = self.rest(2) 303 | else: 304 | flags = '' 305 | command = self.rest(1) 306 | 307 | if command: 308 | self.fm.execute_command(command, flags=flags) 309 | 310 | def tab(self, tabnum): 311 | from ranger.ext.get_executables import get_executables 312 | if self.arg(1) and self.arg(1)[0] == '-': 313 | command = self.rest(2) 314 | else: 315 | command = self.rest(1) 316 | start = self.line[0:len(self.line) - len(command)] 317 | 318 | try: 319 | position_of_last_space = command.rindex(" ") 320 | except ValueError: 321 | return (start + program + ' ' for program 322 | in get_executables() if program.startswith(command)) 323 | if position_of_last_space == len(command) - 1: 324 | selection = self.fm.thistab.get_selection() 325 | if len(selection) == 1: 326 | return self.line + selection[0].shell_escaped_basename + ' ' 327 | return self.line + '%s ' 328 | 329 | before_word, start_of_word = self.line.rsplit(' ', 1) 330 | return (before_word + ' ' + file.shell_escaped_basename 331 | for file in self.fm.thisdir.files or [] 332 | if file.shell_escaped_basename.startswith(start_of_word)) 333 | 334 | 335 | class open_with(Command): 336 | 337 | def execute(self): 338 | app, flags, mode = self._get_app_flags_mode(self.rest(1)) 339 | self.fm.execute_file( 340 | files=[f for f in self.fm.thistab.get_selection()], 341 | app=app, 342 | flags=flags, 343 | mode=mode) 344 | 345 | def tab(self, tabnum): 346 | return self._tab_through_executables() 347 | 348 | def _get_app_flags_mode(self, string): # pylint: disable=too-many-branches,too-many-statements 349 | """Extracts the application, flags and mode from a string. 350 | 351 | examples: 352 | "mplayer f 1" => ("mplayer", "f", 1) 353 | "atool 4" => ("atool", "", 4) 354 | "p" => ("", "p", 0) 355 | "" => None 356 | """ 357 | 358 | app = '' 359 | flags = '' 360 | mode = 0 361 | split = string.split() 362 | 363 | if len(split) == 1: 364 | part = split[0] 365 | if self._is_app(part): 366 | app = part 367 | elif self._is_flags(part): 368 | flags = part 369 | elif self._is_mode(part): 370 | mode = part 371 | 372 | elif len(split) == 2: 373 | part0 = split[0] 374 | part1 = split[1] 375 | 376 | if self._is_app(part0): 377 | app = part0 378 | if self._is_flags(part1): 379 | flags = part1 380 | elif self._is_mode(part1): 381 | mode = part1 382 | elif self._is_flags(part0): 383 | flags = part0 384 | if self._is_mode(part1): 385 | mode = part1 386 | elif self._is_mode(part0): 387 | mode = part0 388 | if self._is_flags(part1): 389 | flags = part1 390 | 391 | elif len(split) >= 3: 392 | part0 = split[0] 393 | part1 = split[1] 394 | part2 = split[2] 395 | 396 | if self._is_app(part0): 397 | app = part0 398 | if self._is_flags(part1): 399 | flags = part1 400 | if self._is_mode(part2): 401 | mode = part2 402 | elif self._is_mode(part1): 403 | mode = part1 404 | if self._is_flags(part2): 405 | flags = part2 406 | elif self._is_flags(part0): 407 | flags = part0 408 | if self._is_mode(part1): 409 | mode = part1 410 | elif self._is_mode(part0): 411 | mode = part0 412 | if self._is_flags(part1): 413 | flags = part1 414 | 415 | return app, flags, int(mode) 416 | 417 | def _is_app(self, arg): 418 | return not self._is_flags(arg) and not arg.isdigit() 419 | 420 | @staticmethod 421 | def _is_flags(arg): 422 | from ranger.core.runner import ALLOWED_FLAGS 423 | return all(x in ALLOWED_FLAGS for x in arg) 424 | 425 | @staticmethod 426 | def _is_mode(arg): 427 | return all(x in '0123456789' for x in arg) 428 | 429 | 430 | class set_(Command): 431 | """:set