-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add a custom Project name? #848
Comments
+1, I have some projects for which I'd like to have a more meaningful name without having to change my directory structure. |
You could easily create a function for that, e.g: (defun my-own-project-name ()
;; Checks if Projectile is currently active, or this will ever run into undefinable errors.
(when (featurep 'projectile)
;; Checks if the file ".custom-project-name" is currently located in the project root.
(if (file-exists-p (concat (expand-file-name (projectile-project-root)) ".custom-project-name"))
;; If that's the case, write their contents into the buffer.
(with-temp-buffer
(insert-file-contents (concat (expand-file-name (projectile-project-root)) ".custom-project-name"))
(buffer-string))
;; If not, then extract the projectname.
(replace-regexp-in-string "/proj/\\(.*?\\)/.*"
"\\1"
(projectile-project-name))))) After evaluating the function above, create the file |
Thanks for the suggestion @ehartc, but it looks at least a bit more involved than that. In addition to replacing (with advice, I guess) the default implementation of edit Sorry, I see your suggestion was for the case of having a custom function to use e.g. in a snippet that would return a custom name or fall back to the projectile name. I understood this feature request to mean that projectile itself would support custom project names. |
The best way to implement this functionality would be simply to augment the existing project tracking. Basically there should be some function which allows you to name a project and it will be saved in the list of known projects as name + folder. All the code dealing with known projects should be updated to reflect this as well. Not a lot of work, but as usual - I'm pretty low on free time. |
+1. I work on WordPress websites, and the convention at my company is to use wp-content as the git root directory, so regardless of the project I'm working on, my mode line always says |
Is anyone except Batsov willing to look into Projectile source code? My Lisp knowhow is not enough for this. |
See #928 |
I use Yasnippet in pair with Projectile. Is there any way to prefer custom project names above the current project names?
For example in this Yasnippet:
Sometimes a project does have a unclear name, e.g. ws_project_fooBAR12. So I get unclear snippets. Is it possible to have any ability in Projectile to define custom project names?
The text was updated successfully, but these errors were encountered: