I use macros to solve most of the same problems. You just on-the-fly record a sequence of regular vim commands that you can then replay as many times as you need. Great for formatting a bunch of data without having to deal with the misery of regex
I use macros to solve most of the same problems. You just on-the-fly record a sequence of regular vim commands that you can then replay as many times as you need. Great for formatting a bunch of data without having to deal with the misery of regex
Really? Not that I’d notice, but I assumed ed
was so tiny that there wouldn’t be any reason to not include it. (Ubuntu has it and it’s 59KB)
Asking for vi
and getting vim
is just a pleasant surprise :)
Just type :!bash
(or whatever heathenous shell you prefer) and you never have to leave the warm embrace of vim ever again
For just regular text to be consumed by humans, it’s not that great, you probably want a word processor.
It shines when you do a lot of more structural editing, stuff like “change all quotation marks on this line to be single tick”, “copy everything inside these parentheses and paste it after the equals sign”, “make the first word on the next five lines uppercase”, these are the type of things vim make easy that are not easy in other editors.
So it’s great for code and config files. Markdown is borderline. You can have a setup that lets you live view how the markdown renders while editing in vim, so it can be pretty good, but the advantage might be a bit dubious.
It does have a vim plugin, so it’s a perfectly fine editor
tl;dr: Run vimtutor
, learn vim, enjoy life
It’s extremely powerful, for mostly the same reason that it’s incomprehensible to newbies. It’s focused not on directly inputting characters from your keyboard, but on issuing commands to the editor on how to modify the text.
These commands are simple but combine to let you do exactly what you want with just a few keypresses.
For example:
w is a movement command that moves one word forward.
You can put a number in front of any command to repeat it that many times, so 3w
moves three words forward.
d is the delete command. You combine it with a movement command that tells it what to delete. So dw
deletes one word and d3w
deletes the next three words.
f is the find movement command. You press it and then a character to move to the first instance of that character. So f.
will move to the end of the current sentence, where the period is.
Now, knowing only this, if you wanted to delete the next two sentences, you could do that by pressing d2f.
Hopefully I gave a taste of how incredibly powerful, flexible, yet simple this system is. You only need to know a handful of commands to use vim more effectively than you ever could most other editors. And there are enough clever features that any time you think “I wish there was a better way to do this” there most certainly is (as well as a nice description of how).
It also comes with a guide to help you get over the initial learning curve, run vimtutor
in a console near you to get started on the path to salvation efficient editing.
Unless you wanted to learn to use ed (which you don’t)
vi is part of the POSIX standard, so it’ll be available in some form on almost anything UNIX-flavoured
Discovered exactly the same thing when I replaced my dead Gigabyte Z370 recently! Also took me a while to figure it out.
Both those chipsets were released in 2017 so I guess it’s no surprise they were made with the same thermal pads.
ls -r
actually lists entries in reverse order! It needs -R
as well.
cp
and rm
accept either.
Looking at some man pages the only commands I found where -R
didn’t work were scp
and gzip
where it doesn’t do anything, and rsync
where it’s “use relative path names”.
(Caveat: BSD utils might be different, who knows what those devils get up to!)
Not chmod related, but I’ve made some other interesting mistakes lately.
Was trying to speed up the boot process on my ancient laptop by changing the startup services. Somehow ended up with nologin
never being unset, which means that regular users aren’t allowed to log in; and since I hadn’t set a root password, no one could log in!
Installed a different version of Python for a project, accidentally removed the wrong version of Python at the end of the day. When I started the computer the next day, all sorts of interesting things were broken!
Aha! I didn’t get that you meant the issue was accidentally using -r
instead of -R
since both you and OP wrote the upper case one.
I’m a lot more used to -R
so I instead get caught off by commands where that means something other than recursive :)
I mostly use symbolic mode and honestly don’t get why everyone else seems to use octal all the time.
That’s what -R does in chmod as well? I feel like something here is going completely over my head. Or are you-all using another version of chmod?
You really can’t though. For several reasons. Which would have been apparent to you had you bothered to actually create your example link to http://аpple.com or to understand this problem.
This is likely because docker runs Linux in a VM on MacOS right?
We’ve had similar problems with stuff that works on the developers Mac but not the server which is case sensitive. It can be quite insidious if it does not cause an immediate “file not found”-error but say falls back to a default config because the provided one has the wrong casing.
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
I and l also look identical in many fonts. So you already have this problem in ascii. (To say nothing of all the non-printing characters!)
If your security relies on a person being able to tell the difference between two characters controlled by an attacker your security is bad.
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 :)
If you did it would likely break something as it’s one of only two characters not allowed in a file name (the other being null).
You can do a lot of funky stuff within the rules though, think about control characters, non-printing characters, newlines, homographs, emojis etc. and go forth and make your file system chaos!
You can run systemd (or cron) inside a pod for scheduling and call the kubernetes API from there to run jobs and stuff. Not sure if this helps you, but it can be easy to overlook.