I heard all things in the heaven and in the earth. I heard many things
in hell. How, then, am I mad? Hearken! and observe how healthily — how
calmly I can tell you the whole story.
To exclude a directory from git diff, use the following command:
git diff -- . ':!directory_name'
You can find this exceptionally terse answer at at least a dozen search results, but not a single one offers an explanation. Well, that's not enough info for me...
The "pathspec" is documented under git help gitglossary and is used for many git commands even if their syntax statement shows <path> instead of <pathspec> :
https://git-scm.com/docs/gitglossary#def_pathspec
Here are the important points:
The double dashes (--) followed by a space means end of command line flags. Without this, git may try to interpret your pathspec as a command line flag.
The dot (.) means the current directory. I don't think this is really necessary.
The colon (:) indicates that the characters which follow it are a "magic signature".
The exclamation mark means "exclude".
The "magic signature" should be terminated by another colon, but that's optional if the pattern begins with a less magical symbol.
I wanted to see what had changed in an Eleventy site, excluding the generated output files. So, here's the command I used:
git status -- ':!:_output'
Note that I needed to terminate the magic signature with another colon because the path I wanted to exclude started with an underscore (_). Without that second colon, I got an error message:
fatal: Unimplemented pathspec magic '_' in ':!_output'`
VSCodeVim broke VSCode's file Quick Open keybinding. Now, CTRL-P just moves the cursor up a line instead of opening the file finder as expected.
Based on the GitHub issue linked in the commit, it was meant to enable MacOS's default cursor movement keys.
Issue #8574 shows some easy fixes. I chose to disable the plugin's handling of the keybinding:
"vim.handleKeys": {
"<C-p>": false
}
This is in settings.json and I got there by opening Settings, entering "handlekeys" into the search box, and clicking on the "Edit in settings.json" link.
I wanted to be able to scroll a man page in the terminal with my mouse wheel. While looking for a setting to change I learned that Vim can be used as a pager allowing mouse support and much more.
Inspired by this entry at the Vim Tips Wiki, I decided to set it up for myself, but with a few minor changes. I did all this in WSL with Ubuntu 20.04.6 and Zsh on Windows 11, but it should work as well with any Unix or Linux variant:
-c 'highlight Normal ctermbg=NONE guibg=NONE': This disables the background color that I use in the editor when editing code so that my terminal transparency is still in effect.
The rest of the lines change some key mappings so that it works in a familiar way if you're used to less (the default pager for man pages)