Code Completion In Emacs - Everything You Need To Know

Gavin Freeborn
15 Oct 202216:56

Summary

TLDRIn this video, the creator discusses the evolution of code completion systems in text editors, focusing on transitioning from Vim to Emacs. They explore various Emacs native and plugin-based completion options, including Debrief, Hippie Expand, and the modern 'completion-at-point' function. The creator highlights the rise of Corfu, a minimalist and extensible completion system that feels native to Emacs, and demonstrates its features like in-buffer previews and integration with orderless. The video also touches on extending built-in completion with Cape and concludes with a shoutout to supporters.

Takeaways

  • πŸ˜€ The speaker initially praised Vim's powerful and flexible code completion system, which saved keystrokes and avoided bugs.
  • πŸ”§ When transitioning to Emacs, the speaker sought a native code completion system that was easy to customize and wouldn't become deprecated.
  • πŸ“š The Emacs landscape for code completion was initially intimidating, with many suggesting the use of 'company', a completion framework rather than a native solution.
  • 🌱 There has been a rise in the Emacs community towards using native features, leading to the development of plugins like Corfu for improved native completion.
  • πŸ› οΈ The script introduces various built-in Emacs completion methods, including 'debrief', 'hippie expand', and 'completion at point'.
  • πŸ”‘ 'Debrief' is a simple, out-of-the-box completion package in Emacs, offering basic functionality with customizable features.
  • πŸŽ›οΈ 'Hippie expand' is similar to 'debrief' but uses a list of functions to attempt completion, offering more flexibility.
  • πŸ”Ž 'Completion at point' is a more modern and general-purpose built-in feature, used by many modern plugins for completion.
  • 🌐 'Company' is a popular completion framework in Emacs, offering powerful features but lacking the native feel of Emacs.
  • πŸ† The speaker's preferred option is 'Corfu', a minimalist and native-feeling completion system that is highly extensible.
  • πŸ“ 'Cape' is introduced as a way to extend the built-in completion functionality, offering additional methods and features for completion.
  • πŸ“’ The speaker acknowledges the support from Patreon and GitHub sponsors, and invites viewers to join the community on Discord.

Q & A

  • What was the main reason the speaker switched to Emacs from Vim?

    -The speaker switched to Emacs because they wanted a code completion system similar to Vim's, which was powerful and flexible, and they were looking for something native and customizable within Emacs.

  • What does the speaker mean by 'native' in the context of code completion systems?

    -By 'native,' the speaker means a code completion system that is originally built into the editor, making it easier to customize and less likely to be deprecated over time.

  • What is the speaker's opinion on the use of completion frameworks like company in Emacs?

    -The speaker finds that completion frameworks like company do not take full advantage of Emacs' built-in features and are not as flexible or native as they would prefer.

  • What is Corfu and how does it relate to the speaker's preference for code completion in Emacs?

    -Corfu is a plugin in Emacs that provides a native, minimalist, and extensible code completion experience, which aligns with the speaker's preference for a system that feels integrated and customizable.

  • What are the built-in code completion options that the speaker mentions in Emacs?

    -The built-in code completion options mentioned by the speaker are 'debrief,' 'hippie expand,' 'completion-at-point,' and the use of 'mini buffer completion' with packages like vertico.

  • How does the speaker describe the functionality of 'debrief' in Emacs?

    -The speaker describes 'debrief' as a basic completion package in Emacs that offers simple functionality, such as expanding and cycling through options, but lacks advanced features.

  • What is 'hippie expand' and how does it differ from 'debrief'?

    -'Hippie expand' is a completion option in Emacs that is similar to 'debrief' but uses a list of functions to try and complete what the user is looking for, offering more flexibility in how it completes text.

  • What is the speaker's view on the use of 'completion-at-point' in Emacs?

    -The speaker views 'completion-at-point' as a modern and versatile built-in option in Emacs that can be extended and used by more advanced plugins for a better completion experience.

  • What is the purpose of the 'cape' package mentioned in the script?

    -The 'cape' package is used to extend the built-in 'completion-at-point' function in Emacs, allowing for additional functionality and customization of the completion process.

  • What are some of the features that the speaker appreciates in Corfu that make it their preferred choice for code completion in Emacs?

    -The speaker appreciates Corfu's native feel, its minimalist design, its extensibility, and features like in-buffer preview, dock echo, and the ability to integrate with 'orderless' for powerful completion.

  • What does the speaker suggest for users who want to further extend their code completion experience in Emacs?

    -The speaker suggests looking into packages like 'cape' to extend the built-in 'completion-at-point' functionality and customize it to their needs.

Outlines

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Mindmap

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Keywords

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Highlights

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Transcripts

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now
Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Code CompletionEmacs EditorVim FeaturesProductivityCustomizationHippie ExpandCompletion FrameworksCorfu PluginAuto-CompletionEmacs TipsProgramming Tools