You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-27
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,20 @@ Neovim compiler for building and running your code without having to configure a
11
11
12
12
## Table of contents
13
13
14
+
-[Why](#why)
14
15
-[Supported languages](#supported-languages)
15
16
-[Required system dependencies](#required-system-dependencies)
16
17
-[How to install](#how-to-install)
17
-
-[Available commands](#available-commands)
18
+
-[Commands](#commands)
18
19
-[Basic usage](#how-to-use-basic-usage)
19
-
-[How to create a solution (advanced)](#how-to-create-a-solution-advanced)
20
-
-[Make (advanced)](#make-advanced)
20
+
-[Creating a solution (optional)](#creating-a-solution-optional)
21
+
-[Make](#make)
21
22
-[Quick start](#quick-start)
22
23
-[FAQ](#faq)
23
24
25
+
## Why
26
+
Those familiar with Visual Studio IDE will remember how convenient it was to just press a button and having your program compiled. I wanted to bring that same user experience to NeoVim.
@@ -56,33 +60,28 @@ Pull requests are welcome. See [FAQ](#faq).
56
60
* cobol
57
61
58
62
## Required system dependencies
59
-
Some languages require you manually install their compilers in your machine, so compiler.nvim is able to call them. Please [check here](https://github.com/Zeioth/Compiler.nvim/wiki/how-to-install-the-required-dependencies), as the packages will be different depending your operative system.
63
+
Some languages require you manually install their compilers in your machine, so compiler.nvim is able to call them. [Please check here](https://github.com/Zeioth/Compiler.nvim/wiki/how-to-install-the-required-dependencies), as the packages will be different depending your operative system.
This is what hapen when you select `build & run`, `build`, or `run` in the compiler:
112
111
113
-
> compiler.nvim will look for the conventional entry point file for the current lenguage you are using. To achieve this, it searches in your current working directory for the next files
112
+
> compiler.nvim will look for the conventional entry point file for the current language you are using. To achieve this, it searches in your current working directory for the next files
114
113
115
114
| Language | Default entry point | Default output |
116
115
|--|--|--|
@@ -132,7 +131,7 @@ This is how the compilation results look after selecting `Build & run program` i
[For more info see wiki - when to use every option](https://github.com/Zeioth/compiler.nvim/wiki/When-to-use-every-option)
134
133
135
-
## How to create a solution (Advanced)
134
+
## Creating a solution (optional)
136
135
If you want to have more control, you can create a `.solution` file in your working directory by using this template:
137
136
138
137
```
@@ -149,7 +148,7 @@ Where every [entry] represents a program to compile
149
148
150
149
| option | Description |
151
150
|--|--|
152
-
|[entry]| Anything inside the brackets will be ignored. Write anything you want inside. You can use it to easily identify your program. |
151
+
|[entry]| Anything inside the brackets will be ignored. Write anything you want to easily identify your program. |
153
152
| entry_point | Path of the file containing the entry point of the program. |
154
153
| output | Path where the compiled program will be written. |
155
154
| parameters | Are optional parameters to pass to the compiler. If you don't need them you can delete this option or leave it as empty string if you want. |
@@ -163,13 +162,11 @@ Where every [entry] represents a program to compile
163
162
164
163
Please, respect the syntax of the `.solution` file, as we intentionally do not parse errors in order to keep the compiler code simple. [For more examples see wiki](https://github.com/Zeioth/Compiler.nvim/wiki/solution-examples).
165
164
166
-
## Make (Advanced)
167
-
This option will look for a Makefile in the working directory and execute it with `make Makefile`. If your Makefile is not in the working directory, you can either change your current working directory, or create a symbolic link to the Makefile (and if you do, add it to .gitignore).
168
-
169
-
For building systems not directly supported by Compiler.nvim: Create a Makefile and use it to call cmake, maven, or any other build system you want to use from there. [For more examples see wiki](https://github.com/Zeioth/Compiler.nvim/wiki/Makefile-examples).
165
+
## Make
166
+
This option will look for a `Makefile` in the working directory and execute it with `make Makefile`. [For more examples see wiki](https://github.com/Zeioth/Compiler.nvim/wiki/Makefile-examples).
170
167
171
168
## Quick start
172
-
Starting to use [Compiler.nvim](https://github.com/Zeioth/compiler.nvim) is very easy. Create `./c_example/main.c` and paste this code. Then do `:cd ./c_example/` to change the working directory to the project.
169
+
Create `./c_example/main.c` and paste this code. Then do `:cd ./c_example/` to change the working directory to the project.
173
170
174
171
```c
175
172
#include<stdio.h>
@@ -180,7 +177,7 @@ int main() {
180
177
}
181
178
```
182
179
183
-
All you have to do now is to open the compiler and select `Build and run`. You will see the results.
180
+
Open the compiler and select `Build and run`. You will see the compilation results.
@@ -189,13 +186,15 @@ All you have to do now is to open the compiler and select `Build and run`. You w
189
186
***How can I add a language that is not supported yet?** Fork the project, and go to the directory `/compiler/languages`. Copy `c.lua` and rename it to any language you would like to add, for example `ruby.lua`. Now modify the file the way you want. It is important you name the file as the filetype of the language you are implementing. Then please, submit a PR to this repo so everyone can benefit from it.
190
187
***How can I change the way the compiler works?** Same as the previous one.
191
188
***Is this plugin just a compiler, or can I run scripts too?** Yes you can. But if your script receive parameters, we recommend you to use the terminal instead, because creating a `.solution` file just to be able to pass parameters to your simple shell script is probably a overkill, and not the right tool.
189
+
***Is this plugin also a building system manager?** No, it is not. For convenience, we provide the option `Run Makefile`, which should cover some cases of use. But if your workflow relies heavily on building systems, please consider installing an specific neovim plugin for this porpuse. [See wiki](https://github.com/Zeioth/Compiler.nvim/wiki/Makefile-examples#building-systems-support).
192
190
***I'm a windows user, do I need to do something special?** In theory no. Check the [dependencies section of this README.md](https://github.com/Zeioth/Compiler.nvim/wiki/how-to-install-the-required-dependencies) and make sure you have them. If for some wild reason a required dependency don't exist on windows, or you don't know how to get it, the easy way is to enable the Windows Linux Subsystem and run neovim from there. Then you can just `sudo apt install some_package` for anything you may need.
193
191
***Where are the global options?** There are not. Creating a `.solution` file of your project is the way to configure stuff. This way we can keep the code extra simple.
194
192
***How can I disable notifications when compiling?** Check [here](https://github.com/stevearc/overseer.nvim/issues/158#issuecomment-1631542247).
195
193
***I'm coding a web, how do I run it?** Please don't try to compile/run web languages. I recommend you this strategy instead:
196
194
197
195
* A way to transpile: toggleterm + tmux.
198
196
* A way run the project: Just keep the website opened in your browser.
197
+
***How can I auto `:cd` my projects?** Use [this fork](https://github.com/Zeioth/project.nvim) of the plugin `project.nvim`.
199
198
200
199
## 🌟 Support the project
201
200
If you want to help me, please star this repository to increase the visibility of the project.
@@ -210,7 +209,6 @@ If you want to help me, please star this repository to increase the visibility o
210
209
</a>
211
210
212
211
## Roadmap
213
-
* Make compiler.nvim 100% async (WIP: proof of concept ready on C, migrating other languages).
214
-
* Make tests 100% async, so we can test faster and more reliably.
215
-
* Research the viability of supporting building system for languages which have an standard (c, cpp, rust, java) directly without a Makefile.
216
212
213
+
* Better windows compatibility when not using WLS: The commands `rm -rf` and `mkdir -p` only exist on unix. To support Windows without WLS we should run the equivalent powershell command when Windows is detected.
214
+
*`C`, `C++`, `C#`: Consider adding the new options `build solution (dotnet)`, `build solution and run (dotnet)`, and `run solution (dotnet)`. Most people will prefer using their visual studio project file when available. → Since the dotnet command is the same for all languages, we just need to implement this once.
0 commit comments