From d641a73aa97d1c99c1776a03c047794313ac2175 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 30 Jan 2024 01:49:24 -0500 Subject: [PATCH] switch to development vim repo --- modules/vim.nix | 12 ++++++++++++ modules/vim/default.nix | 20 -------------------- modules/vim/init.lua | 30 ------------------------------ 3 files changed, 12 insertions(+), 50 deletions(-) create mode 100644 modules/vim.nix delete mode 100644 modules/vim/default.nix delete mode 100644 modules/vim/init.lua diff --git a/modules/vim.nix b/modules/vim.nix new file mode 100644 index 0000000..29e5de9 --- /dev/null +++ b/modules/vim.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +let + alias = cmd: pkgs.writeShellScriptBin cmd '' + exec nix run github:buckley310/vim -- "$@" + ''; +in +{ + environment.systemPackages = [ + (alias "vi") + (alias "vim") + ]; +} diff --git a/modules/vim/default.nix b/modules/vim/default.nix deleted file mode 100644 index 06061b0..0000000 --- a/modules/vim/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: -{ - environment.variables.EDITOR = "vim"; - - environment.systemPackages = with pkgs; [ - nodePackages.prettier - - (lunarvim.override (_: { - viAlias = true; - vimAlias = true; - globalConfig = builtins.readFile ./init.lua + '' - vim.cmd('source ${pkgs.vimPlugins.vim-tmux-navigator}/plugin/tmux_navigator.vim') - ''; - })) - - (writeShellScriptBin "black" '' - exec ${pkgs.python3.pkgs.black}/bin/black "$@" - '') - ]; -} diff --git a/modules/vim/init.lua b/modules/vim/init.lua deleted file mode 100644 index 666a259..0000000 --- a/modules/vim/init.lua +++ /dev/null @@ -1,30 +0,0 @@ -vim.opt.mouse = "" -vim.opt.relativenumber = true -vim.opt.whichwrap = "" - -vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pylyzer" }) - --- null-ls is missing on first-run. only do this if null-ls exists -if pcall(require, "null-ls") then - lvim.format_on_save = true - local formatters = require "lvim.lsp.null-ls.formatters" - formatters.setup { - { exe = "nixpkgs-fmt", filetypes = { "nix" } }, - { exe = "black", filetypes = { "python" } }, - { - name = "prettier", - filetypes = { - "html", - "json", - "js", - "typescript", - "yaml" - }, - }, - } -end - -vim.api.nvim_create_autocmd('BufEnter', { - pattern = '', - command = 'highlight LineNr guifg=#aaaaff' -})