aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 52a8a089a58c343149b184d31934d2d591199712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# nvim-jack-in

---
Jack in to CLJ & Leiningen REPLs from Neovim. Inspired by [vim-jack-in](https://github.com/clojure-vim/vim-jack-in)

## Installation

### Lazy

```lua
{'https://tangled.org/treybastian.com/nvim-jack-in', config = true}
```

#### Example with options

```lua
{
  'https://tangled.org/treybastian.com/nvim-jack-in',
  opts = {
      location = 'vsplit',
      force_powershell = true,
  },
  config = true,
}

```
### vim.pack 

```lua
vim.pack.add{'https://tangled.org/treybastian.com/nvim-jack-in', config = true}
require('nvim-jack-in').setup()
```

#### Example with options

```lua
vim.pack.add{'https://tangled.org/treybastian.com/nvim-jack-in', config = true}
require('nvim-jack-in').setup({
    location = 'vsplit',
    force_powershell = true,
})
```



### Options

#### `clj_dependencies`

Dependencies that should be injected into clj

##### Default

```lua
clj_dependencies = {
  { name = "nrepl/nrepl",       version = "RELEASE" },
  { name = "cider/cider-nrepl", version = "RELEASE" },
}
```

#### `clj_middleware`

Middleware that should be injected into clj

##### Default

```lua
clj_middleware = {
  "cider.nrepl/cider-middleware"
}
```

#### `lein_plugins`

Plugins that should be injected into leiningen

##### Default

```lua
lein_plugins = {
  { name = "cider/cider-nrepl", version = "RELEASE" },
}
```

#### `location`

Location where the REPL should open

##### Default

```lua
location = 'buffer'
```

##### Choices

`buffer` - opens REPL in a new buffer with focus
`background` - opens REPL in a new buffer but you stay focused on current buffer
`split` - opens REPL in new split
`vsplit` - opens REPL in new vertical split
`tab` - opens REPL in new tab

#### `force_powershell`

Force the usage of powershell. In windows setting `vim.o.shell = powershell` might sometimes not be optimal. Clj by default on windows is installed as a powershell module. This forces the plugin to use powershell.

##### Default

```lua
force_powershell = false
```

## Usage

This plugin automatically registers 2 commands `:Clj`and `:Lein` to start their respective REPLs

You can easily map these commands to a key.

```lua
vim.keymap.set("n", "<leader>rc", "<CMD>:Clj<CR>")
vim.keymap.net("n", "<leader>rl", "<CMD>:Lein<CR>")
```

You can supply additional arguments to the command. For example to use [Kit-Clj](https://kit-clj.github.io) development mode you can do.
`:Clj -A:dev`

## Contributing

This project is open source, not just public source.

To contribute email a git patch to patches@treybastian.com

I do not accept pull requests on any of my projects.