mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 01:59:49 +01:00
Compare commits
8 commits
27dea5c575
...
414b9e0d49
Author | SHA1 | Date | |
---|---|---|---|
|
414b9e0d49 | ||
0c90a7b1c6 | |||
bd9fe9eb68 | |||
5b2ab22777 | |||
|
6d07646fae | ||
|
14de965ce9 | ||
|
234ad31909 | ||
|
73cc5edd31 |
2 changed files with 54 additions and 37 deletions
|
@ -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;
|
||||
|
@ -31,54 +35,60 @@ 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;
|
||||
|
||||
# Languages that will be supported in default and maximal configurations.
|
||||
nix.enable = true;
|
||||
markdown.enable = true;
|
||||
|
||||
# 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;
|
||||
go.enable = isMaximal;
|
||||
lua.enable = isMaximal;
|
||||
zig.enable = isMaximal;
|
||||
python.enable = isMaximal;
|
||||
typst.enable = isMaximal;
|
||||
rust = {
|
||||
enable = isMaximal;
|
||||
crates.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;
|
||||
|
||||
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;
|
||||
|
||||
nix.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;
|
||||
css.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;
|
||||
nu.enable = false;
|
||||
};
|
||||
|
||||
visuals = {
|
||||
|
|
|
@ -77,6 +77,9 @@ in {
|
|||
-- buffer is a real file on the disk
|
||||
local real_file = vim.fn.filereadable(data.file) == 1
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
-- buffer is a [No Name]
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
|
@ -84,7 +87,7 @@ in {
|
|||
local filetype = vim.bo[data.buf].ft
|
||||
|
||||
-- only files please
|
||||
if not real_file and not no_name then
|
||||
if not real_file and not directory and not no_name then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -93,6 +96,10 @@ in {
|
|||
return
|
||||
end
|
||||
|
||||
-- cd if buffer is a directory
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
-- open the tree but don't focus it
|
||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue