mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-23 20:08:30 +00:00
Compare commits
3 commits
395ac58a80
...
ae77f5eb96
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ae77f5eb96 | ||
cb7ff874e2 | |||
eb037b7bff |
4 changed files with 92 additions and 15 deletions
|
@ -72,7 +72,8 @@ configuration formats.
|
|||
|
||||
- Fix "Emac" typo
|
||||
|
||||
- Add [new-file-template.nvim] to automatically fill new file contents using templates.
|
||||
- Add [new-file-template.nvim] to automatically fill new file contents using
|
||||
templates.
|
||||
|
||||
[diniamo](https://github.com/diniamo):
|
||||
|
||||
|
@ -94,7 +95,6 @@ configuration formats.
|
|||
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
||||
previous iteration of the module also included out of place/broken options,
|
||||
which have been removed for the time being. These are:
|
||||
|
||||
- `listChar` - this was already unused
|
||||
- `fillChar` - this had nothing to do with the plugin, please configure it
|
||||
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
||||
|
@ -147,11 +147,29 @@ configuration formats.
|
|||
- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim
|
||||
closure. Both of those scripts have been automatically added to your PATH upon
|
||||
using neovimConfig or `programs.nvf.enable`.
|
||||
|
||||
- `nvf-print-config` will display your `init.lua`, in full.
|
||||
- `nvf-print-config-path` will display the path to _a clone_ of your
|
||||
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
||||
identical clone.
|
||||
|
||||
- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on
|
||||
Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time
|
||||
being.
|
||||
|
||||
- [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow
|
||||
controlling the default behaviour of the `nvim-navic` component on Lualine,
|
||||
which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled.
|
||||
- `vim.ui.breadcrumbs.alwaysRender` has been renamed to
|
||||
[](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the
|
||||
new format.
|
||||
|
||||
- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP
|
||||
server and make it default.
|
||||
|
||||
- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an
|
||||
additional Python LSP server.
|
||||
|
||||
[ppenguin](https://github.com/ppenguin):
|
||||
|
||||
- Telescope:
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
cfg = config.vim.languages.python;
|
||||
|
||||
defaultServer = "pyright";
|
||||
defaultServer = "basedpyright";
|
||||
servers = {
|
||||
pyright = {
|
||||
package = pkgs.pyright;
|
||||
|
@ -30,6 +30,36 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
basedpyright = {
|
||||
package = pkgs.basedpyright;
|
||||
lspConfig = ''
|
||||
lspconfig.basedpyright.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
python-lsp-server = {
|
||||
package = pkgs.python-lsp-server;
|
||||
lspConfig = ''
|
||||
lspconfig.pylsp.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/pylsp"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "black";
|
||||
|
@ -61,11 +91,12 @@
|
|||
black-and-isort = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "black";
|
||||
runtimeInputs = [pkgs.black pkgs.isort];
|
||||
text = ''
|
||||
black --quiet - "$@" | isort --profile black -
|
||||
'';
|
||||
runtimeInputs = [pkgs.black pkgs.isort];
|
||||
};
|
||||
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.statusline.lualine;
|
||||
breadcrumbsCfg = config.vim.ui.breadcrumbs;
|
||||
bCfg = config.vim.ui.breadcrumbs;
|
||||
in {
|
||||
config = mkMerge [
|
||||
# TODO: move into nvim-tree file
|
||||
|
@ -20,13 +20,14 @@ in {
|
|||
extensions = ["nvim-tree"];
|
||||
};
|
||||
})
|
||||
(mkIf (breadcrumbsCfg.enable && breadcrumbsCfg.source == "nvim-navic") {
|
||||
|
||||
(mkIf (bCfg.enable && bCfg.lualine.winbar.enable && bCfg.source == "nvim-navic") {
|
||||
vim.statusline.lualine.setupOpts = {
|
||||
# TODO: rewrite in new syntax
|
||||
winbar.lualine_c = mkDefault [
|
||||
[
|
||||
"navic"
|
||||
(mkLuaInline "draw_empty = ${boolToString config.vim.ui.breadcrumbs.alwaysRender}")
|
||||
(mkLuaInline "draw_empty = ${boolToString bCfg.lualine.winbar.alwaysRender}")
|
||||
]
|
||||
];
|
||||
};
|
||||
|
@ -34,7 +35,6 @@ in {
|
|||
(mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["lualine"];
|
||||
|
||||
pluginRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
|
|
|
@ -31,6 +31,8 @@ in {
|
|||
(renameSetupOpt ["sourceBuffer" "scrolloff"] ["source_buffer" "scrolloff"])
|
||||
# TODO: every option under icon is renamed to first letter capitalized
|
||||
(renameSetupOpt ["icon"] ["icon"])
|
||||
|
||||
(mkRenamedOptionModule ["vim" "ui" "breadcrumbs" "alwaysRender"] ["vim" "ui" "breadcrumbs" "lualine" "winbar" "alwaysRender"])
|
||||
];
|
||||
|
||||
options.vim.ui.breadcrumbs = {
|
||||
|
@ -43,17 +45,43 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
# maybe this should be an option to *disable* alwaysRender optionally but oh well
|
||||
# too late
|
||||
alwaysRender = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to always display the breadcrumbs component on winbar (always renders winbar)";
|
||||
# Options for configuring Lualine integration of nvim-navic
|
||||
lualine.winbar = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true; # for retaining previous behaviour
|
||||
example = false;
|
||||
description = ''
|
||||
Whether to automatically configure a winbar component for
|
||||
Lualine on the Winbar section.
|
||||
|
||||
::: {.note}
|
||||
This is **set to `true` by default**, which means nvim-navic
|
||||
will occupy `winbar.lualine_c` for the breadcrumbs feature
|
||||
unless this option is set to `false`.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
alwaysRender = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = ''
|
||||
Whether to always display the breadcrumbs component
|
||||
on winbar.
|
||||
|
||||
::: {.note}
|
||||
This will pass `draw_empty` to the `nvim_navic` winbar
|
||||
component, which causes the component to be drawn even
|
||||
if it's empty
|
||||
:::
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
navbuddy = {
|
||||
enable = mkEnableOption "navbuddy LSP helper UI. Enabling this option automatically loads and enables nvim-navic";
|
||||
|
||||
mappings = {
|
||||
close = mkOption {
|
||||
type = str;
|
||||
|
|
Loading…
Add table
Reference in a new issue