Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
75b036b
Add CLAUDE.md to provide guidance for Claude Code
lambdalisue Jul 5, 2025
6bdfbe0
feat(source): add window source for listing Vim windows
lambdalisue Jul 6, 2025
ad2d410
feat(source): add tabpage source for listing Vim tab pages
lambdalisue Jul 6, 2025
9004a59
feat(source): add loclist source for listing location list items
lambdalisue Jul 6, 2025
d337686
feat(source): add colorscheme source for listing available colorschemes
lambdalisue Jul 6, 2025
d8a627c
feat(source): add highlight source for listing highlight groups
lambdalisue Jul 6, 2025
33e58cd
feat(source): add jumplist source for listing jump locations
lambdalisue Jul 6, 2025
fd1a7c8
feat(source): add register source for listing Vim registers
lambdalisue Jul 6, 2025
5006534
feat(source): add mark source for listing Vim marks
lambdalisue Jul 6, 2025
1c0e825
feat(source): add command source for listing user-defined commands
lambdalisue Jul 6, 2025
9c39f46
feat(source): add mapping source for listing key mappings
lambdalisue Jul 6, 2025
e8f21f1
feat(source): add git status source for listing modified files
lambdalisue Jul 6, 2025
881a059
feat(source): add grep source for vim's :grep command results
lambdalisue Jul 6, 2025
c3bf51b
feat(source): add vimgrep source for vim's :vimgrep command results
lambdalisue Jul 6, 2025
89e0265
feat(source): add autocmd source for vim autocmds
lambdalisue Jul 6, 2025
c74961d
feat(previewer): add shell command previewer
lambdalisue Jul 6, 2025
bfba569
feat(renderer): add file info renderer for displaying file metadata
lambdalisue Jul 6, 2025
8090011
feat(renderer): add buffer info renderer for displaying buffer metadata
lambdalisue Jul 6, 2025
0f0a8f2
feat(renderer): add smart grep renderer for formatting grep-like results
lambdalisue Jul 6, 2025
e9a3319
feat(refiner): add file info refiner for filtering by file properties
lambdalisue Jul 6, 2025
c166b92
feat(refiner): add buffer info refiner for filtering by buffer proper…
lambdalisue Jul 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This file provides guidance to Claude Code (claude.ai/code) when working with
code in this repository.

## Project Overview

This is `@vim-fall/std`, the standard library for Fall - a fuzzy finder plugin for Vim/Neovim powered by Denops. The project provides built-in extensions and utility functions for the Fall ecosystem, written in Deno/TypeScript.
This is `@vim-fall/std`, the standard library for Fall - a fuzzy finder plugin
for Vim/Neovim powered by Denops. The project provides built-in extensions and
utility functions for the Fall ecosystem, written in Deno/TypeScript.

## Key Commands

### Development

- **Type check**: `deno task check` - Run TypeScript type checking
- **Test**: `deno test -A --parallel --shuffle --doc` - Run all tests
- **Test single file**: `deno test -A path/to/file_test.ts` - Run specific test file
- **Test with coverage**: `deno task test:coverage` - Run tests with coverage collection
- **Test single file**: `deno test -A path/to/file_test.ts` - Run specific test
file
- **Test with coverage**: `deno task test:coverage` - Run tests with coverage
collection
- **Lint**: `deno lint` - Run Deno linter
- **Format**: `deno fmt` - Auto-format code
- **Format check**: `deno fmt --check` - Check formatting without modifying

### Code Generation

- **Generate all**: `deno task gen` - Run all code generation tasks
- **Generate modules**: `deno task gen:mod` - Generate module files in each directory
- **Generate modules**: `deno task gen:mod` - Generate module files in each
directory
- **Generate exports**: `deno task gen:exports` - Generate export declarations
- **Generate nerdfont**: `deno task gen:builtin-renderer-nerdfont` - Generate nerdfont icon mappings
- **Generate nerdfont**: `deno task gen:builtin-renderer-nerdfont` - Generate
nerdfont icon mappings

### Dependencies

- **Update check**: `deno task update` - Check for dependency updates
- **Update write**: `deno task update:write` - Update dependencies in place
- **Update commit**: `deno task update:commit` - Update and commit dependency changes
- **Update commit**: `deno task update:commit` - Update and commit dependency
changes

### Publishing

Expand All @@ -45,7 +53,8 @@ The codebase follows a plugin-based architecture with these core concepts:

