Replace string by matching old_str (no line numbers needed)
remove
Delete entire file
chmod
Change file permissions (octal mode, e.g., "755")
Notes
Line numbers are 1-indexed (first line is line 1)
line_start and line_to are both inclusive (e.g., line_start=5 line_to=10 deletes lines 5-10, including both)
Filepath must be within working directory (cwd) and allowed_path config
For insert: line_start can be #lines+1 to append at end
For str_replace: old_str uses literal string matching (no regex/patterns), supports multi-line matching
For str_replace: by default, old_str must match exactly once; use replace_all=true to replace all occurrences
For str_replace: new_str can be empty to delete the matched text
For chmod: mode is an octal string (3 or 4 digits 0-7, e.g., "644", "755", "0755"); works on files and directories; implemented via vim.uv.fs_chmod (on Windows only the read-only bit is honored)
Use validate=true for code files to catch syntax errors (supports Lua and Python)
Use backup=true to create backup before modification (format: <filepath>.backup.<timestamp>)
Line endings: fileformat accepts unix (LF), dos (CRLF) or mac (CR); if omitted, the
existing file’s line endings are preserved automatically (modifying a CRLF file keeps CRLF),
new files default to unix. Use @file_info to check a file’s detected fileformat.