Compare commits

...

8 commits

Author SHA1 Message Date
DamitusThyYeetus123
414b9e0d49
Merge bd9fe9eb68 into 0c90a7b1c6 2024-12-09 15:05:34 +01:00
raf
0c90a7b1c6
configuration: disable superfluous language modules in maximal (#491) 2024-12-09 10:31:59 +00:00
raf
bd9fe9eb68
Merge branch 'main' into v0.7 2024-12-06 15:57:58 +03:00
raf
5b2ab22777
Merge branch 'main' into v0.7 2024-12-04 17:48:44 +03:00
damii
6d07646fae Fix formatting 2024-12-04 09:35:25 +11:00
Ching Pei Yang
14de965ce9
formatting 2024-12-03 01:31:48 +01:00
DamitusThyYeetus123
234ad31909
Merge branch 'NotAShelf:v0.7' into v0.7 2024-12-03 09:13:34 +11:00
DamitusThyYeetus123
73cc5edd31 nvim-tree: Add directory opening 2024-11-12 13:25:08 +11:00
2 changed files with 54 additions and 37 deletions

View file

@ -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: { isMaximal: {
config.vim = { config.vim = {
viAlias = true; 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 = { languages = {
enableLSP = true; enableLSP = true;
enableFormat = true; enableFormat = true;
enableTreesitter = true; enableTreesitter = true;
enableExtraDiagnostics = 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 # Nim LSP is broken on Darwin and therefore
# should be disabled by default. Users may still enable # should be disabled by default. Users may still enable
# `vim.languages.vim` to enable it, this does not restrict # `vim.languages.vim` to enable it, this does not restrict
# that. # that.
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096> # See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
nim.enable = false; 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 = { visuals = {

View file

@ -77,6 +77,9 @@ in {
-- buffer is a real file on the disk -- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1 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] -- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == "" local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
@ -84,7 +87,7 @@ in {
local filetype = vim.bo[data.buf].ft local filetype = vim.bo[data.buf].ft
-- only files please -- 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 return
end end
@ -93,6 +96,10 @@ in {
return return
end end
-- cd if buffer is a directory
if directory then
vim.cmd.cd(data.file)
end
-- open the tree but don't focus it -- open the tree but don't focus it
require("nvim-tree.api").tree.toggle({ focus = false }) require("nvim-tree.api").tree.toggle({ focus = false })
end end