- **Actions**: Operations performed on selected items (open, yank, cd)
- **Coordinators**: UI layout managers (compact, modern, separate)
- **Curators**: Search/filter tools wrapping external commands (grep, ripgrep, git-grep)
- **Curators**: Search/filter tools wrapping external commands (grep,
ripgrep, git-grep)
- **Matchers**: Fuzzy matching algorithms (fzf, regexp, substring)
- **Previewers**: Item preview handlers (file, buffer, helptag)
- **Refiners**: Item transformation/filtering tools
Expand All @@ -56,8 +65,10 @@ The codebase follows a plugin-based architecture with these core concepts:

2. **Core APIs** (in root):

- Each extension type has a corresponding definition file (e.g., `action.ts`, `source.ts`)
- These files define the interface and helper functions for that extension type
- Each extension type has a corresponding definition file (e.g., `action.ts`,
`source.ts`)
- These files define the interface and helper functions for that extension
type
- The `mod.ts` file re-exports utility functions for composing extensions

3. **Denops Integration**:
Expand All @@ -67,10 +78,12 @@ The codebase follows a plugin-based architecture with these core concepts:

### Key Patterns

1. **Extension Definition**: Use `define*` functions (e.g., `defineAction`, `defineSource`)
1. **Extension Definition**: Use `define*` functions (e.g., `defineAction`,
`defineSource`)
2. **Composition**: Use `compose*` functions to combine multiple extensions
3. **Type Safety**: Extensive use of TypeScript generics for item detail types
4. **Async/Streaming**: Sources use async generators for efficient data streaming
4. **Async/Streaming**: Sources use async generators for efficient data
streaming
5. **Parameter Binding**: `ArgsBinder` pattern for flexible parameter handling

### Testing Approach
Expand All @@ -83,7 +96,8 @@ The codebase follows a plugin-based architecture with these core concepts:
### Libraries

- Use `@core/unknownutil` for type-guarding unknown types
- Note that if you use `@denops/std/function`, some functions already provides proper types so you may not need to use `@core/unknownutil`
- You should try hard to avoid using `as any` or `as unkonwn as`. Proper type-guarding is preferred.
- Note that if you use `@denops/std/function`, some functions already provides
proper types so you may not need to use `@core/unknownutil`
- You should try hard to avoid using `as any` or `as unkonwn as`. Proper
type-guarding is preferred.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes applied to this file should be commited in the previous commit.

- Use `@denops/std` for Vim/Neovim API access.

1 change: 1 addition & 0 deletions builtin/source/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export * from "./list.ts";
export * from "./noop.ts";
export * from "./oldfiles.ts";
export * from "./quickfix.ts";
export * from "./window.ts";
78 changes: 78 additions & 0 deletions builtin/source/window.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import * as fn from "@denops/std/function";

import { defineSource, type Source } from "../../source.ts";

type Detail = {
/**
* Window ID
*/
winid: number;

/**
* Window number
*/
winnr: number;

/**
* Tab number
*/
tabnr: number;

/**
* Buffer number in the window
*/
bufnr: number;

/**
* Buffer name in the window
*/
bufname: string;
};

export type WindowOptions = {
/**
* Whether to include windows from all tab pages.
* If false, only windows from the current tab page are included.
* @default false
*/
allTabs?: boolean;
};

/**
* Creates a Source that generates items from Vim windows.
*
* This Source retrieves window information from the current tab page or all tab pages
* and generates items for each window with details about the window and its buffer.
*
* @param options - Options to customize window listing.
* @returns A Source that generates items representing windows.
*/
export function window(options: Readonly<WindowOptions> = {}): Source<Detail> {
const allTabs = options.allTabs ?? false;
return defineSource(async function* (denops, _params, { signal }) {
const wininfos = await fn.getwininfo(denops);
signal?.throwIfAborted();

// Filter windows based on allTabs option
const currentTabnr = allTabs ? 0 : await fn.tabpagenr(denops);
const filteredWininfos = allTabs
? wininfos
: wininfos.filter((w) => w.tabnr === currentTabnr);

let id = 0;
for (const wininfo of filteredWininfos) {
const bufname = await fn.bufname(denops, wininfo.bufnr);
yield {
id: id++,
value: bufname || `[No Name] (${wininfo.winnr})`,
detail: {
winid: wininfo.winid,
winnr: wininfo.winnr,
tabnr: wininfo.tabnr,
bufnr: wininfo.bufnr,
bufname: bufname,
},
};
}
});
}