RepositoryRubyBEBỉ
AndrewRadev

AndrewRadev/sideways.vim

A Vim plugin to move function arguments (and other delimited-by-something items) left and right.

487sao
8fork
12issue
1lượt xem

🔄 Di chuyển đối số trong Vim — sideways.vim

:SidewaysLeft và :SidewaysRight — hoán vị nhanh các mục phân cách mà không rời bàn phím.

sideways.vim là plugin Vim cho phép di chuyển các mục được phân cách bởi dấu phẩy, dấu chấm phẩy, hoặc bất kỳ ký tự phân cách nào sang trái hoặc phải. Plugin hoạt động trên nhiều ngôn ngữ lập trình — từ Python, Ruby, JavaScript, Go, Rust đến LaTeX, HTML, CSS, Elixir, Cucumber. Điểm đặc biệt là plugin nhận diện đúng cấu trúc lồng nhau, nên bạn có thể di chuyển cả danh sách con bên trong danh sách cha chỉ bằng cách đặt con trỏ vào đúng vị trí.

✨ Điểm nổi bật

  • Hoán vị đối số: :SidewaysLeft/:SidewaysRight đổi chỗ các phần tử liền kề dựa trên delimiter (dấu phẩy, dấu chấm phẩy, khoảng trắng...).
  • Hỗ trợ đa ngôn ngữ: Python, Ruby, Go, Rust, C++, JavaScript, Elixir, OCaml, TypeScript, LaTeX, HTML, CSS, Handlebars, Cucumber, Vim settings.
  • Cấu trúc lồng nhau: Di chuyển được cả danh sách con bên trong danh sách cha — plugin nhận diện đúng nested brackets.
  • Text object tích hợp: Cung cấp <Plug>SidewaysArgumentTextobjA (outer) và <Plug>SidewaysArgumentTextobjI (inner) để daa, cia, yaa trên một argument.
  • Chèn/xoá phần tử: 4 mapping <Plug>SidewaysArgumentInsertBefore/After/First/Last để thêm mục vào danh sách.
  • Di chuyển con trỏ: :SidewaysJumpLeft/:SidewaysJumpRight nhảy nhanh giữa các mục.
  • Ruby method call không dấu ngoặc: link_to user_registration_path, 'Something' → link_to 'Something', user_registration_path.
  • Cấu hình được: Hỗ trợ mở rộng cho các loại delimiter mới qua :help sideways-customization.

💡 Vì sao đáng chú ý

sideways.vim giải quyết một thao tác sửa đổi mã rất thường gặp — đổi chỗ đối số, thuộc tính, hoặc phần tử trong danh sách — mà không cần dùng chuột hay thao tác cắt-dán thủ công. Thay vì select từng từ rồi di chuyển, bạn chỉ đặt con trỏ lên mục cần đổi và thực thi một lệnh duy nhất. Plugin hỗ trợ cả trường hợp đặc biệt như template Rust, C++ template, CSS declarations, HTML attributes — nơi mà việc hoán vị thủ công dễ sai và mất thời gian. Kết hợp với text object, bạn có thể dùng daa để xoá một argument hoặc cia để thay đổi nội dung nó, biến sideways.vim thành công cụ refactoring nhỏ gọn nhưng hiệu quả trong workflow hàng ngày.


#Vim #Refactoring #TextObject #Plugin #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryRuby
AndrewRadev/sideways.vim

A Vim plugin to move function arguments (and other delimited-by-something items) left and right.

487
Oct 8, 2026
RepositoryVim Script
AndrewRadev/splitjoin.vim

Switch between single-line and multiline forms of code

2.0k
Oct 1, 2026
RepositoryRuby
AndrewRadev/switch.vim

A simple Vim plugin to switch segments of text with predefined replacements

764
Oct 18, 2026
Repository
sindresorhus/awesome

😎 Awesome lists about all kinds of interesting topics [NOTE: Pull requests are temporarily disabled until I have a chance to catch up with the existing ones]

546.4k
Sep 2, 2026
Repository
x1xhlol/system-prompts-and-models-of-ai-tools

FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Trae, Traycer AI, VSCode Agent, Warp.dev, Windsurf, Xcode, Z.ai Code, Dia & v0. (And other Open Sourced) System Prompts, Internal Tools & AI Models

145.0k
Oct 12, 2026
RepositoryJavaScript
Leonxlnx/taste-skill

Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages

124.6k
Nov 26, 2026
RepositoryJavaScript
addyosmani/agent-skills

Production-grade engineering skills for AI coding agents.

122.0k
Nov 24, 2026
RepositoryPython
Panniantong/Agent-Reach

Give your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.

116.7k
Nov 24, 2026
RepositoryRuby
kilimchoi/engineering-blogs

A curated list of engineering blogs

39.1k
Aug 21, 2024