aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock26
-rw-r--r--flake.nix42
-rw-r--r--init.lua15
-rw-r--r--nix/flake8-isort.nix11
-rw-r--r--nix/mypython.nix13
-rw-r--r--nix/vale.nix20
6 files changed, 127 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..c00c3dd
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,26 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1654230545,
+ "narHash": "sha256-8Vlwf0x8ow6pPOK2a04bT+pxIeRnM1+O0Xv9/CuDzRs=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "236cc2971ac72acd90f0ae3a797f9f83098b17ec",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "ref": "nixos-unstable",
+ "type": "indirect"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..87fffd5
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
+{
+ description = "My Completely Inelegant Neovim Flake";
+
+ inputs = {
+ nixpkgs.url = "nixpkgs/nixos-unstable";
+ };
+
+ outputs = { self, nixpkgs }:
+ let
+ system = "x86_64-linux";
+ pkgs = import nixpkgs {
+ inherit system;
+ overlays = [
+ (self: super: {
+ vale = super.callPackage ./nix/vale.nix { };
+ flake8-isort = super.python3Packages.callPackage ./nix/flake8-isort.nix { };
+ mypython = super.python3Packages.callPackage ./nix/mypython.nix { };
+ })
+ ];
+ };
+ in {
+ packages.${system}.neovimCH = with pkgs; symlinkJoin {
+ name = "neovim";
+ paths = [ pkgs.neovim ];
+ buildInputs = [ pkgs.makeWrapper ];
+ postBuild = with pkgs; ''
+ rm $out/bin/nvim
+ BINPATH=${lib.makeBinPath [
+ nodejs
+ mypython
+ pyright
+ vale
+ tree-sitter
+ nodePackages.bash-language-server
+ shellcheck
+ hadolint
+ ]}
+ makeWrapper ${neovim}/bin/nvim $out/bin/nvim --prefix PATH : $BINPATH
+ '';
+ };
+ };
+}
diff --git a/init.lua b/init.lua
index 59efa86..e62906e 100644
--- a/init.lua
+++ b/init.lua
@@ -103,6 +103,8 @@ vim.api.nvim_set_keymap('n', '<leader>cp', "<cmd>cprev<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>cn', "<cmd>cnext<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>lp', "<cmd>lprev<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>ln', "<cmd>lnext<cr>", { noremap = true })
+vim.api.nvim_set_keymap('n', '<leader>lo', "<cmd>lopen<cr>", { noremap = true })
+vim.api.nvim_set_keymap('n', '<leader>lc', "<cmd>lclose<cr>", { noremap = true })
-- Visually select line without ending
vim.api.nvim_set_keymap('n', '<leader>v', '^v$h', { noremap = true })
-- Ledger Shortcuts
@@ -387,11 +389,15 @@ return require('packer').startup(function()
use {
'dense-analysis/ale',
config = function()
+ -- vim.g.ale_set_quickfix = 1
+ -- vim.g.ale_open_list = 1
+ vim.g.ale_lint_on_save = 1
vim.g.ale_linters = {
sh = { "shellcheck", },
python = { "flake8" },
dockerfile = { "hadolint" },
terraform = { "terraform_ls" },
+ markdown = { "vale" },
}
vim.g.ale_fixers = {
sh = { "shfmt", },
@@ -412,6 +418,15 @@ return require('packer').startup(function()
}
use 'hashivim/vim-terraform'
use {
+ 'anufrievroman/vim-angry-reviewer',
+ config = function()
+ vim.g.AngryReviewerEnglish = 'american'
+ vim.cmd([[
+ autocmd BufWrite *.md :AngryReviewer
+ ]])
+ end
+ }
+ use {
'mileszs/ack.vim',
config = function()
vim.cmd([[
diff --git a/nix/flake8-isort.nix b/nix/flake8-isort.nix
new file mode 100644
index 0000000..385e4f7
--- /dev/null
+++ b/nix/flake8-isort.nix
@@ -0,0 +1,11 @@
+{ buildPythonPackage, fetchPypi, python3Packages }:
+
+buildPythonPackage rec {
+ pname = "flake8-isort";
+ version = "4.1.1";
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "2BQwSrcObliFm8XD4iHi5ucclY5wBSOSAv7hnCT4Jxc=";
+ };
+ checkInputs = with python3Packages; [ flake8 isort pytest testfixtures ];
+}
diff --git a/nix/mypython.nix b/nix/mypython.nix
new file mode 100644
index 0000000..aa262d4
--- /dev/null
+++ b/nix/mypython.nix
@@ -0,0 +1,13 @@
+{ python3, flake8-isort }:
+
+let
+ my-python-packages = python-packages: with python-packages; [
+ jedi-language-server
+ flake8
+ flake8-isort
+ isort
+ black
+ ];
+ mypython = python3.withPackages my-python-packages;
+in
+mypython
diff --git a/nix/vale.nix b/nix/vale.nix
new file mode 100644
index 0000000..396f0b7
--- /dev/null
+++ b/nix/vale.nix
@@ -0,0 +1,20 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+ pname = "vale";
+ version = "2.17.0";
+ subPackages = [ "cmd/vale" ];
+ outputs = [ "out" "data" ];
+ src = fetchFromGitHub {
+ owner = "errata-ai";
+ repo = "vale";
+ rev = "v${version}";
+ sha256 = "sha256-PUaIx6rEaLz0HUxkglsVHw0Kx/ovI2f4Yhknuysr5Gs=";
+ };
+ vendorSha256 = "sha256-zdgLWEArmtHTDM844LoSJwKp0UGoAR8bHnFOSlrrjdg=";
+ postInstall = ''
+ mkdir -p $data/share/vale
+ cp -r styles $data/share/vale
+ '';
+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
+}