Skip to content

Commit

Permalink
Merge branch 'main' into v0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename authored Dec 23, 2024
2 parents 1176ec7 + 46aa168 commit 4ffd67b
Show file tree
Hide file tree
Showing 28 changed files with 556 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[*.{nix,yml,yaml}]
[*.{js,nix,yml,yaml}]
indent_style = space
indent_size = 2
tab_width = 2
Expand Down
24 changes: 16 additions & 8 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm

- **Simple**: One language to rule them all! Use Nix to configure everything,
with additional Lua Support
with optional Lua support for robust configurability!
- **Reproducible**: Your configuration will behave the same _anywhere_. No
surprises, promise!
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
more global binaries! Works on all platforms, without hassle.
- Options to install [standalone], [NixOS module] or [Home-Manager module].
- **Customizable**: There are _almost no defaults_ to annoy you. nvf is fully
customizable through the Nix module system.
- Not comfortable with a full-nix config or want to bring your Lua config? You
can do just that, no unnecessary restrictions.
- Not comfortable with a full-nix config or want to bring your Lua config? You
can do just that, no unnecessary restrictions.
- Lazyloading? We got it! Lazyload both internal and external plugins at will.
- **Well-documented**: Documentation is priority. You will _never_ face
undocumented, obscure behaviour.
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
Expand Down Expand Up @@ -167,19 +168,19 @@ fix.

## Frequently Asked Questions

