1
Fork 0

feat: more work on nvim config

This commit is contained in:
Matei Adriel 2022-01-30 21:19:35 +02:00
parent 860cb11bcc
commit bcf4783d95
10 changed files with 152 additions and 59 deletions

View file

@ -4,11 +4,32 @@ local g = vim.g -- a table to access global variables
local opt = vim.opt -- to set options
-- Basic options
opt.joinspaces = false -- No double spaces with join
opt.list = true -- Show some invisible characters
opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.termguicolors = true -- True color support
opt.ignorecase = true -- Ignore case
opt.smartcase = true -- Do not ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.wrap = false -- Disable line wrap
opt.wildmode = {'list', 'longest'} -- Command-line completion mode
-- Set theme
require('github-theme').setup()
require('github-theme').setup({
theme_style = "light"
})
-- Import my other files
require('my.keymaps').setup()

View file

@ -9,3 +9,5 @@ end
function M.setup()
map("i", "jj", "<Esc>") -- Remap Esc to
end
return M

View file

@ -64,7 +64,38 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1641205782,
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
@ -115,6 +146,52 @@
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1643521936,
"narHash": "sha256-qXtpIBP8wcUIAywqHehlxpaZnwG7spFsb36kDYQXCKQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "9aaf7a2b4dfe9d3f9a1861e7ca85b6bbd4e34e05",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"neovim-flake": "neovim-flake",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1643530359,
"narHash": "sha256-RdCG+OXV3j57BFTyJSXy/Ko1LAM571JV9DiAtIdo0HM=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "e2eaf9379b15c9ee017b0505e9282204b2f29f80",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"nixos-unstable": {
"locked": {
"lastModified": 1642903813,
@ -186,6 +263,7 @@
"easy-purescript-nix": "easy-purescript-nix",
"githubNvimTheme": "githubNvimTheme",
"home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixos-unstable": "nixos-unstable",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
@ -195,8 +273,8 @@
},
"vim-extra-plugins": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {

View file

@ -24,6 +24,9 @@
githubNvimTheme.url = "github:projekt0n/github-nvim-theme";
githubNvimTheme.flake = false;
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs";
vim-extra-plugins.url = "github:m15a/nixpkgs-vim-extra-plugins";
};
@ -32,13 +35,23 @@
system = "x86_64-linux";
provideInputs =
import ./modules/overlays/flakes.nix { inherit system; } inputs;
overlays = { ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [
inputs.vim-extra-plugins.overlay
inputs.neovim-nightly-overlay.overlay
provideInputs
];
};
in {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
home-manager.nixosModules.home-manager
provideInputs
overlays
./hardware/laptop.nix
./configuration.nix
];

View file

@ -15,6 +15,7 @@
./alacritty.nix
./rofi.nix
./postgres.nix
./neovim.nix
];
}

View file

@ -34,7 +34,6 @@
# vscodium
vscode
vim
my-neovim
# emacs
# chat apps

View file

@ -1,14 +1,20 @@
{ wrapNeovim, neovim, tree-sitter, config-nvim, vimPlugins, vimExtraPlugins }:
{ pkgs, ... }:
let
config-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
name = "config-nvim";
src = ../../dotfiles/neovim;
};
in {
home-manager.users.adrielus.programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
wrapNeovim neovim {
configure = {
customRC = ''
extraConfig = ''
let g:disable_paq = v:true
luafile ${config-nvim}/init.lua
'';
packages.default = with vimExtraPlugins; {
start = [ config-nvim vimExtraPlugins.github-nvim-theme ];
};
plugins = with pkgs.vimExtraPlugins; [ config-nvim github-nvim-theme ];
};
}

View file

@ -1,7 +1 @@
{ pkgs, ... }: {
nixpkgs.overlays = [
(import ./tweakSources.nix)
# neovim with my own config baked in
(import ./neovim.nix)
];
}
{ pkgs, ... }: { nixpkgs.overlays = [ (import ./tweakSources.nix) ]; }

View file

@ -1,32 +1,25 @@
{ system }:
{ home-manager, nixpkgs, nixpkgs-unstable, nixos-unstable, easy-purescript-nix
, easy-dhall-nix, z, agnoster, githubNvimTheme, vim-extra-plugins, ... }:
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [
vim-extra-plugins.overlay
(self: super: {
# inherit nixos-unstable;
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config.allowBroken = true;
};
(self: super: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config.allowBroken = true;
};
easy-purescript-nix = import easy-purescript-nix { inherit pkgs; };
easy-dhall-nix = import easy-dhall-nix { inherit pkgs; };
easy-purescript-nix = self.callPackage easy-purescript-nix { };
easy-dhall-nix = self.callPackage easy-dhall-nix { };
z = {
src = z;
name = "z";
};
z = {
src = z;
name = "z";
};
agnoster = {
src = agnoster;
name = "agnoster";
};
agnoster = {
src = agnoster;
name = "agnoster";
};
githubNvimTheme = githubNvimTheme;
})
];
githubNvimTheme = githubNvimTheme;
})

View file

@ -1,14 +0,0 @@
final: prev:
let
config-nvim = final.vimUtils.buildVimPluginFrom2Nix {
name = "config-nvim";
src = ../../dotfiles/neovim;
};
in {
my-neovim = final.callPackage ../applications/neovim.nix {
neovim = final.neovim-nightly;
inherit config-nvim;
};
}