Skip to content

Commit 8902d69

Browse files
committed
feature: add cursor support
1 parent 7b43016 commit 8902d69

File tree

12 files changed

+118
-74
lines changed

12 files changed

+118
-74
lines changed

README.md

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,63 @@ Download from the store
88

99
## Configuration
1010

11-
To get the most out of the `RecentProjectsOpen` plugin, you may need to configure it according to your preferences and environment.
11+
To configure the `RecentProjectsOpen` plugin, you can either use the Flow Launcher settings interface or directly edit the plugin's configuration file.
1212

13-
1. **Open Flow Launcher Settings**: Launch Flow Launcher and navigate to the settings page where plugins are managed.
14-
2. **Find the Plugin**: Locate the `RecentProjectsOpen` plugin in the list of installed plugins.
15-
3. **Access Configuration Options**: Click on the plugin to access its configuration options. There should be a settings icon or a similar indicator that allows you to open the configuration page.
13+
### Using Flow Launcher Settings
1614

17-
Now, to input the software download paths and storage file addresses, you would use the following format as an example:
15+
1. **Open Flow Launcher Settings**:
1816

19-
```plaintext
20-
VISUAL_STUDIO_CODE_DOWNLOAD=D:/VSCode/bin/code
17+
- Launch Flow Launcher.
18+
- Navigate to the settings page where plugins are managed.
19+
2. **Locate the Plugin**:
2120

22-
VISUAL_STUDIO_CODE_STORAGE=C:/Users/YourUsername/AppData/Roaming/Code/User/globalStorage/storage.json
21+
- Find the `RecentProjectsOpen` plugin in the list of installed plugins.
22+
3. **Access Configuration Options**:
2323

24-
ANDROID_STUDIO_DOWNLOAD=D:/Android Studio/bin/studio64.exe
24+
- Click on the plugin to access its configuration options. Look for a settings icon or similar indicator to open the configuration page.
25+
4. **Input Software Paths and Storage Addresses**:
2526

26-
ANDROID_STUDIO_STORAGE=C:/Users/YourUsername/AppData/Roaming/Google/AndroidStudio2024.1/options/recentProjects.xml
27+
- Use the following format to input the paths for your IDEs and their storage files. Replace `YourUsername` with your actual Windows username.
2728

28-
INTELLIJ_IDEA_DOWNLOAD=D:/IntelliJ IDEA 2024.3/bin/idea64.exe
29+
```plaintext
30+
VISUAL_STUDIO_CODE_DOWNLOAD=D:/VSCode/bin/code
31+
VISUAL_STUDIO_CODE_STORAGE=C:/Users/YourUsername/AppData/Roaming/Code/User/globalStorage/storage.json
32+
ANDROID_STUDIO_DOWNLOAD=D:/Android Studio/bin/studio64.exe
33+
ANDROID_STUDIO_STORAGE=C:/Users/YourUsername/AppData/Roaming/Google/AndroidStudio2024.1/options/recentProjects.xml
34+
INTELLIJ_IDEA_DOWNLOAD=D:/IntelliJ IDEA 2024.3/bin/idea64.exe
35+
INTELLIJ_IDEA_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/IntelliJIdea2024.3/options/recentProjects.xml
36+
GOLAND_DOWNLOAD=D:/goland/GoLand 2023.2/bin/goland64.exe
37+
GOLAND_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/GoLand2023.2/options/recentProjects.xml
38+
CLION_DOWNLOAD=D:/Clion/CLion 2024.1.4/bin/clion64.exe
39+
CLION_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/CLion2024.1/options/recentProjects.xml
40+
CURSOR_DOWNLOAD=C:/Users/YourUsername/AppData/Local/Programs/cursor/Cursor.exe
41+
CURSOR_STORAGE=C:/Users/YourUsername/AppData/Roaming/Cursor/globalStorage/storage.json
42+
```
2943

30-
INTELLIJ_IDEA_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/IntelliJIdea2024.3/options/recentProjects.xml
44+
### Directly Editing the Configuration File
3145

32-
GOLAND_DOWNLOAD=D:/goland/GoLand 2023.2/bin/goland64.exe
46+
If you prefer to configure the plugin directly via the configuration file, follow these steps:
3347

34-
GOLAND_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/GoLand2023.2/options/recentProjects.xml
48+
1. **Locate the Configuration File**:
3549

36-
CLION_DOWNLOAD=D:/Clion/CLion 2024.1.4/bin/clion64.exe
50+
- The plugin's configuration file is located at:
51+
```
52+
C:\Users\YourUsername\AppData\Local\FlowLauncher\app-1.19.3\UserData\Plugins\RecentProjectsOpen-1.0.0\plugin\.env
53+
```
54+
- Replace `YourUsername` with your actual Windows username.
55+
2. **Edit the File**:
3756
38-
CLION_STORAGE=C:/Users/YourUsername/AppData/Roaming/JetBrains/CLion2024.1/options/recentProjects.xml
39-
```
57+
- Open the `.env` file with a text editor (e.g., Notepad, Visual Studio Code).
58+
- Add or modify the paths for your IDEs and their storage files as shown in the example above.
59+
3. **Save and Restart**:
60+
61+
- Save the changes and restart Flow Launcher to apply the new configuration.
62+
63+
### Tips
4064
41-
Replace `YourUsername` with your actual Windows username to point to the correct directories. These paths are essential for the plugin to function correctly by opening the appropriate IDEs and accessing their recent projects.
65+
- **Verify Paths**: Ensure that the paths you enter are correct and that the files or executables exist at those locations.
66+
- **Permissions**: Make sure that Flow Launcher has the necessary permissions to access the specified directories and files.
67+
- **Backup**: Before making changes to the `.env` file, create a backup copy in case you need to revert to the original settings.
4268
4369
## Usage
4470
@@ -52,6 +78,7 @@ ABBREVIATE = {
5278
"go": "GOLAND",
5379
"in": "INTELLIJ_IDEA",
5480
"as": "ANDROID_STUDIO",
81+
"cur":"CURSOR"
5582
}
5683
```
5784

@@ -69,18 +96,8 @@ r vsc 空
6996

7097
![1733284760505](image/README/1733284760505.png)
7198

72-
## TODO
73-
74-
IDE
75-
76-
* [X] Vscode
77-
* [X] Jetbrains
78-
* [X] Android Studio
79-
* [ ] Visual Studio
80-
* [ ] Aseprite
81-
82-
feature
99+
## feature
83100

84-
* [X] fuzzy search
85-
* [X] support pinyin
86-
* [X] prevent configurations from disappearing after updates
101+
- [X] fuzzy search
102+
- [X] support pinyin
103+
- [X] prevent configurations from disappearing after updates

SettingsTemplate.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
name: VISUAL_STUDIO_CODE_DOWNLOAD
88
label: VISUAL_STUDIO_CODE_DOWNLOAD
99
description: Please enter the download location of VISUAL_STUDIO_CODE
10-
defaultValue:
10+
defaultValue:
1111
- type: input
1212
attributes:
1313
name: VISUAL_STUDIO_CODE_STORAGE
@@ -74,3 +74,15 @@ body:
7474
label: CLION_STORAGE
7575
description: Please enter the STORAGE location of CLION
7676
defaultValue:
77+
- type: input
78+
attributes:
79+
name: CURSOR_DOWNLOAD
80+
label: CURSOR_DOWNLOAD
81+
description: Please enter the download location of CURSOR
82+
defaultValue:
83+
- type: input
84+
attributes:
85+
name: CURSOR_STORAGE
86+
label: CURSOR_STORAGE
87+
description: Please enter the STORAGE location of CURSOR
88+
defaultValue:

icons/cur_icon.png

62.7 KB
Loading

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "RecentProjectsOpen",
55
"Description": "A plugin that allows users to quickly open recent projects with ease.",
66
"Author": "Attack825",
7-
"Version": "1.0.0",
7+
"Version": "1.1.0",
88
"Language": "python",
99
"Website": "https://github.com/Attack825/RecentProjectsOpen",
1010
"IcoPath": "icons/app.png",

plugin/application/factory.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
Pycharm,
99
)
1010
from .vscode_application import (
11+
Cursor,
1112
Vscode,
1213
)
1314

@@ -38,6 +39,8 @@ def create_app(cls, name: str, download_path: str, storage_file: str):
3839
return Clion(name, download_path, storage_file)
3940
elif name == "VISUAL_STUDIO_CODE":
4041
return Vscode(name, download_path, storage_file)
42+
elif name == "CURSOR":
43+
return Cursor(name, download_path, storage_file)
4144
else:
4245
raise NotImplementedError("Invalid product")
4346
except FileNotFoundError as e:

plugin/application/vscode_application.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ def get_projects(self) -> List[Project]:
4343
projects.append(project)
4444

4545
return projects
46+
47+
48+
class Cursor(Vscode):
49+
def __init__(self, name: str, download_path: str, storage_file: str):
50+
super().__init__(name, download_path, storage_file)
51+
self.name = "cur"

plugin/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def get_logger(log_path=None):
5656
"CLION_STORAGE": os.getenv("CLION_STORAGE", ""),
5757
"PYCHARM_DOWNLOAD": os.getenv("PYCHARM_DOWNLOAD", ""),
5858
"PYCHARM_STORAGE": os.getenv("PYCHARM_STORAGE", ""),
59+
"CURSOR_DOWNLOAD": os.getenv("CURSOR_DOWNLOAD", ""),
60+
"CURSOR_STORAGE": os.getenv("CURSOR_STORAGE", ""),
5961
}
6062

6163

plugin/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"go": "GOLAND",
2323
"in": "INTELLIJ_IDEA",
2424
"as": "ANDROID_STUDIO",
25+
"cur": "CURSOR",
2526
}
2627

2728

plugin/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
"CLION_STORAGE": str,
1616
"PYCHARM_DOWNLOAD": str,
1717
"PYCHARM_STORAGE": str,
18+
"CURSOR_DOWNLOAD": str,
19+
"CURSOR_STORAGE": str,
1820
},
1921
)

test/test_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def cmd_command(command: List[str]):
1111
if __name__ == "__main__":
1212
cmd_command(
1313
[
14-
"D:/IntelliJ IDEA 2024.3/bin/idea64.exe",
15-
"D:/Project/CloneProject/JavaProject/LeetcodeHot",
14+
"C:/Users/xuwenjie/AppData/Local/Programs/cursor/Cursor.exe",
15+
"D:/Project/CloneProject/PythonProject/langchain",
1616
],
1717
)

0 commit comments

Comments
 (0)