I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
cmd + k is going to be specific to MacOS. ctrl + l will work on pretty much any terminal emulator and is also often bound to things like "redraw" in apps as well.
cd ~ will take you to your home directory, but also so will cd on its own.
Opening the current directory in apps, like with code . and open . is the same as passing the complete current path. open is a Mac-specific (in this case) program which dispatches the path parameter to whatever application is associated with "folder" (again, in this case). On Linux you'd do something like xdg-open if you have a GUI, or even something else depending on your configuration. On Windows I suspect you're SOL.
This means if you have something associated with .js files in your GUI (e.g. Finder) then open foo.js will launch that application, regardless of what it is. In that case, open is a tiny bit easier because you can share code using it with others and it'll work even if they use something else like Sublime.
I'm guessing you have less as your pager for git diffs. It doesn't have to be that way though, and even if you do there's a good chance it's not called if there's nothing to diff!
Getting unstuck from hard-to-exit terminal screens
What do you mean by this? What terminal screens are getting stuck? The only time I know ZZ as a shortcut it's an alternative way to save and exit Vim.
Thanks for leaving feedback and additional explanations. Regarding your question at the end, I do believe the screen was a VIM editor. It sometimes comes up when I am working with git.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
If you're using Vim to edit git commit messages and don't want to, I think there's a git config setting. Failing that, I imagine setting something like;
export EDITOR=$(command -v code)
in your shell config would let you use VS Code instead (or whatever you want)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Couple of tips:
cmd + k
is going to be specific to MacOS.ctrl + l
will work on pretty much any terminal emulator and is also often bound to things like "redraw" in apps as well.cd ~
will take you to your home directory, but also so willcd
on its own.Opening the current directory in apps, like with
code .
andopen .
is the same as passing the complete current path.open
is a Mac-specific (in this case) program which dispatches the path parameter to whatever application is associated with "folder" (again, in this case). On Linux you'd do something likexdg-open
if you have a GUI, or even something else depending on your configuration. On Windows I suspect you're SOL.This means if you have something associated with
.js
files in your GUI (e.g. Finder) thenopen foo.js
will launch that application, regardless of what it is. In that case,open
is a tiny bit easier because you can share code using it with others and it'll work even if they use something else like Sublime.I have a whole rant about using touch to create files.
I'm guessing you have
less
as your pager for git diffs. It doesn't have to be that way though, and even if you do there's a good chance it's not called if there's nothing to diff!What do you mean by this? What terminal screens are getting stuck? The only time I know ZZ as a shortcut it's an alternative way to save and exit Vim.
Thanks for leaving feedback and additional explanations. Regarding your question at the end, I do believe the screen was a VIM editor. It sometimes comes up when I am working with git.
Gotcha.
If you're using Vim to edit git commit messages and don't want to, I think there's a git config setting. Failing that, I imagine setting something like;
in your shell config would let you use VS Code instead (or whatever you want)