Skip to content

Commit 75bd350

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 5b622a6 + 6a79591 commit 75bd350

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

README.md

+25-27
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@ Neovim compiler for building and running your code without having to configure a
1111

1212
## Table of contents
1313

14+
- [Why](#why)
1415
- [Supported languages](#supported-languages)
1516
- [Required system dependencies](#required-system-dependencies)
1617
- [How to install](#how-to-install)
17-
- [Available commands](#available-commands)
18+
- [Commands](#commands)
1819
- [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)
2122
- [Quick start](#quick-start)
2223
- [FAQ](#faq)
2324

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.
27+
2428
## Supported languages
2529

2630
* [c](https://github.com/Zeioth/compiler.nvim/blob/main/lua/compiler/languages/c.lua)
@@ -56,33 +60,28 @@ Pull requests are welcome. See [FAQ](#faq).
5660
* cobol
5761

5862
## 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.
6064

6165
## How to install
6266
lazy.nvim package manager
6367
```lua
6468
{ -- This plugin
6569
"Zeioth/compiler.nvim",
66-
cmd = {"CompilerOpen", "CompilerToggleResults"},
70+
cmd = {"CompilerOpen", "CompilerToggleResults", "CompilerRedo"},
6771
dependencies = { "stevearc/overseer.nvim" },
6872
config = function(_, opts) require("compiler").setup(opts) end,
6973
},
70-
{ -- The framework we use to run tasks
74+
{ -- The task runner we use
7175
"stevearc/overseer.nvim",
72-
commit = "3047ede61cc1308069ad1184c0d447ebee92d749", -- Recommended to to avoid breaking changes
73-
cmd = {"CompilerOpen", "CompilerToggleResults"},
76+
commit = "3047ede61cc1308069ad1184c0d447ebee92d749",
77+
cmd = { "CompilerOpen", "CompilerToggleResults" },
7478
opts = {
75-
-- Tasks are disposed 5 minutes after running to free resources.
76-
-- If you need to close a task inmediatelly:
77-
-- press ENTER in the menu you see after compiling on the task you want to close.
7879
task_list = {
7980
direction = "bottom",
8081
min_height = 25,
8182
max_height = 25,
8283
default_detail = 1,
83-
bindings = {
84-
["q"] = function() vim.cmd("OverseerClose") end ,
85-
},
84+
bindings = { ["q"] = function() vim.cmd("OverseerClose") end },
8685
},
8786
},
8887
},
@@ -98,7 +97,7 @@ vim.api.nvim_buf_set_keymap(0, 'n', '<F6>', "<cmd>CompilerOpen<cr>", { noremap =
9897
vim.api.nvim_buf_set_keymap(0, 'n', '<S-F6>', "<cmd>CompilerToggleResults<cr>", { noremap = true, silent = true })
9998
```
10099

101-
## Available commands
100+
## Commands
102101

103102
| Command | Description|
104103
|--|--|
@@ -110,7 +109,7 @@ vim.api.nvim_buf_set_keymap(0, 'n', '<S-F6>', "<cmd>CompilerToggleResults<cr>",
110109
## How to use (Basic usage)
111110
This is what hapen when you select `build & run`, `build`, or `run` in the compiler:
112111

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
114113
115114
| Language | Default entry point | Default output |
116115
|--|--|--|
@@ -132,7 +131,7 @@ This is how the compilation results look after selecting `Build & run program` i
132131
![screenshot_2023-06-19_13-59-37_766847673](https://github.com/Zeioth/compiler.nvim/assets/3357792/42c4ec0d-4446-4ac6-9c4a-478a32d23ca7)
133132
[For more info see wiki - when to use every option](https://github.com/Zeioth/compiler.nvim/wiki/When-to-use-every-option)
134133

135-
## How to create a solution (Advanced)
134+
## Creating a solution (optional)
136135
If you want to have more control, you can create a `.solution` file in your working directory by using this template:
137136

138137
```
@@ -149,7 +148,7 @@ Where every [entry] represents a program to compile
149148

150149
| option | Description |
151150
|--|--|
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. |
153152
| entry_point | Path of the file containing the entry point of the program. |
154153
| output | Path where the compiled program will be written. |
155154
| 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
163162

164163
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).
165164

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).
170167

171168
## 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.
173170

174171
```c
175172
#include <stdio.h>
@@ -180,7 +177,7 @@ int main() {
180177
}
181178
```
182179

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.
184181

185182
![screenshot_2023-07-25_23-56-57_069109256](https://github.com/Zeioth/compiler.nvim/assets/3357792/fd102350-ca44-4501-9cb0-db2ea0093264)
186183

@@ -189,13 +186,15 @@ All you have to do now is to open the compiler and select `Build and run`. You w
189186
* **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.
190187
* **How can I change the way the compiler works?** Same as the previous one.
191188
* **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).
192190
* **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.
193191
* **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.
194192
* **How can I disable notifications when compiling?** Check [here](https://github.com/stevearc/overseer.nvim/issues/158#issuecomment-1631542247).
195193
* **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:
196194

197195
* A way to transpile: toggleterm + tmux.
198196
* 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`.
199198

200199
## 🌟 Support the project
201200
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
210209
</a>
211210

212211
## 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.
216212

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

Comments
 (0)