Skip to content

Commit 952a563

Browse files
committed
README Tweaks
1 parent f6ed8fe commit 952a563

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

README.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,25 @@ Fast, typesafe, Vim plugins with the power of Swift!
44

55
SwiftForVim integrates the Swift Programming Language into Vim.
66

7-
## Usage
8-
9-
First, generate a Vim Plugin setup to use Swift.
10-
```
11-
git clone https://github.com/swift-vim/SwiftForVim.git
12-
cd SwiftForVim
13-
plugin_path=/path/to/MyAwesomePlugin make generate
14-
```
15-
16-
Then, build the plugin
17-
```
18-
cd /path/to/MyAwesomePlugin
19-
make
20-
```
21-
22-
Last, setup the plugin like any other vim plugin ( i.e. with Pathogen ).
23-
247
## Vim API
258

269
### Vim
2710

2811
Vimscript <-> Swift
2912

3013
Calling Vim commands from Swift
31-
```
14+
```swift
3215
Vim.command("echo 'Hello World!'")
3316
```
3417

3518
Evaluating Vim expressions from Swift
36-
```
19+
```swift
3720
let path = String(Vim.eval("expand('%:p')"))
3821
```
3922

4023
Call Swift functions from Vim
4124

42-
```
25+
```swift
4326
VimPlugin.setCallable("cursorMoved") {
4427
_ in
4528
print("The cursor moved")
@@ -53,7 +36,7 @@ call s:SwiftVimEval("MyAwesomePlugin.invoke('cursorMoved')")
5336

5437
Threading and Async support for Vim
5538

56-
```
39+
```swift
5740
DispatchQueue.async {
5841
// Do some work
5942
VimTask.onMain {
@@ -64,6 +47,23 @@ DispatchQueue.async {
6447

6548
_Note: VimAsync depends on Foundation. Its not needed for basic, single threaded plugins._
6649

50+
## Usage
51+
52+
First, generate a Vim Plugin setup to use Swift.
53+
```bash
54+
git clone https://github.com/swift-vim/SwiftForVim.git
55+
cd SwiftForVim
56+
plugin_path=/path/to/MyAwesomePlugin make generate
57+
```
58+
59+
Then, build the plugin.
60+
```bash
61+
cd /path/to/MyAwesomePlugin
62+
make
63+
```
64+
65+
Last, setup the plugin ( VimPlug, Pathogen, etc ).
66+
6767
## Design Goals
6868

6969
Portable, fast, and simple to use.
@@ -81,8 +81,3 @@ The source tree contains a very basic example and test case.
8181

8282
[SwiftPackageManger.vim](https://github.com/swift-vim/SwiftPackageManager.vim) is the canonical use case and uses [VimAsync](#VimAsync) to run a custom RPC service inside of vim.
8383

84-
85-
## Contributing
86-
87-
Contributions welcome :)
88-

0 commit comments

Comments
 (0)