初版可用

This commit is contained in:
2026-03-31 15:34:09 +08:00
commit 9b00ecb585
14 changed files with 366 additions and 0 deletions

3
template/default/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.cache/
.qtcreator/
build*

View File

@@ -0,0 +1,8 @@
[
{
"context": "Editor",
"bindings": {
"alt-g": "editor::GoToDefinition",
},
},
]

View File

@@ -0,0 +1,26 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"tab_size": 4,
"ensure_final_newline_on_save": true,
"lsp": {
"clangd": {
"binary": {
"arguments": [
"--header-insertion=never",
"--all-scopes-completion",
"--completion-style=detailed",
"--clang-tidy",
"-j=4",
"--pch-storage=memory",
"--compile-commands-dir=build",
"--background-index",
"--ranking-model=heuristics",
"--function-arg-placeholders=false",
],
},
},
},
}

View File

@@ -0,0 +1,54 @@
[
{
"label": "Debug-Config",
"command": "cmd",
"shell": {
"program": "C:\\Windows\\System32\\cmd.exe",
},
"env": {
"EXT_ARGS": "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH=C:/local",
"CC": "clang",
"CXX": "clang++",
},
"args": [
"/c",
"cmake -Bbuild -S . -G Ninja %EXT_ARGS% -DCMAKE_BUILD_TYPE=Debug",
],
"cwd": "$ZED_WORKTREE_ROOT",
},
{
"label": "Debug-Build",
"command": "cmd",
"shell": {
"program": "C:\\Windows\\System32\\cmd.exe",
},
"args": ["/c", "cmake --build build --config Debug"],
"cwd": "$ZED_WORKTREE_ROOT",
},
{
"label": "Release-Config",
"command": "cmd",
"shell": {
"program": "C:\\Windows\\System32\\cmd.exe",
},
"env": {
"EXT_ARGS": "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH=C:/local",
"CC": "clang",
"CXX": "clang++",
},
"args": [
"/c",
"cmake -Bbuild -S . -G Ninja %EXT_ARGS% -DCMAKE_BUILD_TYPE=Release",
],
"cwd": "$ZED_WORKTREE_ROOT",
},
{
"label": "Release-Build",
"command": "cmd",
"shell": {
"program": "C:\\Windows\\System32\\cmd.exe",
},
"args": ["/c", "cmake --build build --config Release"],
"cwd": "$ZED_WORKTREE_ROOT",
},
]

View File

@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.16)
project(zedTemplate LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})
if (MSVC)
add_compile_options(/utf-8)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(zedTemplate main.cpp)

View File

@@ -0,0 +1,7 @@
#include <iostream>
int main()
{
std::cout << "Done." << std::endl;
return 0;
}