diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc deleted file mode 100644 index 82be1da1..00000000 --- a/CONTRIBUTING.adoc +++ /dev/null @@ -1,19 +0,0 @@ -= Contributing to Conjure - -Conjure is a https://neovim.io[Neovim] specific Lua plugin written in https://fennel-lang.org/[Fennel] and compiled to Lua by https://github.com/Olical/aniseed[Aniseed]. - -It's developed using itself which leads to an extremely tight feedback loop. This makes it easier to move fast without breaking things. - -To work on Conjure you'll first need to clone the repository and execute `make deps`, then point your plugin manager at the directory. - -You should checkout the `develop` branch and make all changes there as well as target your pull request at the `develop` branch. - -Now you can open up Conjure's source files (ending in `.fnl`) and evaluate them as you would any other language with Conjure, see `:help conjure`. - -Your changes and evaluations only apply to the in memory copy of Conjure, use `make compile` to persist the changes as files in the `lua` directory. I commit these alongside my Fennel changes so each commit lines up with the Fennel and corresponding Lua changes. - -Once you're happy with your changes, you can (maybe) write some tests and execute them with `make test`. CircleCI will also run them for you. - -You can run `scripts/docker.sh` to drop into a fresh Ubuntu based Neovim environment with Conjure pre-installed from your working directory. This can be used to verify your changes in a clean room environment. - -If you'd like to contribute or are having issues please don't hesitate to get in touch with me (Olical / Oliver Caldwell) on twitter, email or Clojurians Slack. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e3e58cb2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing to Conjure + +Conjure is a [Neovim](https://neovim.io) specific Lua plugin written in [Fennel](https://fennel-lang.org/) and compiled to Lua by [nfnl](https://github.com/Olical/nfnl). You will need the nfnl plugin installed to work on Conjure. Don't fear, nfnl is designed to only load and operate on projects already configured to rely on it. So if there's no configuration file it's completely inert, it will only activate when you work on Conjure or other projects built with nfnl. + +It's developed using itself which leads to an extremely tight feedback loop. This makes it easier to move fast without breaking things. + +To work on Conjure you'll first need to clone the repository and execute `make deps`, then point your plugin manager at the directory. + +Contrary to old versions of Conjure, we now simply work on branches that target the `main` branch, I no longer use the `develop` staging branch and we can consider that obsolete just like the `master` branch. + +Now you can open up Conjure's source files (ending in `.fnl`) and evaluate them as you would any other language with Conjure, see `:help conjure`. + +Your changes and evaluations through Conjure only apply to the in memory copy of Conjure. When you write a `.fnl` file with nfnl installed however your Fennel will be compiled to a static `.lua` file automatically. Make sure you commit both your Fennel _and_ Lua file changes! + +Once you're happy with your changes, you can (maybe) write some tests and execute them with `make test`. CircleCI will also run them for you. + +You can run `scripts/docker.sh` to drop into a fresh Ubuntu based Neovim environment with Conjure pre-installed from your working directory. This can be used to verify your changes in a clean room environment. + +If you'd like to contribute or are having issues please don't hesitate to get in touch with me through GitHub discussions and issues. You can also find some ways to contact me privately on my personal site, [oli.me.uk](https://oli.me.uk). diff --git a/README.adoc b/README.adoc index bb6ea9b2..67c9e3f2 100644 --- a/README.adoc +++ b/README.adoc @@ -180,7 +180,7 @@ Broader documentation can be found in the https://github.com/Olical/conjure/wiki == Behind the curtain -Conjure is written entirely in Lua (no VimL or external processes!) which is compiled from https://fennel-lang.org/[Fennel] by https://github.com/Olical/aniseed[Aniseed] ahead of time. Check out link:CONTRIBUTING.adoc[`CONTRIBUTING.adoc`] for more on how to work on Conjure using itself. +Conjure is written entirely in Lua (no VimL or external processes!) which is compiled from https://fennel-lang.org/[Fennel] by https://github.com/Olical/nfnl[nfnl] ahead of time. Check out link:CONTRIBUTING.md[`CONTRIBUTING.md`] for more on how to work on Conjure using itself. Historically, Conjure was Clojure specific with an entirely different implementation, you can still find that version on the https://github.com/Olical/conjure/tree/legacy-jvm[legacy-jvm branch]. diff --git a/doc/conjure.txt b/doc/conjure.txt index 19d5996d..0e751b22 100644 --- a/doc/conjure.txt +++ b/doc/conjure.txt @@ -766,12 +766,13 @@ configure the ones you care about one at a time you can set: `g:conjure#extract#context_header_lines` How many lines of the file should be checked for a context (namespace name) such as `(module foo.bar)` or `(ns foo.bar)` - which is used for setting the right context for evaluations. - If you have buffers with huge comment headers you may want to set - this higher. - If a specific buffer isn't extracting the context correctly, you - can override it by setting `b:conjure#context`. - Default: `24` + which is used for setting the right context for evaluations. You + can hard code a context for a particular buffer by setting + `b:conjure#context`. + This defaults to `-1` which means "all lines" but you can set it + to something like `30` if you're experiencing performance issues + in some buffers or projects. + Default: `-1` *g:conjure#extract#form_pairs* `g:conjure#extract#form_pairs` diff --git a/docs/school b/docs/school index 4e76f0f6..d1ad2148 100644 --- a/docs/school +++ b/docs/school @@ -4,7 +4,7 @@ PREFIX="/tmp/conjure-school" if [ ! -d $PREFIX ]; then echo "Downloading Conjure into $PREFIX..." - curl -LJ https://github.com/Olical/conjure/archive/master.zip -o $PREFIX.zip + curl -LJ https://github.com/Olical/conjure/archive/main.zip -o $PREFIX.zip unzip -qq $PREFIX.zip -d $PREFIX rm $PREFIX.zip else @@ -12,8 +12,8 @@ else fi nvim \ - --cmd "set rtp+=$PREFIX/conjure-master" \ - --cmd "source $PREFIX/conjure-master/plugin/conjure.vim" \ - -c "au VimEnter * ++nested ConjureSchool" \ - && echo "I hope you had a great time! Cleaning up $PREFIX and exiting." \ - && rm -rf $PREFIX + --cmd "set rtp+=$PREFIX/conjure-main" \ + --cmd "source $PREFIX/conjure-main/plugin/conjure.vim" \ + -c "au VimEnter * ++nested ConjureSchool" && + echo "I hope you had a great time! Cleaning up $PREFIX and exiting." && + rm -rf $PREFIX diff --git a/fnl/conjure/config.fnl b/fnl/conjure/config.fnl index 44ce660c..5be0bda1 100644 --- a/fnl/conjure/config.fnl +++ b/fnl/conjure/config.fnl @@ -118,7 +118,7 @@ :end "}%~~~"}}} :extract - {:context_header_lines 24 + {:context_header_lines -1 :form_pairs [["(" ")"] ["{" "}"] ["[" "]" true]] diff --git a/lua/conjure/config.lua b/lua/conjure/config.lua index 335ce43b..9334aff9 100644 --- a/lua/conjure/config.lua +++ b/lua/conjure/config.lua @@ -49,7 +49,7 @@ local function merge(tbl, opts, ks) a["run!"](_4_, a["kv-pairs"](tbl)) return nil end -merge({relative_file_root = nil, path_subs = nil, client_on_load = true, filetypes = {"clojure", "fennel", "janet", "hy", "julia", "racket", "scheme", "lua", "lisp", "python", "rust", "sql"}, filetype = {clojure = "conjure.client.clojure.nrepl", fennel = "conjure.client.fennel.aniseed", janet = "conjure.client.janet.netrepl", hy = "conjure.client.hy.stdio", julia = "conjure.client.julia.stdio", racket = "conjure.client.racket.stdio", scheme = "conjure.client.scheme.stdio", lua = "conjure.client.lua.neovim", lisp = "conjure.client.common-lisp.swank", python = "conjure.client.python.stdio", rust = "conjure.client.rust.evcxr", sql = "conjure.client.sql.stdio"}, filetype_suffixes = {racket = {"rkt"}, scheme = {"scm", "ss"}}, eval = {result_register = "c", inline_results = true, inline = {highlight = "comment", prefix = "=> "}, comment_prefix = nil, gsubs = {}}, mapping = {prefix = "", enable_ft_mappings = true, enable_defaults = true}, completion = {omnifunc = "ConjureOmnifunc", fallback = "syntaxcomplete#Complete"}, highlight = {group = "IncSearch", timeout = 500, enabled = false}, log = {treesitter = true, hud = {width = 0.42, height = 0.3, zindex = 1, enabled = true, passive_close_delay = 0, minimum_lifetime_ms = 20, overlap_padding = 0.1, border = "single", anchor = "NE", ignore_low_priority = false}, jump_to_latest = {cursor_scroll_position = "top", enabled = false}, break_length = 80, trim = {at = 10000, to = 6000}, strip_ansi_escape_sequences_line_limit = 1000, fold = {lines = 10, marker = {start = "~~~%{", ["end"] = "}%~~~"}, enabled = false}, botright = false, diagnostics = false, wrap = false}, extract = {context_header_lines = 24, form_pairs = {{"(", ")"}, {"{", "}"}, {"[", "]", true}}, tree_sitter = {enabled = true}}, preview = {sample_limit = 0.3}, debug = false}) +merge({relative_file_root = nil, path_subs = nil, client_on_load = true, filetypes = {"clojure", "fennel", "janet", "hy", "julia", "racket", "scheme", "lua", "lisp", "python", "rust", "sql"}, filetype = {clojure = "conjure.client.clojure.nrepl", fennel = "conjure.client.fennel.aniseed", janet = "conjure.client.janet.netrepl", hy = "conjure.client.hy.stdio", julia = "conjure.client.julia.stdio", racket = "conjure.client.racket.stdio", scheme = "conjure.client.scheme.stdio", lua = "conjure.client.lua.neovim", lisp = "conjure.client.common-lisp.swank", python = "conjure.client.python.stdio", rust = "conjure.client.rust.evcxr", sql = "conjure.client.sql.stdio"}, filetype_suffixes = {racket = {"rkt"}, scheme = {"scm", "ss"}}, eval = {result_register = "c", inline_results = true, inline = {highlight = "comment", prefix = "=> "}, comment_prefix = nil, gsubs = {}}, mapping = {prefix = "", enable_ft_mappings = true, enable_defaults = true}, completion = {omnifunc = "ConjureOmnifunc", fallback = "syntaxcomplete#Complete"}, highlight = {group = "IncSearch", timeout = 500, enabled = false}, log = {treesitter = true, hud = {width = 0.42, height = 0.3, zindex = 1, enabled = true, passive_close_delay = 0, minimum_lifetime_ms = 20, overlap_padding = 0.1, border = "single", anchor = "NE", ignore_low_priority = false}, jump_to_latest = {cursor_scroll_position = "top", enabled = false}, break_length = 80, trim = {at = 10000, to = 6000}, strip_ansi_escape_sequences_line_limit = 1000, fold = {lines = 10, marker = {start = "~~~%{", ["end"] = "}%~~~"}, enabled = false}, botright = false, diagnostics = false, wrap = false}, extract = {context_header_lines = -1, form_pairs = {{"(", ")"}, {"{", "}"}, {"[", "]", true}}, tree_sitter = {enabled = true}}, preview = {sample_limit = 0.3}, debug = false}) if get_in({"mapping", "enable_defaults"}) then merge({mapping = {log_split = "ls", log_vsplit = "lv", log_tab = "lt", log_buf = "le", log_toggle = "lg", log_close_visible = "lq", log_reset_soft = "lr", log_reset_hard = "lR", log_jump_to_latest = "ll", eval_current_form = "ee", eval_comment_current_form = "ece", eval_root_form = "er", eval_comment_root_form = "ecr", eval_word = "ew", eval_comment_word = "ecw", eval_replace_form = "e!", eval_marked_form = "em", eval_file = "ef", eval_buf = "eb", eval_visual = "E", eval_motion = "E", eval_previous = "ep", def_word = "gd", doc_word = {"K"}}}) else