bye nixvim
This commit is contained in:
38
home/modules/devtools/neovim/plugins/alpha-nvim.nix
Normal file
38
home/modules/devtools/neovim/plugins/alpha-nvim.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = alpha-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
dashboard.section.header.opts.hl = "Title"
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button( "n", " New file" , ":enew<CR>"),
|
||||
dashboard.button( "e", " Explore", ":Explore<CR>"),
|
||||
dashboard.button( "g", " Git summary", ":Git | :only<CR>"),
|
||||
dashboard.button( "c", " Nix config flake" , ":e ~/.nix-config/flake.nix<CR>"),
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
vim.keymap.set("n", "<space>h", ":Alpha<CR>", { desc = "Open home dashboard" })
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/bufferline-nvim.nix
Normal file
15
home/modules/devtools/neovim/plugins/bufferline-nvim.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = bufferline-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bufferline').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
22
home/modules/devtools/neovim/plugins/comment-nvim.nix
Normal file
22
home/modules/devtools/neovim/plugins/comment-nvim.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = comment-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('Comment').setup{
|
||||
opleader = {
|
||||
line = '<C-b>'
|
||||
},
|
||||
toggler = {
|
||||
line = '<C-b>'
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
41
home/modules/devtools/neovim/plugins/conform-nvim.nix
Normal file
41
home/modules/devtools/neovim/plugins/conform-nvim.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = conform-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
css = { "prettierd" },
|
||||
html = { "prettierd" },
|
||||
javascript = { "prettierd" },
|
||||
json = { "fixjson" },
|
||||
lua = { "stylua" },
|
||||
nix = { "alejandra" },
|
||||
php = { "php_cs_fixer" },
|
||||
python = { "black" },
|
||||
rust = { "rustfmt" },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd" },
|
||||
query = { "sql_formatter" },
|
||||
yaml = { "prettierd" },
|
||||
["*"] = { "injected" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Optionally, set up a command or auto-command to format on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ bufnr = args.buf })
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
45
home/modules/devtools/neovim/plugins/copilot-lua.nix
Normal file
45
home/modules/devtools/neovim/plugins/copilot-lua.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = copilot-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('copilot').setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-CR>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
24
home/modules/devtools/neovim/plugins/default.nix
Normal file
24
home/modules/devtools/neovim/plugins/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
vim-illuminate
|
||||
];
|
||||
imports = [
|
||||
./alpha-nvim.nix
|
||||
./bufferline-nvim.nix
|
||||
./comment-nvim.nix
|
||||
./copilot-lua.nix
|
||||
./fidget-nvim.nix
|
||||
./gitsigns-nvim.nix
|
||||
./treesitter.nix
|
||||
./conform-nvim.nix
|
||||
./gx-nvim.nix
|
||||
./nvim-bqf.nix
|
||||
./nvim-colorizer-lua.nix
|
||||
./nvim-web-devicons.nix
|
||||
./oil.nix
|
||||
./lualine.nix
|
||||
./range-highlight-nvim.nix
|
||||
./vim-fugitive.nix
|
||||
./which-key.nix
|
||||
];
|
||||
}
|
||||
21
home/modules/devtools/neovim/plugins/fidget-nvim.nix
Normal file
21
home/modules/devtools/neovim/plugins/fidget-nvim.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = fidget-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('fidget').setup{
|
||||
progress = {
|
||||
display = {
|
||||
progress_icon = { pattern = "dots", period = 1 },
|
||||
},
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
23
home/modules/devtools/neovim/plugins/gitsigns-nvim.nix
Normal file
23
home/modules/devtools/neovim/plugins/gitsigns-nvim.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gitsigns').setup{
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
28
home/modules/devtools/neovim/plugins/gx-nvim.nix
Normal file
28
home/modules/devtools/neovim/plugins/gx-nvim.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{pkgs, ...}: let
|
||||
gx-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "gx-nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "chrishrb";
|
||||
repo = "gx.nvim";
|
||||
rev = "f29a87454b02880e0d76264c21be8316224a7395";
|
||||
hash = "sha256-QWJ/cPvSyMTJoWLg51BNFf9+/9i7G+nzennpHP/eQ4g=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
programs.neovim.plugins = [
|
||||
{
|
||||
plugin = gx-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gx').setup{}
|
||||
vim.keymap.set({"n", "x"}, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app"
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
54
home/modules/devtools/neovim/plugins/lualine.nix
Normal file
54
home/modules/devtools/neovim/plugins/lualine.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('lualine').setup{
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox-material',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/nvim-bqf.nix
Normal file
15
home/modules/devtools/neovim/plugins/nvim-bqf.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-bqf;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bqf').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/nvim-colorizer-lua.nix
Normal file
15
home/modules/devtools/neovim/plugins/nvim-colorizer-lua.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-colorizer-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('colorizer').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/nvim-web-devicons.nix
Normal file
15
home/modules/devtools/neovim/plugins/nvim-web-devicons.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-web-devicons;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('nvim-web-devicons').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
35
home/modules/devtools/neovim/plugins/oil.nix
Normal file
35
home/modules/devtools/neovim/plugins/oil.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = oil-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('oil').setup{
|
||||
buf_options = {
|
||||
buflisted = true,
|
||||
bufhidden = "delete",
|
||||
},
|
||||
cleanup_delay_ms = false,
|
||||
use_default_keymaps = false,
|
||||
keymaps = {
|
||||
["<CR>"] = "actions.select",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["gc"] = "actions.close",
|
||||
["gr"] = "actions.refresh",
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = range-highlight-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('range-highlight').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
25
home/modules/devtools/neovim/plugins/treesitter.nix
Normal file
25
home/modules/devtools/neovim/plugins/treesitter.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-treesitter.withAllGrammars;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- ensure_installed = { "nix", "lua" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = function(lang, bufnr)
|
||||
return vim.fn.getfsize(vim.api.nvim_buf_get_name(bufnr)) > 1048576
|
||||
end,
|
||||
},
|
||||
parser_install_dir = vim.fn.stdpath("data") .. "/parsers",
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/vim-fugitive.nix
Normal file
15
home/modules/devtools/neovim/plugins/vim-fugitive.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = vim-fugitive;
|
||||
type = "viml";
|
||||
config =
|
||||
/*
|
||||
vim
|
||||
*/
|
||||
''
|
||||
nmap <space>G :Git<CR>
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/which-key.nix
Normal file
15
home/modules/devtools/neovim/plugins/which-key.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = which-key-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('which-key').setup{}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user