parent
0a90a3f619
commit
73a8bc507f
5 changed files with 71 additions and 17 deletions
devShells/neovim-shells
homeManagerModules/neovim/langs
|
@ -19,11 +19,12 @@
|
|||
langs);
|
||||
in
|
||||
mkLangsShells [
|
||||
"c-lang"
|
||||
"csharp"
|
||||
"json"
|
||||
"lua"
|
||||
"markdown"
|
||||
"qml"
|
||||
"rust"
|
||||
"web"
|
||||
"c-lang"
|
||||
]
|
||||
|
|
|
@ -20,6 +20,7 @@ in {
|
|||
./json
|
||||
./lua
|
||||
./python
|
||||
./qml
|
||||
./rust
|
||||
|
||||
(import ./csharp self)
|
||||
|
|
|
@ -13,23 +13,17 @@ in {
|
|||
neovim = {
|
||||
extraPackages = with pkgs; [go gopls];
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = pkgs.vimPlugins.clangd_extensions-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
lsp.gopls.setup({
|
||||
cmd = { '${pkgs.gopls}/bin/gopls' },
|
||||
capabilities = default_capabilities,
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
lsp.gopls.setup({
|
||||
cmd = { '${pkgs.gopls}/bin/gopls' },
|
||||
capabilities = default_capabilities,
|
||||
});
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
48
homeManagerModules/neovim/langs/qml/default.nix
Normal file
48
homeManagerModules/neovim/langs/qml/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'qml' },
|
||||
|
||||
callback = function()
|
||||
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
|
||||
|
||||
if (devShells['qml'] == nil) then
|
||||
devShells['qml'] = 1;
|
||||
|
||||
require('nix-develop').nix_develop_extend({'${flakeEnv}#qml'}, function()
|
||||
vim.cmd[[LspStart]];
|
||||
end);
|
||||
end
|
||||
end,
|
||||
});
|
||||
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
lsp.qmlls.setup({
|
||||
cmd = { 'qmlls', '-E' },
|
||||
capabilities = default_capabilities,
|
||||
autostart = false,
|
||||
});
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./default.nix;
|
||||
}
|
10
homeManagerModules/neovim/langs/qml/shell.nix
Normal file
10
homeManagerModules/neovim/langs/qml/shell.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
mkShell,
|
||||
kdePackages,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
kdePackages.qtdeclarative
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue