mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
switch to development vim repo
This commit is contained in:
parent
186d9bc1af
commit
d641a73aa9
3 changed files with 12 additions and 50 deletions
12
modules/vim.nix
Normal file
12
modules/vim.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
alias = cmd: pkgs.writeShellScriptBin cmd ''
|
||||
exec nix run github:buckley310/vim -- "$@"
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(alias "vi")
|
||||
(alias "vim")
|
||||
];
|
||||
}
|
|
@ -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 "$@"
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -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'
|
||||
})
|
Loading…
Reference in a new issue