Skip to content

Commit

Permalink
Several additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Gomez committed Jan 13, 2025
1 parent fb6a899 commit 86c4bc1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 43 deletions.
18 changes: 18 additions & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@
};
};

# extraPlugins = [
# (pkgs.vimUtils.buildVimPlugin {
# name = "ghost-text";
# src = pkgs.fetchFromGitHub {
# owner = "wallpants";
# repo = "ghost-text.nvim";
# rev = "v2.0.4";
# hash = "sha256-zsyB3eJpwN8+dknjRZ89RttdiC1IA2LakBfnFNudQOI=";
# };
# })
# ];
# extraConfigLua = ''
# require('ghost-text').setup({
# autostart=true,
# port = 4001,
# log_level = nil,
# })
# '';
plugins.zen-mode = {
enable = true;
};
Expand Down
66 changes: 29 additions & 37 deletions config/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config,
lib,
pkgs,
helpers,
inputs,
...
}: {
Expand Down Expand Up @@ -59,10 +60,10 @@
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
sources = [
{name = "path";}
{name = "luasnip";}
{name = "nvim_lsp";}
{name = "cmp_tabby";}
{name = "luasnip";}
{name = "path";}
{
name = "buffer";
# Words from other open buffers can also be suggested.
Expand All @@ -74,41 +75,31 @@
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
# "<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
# "<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { 'i', 's' })";

"<S-Tab>" = "cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' })";
"<CR>" = "cmp.mapping(function(fallback)
if cmp.visible() then
if luasnip.expandable() then
luasnip.expand()
else
cmp.confirm({
select = true,
})
end
else
fallback()
end
end)";
# "<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-n>" = ''
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" })
'';
"<C-p>" = ''
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" })
'';
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
};
};
Expand All @@ -118,6 +109,7 @@
enable = true;
autoLoad = true;
servers = {
lua_ls.enable = true;
markdown_oxide.enable = true;
nil_ls.enable = true;
rust_analyzer.enable = true;
Expand Down
12 changes: 8 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = inputs @ {flake-parts, nixvim, ...}:
outputs = inputs @ {
flake-parts,
nixvim,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} ({
withSystem,
flake-parts-lib,
Expand All @@ -36,9 +40,9 @@
# options = {};
# config = import ./config/default.nix;
# });
flake.nixosModules.default = {pkgs, ...}: {
imports = [./nixos-module.nix];
};
flake.nixosModules.default = {pkgs, ...}: {
imports = [./nixos-module.nix];
};
systems = ["x86_64-linux" "aarch64-darwin"];
flake.templates = {
python_uv = {
Expand Down
6 changes: 5 additions & 1 deletion nixos-module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{config, pkgs, ...}: {
{
config,
pkgs,
...
}: {
options = {};
config = import ./config;
}
1 change: 0 additions & 1 deletion pkg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
system,
...
}: {

# checks.buildWithModule = inputs'.nixvim.lib.${system}.check.mkTestDerivationFromNvim {
# name = "Test";
# nvim = inputs'.nixvim.legacyPackages.makeNixvimWithModule{
Expand Down

0 comments on commit 86c4bc1

Please sign in to comment.