Visual Studio Code (VSCode): The Dump
Markdown Tips in VSCode
Interlinking Markdown Documents
Anchors from headings are automaticaly created. Just type ###### Some subhead
In the same file, we can link with just [go to](#some-subhead)
. Notice that we lowercased and replaces spaces with dashes.
To link to other files, easiest way is to drag-drop file and hold Shift
key. That will produce something
[like this](Some%20Filename.md#anchor)
. We can also link to line numbers like [file](file#L60)
Link to folder [like this](Folder)
possible also and it would open folder in Explorer bar, something like “Reveal In SideBar” but for folders.
Also try Find File References
option on mouse right-click that will find us any mention of that file. Amazing!
Mostly from this source and here
Remote editing
This is common Visual Studio Code problem for Remote SSH editing.
Warning: inotify watchers?
This is a part of inotify
filesystem options. A sensible setting is typically 100000 or more on a development machine and Ubuntu’s default of 8K is way too little.
Retrieve the current amount:
sysctl fs.inotify
# or: cat /proc/sys/fs/inotify/max_user_watches
Retrieve a number of opened files for the user:
lsof | grep inotify | wc -l
We can increase the values like this
sysctl -n -w fs.inotify.max_user_watches=1048576
sysctl -n -w fs.inotify.max_user_instances=512
But to make it permanent, it must being added to /etc/sysctl.conf
:
echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Sources:
- Increasing the amount of inotify watchers
- How to get the number of inotify watches in use
- How do I find out what inotify watches have been registered?
- Lists all the owners of inotify watchers and their watcher count: fatso83/dotfiles
PHP in VSCode
Setup VS Code for Efficient PHP development 🚀 | Theodo Getting VSCode ready for PHP development - North Creation Agency
Annoyances
Annoyance Fix: Remove Extra Space on Top When Searching With CTRL+F
search inside file scroll to top space; ctrl-f; find in file space
The annoyance is that editor has an extra space on the top, that is possible to scroll to, when opening find/replace panel, for example using Ctrl+F.
Discussion and a solution is here: Editor area has an extra space on the top when opening find/replace panel
There is a settings option now:
"editor.find.addExtraSpaceOnTop": false,