Table of Contents#
- What is AMP?
- Key Features that Make AMP Shine
- Installing AMP on Your Linux System
- Getting Started: Your First Steps with AMP
- Configuration: Making AMP Your Own
- AMP vs. Vim: A Brief Comparison
- Conclusion
- References
What is AMP?#
AMP is an open-source text editor written in Rust, a language known for its performance and safety. It's specifically designed for use in the terminal. The project's goal is not to be a 100% clone of Vim but to be a "spiritual successor" that embraces the same core principles:
- Keyboard-Driven Efficiency: Minimize reliance on the mouse.
- Modal Editing: Different modes for different tasks (inserting text vs. commanding the editor).
- Composability: Commands can be combined for powerful text manipulation.
By building on modern foundations, AMP avoids some of the legacy complexities of Vim and offers a cleaner, more approachable starting point.
Key Features that Make AMP Shine#
Modal Editing: The Heart of Vim#
Like Vim, AMP operates primarily through modes:
- Normal Mode: This is the default mode when you open a file. You don't type text here; instead, you navigate and issue commands (e.g.,
ddto delete a line,pto paste). - Insert Mode: In this mode, your keystrokes insert text into the document, just like in a standard editor. You enter Insert mode from Normal mode by pressing keys like
i(insert) ora(append). - Visual Mode: Used for selecting text. You can select characters, lines, or blocks.
This separation is the key to Vim's speed, and AMP implements it beautifully.
Sensible Defaults#
One of Vim's biggest hurdles is that its default configuration is very bare-bones. AMP takes a different approach. It comes with useful features enabled out-of-the-box, such as line numbers, syntax highlighting for many languages, and a clean, informative status bar. This means you can be productive immediately without spending hours on initial setup.
Built-in Package Manager#
While Vim has a vast ecosystem of plugins managed by third-party tools like Vim-Plug or Pathogen, AMP includes a built-in package manager. You can easily discover, install, and manage extensions directly from within the editor, streamlining the process of adding new functionality.
Syntax Highlighting and LSP Support#
AMP supports syntax highlighting for a wide array of programming languages. More importantly, it has built-in support for the Language Server Protocol (LSP). This is a game-changer, as it provides modern IDE-like features such as:
- Auto-completion
- Go-to-definition
- Real-time error checking (diagnostics)
- Refactoring tools Setting up LSP in AMP is generally simpler than configuring similar capabilities in vanilla Vim.
Cross-Platform Compatibility#
While this blog focuses on Linux, AMP is truly cross-platform. It works seamlessly on macOS and Windows (via Windows Terminal or similar), ensuring a consistent editing experience across all your development machines.
Installing AMP on Your Linux System#
There are several ways to install AMP. The easiest method is using a package manager if it's available for your distribution.
Method 1: Using a Package Manager (Easiest)#
For Arch Linux and derivatives (Manjaro, etc.): AMP is available in the Arch User Repository (AUR).
# Using yay (or your preferred AUR helper)
yay -S ampFor other distributions (Ubuntu, Fedora, etc.): Check the official GitHub Releases page to see if a package is available for your distribution. Alternatively, use the pre-built binary method below.
Method 2: Pre-built Binary#
- Visit the AMP GitHub Releases page.
- Download the latest
amp-linux-x86_64binary. - Make the binary executable and move it to a directory in your
PATH(e.g.,~/.local/bin/).chmod +x amp-linux-x86_64 mv amp-linux-x86_64 ~/.local/bin/amp - Ensure
~/.local/binis in yourPATH. You can now run AMP by typingampin your terminal.
Method 3: Building from Source#
As AMP is written in Rust, you can build it from source using Cargo.
- Install Rust and Cargo from rustup.rs.
- Use Cargo to install AMP:
cargo install amp
This method will give you the absolute latest version from the main branch.
Getting Started: Your First Steps with AMP#
Let's open a file and learn the basics. Open your terminal and type:
amp myfile.txtBasic Modes and Navigation#
- You are in Normal Mode. You'll see a status bar at the bottom.
- To start typing, press
i. This switches you to Insert Mode. The status bar will change. Now, type some text. - To return to Normal Mode, press
Esc. This is the most important key! You always pressEscto get back to a state where you can issue commands. - Navigation in Normal Mode:
- Use
h,j,k,lfor left, down, up, right (the Vim way). - You can also use the arrow keys.
- Use
Essential Editing Commands#
All these commands are executed from Normal Mode.
- Deleting:
x: Delete the character under the cursor.dd: Delete (cut) the entire current line.dw: Delete from the cursor to the start of the next word.
- Undo/Redo:
u: Undo the last action.Ctrl+r: Redo.
- Copy/Paste (Yanking/Putting):
yy: Yank (copy) the current line.p: Put (paste) after the cursor.
- Search:
/followed by your search term andEnter: Search forward.n: Go to the next match.N: Go to the previous match.
Saving and Quitting#
:w+Enter: Write (save) the file.:q+Enter: Quit the editor.:wqor:x+Enter: Write and quit.:q!+Enter: Quit without saving (force quit).
Configuration: Making AMP Your Own#
AMP's configuration is a breath of fresh air compared to Vim's Vimscript. It uses a clean, human-readable YAML file.
The amp.yml File#
AMP looks for a configuration file at ~/.config/amp/amp.yml. You can create this file if it doesn't exist.
Example Configuration Snippets#
1. Changing the Theme:
# ~/.config/amp/amp.yml
colors:
theme: "solarized-dark" # Other options: "default", "solarized-light"2. Setting Indentation Preferences:
editor:
soft_tab: true # Insert spaces when pressing Tab
tab_size: 4 # Number of spaces per tab3. Enabling Line Number Relative:
editor:
line_numbers: relative # Shows relative line numbers, great for navigation4. Adding a Key Binding:
This example binds F5 to save the file, similar to other editors.
keys:
normal:
F5: ":w" # In Normal mode, F5 will execute the :w (write) commandAfter making changes to amp.yml, restart AMP for them to take effect.
AMP vs. Vim: A Brief Comparison#
| Feature | AMP | Vim |
|---|---|---|
| Philosophy | Modern, sensible defaults, easy setup | Power through customization, "built your own" |
| Configuration | YAML file (amp.yml) | Vimscript/Lua (.vimrc/init.lua) |
| Plugin Manager | Built-in | Third-party (Vim-Plug, Packer.nvim, etc.) |
| Language | Rust | C & Vimscript |
| Learning Curve | Easier for beginners, gentle introduction to modal editing | Steeper, but ultimate depth and control |
| Ecosystem | Growing, smaller | Massive, mature, incredibly vast |
Choose AMP if: You are new to modal editing, want a modern editor with great defaults, or value simplicity in configuration. Stick with Vim/Neovim if: You are already heavily invested in your Vim configuration, rely on specific plugins, or need its unparalleled depth and scripting capabilities.
Conclusion#
AMP successfully captures the spirit of Vim's efficient, modal editing paradigm and packages it in a modern, accessible, and user-friendly editor. It serves as an excellent gateway for newcomers to the world of keyboard-centric editing and a refreshing, minimalistic alternative for seasoned veterans.
Its sensible defaults, straightforward YAML configuration, and built-in package manager remove significant barriers to entry. While it may not yet have the decades of refinement and immense plugin ecosystem of Vim, its focused design and modern foundation make it a compelling choice for any Linux user who lives in the terminal.
Why not give it a try? Open your terminal, install AMP, and experience the power of modal editing without the initial friction.
References#
- Official AMP Website: https://amp.rs
- AMP GitHub Repository: https://github.com/jmacdonald/amp - The source code, issue tracker, and latest releases.
- AMP User Guide: https://amp.rs/guide - Comprehensive official documentation.
- The Language Server Protocol: https://microsoft.github.io/language-server-protocol/ - Learn more about LSP.
- Vim Adventures: https://vim-adventures.com/ - A fun way to learn Vim-like keybindings that are applicable to AMP.