corgi-emacs / corgi

Unbundled Emacs configuration aimed at Clojure developers
181 stars 18 forks source link

What is the best way to refactor in corgi? #28

Closed davidh38 closed 2 years ago

davidh38 commented 2 years ago

Do you have any recomendations?

theophilusx commented 2 years ago

davidh38 @.***> writes:

Do you have any recomendations?

That is a pretty broad topic. You probably need to be more specific on exactly what type of refactoring you want to do.

Emacs itself has a lot of functionality which is useful for refactoring and there are numerous emacs packages that provide refactoring support for different languages. Adding additional packages is as simple as just adding them to your init.el file. You can add global or local menu items using your user-keys.el and user-signals.el files.

Corgi has setup some default menu items relating to refactoring for Clojure within the local mode menu (accessed by typing ', r' when in a clojure file). This should give you some ideas.

davidh38 commented 2 years ago

Ah, thank you!

theophilusx commented 2 years ago

Corgi is configured to have 2 'leader keys', SPC as a global leader key and comma (,) as a local leader key. So, when you are in 'normal' mode and you hit space, you will be presented with a list of global menus in the minibuffer. This list of menus will be the same regardless of what mode you are in.

The local leader key, the comma (,) will also present you with a list of menu keys in the minibuffer, but these are mode specific. You will get different menus/bindings depending on what mode you are in. One of the local mode menus is 'r' for 'refactor' and it will present you with a list of refactoring related menus or key bindings. What is in that list will depend on the programming mode you are in. You can also add to or change what bindings and menus are available by editing your user-keys.el and user-signals.el files.

The global and local leader keys are completely separate from the standard vim/evil states. So the sequence ', r', is completely separate from the vim/evil 'r' command.