Skip to content

About

This project redefines the default word navigation and deletion behavior in Emacs, providing a more intuitive way to move through and manipulate text.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Cursor Ops for Emacs

Cursor Ops is an Emacs plugin that enhances cursor movement and text manipulation in the buffer, providing intelligent operations with words, special characters, and spaces for both navigation and deletion.


Features

  • Advanced cursor movement

    • cursor-ops--forward-expr — moves the cursor forward over sequences of alphanumeric characters, special characters, or spaces.
    • cursor-ops--backward-expr — moves the cursor backward over sequences of alphanumeric characters, special characters, or spaces.
  • Intelligent deletion

    • cursor-ops--forward-delete-expr — deletes forward following the same sequence rules.
    • cursor-ops--backward-delete-expr — deletes backward following the same sequence rules.
    • cursor-ops--delete-lines — deletes entire lines or the active region if a selection exists, preserving column position.
  • Keyboard shortcuts

    • left-word → intelligent backward navigation
    • right-word → intelligent forward navigation
    • backward-kill-word → intelligent backward deletion
    • kill-word → intelligent forward deletion
    • C-S-<backspace> → delete entire lines
    • <home> → move to the beginning of the text on the line (ignoring leading spaces)

Installation

  1. Save the file cursor-ops.el in a directory of your choice, for example:
~/.emacs.d/plugins/cursor-ops.el
  1. Add the directory to your load-path in init.el or .emacs:
(load-file (concat user-emacs-directory "plugins/cursor-ops.el"))
  1. Load the plugin
(global-cursor-ops-mode 1)

Usage

  • Navigation: Use left-word (ctrl + ) and right-word (ctrl + ) to move intelligently between words, special characters, and spaces.
  • Deletion: Use backward-kill-word (ctrl + ) and kill-word (ctrl + ) to delete intelligently in the same segments as the movement.
  • Delete entire lines: Press C-S-.
  • Go to beginning of line text: Press .

Motivation

The plugin was created to provide more natural movement and deletion in Emacs, taking into account sequences of special characters, spaces, and alphanumeric words consistently — something that Emacs does not do by default.

Contributing

Pull requests are welcome! For suggestions or issues, please open an issue in the repository.

About

This project redefines the default word navigation and deletion behavior in Emacs, providing a more intuitive way to move through and manipulate text.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages