Skip to content
emacs-navigation logo

Emacs Navigation Skill

emacs-navigation

Use when navigating files and positions in Emacs - provides elisp patterns for finding files, searching, and position management

SKILL.md

Full skill instructions

Emacs Navigation Skill

Display Guidelines

E-ink Monitor Compatibility: User uses an e-ink monitor that only supports black, white, and grey.

  • NEVER use colors (:foreground "red", :foreground "cyan", etc.)
  • Use :weight bold, :weight light, :slant italic, :underline t for differentiation
  • Standard Emacs faces (font-lock-*-face) are acceptable as they adapt to themes

File Navigation

Open file

(find-file "/​path/​to/​file")
(find-file-noselect "/​path/​to/​file")  ; open without switching

Find file in project

(project-find-file)  ; interactive
(project-root (project-current))  ; get project root

Recent files

recentf-list  ; list of recent files
(recentf-open-files)  ; interactive

Position Navigation

Line navigation

(goto-line 42)
(forward-line n)  ; move n lines (negative goes backward)
(beginning-of-line)
(end-of-line)

Character navigation

(goto-char position)
(forward-char n)
(backward-char n)

Word navigation

(forward-word)
(backward-word)

Search Navigation

Search forward

(search-forward "text" nil t)  ; returns nil if not found
(re-search-forward "regex" nil t)

Search backward

(search-backward "text" nil t)
(re-search-backward "regex" nil t)

Search with bounds

(re-search-forward "pattern" limit-pos t)  ; stop at limit-pos

Save/​Restore Positions

save-excursion

(save-excursion
  (goto-char (point-min))
  (search-forward "target")
  ;; point restored after body
  )

save-restriction

(save-restriction
  (narrow-to-region start end)
  ;; work with narrowed buffer
  )  ; narrowing restored

Markers

(point-marker)  ; marker at current point
(set-marker marker position)
(marker-position marker)
(goto-char marker)

Window Navigation

Switch windows

(other-window 1)  ; next window
(select-window window)

Find window

(get-buffer-window "*buffer*")
(selected-window)

Split windows

(split-window-right)
(split-window-below)
(delete-window)

Match Data

After successful search

(re-search-forward "\\(group1\\).*\\(group2\\)")
(match-string 1)  ; first group
(match-string 2)  ; second group
(match-beginning 0)  ; start of full match
(match-end 0)  ; end of full match

Common Patterns

Find and process all matches

(save-excursion
  (goto-char (point-min))
  (while (re-search-forward "pattern" nil t)
    ;; process each match
    (let ((matched (match-string 0)))
      ;; do something
      )))

Navigate to specific file and line

(let ((file "/​path/​to/​file")
      (line 42))
  (find-file file)
  (goto-char (point-min))
  (forward-line (1- line)))  ; lines are 1-indexed

Narrow to function/​section

(save-restriction
  (org-narrow-to-subtree)  ; or narrow-to-defun
  ;; work within narrowed region
  (point-min)  ; now returns subtree start
  )

Visit file at point

(find-file-at-point)  ; interactive
(ffap-file-at-point)  ; get filename at point

Directory Navigation

Default directory

default-directory  ; current directory
(cd "/​new/​path")

List directory

(directory-files "/​path")
(directory-files "/​path" t "\\.el$")  ; full paths, only .el files

Walk directory tree

(directory-files-recursively "/​path" "\\.org$")

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View