Compare commits

...

2 commits

Author SHA1 Message Date
matt1432 0667f0f4c9 fix(nvim): keep bash settings even when not using as IDE
All checks were successful
Discord / discord commits (push) Has been skipped
2024-05-09 09:13:40 -04:00
matt1432 9c9945523c feat(nvim): setup lsp_lines 2024-05-09 09:12:01 -04:00
4 changed files with 49 additions and 40 deletions

View file

@ -6,33 +6,33 @@
}: let }: let
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins; inherit (pkgs) vimPlugins;
in in {
lib.mkIf neovimIde { programs = {
programs = { # I love doing typos
# I love doing typos bash.shellAliases = {
bash.shellAliases = { nivm = "nvim";
nivm = "nvim"; nivim = "nvim";
nivim = "nvim";
};
neovim = {
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraLuaConfig =
/*
lua
*/
''
vim.api.nvim_create_autocmd("FileType", {
pattern = 'sh',
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
'';
plugins = [
];
};
}; };
}
neovim = {
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraLuaConfig =
/*
lua
*/
''
vim.api.nvim_create_autocmd("FileType", {
pattern = 'sh',
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
'';
plugins =
lib.mkIf neovimIde [
];
};
};
}

View file

@ -50,13 +50,23 @@ in {
lsp_status.on_attach(client); lsp_status.on_attach(client);
end, end,
}); });
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
});
require('lsp_lines').setup();
''; '';
plugins = [ plugins = [
vimPlugins.nvim-lspconfig vimPlugins.nvim-lspconfig
vimPlugins.coq_nvim vimPlugins.coq_nvim
vimPlugins.coq-artifacts vimPlugins.coq-artifacts
vimPlugins.coq-thirdparty vimPlugins.coq-thirdparty
vimPlugins.lsp-status-nvim vimPlugins.lsp-status-nvim
vimPlugins.lsp_lines-nvim
]; ];
}; };
}; };

View file

@ -55,7 +55,7 @@ in
lua lua
*/ */
'' ''
local lsp = require('lspconfig') local lsp = require('lspconfig');
lsp.nixd.setup({}); lsp.nixd.setup({});
lsp.nixd.setup(require('coq').lsp_ensure_capabilities({})); lsp.nixd.setup(require('coq').lsp_ensure_capabilities({}));

View file

@ -1,6 +1,6 @@
-- Override netrw -- Override netrw
vim.g.loaded_netrw = 0 vim.g.loaded_netrw = 0;
vim.g.loaded_netrwPlugin = 0 vim.g.loaded_netrwPlugin = 0;
require('neo-tree').setup({ require('neo-tree').setup({
close_if_last_window = true, close_if_last_window = true,
@ -28,21 +28,20 @@ require('neo-tree').setup({
source_selector = { source_selector = {
winbar = true, winbar = true,
statusline = false statusline = false,
}, },
follow_current_file = { follow_current_file = {
enabled = true, enabled = true,
leave_dirs_open = true, leave_dirs_open = true,
} },
}) });
local function is_neotree_open() local function is_neotree_open()
local manager = require("neo-tree.sources.manager") local manager = require("neo-tree.sources.manager");
local renderer = require("neo-tree.ui.renderer") local renderer = require("neo-tree.ui.renderer");
local state = manager.get_state("filesystem") local state = manager.get_state("filesystem");
local window_exists = renderer.window_exists(state) return renderer.window_exists(state);
return window_exists
end end
-- Auto open Neo-Tree on big enough window -- Auto open Neo-Tree on big enough window