mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Updating vscode.md (#1095)
* Update vscode.md Updating vscode makedown to match what is found in the mm repository * Update docs/tutorial/vscode.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update docs/tutorial/vscode.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update docs/tutorial/vscode.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Moving vscode.md to the root of the docs folder * Update docs/vscode.md Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Stephen Meier <stephen.meier@ibm.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
This commit is contained in:
parent
71be03da7c
commit
46b826fcd4
2 changed files with 82 additions and 30 deletions
|
@ -1,30 +0,0 @@
|
||||||
# VSCode
|
|
||||||
|
|
||||||
A lot of people on this project use VSCode as their coding environment, and there are a number of useful plugins available to make work more efficient:
|
|
||||||
|
|
||||||
- c/c++ intellisense
|
|
||||||
- clang-format
|
|
||||||
- hexinspector (hover on numbers for float and other info)
|
|
||||||
- numbermonger (hex to decimal and vice versa)
|
|
||||||
- bracket pair colorizer 2
|
|
||||||
- better mips support
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
You will probably also find it helpful to watch Fig's video, although it was not meant to be an actual introduction. But it does show various useful features of VSCode, quite apart from the decompilation aspect.
|
|
||||||
|
|
||||||
Useful stuff to know:
|
|
||||||
|
|
||||||
- Ctrl + Alt + Up/Down (on Windows, on Linux it's Ctrl + Shift + Up/Down or Shift + Alt + Up/Down) gives multicursors across consecutive lines. If you want several cursors in a more diverse arrangement, middle clicking works, at least on Windows.
|
|
||||||
- Alt + Up/Down moves lines up/down.
|
|
||||||
- Shift + Alt + Up/Down (Linux: Ctrl + Shift + Alt + Up/Down) copies lines up/down.
|
|
||||||
|
|
||||||
- Make use of VSCode's search/search-and-replace features.
|
|
||||||
- Ctrl + Click goes to a definition.
|
|
||||||
- Ctrl + F for search in current file
|
|
||||||
- Ctrl + H for replace in current file
|
|
||||||
- Ctrl + Shift + F for search in all files
|
|
||||||
- Ctrl + Shift + H for replace in all files
|
|
||||||
- F2 for Rename symbol
|
|
||||||
|
|
||||||
Many of VS Code's other shortcuts can be found on [its getting started page](https://code.visualstudio.com/docs/getstarted/keybindings), which also has links to OS-specific PDFs.
|
|
82
docs/vscode.md
Normal file
82
docs/vscode.md
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# VSCode
|
||||||
|
|
||||||
|
A lot of people on this project use VSCode as their coding environment.
|
||||||
|
|
||||||
|
## Extensions
|
||||||
|
|
||||||
|
There are a number of useful extensions available to make work more efficient:
|
||||||
|
|
||||||
|
- C/C++ IntelliSense
|
||||||
|
- Clang-Format
|
||||||
|
- HexInspector (hover on numbers for float and other info)
|
||||||
|
- NumberMonger (convert hex to decimal and vice versa)
|
||||||
|
- Better MIPS Support
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Useful keyboard shortcuts
|
||||||
|
|
||||||
|
- Ctrl + Alt + Up/Down (on Windows, on Linux it's Ctrl + Shift + Up/Down or Shift + Alt + Up/Down) gives multicursors across consecutive lines. If you want several cursors in a more diverse arrangement, middle clicking works, at least on Windows.
|
||||||
|
- Alt + Up/Down moves lines up/down.
|
||||||
|
- Shift + Alt + Up/Down (Linux: Ctrl + Shift + Alt + Up/Down) copies lines up/down.
|
||||||
|
- Ctrl + P offers a box to use to search for and open files.
|
||||||
|
- Ctrl + Shift + P offers a box for commands like editing settings or reloading the window.
|
||||||
|
|
||||||
|
- Make use of VSCode's search/search-and-replace features.
|
||||||
|
- Ctrl + Click goes to a definition.
|
||||||
|
- Ctrl + F for search in current file
|
||||||
|
- Ctrl + H for replace in current file
|
||||||
|
- Ctrl + Shift + F for search in all files
|
||||||
|
- Ctrl + Shift + H for replace in all files
|
||||||
|
- F2 for Rename symbol
|
||||||
|
|
||||||
|
Many of VS Code's other shortcuts can be found on [its getting started page](https://code.visualstudio.com/docs/getstarted/keybindings), which also has links to OS-specific PDFs.
|
||||||
|
|
||||||
|
## C/C++ configuration
|
||||||
|
|
||||||
|
You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configurations (JSON)` in the command box to customise how IntelliSense reads the repository (stuff like where to look for includes, flags, compiler defines, etc.) to make VSCode's IntelliSense plugin better able to understand the structure of the repository. This is a good default one to use for this project's repository:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"compilerPath": "${default}", // Needs to not be "" for -m32 to work
|
||||||
|
"compilerArgs": [
|
||||||
|
"-m32" // Removes integer truncation warnings with gbi macros
|
||||||
|
],
|
||||||
|
"intelliSenseMode": "${default}", // Shouldn't matter
|
||||||
|
"includePath": [ // Matches makefile's includes
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"src",
|
||||||
|
"assets",
|
||||||
|
"build",
|
||||||
|
"include"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"_LANGUAGE_C" // For gbi.h
|
||||||
|
],
|
||||||
|
"cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments
|
||||||
|
"cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
|
||||||
|
Add the following to (or create) the `.vscode/settings.json` file for VSCode to search the gitignored asset files by default:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"search.useIgnoreFiles": false,
|
||||||
|
"search.exclude": {
|
||||||
|
"**/.git": true,
|
||||||
|
"baserom/**": true,
|
||||||
|
"build/**": true,
|
||||||
|
"expected/**": true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in a new issue