קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אתם יכולים להשתמש בספריית ההנחיות כדי לשמור ולנהל את ההנחיות שבהן אתם משתמשים לעיתים קרובות, וכדי לשלוף אותן במהירות כשצריך. אם יש הנחיה שאתם משתמשים בה לעיתים קרובות עבור קבצים שונים או קטעי קוד שונים, אתם יכולים להשתמש במשתנה של תבנית הנחיה שמוחלף באופן אוטומטי בקוד או בקובץ שנבחרו במהלך ההפעלה של ההנחיה. תהליך העבודה היעיל הזה חוסך לכם זמן ומאמץ כי אתם לא צריכים להקליד מחדש הנחיות שבהן אתם משתמשים לעיתים קרובות.
כדי לפתוח את ספריית ההנחיות, עוברים אל File (Android Studio ב-macOS)
Settings > Tools > Gemini > Prompt Library.
שמירת הנחיה
כדי להוסיף הנחיה:
פותחים את ספריית ההנחיות בלחיצה על File (Android Studio ב-macOS)
> Settings > Tools > Gemini > Prompt Library.
כדי להגדיר את ההיקף של ההנחיה, משתמשים בתפריט הנפתח היקף:
כללים ברמת ה-IDE הם פרטיים וניתן להשתמש בהם בכמה פרויקטים.
נותנים שם להנחיה. השם הזה יופיע בתפריט ספריית ההנחיות אם רוצים להחיל את ההנחיה מהעורך.
מזינים את ההנחיה בשדה שמופיע. אם ההנחיה כוללת הפניה לקוד ספציפי, אפשר להוסיף את הקוד הרלוונטי במהלך הרצת ההנחיה באמצעות המשתנים הבאים בהנחיה:
$SELECTION – מייצג את הטקסט שנבחר או את הטקסט שמסביב לסמן אם לא נבחר טקסט.
$CURRENT_FILE – מייצג את כל הטקסט בקובץ שפעיל כרגע בעורך.
אופציונלי: אם לא רוצים שההנחיה תופיע בתפריט ספריית ההנחיות, מבטלים את הסימון של האפשרות הצגה בתפריט ספריית ההנחיות.
כדי להחיל את השינויים ולהמשיך להגדיר הגדרות אחרות, לוחצים על החלה.
כדי להחיל את השינויים ולצאת מיד מתיבת הדו-שיח של ההגדרות, לוחצים על אישור.
אפשר גם ללחוץ לחיצה ימנית על הנחיה בצ'אט כדי לשמור אותה לשימוש מאוחר יותר. כדי להשתמש בהנחיה שמורה, לוחצים לחיצה ימנית בעורך ועוברים אל Gemini > ספריית ההנחיות כדי להחיל את ההנחיה.
שימוש בהנחיה שמורה
כדי להשתמש בהנחיה מספריית ההנחיות, פועלים לפי השלבים הבאים:
מסמנים את הקוד הרלוונטי, אם הוא רלוונטי להנחיה שמתכננים להשתמש בה. אם ההנחיה לא מתייחסת לקוד ספציפי, לא משנה איפה הסמן נמצא בקובץ.
כדי לראות את רשימת ההנחיות, לוחצים לחיצה ימנית בעורך ועוברים אל Gemini > ספריית ההנחיות.
כדי לשלוח את ההנחיה ל-Gemini, בוחרים את ההנחיה מהתפריט.
שיתוף וניהול של הנחיות ברמת הפרויקט
אתם יכולים לשתף הנחיות ברמת הפרויקט עם חברי צוות שעובדים על אותו פרויקט ולנהל אותן. כששומרים הנחיה ברמת הפרויקט בספריית ההנחיות, ההנחיה נשמרת ב-<project-root>/.idea/project.prompts.xml. כדי לשתף הנחיות ברמת הפרויקט ולנהל אותן, מוסיפים את התיקייה .idea למערכת בקרת הגרסאות.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-31 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-31 (שעון UTC)."],[],[],null,["# Save and manage prompts with the Prompt Library\n\nUse the Prompt Library to save and manage your frequently used prompts and\nquickly recall them when needed. If there's a prompt that you use often for\ndifferent files or different sections of code, you can use a prompt template\nvariable that is automatically replaced with the selected code or file during\nprompt execution. This streamlined workflow eliminates the need to retype\ncommonly used prompts, saving you time and effort.\n\nTo open the Prompt Library, go to **File** (**Android Studio** on macOS)\n**Settings \\\u003e Tools \\\u003e Gemini \\\u003e Prompt Library**.\n\nSave a prompt\n-------------\n\nTo add a prompt, follow these steps:\n\n1. Open the Prompt Library by clicking **File** (**Android Studio** on macOS) **\\\u003e Settings \\\u003e Tools \\\u003e Gemini \\\u003e Prompt Library**.\n2. To set the scope of the prompt, use the **Scope** drop-down:\n - IDE-level rules are private to yourself and can be used across multiple projects.\n - Project-level rules can be [shared among teammates](#share-project-prompts) working on the same project.\n3. To add a new prompt, click **Add** .\n4. Give the prompt a name. This name is what appears in the [Prompt Library menu](#use-saved-prompt) if you want to apply the prompt from the editor.\n5. Enter the prompt in the field provided. If the prompt involves referencing specific code, you can add the relevant code during prompt execution by using the following variables in your prompt:\n - `$SELECTION` - Represents the selected text, or text surrounding the cursor if no text is selected.\n - `$CURRENT_FILE` - Represents all the text in the file that's currently active in the editor.\n6. Optional: If you don't want the prompt to show up in the [Prompt Library menu](#use-saved-prompt), un-check **Show in Prompt Library menu**.\n7. To apply the changes and continue configuring other settings, click **Apply** . To apply the changes and immediately exit the settings dialog, click **Ok**.\n\nYou can also right-click on a prompt in chat to save it for later use. To apply\na saved prompt, right-click in the Editor and navigate to **Gemini \\\u003e Prompt\nLibrary** to apply the prompt.\n\nUse a saved prompt\n------------------\n\nTo use a prompt from the Prompt Library, follow these steps:\n\n1. Highlight the relevant code, if applicable to the prompt that you're planning to use. If the prompt doesn't reference specific code, it doesn't matter where your cursor is in the file.\n2. To get your list of prompts, right-click in the editor and go to **Gemini \\\u003e Prompt Library**.\n3. To submit the prompt to Gemini, select the prompt from the menu.\n\nShare and manage project-level prompts\n--------------------------------------\n\nYou can share and manage project-level prompts with teammates working on the\nsame project. When you save a prompt at the project level in the Prompt Library,\nthe prompt is stored at `\u003cproject-root\u003e/.idea/project.prompts.xml`. To share and\nmanage project-level prompts, add the `.idea` folder to your version control\nsystem."]]