Skip to content

Emacs built in features

USAMI Kenta edited this page Nov 5, 2022 · 1 revision

This page describes useful Emacs built-in features for editing PHP code. PHP Mode is designed to work well with these Emacs built-in features.

Narrowing

Narrowing (GNU Emacs Manual)

When you are analyzing a long method in code reading, jumping out of the method by keyword search becomes a noise of understanding. Narrowing is a feature that allows you to display only specific parts of the buffer that you want to focus on.

If you execute M-x narrow-to-defun while visiting a method/function, you will only see that function on your screen.

Want to see other functions in the same file? please do not worry. Execute M-x widen to cancel narrowing.

Subword

Subword Movement (CC Mode Manual)

Subword is a concept to treat CamelCase as word delimiter. PHP Mode does not have subword-mode enabled by default, so run M-x subword-mode to enable it. In PHP Mode's standard keybindings, pressing C-c C-w toggles subword-mode on and off.

Clone this wiki locally