- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
This is a feature, not a bug
deleted by creator
Why did Linux systems go for capitals in the home folder? It’s actually kind of annoying and takes extra key presses.
…A while later “XDG Base Directory Specification”
deleted by creator
Any help with that?
deleted by creator
Symlink your desired location on the target disk to the place the system thinks the software should go. (In my case, /usr/local/games is a symlink to a different drive.)
Thanks
XDG specifies the capital names, but to be nitpickingly technically precise, linux systems don’t do this. It mostly is done by the distribution maintainers, and the XDG specs. A base system does not usually have a notion of anything beyond your $HOME.
Try adding a user:
sudo adduser basicuser
. If youls -al ~basicuser
you will see it’s almost empty, just the .bashrc (or in my fedora, there’s some .mozilla crap in /etc/skel that also gets bootstrapped).
You’ve come from Windows and have brought dangerous expectations.
MacOS has a case insensitive file system. It causes me untold grief
Is a 40 year old it guy who love linux, wat
Macos is case insensitive?!
OSX offers both case sensitive and case insensitive filesystems
Defaults to insensitive and if you want to change it you have to reformat 🥲
I’ve been using case insensitive fs on macOS for years and the only software having issues with this is onedrive.
can’t say i’m surprised.
Why would case sensitive path names be considered dangerous?
alias d=“cd ~/Downloads”
Op does not know about $CDPATH and tab completion keke
I’ve seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?
I have multiple times fumbled with forgetting to capitalize something, only for the terminal to ‘dunk’ at me
For bash, this is enough:
# Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on"
If you also add e.g.
CDPATH=~/Documents
, it will also always autocomplete from your Documents no matter which directory you’re on.Setting
CDPATH=:~/Documents/Dev
makes navigating to any of my projects so much easier.Thanks for bringing it to my attention
Thanks kind stranger. Never knew of this.
No problem!
As an aside, I see we’re bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.
Well
completion-ignore-case
is enough to solve this particular problem, the other options are just sugar on top :)I’m going to add
completion-prefix-display-length
to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.For example if you have a folder with these files:
FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles
Just type
vim TAB
to see...1-CrashLog2022-12-22 ...1.config ...2 ...2-CrashLog2023-10-02 ...2.config ...2.userprofiles $vim FoobarSystem-v20.69.1
GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is
~/.inputrc
and you’d enable the above mentioned options like this$include /etc/inputrc set completion-ignore-case on set show-all-if-ambiguous on set completion-map-case on set completion-prefix-display-length 9
There’s probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things “just work”: not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don’t need any weird magic like in Bash if you want to use an alias with the same completion
Hmm, it didn’t “just work” for me. I had to set it up recently:
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
That line needs to go in .zshrc. Maybe it’s enabled by default with oh-my-zsh?
I’m sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh
I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind
echo ‘set completion-ignore-case On’ >> ~/.inputrc
also idk does zsh do this automatically? don’t think i’ve ever had this problem except on legacy AF servers
i mean… unless you don’t tab complete, but then who doesn’t spam tab 30 times every keystroke?
Or up-arrow a bazillion time because you probably have it SOMEWHERE in the buffer, surely.
Shit yo. How come I only learn this now? Thanks!
How does that handle languages that have different rules for capitalization? For example I and i are not the same letter in Turkish.
I believe that type of stuff is specified in your locale, so it’s possible that it would do the right thing if you’ve set your language to Turkish. Please try it and let us know though :)
Don’t know actually, never used a language like that. But should be easy enough to undo should one test it and end up not liking how it handles it.
Reasonable and sane behavior of
cd
. Just get into the habit of always using lower case names for files and directories, that’s how our forefathers did it.Yes, but this is the default on many distros, so for once the end user is not to blame
Even worse, many components will ignore the
XDG_DOWNLOAD_DIR
var so even if you manually change it to$HOME/downloads
(lower-case) it will often break things.Something something symlink Downloads to downloads
Yeah but the main issue is that I don’t want there to be a
Downloads
directory in my home.
Why not just
cd $XDG_DOWNLOAD_DIR
in the first place?That’s not an environment variable. It’s defined in
${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs
.Though you can use the
xdg-user-dir DOWNLOAD
command to get it automatically.
Keep filling those bugs and stop complaining on random forums, kids
Porque no los dos?
Lower case directories?
Eww
ILikeMineInAWayICanReadThemProperly, instead of ilikemineinawayicanreadthemproperly
If a directory has multiple words in it I usually do kebab case: i-like-mine-in-a-way-i-can-read-them-properly. Both easier to read and type than pascal case.
For more complex filenames I use a combination of kebab-case and snake_case, where the underscore separates portions of the file name and kebab-case the parts of those portions. E.g.
movie-title_release-date-or-year_technical-specifications.mp4
CamelCase directories and snake_case files.
Do. none of you use case insensitive autocomplete? “do ” “Downloads”
Just make a downloads folder if you absolutely want to go there
Symlink
mount bind
…why is it so hard to find a picture of a mountain with a harness on it
ln -s Downloads downloads FTW
But then you’re still accessing “Downloads” and not “downloads”
deleted by creator
So you type
cd D
tab and it brings you toDocuments
Don’t even have to cd when using completion with fish/zsh. Just type
down[tab]
Fish baby. Fish.
i renamed my home folders to
dl
,docs
,pics
, etc. and use auto-cd (whatever its called) to just typedl
instead ofcd dl
You could just use aliases in your bashrc
alias dl=cd ~/Downloads
Might need quotes around the command.
sure, but what if need a subfolder of
dl
, likedl/source
or whatever. same with documents and picturesYou have to try it but I think it still works. Aliases just replaced the text you typed with text in the alias, so if you append a subfolder to the alias it should also be appended to the command.
It’s like using !! when navigating folders. You can do
cd ~/Downloads
and then!!/source
and it resolves tocd ~/Downloads/source
I’m sure that still works with aliases. Then you’ll have dl/source and Doenloads/source that are the same location. Using aliases will mean any script or program you may use that might point to them won’t just create a new default folder that is then no longer the same location as the renamed one that you’ll expect everything in
ok but if i open a gui file explorer, i can type
dl
to go to focus downloads, anddo
can match downloads or documents (or dotfiles)Oh, yeah i think i also confused them with symlinks, you could use them?
true, but then i would have duplicates of those folders in home directory
That’s fair
Use Zsh or Fish and tab completion.
Or better yet, use z or zoxide:
“z down” will fuzzy match the “~/Download” folder.This is the way!
OMZ and TAB gang raise up!