This has forever improved the way I move around the terminal

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 93

  • @Manstrual
    @Manstrual 5 днів тому +10

    YT and its algorithm. This is something I feel I can benefit from too. I like the idea someone else said: two or more buttons to leap to a directory could easily solve the issue while still being fairly responsive. You could keep the most used directories as single button inputs, where it leaps as soon as it's pressed, and less used directories as dual inputs. You could set any button, or even the spacebar possibly, as a modifier, or just go A-Z and once Z is reached, start going AB, AC, etc. That issue would be the way it feels; the action would occur on key release which may not feel as great but might be worth it for productivity.
    That last though provoked another one. If it the action were to be on key release, you could set the spacebar to void your current key. If you mess up skipping to number 27 by using AB by instead typing AC, which would go to 28, you could press the spacebar and redo the key combo. In general, the action should occur on the first key release, so pressing AB then releasing B would trigger the action, just to keep it consistent.
    That was a lot of random thoughts. Make more videos of this and other stuff you're interested in. This is the terminal, after all... Everyone uses the terminal so what helps you probably would be used by many people. Really nice first video!

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому +1

      Thanks! Yeah I like those thoughts. Definitely getting a lot of different ideas to try based on the comments

    • @sahasananth987
      @sahasananth987 День тому

      Try oil.nvim it’s good for stuff like this

  • @damouze
    @damouze 4 дні тому +11

    I like what you're doing there. It's plain, it's simple, nothing fancy and it helps you in your daily work.
    Back in the 'old' MS-DOS days there was a program called 'Norton Commander', or 'nc' for short. I, and the people I interacted with back then, used it all the time to go around the directory tree. It made life so much easier than typing cd [here] or cd [there] all the time. So when I first started using Linux I was looking for a similar tool. Then the father of a friend of mine (who coincidentally also gave me my very first Unix/Linux CD box) pointed me to 'mc', or 'Midnight Commander'. I've been using it ever since... Even when I was using WIndows (NT) on a daily basis at work, I built a native version of 'mc' for it and used it more often than Windows's own filemanagers.

    • @DigitalMakerChannel
      @DigitalMakerChannel  4 дні тому +1

      That's interesting. I hadn't heard of that tool before. Thanks for the info

    • @damouze
      @damouze 4 дні тому

      @@DigitalMakerChannel You are most welcome.

  • @nerdycatgamer
    @nerdycatgamer 5 днів тому +30

    I feel like this actually isn't more efficient at all. with standard `cd' you move to a directory by actually specifying the path, but here you have to look through a list and press the corresponding keys in an interactive interface (and also learn arcane keybinds like `e' for going up a directory). if you're fast with typing, know how your directories are laid out, and have them laid out intelligently (i.e., in a proper tree structure with different names, rather than having a million different directories/files with similar names next to each other in a flat directory) you can get around very quickly with cd. my shell doesn't even have tab-completion and i can get by just fine with wildcard globbing.

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому +7

      No that's fair. My desire to have a system like this does probably come from playing too many video games and not being used to navigating via typing rather than having some button input

    • @dancom6030
      @dancom6030 4 дні тому +1

      That works, but it's definitely still slow. I did that until I started using terminal file managers, and it's significantly faster. I honestly don't really understand the problem the author of this video has with them. You don't actually have to press the down key 15 times as he says in the video. You can just hold it. With ranger vim bindings you can also prefix t her down key with a number to immediately jump however much you want as well.

    • @nerdycatgamer
      @nerdycatgamer 4 дні тому +1

      @@dancom6030 tbh i always found terminal file managers to be the most 'script kiddy' things, no offense. like, if you want an interactive file explorer, that's fine, but don't be like 'woagh! its in the terminal! le epic efficiency'. For me, if i'm looking for a terminal application it's because I want something non-interactive. if I wanted something interactive with mouse support and everything, whether it's a TUI or a GUI makes no difference.

    • @paultapping9510
      @paultapping9510 3 дні тому +1

      your talking to vim users. Learning arcane keybinds is hardly a barrier for entry.

    • @dancom6030
      @dancom6030 3 дні тому +3

      @nerdycatgamer the point of a terminal file manager is to not use the mouse. Using the keyboard is what makes it efficient. You could use the mouse in a WM like i3, but that defeats its entire purpose, too. You also forget that with terminal file managers, you still live in the terminal, you use it to navigate to some directory, do all your stuff in bash, repeat. You can't do that with a GUI file manager. Well, at least nowhere near as efficiently.

  • @KnightMirkoYo
    @KnightMirkoYo 23 години тому

    Nice! I am glad that you thought of something new and made it, so other people can benefit from it. I think people saying "who needs this, it's stupid" should be ignored.

  • @nukegundie
    @nukegundie 5 днів тому +3

    This is pretty neat!
    I think if I were more "terminal-locked", I would probably prefer something like this:
    Imagine `ls`, but it locks your cursor into the options for you to select. So, like ranger, but not all vertical, and not taking up the whole screen. Additionally, you could type the directory out and it would take you to whatever is closest to what you typed while you type it, like a form-fill box.

  • @stargazer8465
    @stargazer8465 5 днів тому +2

    You have earned a sub from me, this was a brilliant video - and such a wonderful introduction to writing your own cli programs. I’d love to see more of these quick videos where you introduce a problem, talk about the solutions you have found, and then implement your own. Keep up the great work!!

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому

      Thanks so much! Yeah I have a ton of video ideas. We'll see how many I get around to based on my schedule 😅. Thanks for the subscription

  • @mayureshsaitwal5716
    @mayureshsaitwal5716 15 годин тому

    I think someone did pointed out , but heres something another addition .
    You can list contents just like ls output and then use keybind say comma or semicolor to activate navigation just like hop or leap nvim plugins to directly jump to specific folder and shift j/k to go up and down if you want.
    Also add all this as keybind for example, if i dont know the folder name , i can jump to its parent dir using cd then use dot to print the content like ls then again use comma for hop or leap to navigate

  • @simonlavoie2858
    @simonlavoie2858 5 днів тому +8

    This is a neat project. I was thinking about how vim keys could solve the >25 files in directory problem as an alternate way to navigate. If you had a numbered list of the files/subdirectories in your current directory, you could use commands like "15j" to select the 15th one. Similar to what happens when you run the :Ex command in vim.

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому

      Mmm, that's a good idea. Seeing a lot of good suggestions for how to address that problem

  • @afterfallout1
    @afterfallout1 2 дні тому

    The pattern described here could be better than `cd` with a few small tweaks:
    1. place the available options on easily accessed keys instead of alphabetically ordering options
    2. sort folders by creation date so they don't change location when adding new folders; even better you could index periodically and label folders such that the ordering is stable to deletion as well
    3. have a few options for quick navigation to a few home directories that are configurable
    4. display options so they do not move around depending on size of the largest option
    With these changes you can quickly develop muscle memory for commonly accessed directories. You could even parse an input argument to navigate instantly: `h arewiv` to get to /Users/me/Documents/images/screenshots/boring/a/p/ instantly instead of `harewiv` and waiting 7 lag frames (though maybe you save that folder as home position `f` if you are going there often enough to remember it).

    • @DigitalMakerChannel
      @DigitalMakerChannel  2 дні тому

      Great suggestions. Probably going to add some stuff like that in a followup video at some point

  • @osca1882
    @osca1882 5 днів тому +3

    This is a genuinely interesting method of terminal file-hopping that I think could be insanely fast if done well.
    My solution for the whole ”folder contents is bigger than my keyboard” problem would be to have switcher keys, for example, ”[” and ”]”, which could increment or decrememt the folder selection by ”n” keys (up to the user?).
    ”[” and ”]” may not he the optimal key choices but I’m sure. That someone smarter than me would be able to fugure out a more well placed set

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому +1

      I really like that idea. Probably going to make a followup video at some point with some new features, so I might add in something like that

    • @oserodal2702
      @oserodal2702 3 дні тому

      @@DigitalMakerChannel Another solution I've seen is extending the "jump strokes" to an additional letter, like after `z` would be `aa`, `ab`, `ac`, as it overflows beyond the Latin alphabet.

  • @alirezajadidi9730
    @alirezajadidi9730 День тому

    Not a bad idea, however you can use the / command to search for the project in ranger, and Yazi is also incredibly useful. It provides all the capabilities of ranger but quicker and better. It also has an option for zoxide to navigate quicker! The preview is also great.

  • @gavinvales8928
    @gavinvales8928 2 дні тому

    Great idea! I always like navigating with hints!

  • @adammontgomery7980
    @adammontgomery7980 День тому

    I like seeing people create their own ways to do things rather than jumping on some band wagon. This is how we're supposed to be using our computers as nerds; it's the Unix way.

  • @jackbeesleyrally
    @jackbeesleyrally 2 дні тому +5

    As you said, you can use vim keys to move around in Ranger, so therefore you can do 10J for example to move down 10 lines. You can also use gg and GG to move to the top or bottom respectively.

    • @DigitalMakerChannel
      @DigitalMakerChannel  День тому

      Yeah, that makes sense. There is something about the immediate reaction I get with my solution I like. Right on the down press of the key you are in the new directory looking for where you want to go next.
      I did forget about adding numbers to vim motions though, so you are right

  • @dominokos
    @dominokos 5 днів тому +6

    Why not make the directory keys two character strings? I think you said you'd be in trouble if there were more than 20 directories. With two-character-strings it'd be 20*20 and at that point it'd be really on the user if that's still not enough. Plus, two keystrokes really aren't such a big overhead. Anyway, cool project!

    • @Manstrual
      @Manstrual 5 днів тому

      My one concern is how it would feel to navigate, needing to release the key for the action to occur. That said, it would be enough of a reason to do it. Also, you could implement an "oops!" button being the spacebar, to where if you mess up, you could just clear the current keystrokes by pressing spacebar, instead of going to the directory and going back. I thought this was a good idea so I brought it up in a much longer comment I made too.

    • @julians.2597
      @julians.2597 3 дні тому +2

      @@Manstrual text editors like Helix and Amp use two character jump labels and it feels pretty good

  • @monad_tcp
    @monad_tcp 2 дні тому

    I made a directory chooser that consider LRU of the current project (saved as a text file in the root), show a list like total commander (also allows for finding with ctrl-r), and also allow for fuzzy finding globally with a exclamation mark in the beginning that works like that "Z" tool. I made it in powershell because I like the way powershell readline works and you can customize it with C#, which is better than shell-script.

  • @curiousmushroom9900
    @curiousmushroom9900 2 дні тому

    I personally really use zoxide (especially with the zi command) and when I'm not sure where to go I use broot (br command) which is awesome. Easy setup using fish shell

  • @matwadoesgames
    @matwadoesgames 5 днів тому +1

    Not gonna lie my first thought was "so now you're mapping files to words" so if you type like "water" from home it will end up at some folder 5 levels deep into the tree

    • @DigitalMakerChannel
      @DigitalMakerChannel  4 дні тому

      Yeah, that's much more similar to what The Primeagen does with fzf. That doesn't really fit my brain

  • @Cybergazer-n9o
    @Cybergazer-n9o 2 дні тому

    another better way to do this is to use ranger or lf and write keymaps to change to directories, for example in your lfrc
    map gco cd ~/.config
    map gd cd ~/Documents/
    map ge cd /etc
    map gh cd ~/
    Then you can just tap those keys when lf is opened to go to them. Also you can set up lf to bring you to the directory you close it in with this
    lfc() {
    tmp="$(mktemp)"
    lf -last-dir-path="$tmp"
    if [ -f "$tmp" ]; then
    dir="$(cat "$tmp")"
    [ -d "$dir" ] && cd "$dir"
    fi
    }
    Then type lfc instead of lf and it'll close lf in the directory you're currently in.

  • @zomg-rofl
    @zomg-rofl 5 днів тому +1

    Amazing video, I love your idea! One thing you mentioned is that you felt it pretty rare that directories themselves will be filled with more than 20 directories. However I periodically navigate to a /etc/portage directory on my system. I checked to confirm, and /etc/ has 85 ( !! ) directories on my machine. So I think it might be more common than you think for there to be excessive amounts of directories. Maybe in these cases you can include a page system to navigate across chunks of directories at once? Of course this will possibly cause repetitive searching across pages, but you can always use maybe numbers for the directory pages/chunks?

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому

      Yeah, if I make a follow up video addressing that situation will have to be one of the features I work on

  • @alexfontenot4963
    @alexfontenot4963 4 дні тому

    I think it would be particularly interesting if you applied your mode of selection to the file-browser like experience, where you have panes, basically. Then, you can move left or right, which would select the pane to the left or right. Within a pane, hitting a key would select a file or directory as you have now, but would alter the panes to the right

  • @lpanebr
    @lpanebr 3 дні тому

    2:40 yazi with the relative line plugin is awesome.

  • @moisessiqueira9541
    @moisessiqueira9541 5 днів тому

    Very nice work dude, good explanation too

  • @Jeremyak
    @Jeremyak 4 дні тому +1

    The terminal separates the men from the boys.

  • @ghsgidghj
    @ghsgidghj 3 дні тому +1

    If you use a bash alias instead of a script you won't need to exec a new shell each time.

  • @rumble_bird
    @rumble_bird 3 дні тому

    If there where more then 20 folders it could be implemented with repeating characters twice e.g aa to jump to 21 dir and so on, this in theory can increase the amount of jumpable dirs to 20 ** 2 + 20, also you can pipe result not only to cd but to other terminal utils essentially making a faster fzf. So all in al this is great idea i really liked it

  • @dinhero21
    @dinhero21 3 дні тому

    I feel like it might be more intuitive to use something similar to fuzzy search (dependent on the file name) so the keys don't all change when one file gets deleted/added/renamed

    • @DigitalMakerChannel
      @DigitalMakerChannel  3 дні тому

      Yeah that's fair. That definitely is a downside to the current system

  • @JosiahRitchie
    @JosiahRitchie День тому

    I prefer to not move around in the file tree. Go to a common directory and stay there. Specify files by relative or absolute path. Use cd as little as possible and you'll often speed up. Add $! to your flow and you'll find more efficiency.

  • @willrandall4012
    @willrandall4012 4 дні тому

    Really nice! Subscribed!!

  • @RONITCHHABRIA-
    @RONITCHHABRIA- 2 дні тому

    nice thought

  • @PhilSamoylov
    @PhilSamoylov 5 днів тому

    I enjoy broot for navigation in a terminal

  • @blackpanther8716
    @blackpanther8716 5 днів тому

    This is really clever!

  • @MrDiarukia
    @MrDiarukia 5 днів тому

    I would like to move through it more like a hybrid of yours and cd. In GUI file browsers you can type the first letter(s) to jump to that entry, selecting it. So if I am in /home/user/ I'd expect to press P and it selects Pictures and enter gets me into Pictures then.

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому

      Yeah, something like that may work also. I could imagine adding a search feature to my system could work along those lines. You press '/' and then you can type to search

  • @Irekalis
    @Irekalis 5 днів тому

    This is very cool!

  • @MrNerdyjoke
    @MrNerdyjoke 4 дні тому

    Please make more videos!

  • @wilville3752
    @wilville3752 2 дні тому

    This is cool

  • @juillotine
    @juillotine 5 днів тому

    thats awesome, but instead of having a seperate bash script, i think you could call cd directly from go.

  • @mayureshsaitwal5716
    @mayureshsaitwal5716 15 годин тому

    can i get name or link of the background wallpaper? I was searching for dark space minimal video wall and i believe ur using mpvpaper as well?

  • @jamesgray6804
    @jamesgray6804 День тому

    I have a command to create a script that changes to a given directory. I create these aliases for the directories i use most.

  • @_daiter_
    @_daiter_ 5 днів тому

    I reminds me the web vim navigation. I wonder if there is a solution for ranger like this.
    And I think you should implement double key for when there is more folders, the way web thing does it.

  • @oprio123
    @oprio123 3 дні тому

    great

  • @mzakyr342
    @mzakyr342 2 дні тому

    idk why when i see you from far away, you look like anakin skywalker, thats my opinion

    • @DigitalMakerChannel
      @DigitalMakerChannel  2 дні тому

      Haha. You are now the second person to tell me this. I guess it must be true

  • @andreichicu2799
    @andreichicu2799 2 дні тому

    nice

  • @gavinvales8928
    @gavinvales8928 2 дні тому

    Install the zoxide plugin for ranger and then your golden

  • @onaecO
    @onaecO 3 дні тому

    Uh! NICE

  • @harleycoughlin8050
    @harleycoughlin8050 3 дні тому

    Since you're already used to Vim, why not copy the way vim moves within a file and allow something like 12G to go to line 12?

    • @DigitalMakerChannel
      @DigitalMakerChannel  3 дні тому

      Yeah, that would work as well. I kind of like how my solution moves immediately as soon as you press any key. It feels faster (even if doing that vim motion would be basically as good or better)

    • @harleycoughlin8050
      @harleycoughlin8050 2 дні тому

      I agree that the immediate move would be great. You’re just limited to 26 options. There’s certainly a compromise to make.

  • @-iIIiiiiiIiiiiIIIiiIi-
    @-iIIiiiiiIiiiiIIIiiIi- 17 годин тому

    Bruh, Shift+J/K?!

  • @user-iw7wb9ds8n
    @user-iw7wb9ds8n 5 днів тому

    I use autojump when I need to move too far. `j foo`
    I run a dialog script when I need to do something specific, for example open nvim in specific folder or stop all docker containers. You can bind keys to each Option. So I can press n+ and I am in my nvim folder. I was using .bashrc with functions but now that's just too slow.

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому +1

      Yeah, I like that solution. I basically have that for jumping between apps. I use Raycast to bind different apps to (super key) + (some character unique to each app). I never considered doing that with folders as well, but I like that idea

    • @user-iw7wb9ds8n
      @user-iw7wb9ds8n 4 дні тому +1

      ​@@DigitalMakerChannel You can use it not only for folders but for whole scripts (bash or sh). It's more like tmux example in your video. Unfortunately, I can't test Raycast on my main machine, but I'll try it on Windows later. I also link apps, but with (Left Control) using i3. i3 is a tiling window manager for Linux, it's easy to set up for such shortcuts.
      `bindsym $mod3+f exec firefox`
      Will put it here for other who use i3 and don't know how rebind Control:
      `exec_always --no-startup-id xmodmap -e "clear control" ; xmodmap -e "add control = Control_L" ; xmodmap -e "add mod3 = Control_R"`

  • @BenedictGS
    @BenedictGS 5 днів тому

    Cool

  • @glintcoretheprotogen
    @glintcoretheprotogen 5 днів тому

    i use stenography. less keystrokes altogether

    • @DigitalMakerChannel
      @DigitalMakerChannel  5 днів тому

      Mmm. Honestly the thought of trying to learn that typing system has occurred to me. Seems like it's mostly for dictation though

    • @glintcoretheprotogen
      @glintcoretheprotogen 4 дні тому

      @@DigitalMakerChannel professionally, it is. theres an entire community of hobbyists who use it instead of a normal qwerty keyboqrd. im still learning, and its so much fun. one of myy friends doesnt even need to use his qwerty keyboard, he just connects his stenography board and types likes theres no tomorrow. hes also a linux nerd (hes switching to arch lol)

  • @furank_i
    @furank_i 2 дні тому

    Which browser I this?

  • @AwesomeLifeguard
    @AwesomeLifeguard 5 днів тому

    Cool stuff man!

  • @sideone3581
    @sideone3581 День тому

    function g() {
    local selected_dir
    local firstPriority=$([ "$PWD" != "$HOME" ] && echo "$PWD" || echo "")
    local find_command="find ${firstPriority:+$firstPriority} $HOME/{projects,backups,dotfiles,.config} $HOME"
    local excludes=(
    "node_modules"
    "Android"
    "go"
    "phone"
    ".git"
    )
    Thanks me later!