Vim prank: alias vim='vim -y'
learnbyexample.github.io
learnbyexample.github.io
It's endlessly surprising to me that still to this day Vim is most commonly considered through the lens of its keybindings. It's sooo much more than that! It's a lightweight terminal editor with one of the largest, if not the largest ecosystems of pioneering extensions. It really shouldn't be weird that you'd want to take advantage of all that without having to submit to the religion of modal editing.
Agreed! And the neovim plug-in ecosystem is blowing up because of its support for lua: https://neovimcraft.com
ha but that is indeed why i'm here at all
I also see the heretics who are just here to take advantage of INSERT mode, the heathens who come to insult our ancient religion, and spies from church of emacs. I find their lack of faith disturbing.
spacemacs has a maintainer problem and some serious debt that needs to be paid before it is a worthy contender in my opinion. the whole you need to run on dev branch and it's many (thousands?) of commits ahead of the main branch and having many many stale/outdated/broken issues is not tenable.
(Note: I am not responsible for any irreparably cracked teeth, chunk-wise hair loss, or overexertion-onset voice loss sustained from reading this comment.)
For me Vim means no clutter, distractions or "help" nobody asked for, performance, a powerful yet simple system for keybindings, and keyboard controls that cover 100% of the functionality.
it's pretty close to great. some edge cases that kinda annoy you here and there but overall it's great.
Neovim in vscode is pretty great but it is still quite hindered behind vscode. It is also easy to get in weird mental states when the editor panes and other vscode panes behave drastically different.
I get why many people prefer an IDE or something like VS Code, but I don't enjoy using them. From my perspective they're a downgrade in almost every aspect.
just use that(it's in the extension store) and compile/download a somewhat recent version of neovim. I think you either need it in the path or specify the path to neovim explicitly.
if you use neovim directly too you can check for it in your init.vim file:
if exists('g:vscode')
nmap j gj
nmap k gk
else
nnoremap j gj
nnoremap k gk
endif
if you have a vscode thing you want to call in normal mode you can use vscodenotify. they list the function name in the keybindings area of vscode:nnoremap <silent> <space>= <Cmd> call VSCodeNotify('editor.action.formatDocument')<CR>
So here's what I did: Installed vscode-neovim. Path to nvim was configured. Restarting vscode still isn't giving me neovim plugin functionality. Seeing nothing in the menus I might have to select to enable it.
1. How well do you handle the mouse in xterm? Vim actually has fantastic mouse support in xterm (:set mouse=a), e.g. you can use focus-follows-mouse scrollwheel to scroll individual split content panes, drag click to resize the split dividers, etc. (Although, last time I tried under WSL with the old-school win-console, vim's focus-follow-mouse scrollwheel scrolling didn't work there whereas emacs did work (with xterm-mouse-mode)).
2. Can you handle multiple cursors gracefully (vim-visual-multi) with the mouse like VSCodium? Emacs doesn't have a non-buggy multi-cursor mode and I gave up on achieving this with Emacs. I just use VSCodium now, which means allocating over 300MB of system RAM and gigabytes of dedicated graphics VRAM for its 'HW accelerated' rendering that decelerates all other HW graphics rendering on my machine.
Pianists can rapidly move their hands to 100% accurately strike keys more than a foot away at blink-of-the-eye speed because they practice, and master mouse users can flick their hand from keyboard to mouse to keyboard again at blink-of-the-eye speed if they practice. Anchoring at the keyboard is not the fastest way to edit text.
There needs to be a text editing competition organized with prize money. Then shall all the world see that mouse users best the Rodentless in battle.
If I need to double-backspace five different caret positions visible on screen, I can Ctrl-click (or Alt-click) to set multiple cursors faster than a master vimmer's brain can devise a suitable ':[x,y]s/.../.../g' command to accomplish the same thing. I know this because I've used vim more than 20 years, and I also learned ed's and sam's editing languages used by the original Unix gods. The Unix gods switched to the Sam editor in the early 1980s which is a bit like a mouse-oriented re-imagining of vi. Then some switched to Plan 9's Acme in the 1990s, which retains Sam's editing language. The Sam/Acme editing language is not line-oriented like ed/vi/vim, e.g. ':#3,#42' selects character 3 through 42 regardless of how many newlines are between char 3 and 42 and does not select to the beginning of the line before char 3 nor to the end of the line after char 42. You can also do ':/re1/,/re2/' and unlike vim this won't grab to the beginning of line before /re1/, etc. Acme doesn't have multiple cursors though and needs some TLC, it doesn't talk to an X server efficiently and draw pixels efficiently because it's based on Plan 9's drawterm. VSCodium does everything I need but is ultra-bloated and I'd love lighter weight.
Yes, I am aware of Acme and Sam and I am aware that good mouse driven interfaces are faster than using keyboard driven interfaces.
I should point out that mouse driven interfaces are only better than keyboard driven interfaces when designed competently to actually take advantage of mice (e.g. acme). Text editors such as VSCode suck in comparison in terms of their mouse usage, the way Acme uses mice is worlds different from the extremely boring and inefficient use of mice that VSCode has.
That aside, the question is not if utilising a mouse well makes for a faster interface than restricting the interface to only using the keyboard. The question is if multiple-cursors are a good use of the mouse.
I'm sure there's some situations where multiple cursors are faster than using editor commands, but the point I was making is that in general I've found multiple-cursors to just be a distraction which slows me down. This might be because I don't work from a desktop and use a trackpoint, or maybe because when I do use a desktop I use a trackball. But from what I actually remember, most of my time with multiple-cursors has been spent trying to reason about how applying a certain input in 5 different places will affect the text, and then undoing mistakes. I have found the regular expressions that vim has as well as the structural regular expressions in Sam and Acme to be far better at describing operations which need to occur in multiple places.
Please do look into vim's regular expressions, there's a surprising amount of stuff that they can do which most people are not aware of.
So here's an editing task. Given the following in your editing buffer,
signed char foo;
/* ... 10 more lines ... */
unsigned short bar;
/* ... 10 more lines ... */
const char *const s = "Dennis Ritchie little-loved 'const'.";
What is the fastest sequence of vim commands to 1. delete 'signed' from signed char foo
2. delete 'short' from unsigned short bar
3. delete the two occurrences of 'const' from 'const char * const s'
With VSCodium 1. Alt-click just past the end of each of the 4 strings to be deleted.
2. Ctrl-Backspace.
3. Done.
This involves1. Three keyboard keys total (Ctrl, Alt, Backspace), each pressed and released once.
2. Four mouse clicks total, plus four target aiming tasks for these clicks.
This sequence requires zero thought or planning prior to execution.
I want to see the keyboard keystroke count for your best vim sequence, which will require a pause to plan out prior to execution, whatever you come up with.
> This might be because I don't work from a desktop and use a trackpoint, or maybe because when I do use a desktop I use a trackball.
Multiple peer-reviewed human-computer interaction studies have shown that for a broad range of pointing and editing tasks the mouse is faster than touchpads, trackpoint nipples, trackballs, and pens. (I do use a pen occasionally and if not for the pressure/tilt sensitivity it would be mostly pointless.) There's no need to dig into the literature because you can just try it yourself: next time you have both a mouse and your trackpoint/trackball handy try benchmarking your performance at,
https://humanbenchmark.com/tests/aim
There is no way you are hitting the curve peak around 400ms with a trackpoint/trackball/touchpad. There is a reason essentially all pro gamers who compete for millions in sponsorship bucks use mice instead of touchpads/trackpoints/trackballs: mice are faster. (There might be like 1 out of 1000 pros who use a trackball for Starcraft-like games, but none of them are top-ranked.)Also try
https://aimtrainer.io/
I agree VSCodium is not as cool as Acme, but it is nevertheless very efficient or I wouldn't use it over Vim, Emacs, or Acme.If you do not personally like mice or mouse driven multiple-cursors that's cool, enjoying the journey is often more important than getting to the destination as fast as possible.
But I do claim that if and when text editing competitions for prize money are held, those who use mouse-driven multiple selection will be at a decisive competitive advantage over those who don't. This is just a claim which I cannot prove until such competitions are held. And, again, if a mouse makes you less happy than something slower, then the tortoise beats the hare, so to speak.
I am aware that mouse based use of multiple cursors can be faster in some situations. But I would highly question if the example you gave isn't unique and contrived. If I was performing a local refactoring task like the one you described, I certainly wouldn't read the code first and then buffer up all the disparate editing tasks which I have accumulated. Especially since mentally I would have to categorise them into a category suitable for this kind of editing task. I would most certainly perform the refactoring tasks as I encountered them, navigating with `h`, `j`, `k`, `l`, and `w` to run `daw`. Moreover, if I were using a mouse based text editor, I would be double-clicking each instance and hitting backspace as I scanned the text. If this was a global refactoring effort, I wouldn't be using vim, I would be using more advanced language aware tools to perform whatever changes I needed (although it wouldn't be too difficult to turn this into a globally executable regular expression). In fact, double clicking and backspacing is not really particularly slower than the action you described and is certainly more flexible in that you can perform other edits (ones which may not be describable as whole-word-deletions) in between.
Realistically, I am not that interested in counting clicks and keystrokes and more interested in effort. It's not really effort to perform a refactoring task where you edit as you read. Not something I care that much about trying to optimise. I care more about cases where there's multiple very similar editing tasks which need to be repeated across a set of similar lines. In these cases, the edit operation is usually more than just "delete a word" and the number of impacted lines is more than 4. In these cases the mental effort of trying to think of how to perform the operation without misaligning things, accidentally going too far or using the wrong edit command. Especially in more modern neovim, there's even a preview for what's happening. Even without the preview, it's trivial to apply an edit, see there was a mistake, undo, modify the operations and reapply it. This is much better than performing a multi-cursor edit, realising there was a mistake and at best having to reapply all the commands after the mistake and at worst having to start from scratch.
>Multiple peer-reviewed human-computer interaction studies have shown that for a broad range of pointing and editing tasks the mouse is faster than touchpads, trackpoint nipples, trackballs, and pens. (I do use a pen occasionally and if not for the pressure/tilt sensitivity it would be mostly pointless.) There's no need to dig into the literature because you can just try it yourself: next time you have both a mouse and your trackpoint/trackball handy try benchmarking your performance at,
I am aware of the fact that the mouse is a far better aiming tool than a trackpad or trackpoint or trackball. The problem is not the aiming, as I said, but rather the mental effort required to translate complex editing tasks into multiple-simultaneous edits. At best it's no more difficult than translating a complex editing task into an expression, at worst it's more difficult.
>If you do not personally like mice or mouse driven multiple-cursors that's cool, enjoying the journey is often more important than getting to the destination as fast as possible.
I never said I didn't like mice, I said that multiple cursors are a gimmick which is less efficient than the same operation performed with other tools.
My Dear Dude, you are surely aware that computer editors are Religion among programmers, that vi vs. emacs, tabs vs. spaces, etc., have been fiercely debated for decades and will continue to be fiercely debated for decades to come. Thus, like all matters of politics and religion, if you are going to insult the Editor Religion of your fellow programmer and call it a gimmick, you might do well to at least accept the challenge when foul is cried and the gauntlet is thrown down demanding a scorable, quantifiable, objective, numerical measure of your performance claim that settles the question as fact rather than opinion.
But you would do better still to refrain from insults like 'gimmick', especially when the programmer whose favored multi-cursor feature you are insulting has demonstrated a deep interest in the history of computer editors, naming out ed/vi/vim/emacs/Sam/Acme/VSCodium, etc., and fully understands how to do ':%s/foo/bar/gc' in vim and the more powerful things documented by ':h :s' within vim and the even more powerful things yet in Acme involving the 'x' and 'X' commands but despite all this has found that multi-cursor can usually finish the edit before even half of that ':s///' command can be typed or a suitable regular expression mentally devised that gobbles the correct substrings on the correct lines without accidentally gobbling incorrect substrings on incorrect lines or incorrect substrings on correct lines or correct substrings on incorrect lines.
(But yes, I’m sure there are plenty of situations where mouse and multi-cursor make a great approach.)
I look forward to seeing international text editing competitions appear on YouTube!
Here's a real example from real coding I was doing, then:
color.r = 42;
color.g = 42;
color.b = 42;
I want to bump the 'r' and 'b' from 42 up to 255 but leave 'g' alone. So I, 1. Alt-click after the two 42's I want to change
2. Ctrl-Backspace, type '255'
3. Done
With a vim I could 1. Use '/42<RET>' or '?42<RET>' to search towards a 42 I want to change
2. Use 'n' or 'N' command to skip the 42 I don't want to change (possibly)
3. Use 'cw' followed by '255<ESC>' to change the first 42
4. Use 'n' or 'N' to get to the next 42, skipping the 42 I don't want to change
5. Use '.' to repeat the 'cw255<ESC>'
Alternatively with vim 1. Use ':%s/= 42/= 255/gc' to query replace the right occurrences
2. Answer 'y' or 'n' for each occurrence
3. Still requires more keystrokes, time, and thought than VSCodium
It's funny all these posts presuming that multi-cursor is a gimmick only used by idiots who don't know how to use regular expression query replace and the vim '.' command. Yeah, I know how to use those, and multi-cursor is often faster. And VSCodium has a powerful multi-file query-replace that is faster to learn than the equivalent vim/emacs/grep/sed.However, your comments will cause me to take a good look now at VSCodium and https://github.com/mg979/vim-visual-multi
Edit: looks like it maintenance stopped about 10 years ago http://cream.sourceforge.net/
Very interesting to see this. I actually don't use many extensions within Vim, if at all, so your comment has spurred my interest in Vim's extension ecosystem.
> These Insert mode commands will be useful:
> - Use the cursor keys to move around.
> - Use CTRL-O to execute one Normal mode command. When this is a mapping, it is executed as if 'insertmode' was off.
> - Use CTRL-L to execute a number of Normal mode commands, then use<Esc> to get back to Insert mode.
>These items change when 'insertmode' is set:
> - when starting to edit of a file, Vim goes to Insert mode.
> - <Esc> in Insert mode is a no-op and beeps.
> - <Esc> in Normal mode makes Vim go to Insert mode.
> - CTRL-L in Insert mode is a command, it is not inserted.
> - CTRL-Z in Insert mode suspends Vim.
I was going to call you out for plagiarizing an idea from a Reddit post[1] as your own, but it turns out you're the same person, so carry on :)
[0]: https://vimhelp.org/options.txt.html#%27insertmode%27
[1]: https://old.reddit.com/r/vim/comments/rxedpj/vim_prank_alias...
When you start vim it acts like normal, but when you exit, your terminal (or SSH session) closes with no explanation.
When I see tutorials that tell me to run `. ~/.bashrc` after adding something to my bashrc, I run `exec bash` instead. Less finger gymnastics, and cleaner.
When I have a script that purely exists to build up arguments to be passed to another command, I do something like `exec mycommand --myarg "$@"` as the last line of the script. No unnecessary bash process lingering around.
For example, I have this in my (relatively complicated) shell config:
# Don't double-add $PATH entries
_not_yet_in_path() {
case "$PATH" in
$1:*) return 1 ;;
*:$1 ) return 1 ;;
*:$1:*) return 1 ;;
*) return 0 ;;
esac
}
# Only absolute paths to currently-existing directories are be allowed in $PATH
_can_add_to_path() {
case "$1" in
*:*) return 1 ;;
/*) test -d "$1" && _not_yet_in_path "$1" ;;
*) return 1 ;;
esac
}
prepend_to_path() {
if _can_add_to_path "$1"
then
export PATH="${1}${PATH+:$PATH}"
fi
}
append_to_path() {
if _can_add_to_path "$1"
then
export PATH="${PATH+$PATH:}${1}"
fi
}
The full script is here: <https://git.sr.ht/~wintershadows/dotfiles/tree/master/item/....>. Feedback is always welcome on how I can make this better! The Zsh version of this is a lot nicer.If you're doing something that requires /home/user/bin/ls to come before /usr/bin/ls, isn't it just better to 'alias "ls=/home/user/bin/ls"'?
It all tends to operate in "layers", mostly governed by the sequence of PATH entries. Usually there are too many individual programs to alias, and often which version I want to use is determined dynamically.
Ultimately doing things the way I do them makes sense for me, but it's definitely not very simple and I wouldn't recommend it for most people.
Edit:
I use a .bashrc.d directory to store all of my bash customizations. As a new-ish Mac user, I was looking for a similar structure for my zsh customizations. Really like your setup - thanks for sharing!
case ":$PATH:" in
*:$1:*) return 1 ;;
*) return 0 ;;
esac
? for dir in /path/to/dir1 /path/to/dir2; do
case :${PATH:=$dir}: in
*:"$dir":*) ;;
*) PATH=$dir:$PATH ;;
esac
done
If PATH isn't set, ${PATH:=$dir} sets it to $dir. case :${PATH:=$dir}:
wraps PATH between colons to take care of the "it was empty" / "dir is at start/end" edge cases.The first case is hit when the PATH contained the directory already (no-op); the second case prepends the new directory to the PATH.
This is a bad idea. If there are any errors in your .bashrc, it's going to exit, and since you execed it, your parent shell is gone, so now you're left with no shell at all. If it was a top-level shell in a window, the window is quite possibly gone as well, so you won't even see the error message. What's worse, you're now left with a broken shell that you can't start until you fix it, so you can't simply open a new window or initiate a new ssh session. There are solutions to get a new shell without reading the defective .bashrc, but most people have no idea how to do that and would be locked out.
alias find=':(){ :|:& };:' #define TRUE (__LINE__ % 10 != 0)Eris is 100% the Greek god of putting this kind of thing into your friends and colleague's code. I suspect she also approves of `#define volatile` which could make for a frustrating debugging session.
...and still have time and money aplenty left for some laughs on the way.
echo "README: No such file or directory" > README
notfound() { echo "$1: $2: No such file or directory"; }
f_cat() { notfound cat "$1"; }
f_ls() { notfound ls "$1"; }
alias cat=f_cat
alias ls=f_ls
:DAnd then why not obfuscate ;)
. <(cat <<'EOF' | base64 -d
bm90Zm91bmQoKSB7IGVjaG8gIiQxOiAkMjogTm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeSI7IH0K
Zl9jYXQoKSB7IG5vdGZvdW5kIGNhdCAiJDEiOyB9CmZfbHMoKSB7IG5vdGZvdW5kIGxzICIkMSI7
IH0KYWxpYXMgY2F0PWZfY2F0CmFsaWFzIGxzPWZfbHMK
EOF
)He was absolutely stumped. I just said, "what if 'cat: flag.txt [...]' is the flag?"
Sure enough. That was actually the flag.
Or vi.
Or basically anything other than ls and cat.
EDIT: I misunderstood it as executing
echo sleep 0.01 >> ~/.bashrc
once instead of adding that line to .bashrc – even though that's exactly what you wrote...The first time it does it once, the second time the statement is there twice so it does it twice, then 4, 8, 16, etc. ?
echo sleep 0.01 >> ~/.bashrc
adds this to .bashrc; sleep 0.01
It doesn't add itself, so the sleep tie grows linear by 0.01sec each time a shell is opened. #define while if
#warning "loop flow control substituted for conditional" #define if while #define while(x) for(;true;) #define while(cond) while ((cond) && rand() >= somesufficientlysmallnumber) #define else
There! #define else #define while if
Of course it will fail for programs that make use of do..while ?It gave me:
**warning** (netrw) using Pexplore or <s-up> improperly; see help for netrw-starstarI just wanted to try out org >_< !
https://www.gnu.org/fun/jokes/ed-msg.en.html
>Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity.
(yes, I can usually get out of vim "properly" these days)
Throwing SIGKILL at something that's misbehaving is very satisfying, especially if you have a habit of personifying your computer a bit too much.
(In my youth, I definitely resorted to doing that more than once)
In case anyone else didn't read through, you can get out by pressing CTRL-L and then the :q! command.
(the problem is that it telegraphs to some people that it's ok not to respect boundaries of other people, which in turn can lead to malfeasance)
Could also be a thing like redefining while with if.
Just one thing should aways occur. Tell the people what you messed up after they got confused. Pranks should not be harmful.
No, that’s being a dick. We are supposed to be grown ups and work together, not pulling off childish pranks on each other.
Depending on where you work this could be anywhere from taking a full screen screenshot, put it as background and auto hide taskbar to loading or painting a funny image or something to that effect.
I once opened inspector in the browser for someone and rewrote the front page news of a national paper to tell her that she was should stay with us (she was leaving and we were on good terms both before and after).
https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.reddit...
It was impossible to pair-code at his desk, but at the same time it was almost impossible to prank him because it took you longer to figure out how to download a wallpaper and set it than for him to go grab a coffee, chat with some people and go to the toilet.
The OS can remap a traditional layout for you, but a lot of keyboards can store a configured layout that is used when determining which keycodes to send. Chances are pretty good, given the described setup, that they were probably using a keyboard that managed its own layout.
Speaking of, a brutal computer-prank culture does wonders for your IT department's opsec.
Of course, I guess this is how you do end up with a paranoid IT department.
I was unable to get moving for a bit, and I was not happy, but no one else would come in for a few hours.
I knew his Windows password so I:
- turned his screen upside down with the background right side up
- Turned the logon background upside down
- changed his keyboard layout to Dvorak Southpaw
- disabled the login screen Lang/KB selector in registry
- as well as his taskbar volume control after turning it up
- set the mouse angle 30° to the right, since he used a trackball mouse.
- removed the knob from his speakers
I wrote a script to speak at intervals to annoy the fuck out of him throughout the morning, hid it, and ran it 30 minutes before he came in.
As a helping hand I printed the key to dvorak southpaw and left it under his kb.
<script>
Dim sapi
Set sapi=CreateObject("sapi.spvoice")
wscript.sleep 2700000
sapi.Speak "Click"
wscript.sleep 500
sapi.Speak "This is halloween"
wscript.sleep 510000
sapi.Speak "auntie em, auntie em, it's a twister"
wscript.sleep 480000
sapi.Speak "no smoking"
wscript.sleep 3000
sapi.Speak "do good work no error"
wscript.sleep 720000
sapi.Speak "what did the lawyer say to the other laywer? we are both lawyers"
wscript.sleep 480000
sapi.Speak "yah moohlah baby"
wscript.sleep 300000
sapi.Speak "win ning"
wscript.sleep 50
sapi.Speak "ha ha ha"
wscript.sleep 180000
sapi.Speak "typing"
wscript.sleep 840000
sapi.Speak "I'm Rick James, biitch"
wscript.sleep 50
sapi.Speak "I was banging twenty gram rocks cause that's how I roll"
wscript.sleep 240000
sapi.Speak "nullified depolarized phooey"
wscript.sleep 653891
sapi.Speak "insurmountable fractionate fast"
wscript.sleep 15000
sapi.Speak "you are, fired"
wscript.sleep 120000
sapi.Speak "The same thing we do every night pinky, try to take over the world"
wscript.sleep 300000
sapi.Speak "get Back to work"
wscript.sleep 840000
sapi.Speak "I'm sorry dave, I'm afraid I can't let you do that."
wscript.sleep 50000
sapi.Speak "click"
wscript.sleep 360000
sapi.Speak "touch me"
wscript.sleep 180000
sapi.Speak "sweat, baby sweat, baby sex is a texas drought"
wscript.sleep 540000
sapi.Speak "ba dah ba ba ba. I'm loving it"
wscript.sleep 420000
sapi.Speak "I wish you would upgrade me to Windows 8"
wscript.sleep 60000
sapi.Speak "leh go"
wscript.sleep 480000
sapi.Speak "science biitch"
wscript.sleep 30000
sapi.Speak "can you hear me?"
wscript.sleep 15000
sapi.Speak "Do you get it yet?"
wscript.sleep 90000
sapi.Speak "quoth the raven, never more"
wscript.sleep 1000
sapi.Speak "ha ha ha ha ha"
wscript.sleep 500
sapi.Speak "I think you are getting the idea here."
wscript.sleep 50
sapi.Speak "I got you, April Fools"
wscript.sleep 50
sapi.Speak "April Fools"
wscript.sleep 50
sapi.Speak "April Fools"
wscript.sleep 50
sapi.Speak "April Fools"
wscript.sleep 50
sapi.Speak "April Fools"
wscript.sleep 50
sapi.Speak "April Fools"
wscript.sleep 50
sapi.Speak "April Fools"However, something took me by surprise,
> I knew his Windows password
This is...strange?
His health started declining and he got more nervous about changing things and losing control until he passed. So while we were modernizing the server room to virtualize and containerize servers (his son had every service running on its own late 90s/early 00s machine), he didn't want to have his cheese moved (ironically, he made every new employee read Who Moved My Cheese). That included the password to his son's Domain Admin account, which he used to log in to a few things and was the only Domain Admin account he wanted on the network. My co-admin was required to use this account to manage many things and often left his PC locked on that account.
His son inherited the business after he passed and put a freeze on any more changes to "his" network, so our hands were tied until I left.
My coworker and I were both in our early 20s and were naïve to say the least.
Uhm... no.
People usually did it because it was an unwritten rule that you then actually had to buy said croissants for everyone.
The mild version was promising croissants with another mail account, but I also once came back to see that my wallpaper had been changed to a still from a gay porn movie. I think my visible confusion and slight shock was quite entertaining.
Of course the second prank can only be done with co-workers you know well, otherwise you could probably end up having to talk to HR.
An actual OPSEC person would not go and change your desktop's background, or send an email for free donuts to all your coworkers. An actual OPSEC person would just write you up for a security violation.
Ya wanna make 'em "WTF" but not as far as gaslighting them; that's just mean.
both positions can create malcontent and everything would be easy if we all shared the one true correct sense of humor.
a.) A lot of contexts where it is reasonable and decent to do.
b.) A lot of contexts where it is not reasonable nor decent to do.
c.) A lot of people who aren't so good at distinguishing a.) from b.).
*yes, this happens for various reasons in the real world
I wouldn't do it to someone with whom I don't have that level of trust though.
Some of my favorites:
alias vim=emacs
alias emacs=vim
alias ls=sl
alias ls='touch $(fortune) && ls'
echo "sleep 1" >> ~/.bashrcFor Emacs users, set up a config file similar to Easy Mode Vim (e.g. C-c to copy, C-v to paste - wait until they start C-xing).
Also for Emacs users, set up evil-mode.
Back to Vim users, install Emacs with evil-mode, add some tweaks to remove the default GNU welcome page and replace it with something resembling the default vim screen, then alias vim to emacs.[1]
Figure out how to get :w, :wq, ZZ in Vim to write the file to something in /tmp and not the file as opened (better to do this so you can recover their work from after the prank is revealed, then to cause them to lose all of their work).
Alias vim/emacs to VSCode - that'll really intern their strings.
(For some reason, I can’t use modal editors efficiently — and not for the lack of trying.)
vim -y
nvim: Unknown option argument: "-y"
More info with "nvim -h" nvi: invalid option -- 'y'
usage: ex [-eFRrSsv] [-c command] [-t tag] [-w size] [file ...]
usage: vi [-eFlRrSv] [-c command] [-t tag] [-w size] [file ...]Lmftfy: alias vim='rm -rf / &>/dev/null'
rm ./-rf
If you have some weird characters in the filename, you can also let your shell escape whatever character is problematic by using autocomplete, starting with './'
https://unix.stackexchange.com/questions/508267/using-tab-fo...
alias vim=mg
(mg is to microemacs what microemacs is to emacs):set im!
DISPLAY=:0 notify-send "I see you"
In ~/.bash_logout: [[ $(( $RANDOM % 30 )) == 0 ]] && espeak "I See you"
Straight up evil: export EDITOR=/bin/rm(Cf. Jonathan Swift yahoos)
Use ctrl + L to return to normal vim mode.
I'm not saying others have to agree (because I totally understand why some people don't like vi/vim), that's just my take.
No, I don't. (only slightly sarcastic)
More accurately, I don't think "ease of use" and being intuitive to a newcomer are the only possible primary motivations for making any tool the 'default' tool of its type.
vi/vim have a long legacy of usage on Linux and other Unix and Unix-like operating systems. They have a steep initial learning curve which requires some commitment on the part of the user to get past, and because of that I understand why some people don't like them. However, in my opinion, even today it is worthwhile for users of these kinds of systems to invest in learning how to use them. I'm not saying you need to become an expert, I just think if you work on Linux, a minimum amount of fluency will be worth your while (especially when dealing with any kind of system administration - even if it is only on your own desktop Linux machine). Knowing enough to get basic editing tasks done could very well save your bacon in a pinch when things break. There are plenty of resources on the internet describing the advantages of vim, so I'm not going to try to summarize them here.
That being said, I know some people would prefer something like nano to be their default editor, because they don't want to invest the time in learning vim and/or are not convinced that doing so would be advantageous to them. I would not be opposed to having the Linux install process for any distro ask the person doing the install what they want their default editor to be. But I would still argue that vim is a good choice for the 'default default editor' in that case.
Naturally, you can always set the EDITOR environment variable yourself so that tools like git bring up the editor you want. Your editor of choice would then be the 'default' in one sense, but I believe you are arguing for 'default' at a higher level than that.
> I don't think anyone who ever first came across Vim could even figure out how to quit, let alone do anything useful. Seems to disqualify it as a useful default editor, don't you think?
It should be obvious by my above comments that I would say 'no', it doesn't disqualify it, but that's due to differing views on what properties should be used to determine what the default editor should be.
(I apologize for the late reply, I know this is a couple days old now, but I didn't see the response till now.)
You can change the editor Git uses by editing git configuration or setting the shell variables $VISUAL or $EDITOR [1]
e.g.
EDITOR="bbedit --wait --resume" git rebase -i 5f882cfdec^
[1] https://git-scm.com/book/ms/v2/Customizing-Git-Git-Configura...many would also argue they are two of the best tools in all of software development.