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
nvim.echo("Warning: No Fennel filetype found, falling back to Clojure syntax.", "Install https://github.com/Olical/aniseed for better Fennel support.")
@@ -56,58 +71,51 @@ local function start()
56
71
localbuf=upsert_buf()
57
72
nvim.ex.edit(buf_name)
58
73
nvim.buf_set_lines(buf, 0, -1, false, {})
59
-
local_4_
74
+
local_6_
60
75
if ("<localleader>" ==config["get-in"]({"mapping", "prefix"})) then
61
76
ifa["empty?"](nvim.g.maplocalleader) then
62
77
nvim.g.maplocalleader=","
63
78
nvim.ex.edit()
64
-
_4_= {";; Your <localleader> wasn't configured so I've defaulted it to comma (,) for now.", ";; See :help localleader for more information. (let maplocalleader=\",\")"}
79
+
_6_= {";; Your <localleader> wasn't configured so I've defaulted it to comma (,) for now.", ";; See :help localleader for more information. (let maplocalleader=\",\")"}
65
80
else
66
-
_4_= {(";; Your <localleader> is currently mapped to \"" ..nvim.g.maplocalleader.."\"")}
81
+
_6_= {(";; Your <localleader> is currently mapped to \"" ..nvim.g.maplocalleader.."\"")}
67
82
end
68
83
else
69
-
_4_=nil
84
+
_6_=nil
70
85
end
71
-
returnappend(a.concat({"(module user.conjure-school", " {require {school conjure.school}})", "", ";; Welcome to Conjure school!", ";; Grab yourself a nice beverage and let's get evaluating. I hope you enjoy!", "", ";; This language is Fennel, it's quite similar to Clojure.", ";; Conjure is written in Fennel, it's compiled to Lua and executed inside Neovim itself.", ";; This means we can work with a Lisp without installing or running anything else.", "", ";; Note: Some colorschemes will make the HUD unreadable, see here for more: https://git.io/JJ1Hl", "", ";; Let's learn how to evaluate it using Conjure's assortment of mappings.", ";; You can learn how to change these mappings with :help conjure-mappings", "", (";; Let's begin by evaluating the whole buffer using " ..map_str("eval_buf"))}, _4_, {"(school.lesson-1)"}))
86
+
returnappend(a.concat({"(module user.conjure-school", " {require {school conjure.school}})", "", ";; Welcome to Conjure school!", ";; Grab yourself a nice beverage and let's get evaluating. I hope you enjoy!", "", ";; This language is Fennel, it's quite similar to Clojure.", ";; Conjure is written in Fennel, it's compiled to Lua and executed inside Neovim itself.", ";; This means we can work with a Lisp without installing or running anything else.", "", ";; Note: Some colorschemes will make the HUD unreadable, see here for more: https://git.io/JJ1Hl", "", ";; Let's learn how to evaluate it using Conjure's assortment of mappings.", ";; You can learn how to change these mappings with :help conjure-mappings", "", (";; Let's begin by evaluating the whole buffer using " ..map_str("eval_buf"))}, _6_, {"(school.lesson-1)"}))
72
87
end
73
88
_2amodule_2a["start"] =start
74
89
localfunctionlesson_1()
75
-
append({"", ";; Good job!", ";; You'll notice the heads up display (HUD) appeared showing the result of the evaluation.", ";; All results are appended to a log buffer. If that log is not open, the HUD will appear.", ";; The HUD closes automatically when you move your cursor.", "", ";; You can open the log buffer in a few ways:", (";; * Horizontally - " .. map_str("log_split")), (";; * Vertically - " .. map_str("log_vsplit")), (";; * New tab - " .. map_str("log_tab")), "", (";; All visible log windows (including the HUD) can be closed with " .. map_str("log_close_visible")), ";; Try opening and closing the log window to get the hang of those key mappings.", ";; It's a regular window and buffer, so you can edit and close it however you want.", ";; Feel free to leave the log open in a split for the next lesson to see how it behaves.", "", ";; If you ever need to clear your log you can use the reset mappings:", (";; * Soft reset (leaves windows open) - " .. map_str("log_reset_soft")), (";; * Hard reset (closes windows, deletes the buffer) - " .. map_str("log_reset_hard")), "", ";; Next, we have a form inside a comment. We want to evaluate that inner form, not the comment.", (";; Place your cursor on the inner form (the one inside the comment) and use " .. map_str("eval_current_form") .. " to evaluate it."), "(comment", " (school.lesson-2))"})
76
-
returnprogress(1)
90
+
return append_or_warn(1, {"", ";; Good job!", ";; You'll notice the heads up display (HUD) appeared showing the result of the evaluation.", ";; All results are appended to a log buffer. If that log is not open, the HUD will appear.", ";; The HUD closes automatically when you move your cursor.", "", ";; You can open the log buffer in a few ways:", (";; * Horizontally - " .. map_str("log_split")), (";; * Vertically - " .. map_str("log_vsplit")), (";; * New tab - " .. map_str("log_tab")), "", (";; All visible log windows (including the HUD) can be closed with " .. map_str("log_close_visible")), ";; Try opening and closing the log window to get the hang of those key mappings.", ";; It's a regular window and buffer, so you can edit and close it however you want.", ";; Feel free to leave the log open in a split for the next lesson to see how it behaves.", "", ";; If you ever need to clear your log you can use the reset mappings:", (";; * Soft reset (leaves windows open) - " .. map_str("log_reset_soft")), (";; * Hard reset (closes windows, deletes the buffer) - " .. map_str("log_reset_hard")), "", ";; Next, we have a form inside a comment. We want to evaluate that inner form, not the comment.", (";; Place your cursor on the inner form (the one inside the comment) and use " .. map_str("eval_current_form") .. " to evaluate it."), "(comment", " (school.lesson-2))"})
77
91
end
78
92
_2amodule_2a["lesson-1"] =lesson_1
79
93
localfunctionlesson_2()
80
-
append({"", ";; Awesome! You evaluated the inner form under your cursor.", (";; If we want to evaluate the outermost form under our cursor, we can use " ..map_str("eval_root_form") .." instead."), ";; Try that below to print some output and advance to the next lesson.", ";; You can place your cursor anywhere inside the (do ...) form or it's children.", "(do", " (print \"Hello, World!\")", " (school.lesson-3))"})
81
-
returnprogress(2)
94
+
returnappend_or_warn(2, {"", ";; Awesome! You evaluated the inner form under your cursor.", (";; If we want to evaluate the outermost form under our cursor, we can use " ..map_str("eval_root_form") .." instead."), ";; Try that below to print some output and advance to the next lesson.", ";; You can place your cursor anywhere inside the (do ...) form or it's children.", "(do", " (print \"Hello, World!\")", " (school.lesson-3))"})
82
95
end
83
96
_2amodule_2a["lesson-2"] =lesson_2
84
97
localfunctionlesson_3()
85
-
append({"", ";; You evaluated the outermost form! Nice!", ";; Notice that the print output was captured and displayed in the log too.", ";; The result of every evaluation is stored in a Neovim register as well as the log.", (";; Try pressing \"" ..config["get-in"]({"eval", "result_register"}) .."p to paste the contents of the register into your buffer."), (";; We can also evaluate a form and replace it with the result of the evaluation with " ..map_str("eval_replace_form")), (";; We'll try that in the next lesson, place your cursor inside the form below and press " ..map_str("eval_replace_form")), "(school.lesson-4)"})
86
-
returnprogress(3)
98
+
returnappend_or_warn(3, {"", ";; You evaluated the outermost form! Nice!", ";; Notice that the print output was captured and displayed in the log too.", ";; The result of every evaluation is stored in a Neovim register as well as the log.", (";; Try pressing \"" ..config["get-in"]({"eval", "result_register"}) .."p to paste the contents of the register into your buffer."), (";; We can also evaluate a form and replace it with the result of the evaluation with " ..map_str("eval_replace_form")), (";; We'll try that in the next lesson, place your cursor inside the form below and press " ..map_str("eval_replace_form")), "(school.lesson-4)"})
87
99
end
88
100
_2amodule_2a["lesson-3"] =lesson_3
89
101
localfunctionlesson_4()
90
-
append({"", ";; Well done! Notice how the resulting string in the log also replaced the form in the buffer!", ";; Next let's try evaluating a form at a mark.", ";; Place your cursor on the next lesson form below and use mf to set the f mark at that location.", (";; Now move your cursor elsewhere in the buffer and use " ..map_str("eval_marked_form") .."f to evaluate it."), ";; If you use a capital letter like mF you can even open a different file and evaluate that marked form without changing buffers!", "(school.lesson-5)"})
91
-
returnprogress(4)
102
+
returnappend_or_warn(4, {"", ";; Well done! Notice how the resulting string in the log also replaced the form in the buffer!", ";; Next let's try evaluating a form at a mark.", ";; Place your cursor on the next lesson form below and use mf to set the f mark at that location.", (";; Now move your cursor elsewhere in the buffer and use " ..map_str("eval_marked_form") .."f to evaluate it."), ";; If you use a capital letter like mF you can even open a different file and evaluate that marked form without changing buffers!", "(school.lesson-5)"})
92
103
end
93
104
_2amodule_2a["lesson-4"] =lesson_4
94
105
locallesson_5_message="This is the contents of school.lesson-5-message!"
append({"", ";; Excellent!", ";; This is extremely useful when you want to evaluate a specific form repeatedly as you change code elsewhere in the file or project.", (";; Try inspecting the contents of the variable below by placing your cursor on it and pressing " ..map_str("eval_word")), "school.lesson-5-message", "", ";; You should see the contents in the HUD or log.", "", (";; You can evaluate visual selections with " ..map_str("eval_visual")), ";; Try evaluating the form below using a visual selection.", "(school.lesson-6)"})
98
-
returnprogress(5)
108
+
returnappend_or_warn(5, {"", ";; Excellent!", ";; This is extremely useful when you want to evaluate a specific form repeatedly as you change code elsewhere in the file or project.", (";; Try inspecting the contents of the variable below by placing your cursor on it and pressing " ..map_str("eval_word")), "school.lesson-5-message", "", ";; You should see the contents in the HUD or log.", "", (";; You can evaluate visual selections with " ..map_str("eval_visual")), ";; Try evaluating the form below using a visual selection.", "(school.lesson-6)"})
99
109
end
100
110
_2amodule_2a["lesson-5"] =lesson_5
101
111
locallesson_6_message="This is the contents of school.lesson-6-message!"
append({"", ";; Wonderful!", ";; Visual evaluation is great for specific sections of a form.", (";; You can also evaluate a given motion with " ..map_str("eval_motion")), (";; Try " ..map_str("eval_motion") .."iw below to evaluate the word."), "school.lesson-6-message", "", (";; Use " ..map_str("eval_motion") .."a( to evaluate the lesson form."), "(school.lesson-7)"})
105
-
returnprogress(6)
114
+
returnappend_or_warn(6, {"", ";; Wonderful!", ";; Visual evaluation is great for specific sections of a form.", (";; You can also evaluate a given motion with " ..map_str("eval_motion")), (";; Try " ..map_str("eval_motion") .."iw below to evaluate the word."), "school.lesson-6-message", "", (";; Use " ..map_str("eval_motion") .."a( to evaluate the lesson form."), "(school.lesson-7)"})
106
115
end
107
116
_2amodule_2a["lesson-6"] =lesson_6
108
117
localfunctionlesson_7()
109
-
append({"", ";; Excellent job, you made it to the end!", ";; To learn more about configuring Conjure, install the plugin and check out :help conjure", ";; You can learn about specific languages with :help conjure-client- and then tab completion.", ";; For example, conjure-client-fennel-aniseed or conjure-client-clojure-nrepl.", "", ";; I hope you have a wonderful time in Conjure!"})
110
-
returnprogress(7)
118
+
returnappend_or_warn(7, {"", ";; Excellent job, you made it to the end!", ";; To learn more about configuring Conjure, install the plugin and check out :help conjure", ";; You can learn about specific languages with :help conjure-client- and then tab completion.", ";; For example, conjure-client-fennel-aniseed or conjure-client-clojure-nrepl.", "", ";; I hope you have a wonderful time in Conjure!"})
0 commit comments