An Emacs package for integrating with the omg.lol pastebin service. Create, retrieve, list, and delete pastes directly from Emacs with full API integration.
- ✅ Create/Update Pastes: From selected text, regions, or entire buffers
- ✅ Retrieve Pastes: View existing pastes in dedicated buffers
- ✅ List All Pastes: Browse all your pastes with previews and timestamps
- ✅ Delete Pastes: Remove pastes with confirmation prompts
- ✅ Configurable Settings: Customize API credentials, timeouts, and behavior
- ✅ Interactive Setup: Easy configuration wizard
- ✅ Error Handling: Comprehensive error reporting and user feedback
- ✅ Keyboard Shortcuts: Convenient key bindings for all operations
- Download
omglol-pastebin.eland place it in your Emacs load path - Add to your Emacs configuration:
(require 'omglol-pastebin)Before using the package, you need to configure your omg.lol credentials:
Run the interactive setup command:
M-x omglol-pastebin-setup
Add the following to your Emacs configuration:
(setq omglol-pastebin-address "your-address") ; Your omg.lol address (without @)
(setq omglol-pastebin-api-token "your-api-token") ; Your API token from https://home.omg.lol/account/api;; Customize base URL (usually not needed)
(setq omglol-pastebin-base-url "https://api.omg.lol")
;; Set request timeout (default: 30 seconds)
(setq omglol-pastebin-timeout 30)
;; Show URL after creating paste (default: t)
(setq omglol-pastebin-show-url-after-create t)| Command | Description |
|---|---|
M-x omglol-pastebin-create |
Create paste from region or buffer |
M-x omglol-pastebin-create-from-buffer |
Create paste from entire buffer |
M-x omglol-pastebin-create-from-region |
Create paste from selected region |
M-x omglol-pastebin-get |
Retrieve and view a specific paste |
M-x omglol-pastebin-list |
List all your pastes with previews |
M-x omglol-pastebin-delete |
Delete a paste (with confirmation) |
M-x omglol-pastebin-setup |
Configure credentials interactively |
Enable the minor mode to access convenient key bindings:
(omglol-pastebin-mode 1)| Key Binding | Command |
|---|---|
C-c p c |
Create paste |
C-c p b |
Create from buffer |
C-c p r |
Create from region |
C-c p g |
Get paste |
C-c p l |
List pastes |
C-c p d |
Delete paste |
C-c p s |
Setup/configure |
To enable the key bindings globally:
(omglol-pastebin-enable-globally)The package implements all four core omg.lol pastebin API endpoints:
- POST
/address/:address/pastebin/- Create or update pastes - GET
/address/:address/pastebin/:paste- Retrieve specific paste - GET
/address/:address/pastebin- List all pastes - DELETE
/address/:address/pastebin/:paste- Delete paste
Authentication is handled automatically using your configured API token.
;; Create a paste from selected text
(omglol-pastebin-create "my-code-snippet" "console.log('Hello World');")
;; Retrieve a paste
(omglol-pastebin-get "my-code-snippet")
;; List all pastes
(omglol-pastebin-list)
;; Delete a paste
(omglol-pastebin-delete "my-code-snippet")-
Share Code Snippets:
- Select code in your buffer
- Run
M-x omglol-pastebin-create-from-region - Enter a title when prompted
- The paste URL is automatically copied to your clipboard
-
Backup Buffer Content:
- Run
M-x omglol-pastebin-create-from-buffer - Enter a descriptive title
- Your entire buffer is saved as a paste
- Run
-
Browse Your Pastes:
- Run
M-x omglol-pastebin-list - View all pastes with timestamps and previews
- Use the paste names with
omglol-pastebin-getto view full content
- Run
The package includes comprehensive error handling:
- Configuration Errors: Clear messages when API token or address is missing
- Network Errors: Timeout handling and connection error reporting
- API Errors: Detailed error messages from the omg.lol API
- User Input Validation: Proper validation of paste names and content
- Emacs: Version 26.1 or later
- Dependencies: Built-in packages only (
url,json) - omg.lol Account: Required for API access
- API Token: Available from your omg.lol account settings
Based on the official omg.lol API documentation:
- Uses Bearer token authentication
- Token required for create, update, and delete operations
- Public read access available for individual pastes
- Base URL:
https://api.omg.lol - All requests use JSON format
- Standard HTTP status codes for responses
-
"API token is not set" error:
- Run
M-x omglol-pastebin-setupto configure credentials - Or manually set
omglol-pastebin-api-token
- Run
-
"Address is not set" error:
- Run
M-x omglol-pastebin-setupto configure credentials - Or manually set
omglol-pastebin-address
- Run
-
HTTP timeout errors:
- Check internet connection
- Increase
omglol-pastebin-timeoutvalue - Verify omg.lol service status
-
"Paste not found" errors:
- Verify paste name spelling
- Check if paste was deleted
- Ensure you're using the correct address
Enable debug mode for detailed HTTP request logging:
(setq url-debug t)Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- Initial release
- Full API integration (create, retrieve, list, delete)
- Interactive commands and key bindings
- Configuration system with setup wizard
- Comprehensive error handling
- Documentation and examples