nml/readme/Getting Started.html
2024-11-03 14:12:43 +01:00

1 line
No EOL
23 KiB
HTML

<!DOCTYPE HTML><html><head><meta charset="UTF-8"><title>NML | Getting Started</title><link rel="stylesheet" href="../style.css"></head><body><div class="layout"><input id="navbar-checkbox" class="toggle" type="checkbox" style="display:none" checked><div id="navbar"><ul><li class="navbar-entry-current"><a href="Getting Started.html">Getting Started</a></li><li class="navbar-entry"><a href="Sections.html">Sections</a></li><li class="navbar-entry"><a href="Variables.html">Variables</a></li><li class="navbar-entry"><a href="References.html">References</a></li><li class="navbar-entry"><a href="Imports.html">Imports</a></li><li class="navbar-entry"><a href="Raw.html">Raw</a></li><li class="navbar-entry"><a href="Comments.html">Comments</a></li><li><details><summary class="navbar-category">External Tools</summary><ul><li class="navbar-entry"><a href="Graphviz.html">Graphviz</a></li><li class="navbar-entry"><a href="LaTeX.html">LaTeX</a></li></ul></details></li><li><details><summary class="navbar-category">Blocks</summary><ul><li class="navbar-entry"><a href="Blockquotes.html">Blockquotes</a></li><li class="navbar-entry"><a href="Code.html">Code</a></li><li class="navbar-entry"><a href="Lists.html">Lists</a></li></ul></details></li><li><details><summary class="navbar-category">Lua</summary><ul><li class="navbar-entry"><a href="Lua Basics.html">Lua</a></li></ul></details></li><li><details><summary class="navbar-category">Styles</summary><ul><li class="navbar-entry"><a href="Basic Styles.html">Basic</a></li><li class="navbar-entry"><a href="Basic Layouts.html">Layouts</a></li><li class="navbar-entry"><a href="User-Defined Styles.html">User-Defined</a></li></ul></details></li></ul></div><label for="navbar-checkbox" class="navbar-checkbox-label">&#9776;</label><div class="content"><div class="toc"><span>Table of Content</span><ol><li value="1"><a href="#Building_NML">Building NML</a></li><li value="2"><a href="#Building_your_first_document">Building your first document</a></li><li value="3"><a href="#Using_the_cache">Using the cache</a></li><li value="4"><a href="#Directory-Processing_mode">Directory-Processing mode</a></li><li value="5"><a href="#Building_the_Language_Server">Building the Language Server</a></li><ol><li style="list-style-type:none"><a href="#Integrating_the_LSP">Integrating the LSP</a></li><ol><li style="list-style-type:none"><a href="#NeoVim">NeoVim</a></li></div><h1 id="Building_NML">1. Building NML <a class="section-link" href="#Building_NML">🔗 </a> </h1><p>You need at least the nightly version of rustc to compile NML. Instruction for your operating system can be found on <a href="https://forge.rust-lang.org/infra/other-installation-methods.html">Rust's website</a>. You'll also need liblua 5.4 installed. You can then move the <em>nml</em> executable in <em>target/release/nml</em> into your <em>$PATH</em></p><p><a class="inline-code"><code><span style="color:#c0c5ce;">cargo build --bin nml</span></code></a> or for release mode: <a class="inline-code"><code><span style="color:#c0c5ce;">cargo build --release --bin nml</span></code></a><i>(Note: The release build binary is much smaller than the debug build one)</i></p><h1 id="Building_your_first_document">2. Building your first document <a class="section-link" href="#Building_your_first_document">🔗 </a> </h1><ul><li><a class="inline-code"><code><span style="color:#c0c5ce;">nml -i input.nml -o output.html</span></code></a></li></ul><h1 id="Using_the_cache">3. Using the cache <a class="section-link" href="#Using_the_cache">🔗 </a> </h1><p>NML relies on sqlite to keep a cache of pre-compiled elements that take a long time to process (e.g <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="2.862216em" height="1.002199em" viewBox="0 -6.807795 25.567823 8.952523" style="vertical-align:-0.240094em"><defs><path id="uDwo_g1-65" d="M3.131258-4.811955C3.089415-4.923537 3.068493-4.972354 2.93599-4.972354S2.782565-4.923537 2.740722-4.811955L1.129763-.732254C1.060025-.557908 .941469-.251059 .313823-.251059V0C.550934-.020922 .795019-.027895 1.03213-.027895C1.311083-.027895 1.827148 0 1.868991 0V-.251059C1.562142-.251059 1.366874-.390535 1.366874-.585803C1.366874-.641594 1.373848-.655542 1.401743-.72528L1.736488-1.583064H3.717061L4.121544-.564882C4.135492-.530012 4.156413-.481196 4.156413-.446326C4.156413-.251059 3.779826-.251059 3.591532-.251059V0C3.940224-.013948 4.38655-.027895 4.630635-.027895C4.958406-.027895 5.481445-.006974 5.558157 0V-.251059H5.41868C4.951432-.251059 4.902615-.320797 4.825903-.516065L3.131258-4.811955ZM2.726775-4.100623L3.619427-1.834122H1.834122L2.726775-4.100623Z"/><path id="uDwo_g0-69" d="M1.354919-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H6.07721L6.495641-2.570361H6.246575C5.997509-1.036115 5.768369-.308842 4.054795-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-3.367372H3.138232C4.104608-3.367372 4.214197-3.048568 4.214197-2.201743H4.463263V-4.841843H4.214197C4.214197-3.985056 4.104608-3.676214 3.138232-3.676214H2.241594V-6.067248C2.241594-6.396015 2.261519-6.465753 2.729763-6.465753H4.014944C5.539228-6.465753 5.808219-5.917808 5.967621-4.533001H6.216687L5.937733-6.774595H.328767V-6.465753H.56787C1.334994-6.465753 1.354919-6.356164 1.354919-5.997509V-.777086Z"/><path id="uDwo_g0-76" d="M5.798257-2.570361H5.549191C5.439601-1.554172 5.300125-.308842 3.5467-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-6.017435C2.241594-6.356164 2.241594-6.495641 3.188045-6.495641H3.516812V-6.804483C3.158157-6.774595 2.251557-6.774595 1.843088-6.774595C1.454545-6.774595 .67746-6.774595 .328767-6.804483V-6.495641H.56787C1.334994-6.495641 1.354919-6.386052 1.354919-6.027397V-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H5.519303L5.798257-2.570361Z"/><path id="uDwo_g0-84" d="M6.635118-6.744707H.547945L.358655-4.503113H.607721C.747198-6.107098 .896638-6.435866 2.400996-6.435866C2.580324-6.435866 2.839352-6.435866 2.938979-6.41594C3.148194-6.37609 3.148194-6.266501 3.148194-6.03736V-.787049C3.148194-.448319 3.148194-.308842 2.102117-.308842H1.703611V0C2.11208-.029888 3.128269-.029888 3.58655-.029888S5.070984-.029888 5.479452 0V-.308842H5.080946C4.034869-.308842 4.034869-.448319 4.034869-.787049V-6.03736C4.034869-6.236613 4.034869-6.37609 4.214197-6.41594C4.323786-6.435866 4.592777-6.435866 4.782067-6.435866C6.286426-6.435866 6.435866-6.107098 6.575342-4.503113H6.824408L6.635118-6.744707Z"/><path id="uDwo_g0-88" d="M4.004981-3.845579L5.369863-5.84807C5.589041-6.166874 5.927771-6.485679 6.814446-6.495641V-6.804483C6.425903-6.794521 5.957659-6.774595 5.708593-6.774595C5.310087-6.774595 4.83188-6.774595 4.433375-6.804483V-6.495641C4.83188-6.485679 5.051059-6.266501 5.051059-6.03736C5.051059-5.937733 5.031133-5.917808 4.961395-5.808219L3.825654-4.124533L2.540473-6.047323C2.520548-6.07721 2.470735-6.156912 2.470735-6.196762C2.470735-6.316314 2.689913-6.485679 3.118306-6.495641V-6.804483C2.769614-6.774595 2.042341-6.774595 1.663761-6.774595C1.354919-6.774595 .737235-6.784558 .368618-6.804483V-6.495641H.557908C1.105853-6.495641 1.295143-6.425903 1.484433-6.146949L3.317559-3.377335L1.683686-.966376C1.544209-.767123 1.24533-.308842 .239103-.308842V0C.597758-.009963 1.016189-.029888 1.344956-.029888C1.713574-.029888 2.261519-.029888 2.620174 0V-.308842C2.161893-.318804 1.992528-.587796 1.992528-.767123C1.992528-.856787 2.022416-.896638 2.092154-1.006227L3.506849-3.098381L5.080946-.71731C5.100872-.67746 5.13076-.637609 5.13076-.607721C5.13076-.488169 4.911582-.318804 4.483188-.308842V0C4.83188-.029888 5.559153-.029888 5.937733-.029888C6.356164-.029888 6.814446-.019925 7.232877 0V-.308842H7.043587C6.525529-.308842 6.316314-.358655 6.107098-.667497L4.004981-3.845579Z"/></defs><g id="uDwo_page1"><g fill="#d5d5d5"><use x="0" y="0" xlink:href="#uDwo_g0-76"/><use x="2.640113" y="-2.042314" xlink:href="#uDwo_g1-65"/><use x="7.026541" y="0" xlink:href="#uDwo_g0-84"/><use x="12.561007" y="2.144728" xlink:href="#uDwo_g0-69"/><use x="18.095824" y="0" xlink:href="#uDwo_g0-88"/></g></g></svg>). To enable caching, use option <em>-d</em> with a path: <a class="inline-code"><code><span style="color:#c0c5ce;">-d cache.db</span></code></a>. You can reuse the same cache for multiple documents and benefit from cached elements. Note that in directory-processing mode, a cache is required so that only modified <a class="inline-code"><code><span style="color:#c0c5ce;">.nml</span></code></a> files get reprocessed.</p><p><b>Elements that will use the cache:</b></p><ul><li>All <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="2.862216em" height="1.002199em" viewBox="0 -6.807795 25.567823 8.952523" style="vertical-align:-0.240094em"><defs><path id="uDwo_g1-65" d="M3.131258-4.811955C3.089415-4.923537 3.068493-4.972354 2.93599-4.972354S2.782565-4.923537 2.740722-4.811955L1.129763-.732254C1.060025-.557908 .941469-.251059 .313823-.251059V0C.550934-.020922 .795019-.027895 1.03213-.027895C1.311083-.027895 1.827148 0 1.868991 0V-.251059C1.562142-.251059 1.366874-.390535 1.366874-.585803C1.366874-.641594 1.373848-.655542 1.401743-.72528L1.736488-1.583064H3.717061L4.121544-.564882C4.135492-.530012 4.156413-.481196 4.156413-.446326C4.156413-.251059 3.779826-.251059 3.591532-.251059V0C3.940224-.013948 4.38655-.027895 4.630635-.027895C4.958406-.027895 5.481445-.006974 5.558157 0V-.251059H5.41868C4.951432-.251059 4.902615-.320797 4.825903-.516065L3.131258-4.811955ZM2.726775-4.100623L3.619427-1.834122H1.834122L2.726775-4.100623Z"/><path id="uDwo_g0-69" d="M1.354919-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H6.07721L6.495641-2.570361H6.246575C5.997509-1.036115 5.768369-.308842 4.054795-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-3.367372H3.138232C4.104608-3.367372 4.214197-3.048568 4.214197-2.201743H4.463263V-4.841843H4.214197C4.214197-3.985056 4.104608-3.676214 3.138232-3.676214H2.241594V-6.067248C2.241594-6.396015 2.261519-6.465753 2.729763-6.465753H4.014944C5.539228-6.465753 5.808219-5.917808 5.967621-4.533001H6.216687L5.937733-6.774595H.328767V-6.465753H.56787C1.334994-6.465753 1.354919-6.356164 1.354919-5.997509V-.777086Z"/><path id="uDwo_g0-76" d="M5.798257-2.570361H5.549191C5.439601-1.554172 5.300125-.308842 3.5467-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-6.017435C2.241594-6.356164 2.241594-6.495641 3.188045-6.495641H3.516812V-6.804483C3.158157-6.774595 2.251557-6.774595 1.843088-6.774595C1.454545-6.774595 .67746-6.774595 .328767-6.804483V-6.495641H.56787C1.334994-6.495641 1.354919-6.386052 1.354919-6.027397V-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H5.519303L5.798257-2.570361Z"/><path id="uDwo_g0-84" d="M6.635118-6.744707H.547945L.358655-4.503113H.607721C.747198-6.107098 .896638-6.435866 2.400996-6.435866C2.580324-6.435866 2.839352-6.435866 2.938979-6.41594C3.148194-6.37609 3.148194-6.266501 3.148194-6.03736V-.787049C3.148194-.448319 3.148194-.308842 2.102117-.308842H1.703611V0C2.11208-.029888 3.128269-.029888 3.58655-.029888S5.070984-.029888 5.479452 0V-.308842H5.080946C4.034869-.308842 4.034869-.448319 4.034869-.787049V-6.03736C4.034869-6.236613 4.034869-6.37609 4.214197-6.41594C4.323786-6.435866 4.592777-6.435866 4.782067-6.435866C6.286426-6.435866 6.435866-6.107098 6.575342-4.503113H6.824408L6.635118-6.744707Z"/><path id="uDwo_g0-88" d="M4.004981-3.845579L5.369863-5.84807C5.589041-6.166874 5.927771-6.485679 6.814446-6.495641V-6.804483C6.425903-6.794521 5.957659-6.774595 5.708593-6.774595C5.310087-6.774595 4.83188-6.774595 4.433375-6.804483V-6.495641C4.83188-6.485679 5.051059-6.266501 5.051059-6.03736C5.051059-5.937733 5.031133-5.917808 4.961395-5.808219L3.825654-4.124533L2.540473-6.047323C2.520548-6.07721 2.470735-6.156912 2.470735-6.196762C2.470735-6.316314 2.689913-6.485679 3.118306-6.495641V-6.804483C2.769614-6.774595 2.042341-6.774595 1.663761-6.774595C1.354919-6.774595 .737235-6.784558 .368618-6.804483V-6.495641H.557908C1.105853-6.495641 1.295143-6.425903 1.484433-6.146949L3.317559-3.377335L1.683686-.966376C1.544209-.767123 1.24533-.308842 .239103-.308842V0C.597758-.009963 1.016189-.029888 1.344956-.029888C1.713574-.029888 2.261519-.029888 2.620174 0V-.308842C2.161893-.318804 1.992528-.587796 1.992528-.767123C1.992528-.856787 2.022416-.896638 2.092154-1.006227L3.506849-3.098381L5.080946-.71731C5.100872-.67746 5.13076-.637609 5.13076-.607721C5.13076-.488169 4.911582-.318804 4.483188-.308842V0C4.83188-.029888 5.559153-.029888 5.937733-.029888C6.356164-.029888 6.814446-.019925 7.232877 0V-.308842H7.043587C6.525529-.308842 6.316314-.358655 6.107098-.667497L4.004981-3.845579Z"/></defs><g id="uDwo_page1"><g fill="#d5d5d5"><use x="0" y="0" xlink:href="#uDwo_g0-76"/><use x="2.640113" y="-2.042314" xlink:href="#uDwo_g1-65"/><use x="7.026541" y="0" xlink:href="#uDwo_g0-84"/><use x="12.561007" y="2.144728" xlink:href="#uDwo_g0-69"/><use x="18.095824" y="0" xlink:href="#uDwo_g0-88"/></g></g></svg> elements (<i>NOTE: Upon modification of the <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="2.862216em" height="1.002199em" viewBox="0 -6.807795 25.567823 8.952523" style="vertical-align:-0.240094em"><defs><path id="uDwo_g1-65" d="M3.131258-4.811955C3.089415-4.923537 3.068493-4.972354 2.93599-4.972354S2.782565-4.923537 2.740722-4.811955L1.129763-.732254C1.060025-.557908 .941469-.251059 .313823-.251059V0C.550934-.020922 .795019-.027895 1.03213-.027895C1.311083-.027895 1.827148 0 1.868991 0V-.251059C1.562142-.251059 1.366874-.390535 1.366874-.585803C1.366874-.641594 1.373848-.655542 1.401743-.72528L1.736488-1.583064H3.717061L4.121544-.564882C4.135492-.530012 4.156413-.481196 4.156413-.446326C4.156413-.251059 3.779826-.251059 3.591532-.251059V0C3.940224-.013948 4.38655-.027895 4.630635-.027895C4.958406-.027895 5.481445-.006974 5.558157 0V-.251059H5.41868C4.951432-.251059 4.902615-.320797 4.825903-.516065L3.131258-4.811955ZM2.726775-4.100623L3.619427-1.834122H1.834122L2.726775-4.100623Z"/><path id="uDwo_g0-69" d="M1.354919-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H6.07721L6.495641-2.570361H6.246575C5.997509-1.036115 5.768369-.308842 4.054795-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-3.367372H3.138232C4.104608-3.367372 4.214197-3.048568 4.214197-2.201743H4.463263V-4.841843H4.214197C4.214197-3.985056 4.104608-3.676214 3.138232-3.676214H2.241594V-6.067248C2.241594-6.396015 2.261519-6.465753 2.729763-6.465753H4.014944C5.539228-6.465753 5.808219-5.917808 5.967621-4.533001H6.216687L5.937733-6.774595H.328767V-6.465753H.56787C1.334994-6.465753 1.354919-6.356164 1.354919-5.997509V-.777086Z"/><path id="uDwo_g0-76" d="M5.798257-2.570361H5.549191C5.439601-1.554172 5.300125-.308842 3.5467-.308842H2.729763C2.261519-.308842 2.241594-.37858 2.241594-.707347V-6.017435C2.241594-6.356164 2.241594-6.495641 3.188045-6.495641H3.516812V-6.804483C3.158157-6.774595 2.251557-6.774595 1.843088-6.774595C1.454545-6.774595 .67746-6.774595 .328767-6.804483V-6.495641H.56787C1.334994-6.495641 1.354919-6.386052 1.354919-6.027397V-.777086C1.354919-.418431 1.334994-.308842 .56787-.308842H.328767V0H5.519303L5.798257-2.570361Z"/><path id="uDwo_g0-84" d="M6.635118-6.744707H.547945L.358655-4.503113H.607721C.747198-6.107098 .896638-6.435866 2.400996-6.435866C2.580324-6.435866 2.839352-6.435866 2.938979-6.41594C3.148194-6.37609 3.148194-6.266501 3.148194-6.03736V-.787049C3.148194-.448319 3.148194-.308842 2.102117-.308842H1.703611V0C2.11208-.029888 3.128269-.029888 3.58655-.029888S5.070984-.029888 5.479452 0V-.308842H5.080946C4.034869-.308842 4.034869-.448319 4.034869-.787049V-6.03736C4.034869-6.236613 4.034869-6.37609 4.214197-6.41594C4.323786-6.435866 4.592777-6.435866 4.782067-6.435866C6.286426-6.435866 6.435866-6.107098 6.575342-4.503113H6.824408L6.635118-6.744707Z"/><path id="uDwo_g0-88" d="M4.004981-3.845579L5.369863-5.84807C5.589041-6.166874 5.927771-6.485679 6.814446-6.495641V-6.804483C6.425903-6.794521 5.957659-6.774595 5.708593-6.774595C5.310087-6.774595 4.83188-6.774595 4.433375-6.804483V-6.495641C4.83188-6.485679 5.051059-6.266501 5.051059-6.03736C5.051059-5.937733 5.031133-5.917808 4.961395-5.808219L3.825654-4.124533L2.540473-6.047323C2.520548-6.07721 2.470735-6.156912 2.470735-6.196762C2.470735-6.316314 2.689913-6.485679 3.118306-6.495641V-6.804483C2.769614-6.774595 2.042341-6.774595 1.663761-6.774595C1.354919-6.774595 .737235-6.784558 .368618-6.804483V-6.495641H.557908C1.105853-6.495641 1.295143-6.425903 1.484433-6.146949L3.317559-3.377335L1.683686-.966376C1.544209-.767123 1.24533-.308842 .239103-.308842V0C.597758-.009963 1.016189-.029888 1.344956-.029888C1.713574-.029888 2.261519-.029888 2.620174 0V-.308842C2.161893-.318804 1.992528-.587796 1.992528-.767123C1.992528-.856787 2.022416-.896638 2.092154-1.006227L3.506849-3.098381L5.080946-.71731C5.100872-.67746 5.13076-.637609 5.13076-.607721C5.13076-.488169 4.911582-.318804 4.483188-.308842V0C4.83188-.029888 5.559153-.029888 5.937733-.029888C6.356164-.029888 6.814446-.019925 7.232877 0V-.308842H7.043587C6.525529-.308842 6.316314-.358655 6.107098-.667497L4.004981-3.845579Z"/></defs><g id="uDwo_page1"><g fill="#d5d5d5"><use x="0" y="0" xlink:href="#uDwo_g0-76"/><use x="2.640113" y="-2.042314" xlink:href="#uDwo_g1-65"/><use x="7.026541" y="0" xlink:href="#uDwo_g0-84"/><use x="12.561007" y="2.144728" xlink:href="#uDwo_g0-69"/><use x="18.095824" y="0" xlink:href="#uDwo_g0-88"/></g></g></svg> environment, they will be reprocessed, see <a href="LaTeX.html#LaTeX_cache">TeX Cache</a> for more information</i>)</li><li>All Graphviz elements</li><li>All code blocks</li></ul><h1 id="Directory-Processing_mode">4. Directory-Processing mode <a class="section-link" href="#Directory-Processing_mode">🔗 </a> </h1><p>To use directory-processing mode, you need to pass an input directory and an output directory. Directory-processing mode requires that you use a database, so that it knows which documents have already been compiled. If the output directory doesn't exist, it will be automatically created.</p><p>Compiling the docs: <a class="inline-code"><code><span style="color:#c0c5ce;">nml -i docs -o docs_out -d cache.db</span></code></a></p><p>If you modify an <a class="inline-code"><code><span style="color:#c0c5ce;">@import</span></code></a>ed file, you will need to use the <a class="inline-code"><code><span style="color:#c0c5ce;">--force-rebuild</span></code></a> option, as NML currently doesn't track which files are imported by other files.</p><h1 id="Building_the_Language_Server">5. Building the Language Server <a class="section-link" href="#Building_the_Language_Server">🔗 </a> </h1><p>NML comes with it's own language server, ready to be used in any LSP-compatible text editor, such as NeoVim.</p><p>Build it by using the following command: <a class="inline-code"><code><span style="color:#c0c5ce;">cargo build --bin nmlls</span></code></a> or for release mode: <a class="inline-code"><code><span style="color:#c0c5ce;">cargo build --release --bin nmlls</span></code></a><i>(Note: The release build binary is much smaller than the debug build one)</i></p><p>You should move the language server somewhere in your <a class="inline-code"><code><span style="color:#c0c5ce;">$PATH</span></code></a>.</p><h2 id="Integrating_the_LSP">Integrating the LSP <a class="section-link" href="#Integrating_the_LSP">🔗 </a> </h2><p>Below is a list of integration steps the language server in various editors.</p><h3 id="NeoVim">NeoVim <a class="section-link" href="#NeoVim">🔗 </a> </h3><p>The first step is to add the <em>.nml</em> extension to NeoVim, so it is recognized:</p><div class="code-block"><div class="code-block-content"><table cellspacing="0"><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;">vim.filetype.add({</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> pattern = {</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> [&#39;</span><span style="color:#a3be8c;">.*%.nml</span><span style="color:#c0c5ce;">&#39;] = &#39;</span><span style="color:#a3be8c;">nml</span><span style="color:#c0c5ce;">&#39;,</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> },</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;">})</span></pre></td></tr></table></div></div><p>Then you need to register the language server in NeoVim. I recommend the <a class="inline-code"><code><span style="color:#c0c5ce;">lsp-zero</span></code></a> plugin for that purpose:</p><div class="code-block"><div class="code-block-content"><table cellspacing="0"><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;">{</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> &quot;</span><span style="color:#a3be8c;">VonHeikemen/lsp-zero.nvim</span><span style="color:#c0c5ce;">&quot;,</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> config = </span><span style="color:#b48ead;">function</span><span style="color:#c0c5ce;">()</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> </span><span style="color:#b48ead;">local</span><span style="color:#c0c5ce;"> lsp_zero = </span><span style="color:#96b5b4;">require</span><span style="color:#c0c5ce;">(&#39;</span><span style="color:#a3be8c;">lsp-zero</span><span style="color:#c0c5ce;">&#39;)</span></pre></td></tr><tr><td class="code-block-line"><pre><br></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> lsp_zero.on_attach(</span><span style="color:#b48ead;">function</span><span style="color:#c0c5ce;">(client, bufnr)</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> lsp_zero.default_keymaps({buffer = bufnr})</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> </span><span style="color:#b48ead;">end</span><span style="color:#c0c5ce;">)</span></pre></td></tr><tr><td class="code-block-line"><pre><br></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> lsp_zero.new_client({</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> name = &#39;</span><span style="color:#a3be8c;">nmlls</span><span style="color:#c0c5ce;">&#39;,</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> cmd = {&#39;</span><span style="color:#a3be8c;">&lt;PATH TO BINARY IF NOT IN $PATH/&gt;nmlls</span><span style="color:#c0c5ce;">&#39;},</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> filetypes = {&#39;</span><span style="color:#a3be8c;">nml</span><span style="color:#c0c5ce;">&#39;},</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> })</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;"> </span><span style="color:#b48ead;">end</span><span style="color:#c0c5ce;">,</span></pre></td></tr><tr><td class="code-block-line"><pre><span style="color:#c0c5ce;">}</span></pre></td></tr></table></div></div><p></p></div></div></body></html>