adding helix, vanilla neovim
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
{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" })
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
38
home/modules/devtools/neovim/plugins/alpha.nix
Normal file
38
home/modules/devtools/neovim/plugins/alpha.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/autopairs.nix
Normal file
15
home/modules/devtools/neovim/plugins/autopairs.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-autopairs").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bqf').setup{}
|
||||
require("bqf").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bufferline').setup{}
|
||||
require("bufferline").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('colorizer').setup{}
|
||||
require("colorizer").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,14 +8,14 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('Comment').setup{
|
||||
opleader = {
|
||||
line = '<C-b>'
|
||||
},
|
||||
toggler = {
|
||||
line = '<C-b>'
|
||||
},
|
||||
}
|
||||
require("Comment").setup({
|
||||
opleader = {
|
||||
line = "<C-b>",
|
||||
},
|
||||
toggler = {
|
||||
line = "<C-b>",
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -9,6 +9,12 @@
|
||||
*/
|
||||
''
|
||||
require("conform").setup({
|
||||
default_format_opts = {
|
||||
timeout_ms = 3000,
|
||||
async = false, -- not recommended to change
|
||||
quiet = false, -- not recommended to change
|
||||
lsp_format = "fallback", -- not recommended to change
|
||||
},
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
css = { "prettierd" },
|
||||
@@ -18,7 +24,7 @@
|
||||
lua = { "stylua" },
|
||||
nix = { "alejandra" },
|
||||
php = { "php_cs_fixer" },
|
||||
python = { "black" },
|
||||
python = { "black" },
|
||||
rust = { "rustfmt" },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd" },
|
||||
@@ -31,8 +37,8 @@
|
||||
-- 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 })
|
||||
callback = function()
|
||||
require("conform").format()
|
||||
end,
|
||||
})
|
||||
'';
|
||||
@@ -1,45 +0,0 @@
|
||||
{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-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
45
home/modules/devtools/neovim/plugins/copilot.nix
Normal file
45
home/modules/devtools/neovim/plugins/copilot.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-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -3,22 +3,23 @@
|
||||
vim-illuminate
|
||||
];
|
||||
imports = [
|
||||
./alpha-nvim.nix
|
||||
./bufferline-nvim.nix
|
||||
./comment-nvim.nix
|
||||
./copilot-lua.nix
|
||||
./fidget-nvim.nix
|
||||
./gitsigns-nvim.nix
|
||||
./alpha.nix
|
||||
./bufferline.nix
|
||||
./comment.nix
|
||||
./copilot.nix
|
||||
./fidget.nix
|
||||
./gitsigns.nix
|
||||
./treesitter.nix
|
||||
./conform-nvim.nix
|
||||
./gx-nvim.nix
|
||||
./nvim-bqf.nix
|
||||
./nvim-colorizer-lua.nix
|
||||
./nvim-web-devicons.nix
|
||||
./conform.nix
|
||||
./gx.nix
|
||||
./bqf.nix
|
||||
./colorizer.nix
|
||||
./web-devicons.nix
|
||||
./oil.nix
|
||||
./lualine.nix
|
||||
./range-highlight-nvim.nix
|
||||
./vim-fugitive.nix
|
||||
./range-highlight.nix
|
||||
./fugitive.nix
|
||||
./which-key.nix
|
||||
./autopairs.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('fidget').setup{
|
||||
progress = {
|
||||
display = {
|
||||
progress_icon = { pattern = "dots", period = 1 },
|
||||
},
|
||||
},
|
||||
}
|
||||
require("fidget").setup({
|
||||
progress = {
|
||||
display = {
|
||||
progress_icon = { pattern = "dots", period = 1 },
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -1,23 +0,0 @@
|
||||
{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 = '~' },
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
23
home/modules/devtools/neovim/plugins/gitsigns.nix
Normal file
23
home/modules/devtools/neovim/plugins/gitsigns.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 = "~" },
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -18,9 +18,9 @@ in {
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gx').setup{}
|
||||
vim.keymap.set({"n", "x"}, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app"
|
||||
require("gx").setup({})
|
||||
vim.keymap.set({ "n", "x" }, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app",
|
||||
})
|
||||
'';
|
||||
}
|
||||
@@ -8,46 +8,46 @@
|
||||
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 = {}
|
||||
}
|
||||
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 = {},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
none-ls-nvim
|
||||
plenary-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
extraConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Require necessary plugins
|
||||
require("plenary")
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- Setup null-ls with stylua and other formatters
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.alejandra,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.pint,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.sql_formatter,
|
||||
null_ls.builtins.formatting.xmllint,
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
},
|
||||
})
|
||||
|
||||
-- Function to format on save
|
||||
local function format_on_save()
|
||||
vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({ async = true })]])
|
||||
end
|
||||
|
||||
-- Call the function to enable auto format on save
|
||||
format_on_save()
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -8,27 +8,27 @@
|
||||
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",
|
||||
},
|
||||
}
|
||||
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",
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = plenary-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("plenary").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('range-highlight').setup{}
|
||||
require("range-highlight").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -9,15 +9,10 @@
|
||||
*/
|
||||
''
|
||||
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",
|
||||
})
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('nvim-web-devicons').setup{}
|
||||
require("nvim-web-devicons").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('which-key').setup{}
|
||||
require("which-key").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user