https://github.com/tenderlove/vim-to-rtf
Convert code to syntax highlighted RTF
https://github.com/tenderlove/vim-to-rtf
rtf vim
Last synced: 4 months ago
JSON representation
Convert code to syntax highlighted RTF
- Host: GitHub
- URL: https://github.com/tenderlove/vim-to-rtf
- Owner: tenderlove
- License: apache-2.0
- Created: 2024-06-06T04:41:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T22:29:30.000Z (about 2 years ago)
- Last Synced: 2025-08-29T02:19:27.247Z (10 months ago)
- Topics: rtf, vim
- Language: Vim Script
- Homepage:
- Size: 21.5 KB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vim to RTF
Converts the current buffer or visually selected text to syntax highlighted RTF
text and puts it in the paste buffer.
Watch it in action:
Inspired by [vim-copy-as-rtf](https://github.com/zerowidth/vim-copy-as-rtf).
I wrote this because I write code examples in Vim, and I want to paste them
in to Keynote but maintain the syntax highlighting. I've been using
vim-copy-as-rtf for years, but it uses a macOS utility called `textutil`, and
that utility has started giving me problems. vim-copy-as-rtf would convert
the source to HTML, then use `textutil` to convert the HTML to RTF. This
plugin directly converts the text to RTF without an intermediate HTML file.
## Installation
```
$ git submodule add https://github.com/tenderlove/vim-to-rtf.git pack/dist/start/vim-to-rtf
```
## Usage
Convert the entire buffer to RTF and put it in the paste buffer:
```
:ToRTF
```
To select lines and put in the paste buffer, just visual select, then do
```
:ToRTF
```
## Configuration
The default font it uses is `Courier`, but you can change it like this:
```vim
g:tortf_font = "SF Mono"
```
No font size is specified by default, but you can specify a font size like this:
```vim
g:tortf_font_size = 32
```