[appropriate issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
[issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
[list of branches]: https://github.com/NotAShelf/nvf/branches
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls

**Q**: What platforms are supported?
<br/> **A**: nvf actively supports Linux and Darwin platforms using standalone
Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
installation instructions.
<br/> **A**: nvf actively supports **Linux and Darwin** platforms using
standalone Nix, NixOS or Home-Manager. Please take a look at the [nvf manual]
for available installation instructions.

**Q**: Can you add _X_?
<br/> **A**: Maybe! It is not one of our goals to support each and every Neovim
plugin, however, I am always open to new modules and plugin setup additions to
**nvf**. Use the [appropriate issue template] and I will consider a module
**nvf**. Use the appropriate [issue template] and I will consider a module
addition. As mentioned before, pull requests to add new features are also
welcome.

Expand All @@ -196,6 +197,13 @@ not noticed any activity on the main branch, consider taking a look at the
_testing_ those release branches to get access to new features ahead of time and
better prepare to breaking changes.

**Q**: Will you support non-flake installations?
<br/> **A**: Quite possibly. **nvf** started as "neovim-flake", which does mean
it is and will remain flakes-first but we might consider non-flakes
compatibility. Though keep in mind that **nvf** under non-flake environments
would lose customizability of plugin inputs, which is one of our primary
features.

## Credits

### Contributors
Expand Down
61 changes: 36 additions & 25 deletions configuration.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is the sample configuration for nvf, aiming to give you a feel of the default options
# while certain plugins are enabled. While it may act as one, this is not an overview of nvf's
# module options. To find a complete overview of nvf's options and examples, visit the manual.
# https://notashelf.github.io/nvf/options.html
isMaximal: {
config.vim = {
viAlias = true;
Expand Down Expand Up @@ -31,54 +35,61 @@ isMaximal: {
};
};

# This section does not include a comprehensive list of available language modules.
# To list all available language module options, please visit the nvf manual.
languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;

# Nim LSP is broken on Darwin and therefore
# should be disabled by default. Users may still enable
# `vim.languages.vim` to enable it, this does not restrict
# that.
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
nim.enable = false;

# Languages that will be supported in default and maximal configurations.
nix.enable = true;
markdown.enable = true;

# Assembly is not common, and the asm LSP is a major hit-or-miss
assembly.enable = false;
astro.enable = false;
markdown.enable = isMaximal;
html.enable = isMaximal;
# Languages that are enabled in the maximal configuration.
bash.enable = isMaximal;
clang.enable = isMaximal;
css.enable = isMaximal;
html.enable = isMaximal;
sql.enable = isMaximal;
java.enable = isMaximal;
kotlin.enable = isMaximal;
ts.enable = isMaximal;
svelte.enable = isMaximal;
go.enable = isMaximal;
lua.enable = isMaximal;
elixir.enable = isMaximal;
zig.enable = isMaximal;
ocaml.enable = isMaximal;
python.enable = isMaximal;
dart.enable = isMaximal;
bash.enable = isMaximal;
gleam.enable = false;
r.enable = isMaximal;
tailwind.enable = isMaximal;
typst.enable = isMaximal;
clang.enable = isMaximal;
scala.enable = isMaximal;
rust = {
enable = isMaximal;
crates.enable = isMaximal;
};
csharp.enable = isMaximal;
julia.enable = isMaximal;
vala.enable = isMaximal;

# Language modules that are not as common.
assembly.enable = false;
astro.enable = false;
nu.enable = false;
csharp.enable = false;
julia.enable = false;
vala.enable = false;
scala.enable = false;
r.enable = false;
gleam.enable = false;
dart.enable = false;
ocaml.enable = false;
elixir.enable = false;
haskell.enable = false;

tailwind.enable = false;
svelte.enable = false;

# Nim LSP is broken on Darwin and therefore
# should be disabled by default. Users may still enable
# `vim.languages.vim` to enable it, this does not restrict
# that.
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
nim.enable = false;
};

visuals = {
Expand Down
4 changes: 3 additions & 1 deletion docs/manual.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ in
# Copy anchor scripts to the script directory in document root.
cp -vt "$dest"/script \
${./static/script}/anchor-min.js \
${./static/script}/anchor-use.js
${./static/script}/anchor-use.js \
${./static/script}/search.js
substituteInPlace ./options.md \
--subst-var-by OPTIONS_JSON ./config-options.json
Expand Down Expand Up @@ -100,6 +101,7 @@ in
--script highlightjs/loader.js \
--script script/anchor-use.js \
--script script/anchor-min.js \
--script script/search.js \
--toc-depth 2 \
--section-toc-depth 1 \
manual.md \
Expand Down
20 changes: 20 additions & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Release 0.8 {#sec-release-0.8}

[NotAShelf](https://github.com/notashelf):

[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim

- Add [typst-preview.nvim] under
`languages.typst.extensions.typst-preview-nvim`.

- Add a search widget to the options page in the nvf manual.

[amadaluzia](https://github.com/amadaluzia):

[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim

- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].

[diniamo](https://github.com/diniamo):

- Add Odin support under `vim.languages.odin`.
58 changes: 58 additions & 0 deletions docs/static/script/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
document.addEventListener("DOMContentLoaded", () => {
if (!window.location.pathname.endsWith("options.html")) return;

const searchDiv = document.createElement("div");
searchDiv.id = "search-bar";
searchDiv.innerHTML = `
<input type="text" id="search-input" placeholder="Search options by ID..." />
<div id="search-results"></div>
`;
document.body.prepend(searchDiv);

const dtElements = Array.from(document.querySelectorAll("dt"));
const ddElements = Array.from(document.querySelectorAll("dd"));
const dtOptionIds = dtElements.map(
(dt) => dt.querySelector("a")?.id.toLowerCase() || "",
);

if (dtElements.length === 0 || ddElements.length === 0) {
console.warn("Something went wrong, page may be loaded incorrectly.");
return;
}

const dtElementsData = dtElements.map((dt, index) => ({
element: dt,
id: dtOptionIds[index],
ddElement: ddElements[index],
}));

const hiddenClass = "hidden";
const hiddenStyle = document.createElement("style");
hiddenStyle.innerHTML = `.${hiddenClass} { display: none; }`;
document.head.appendChild(hiddenStyle);

let debounceTimeout;
document.getElementById("search-input").addEventListener("input", (event) => {
clearTimeout(debounceTimeout);
debounceTimeout = setTimeout(() => {
const query = event.target.value.toLowerCase();

const matches = [];
const nonMatches = [];

dtElementsData.forEach(({ element, id, ddElement }) => {
const isMatch = id.includes(query);
if (isMatch) {
matches.push(element, ddElement);
} else {
nonMatches.push(element, ddElement);
}
});

requestAnimationFrame(() => {
matches.forEach((el) => el?.classList.remove(hiddenClass));
nonMatches.forEach((el) => el?.classList.add(hiddenClass));
});
}, 200);
});
});
35 changes: 32 additions & 3 deletions docs/static/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,16 @@ th {

dt {
margin: 1.2rem 0 0.8rem;
content-visibility: auto;
contain-intrinsic-size: auto 42px;
}

dd {
margin-left: 2rem;
content-visibility: auto;
contain-intrinsic-size: auto 500px;
}

div.book {
}
div.book {}

ul {
@include margined;
Expand Down Expand Up @@ -233,6 +235,33 @@ li {
}
}

#search-bar {
position: sticky;
top: 0;
background: white;
padding: 10px;
border-bottom: 1px solid $color-gray-200;
z-index: 1000;
@media (prefers-color-scheme: dark) {
background: $color-gray-900;
color: $color-gray-50;
border-bottom: 1px solid black;
}
}

#search-input {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
background: inherit;
color: inherit;
}

.hidden {
display: none;
}

div.titlepage {
margin: 40px 0;

Expand Down
40 changes: 37 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ffd67b

Please sign in to comment.