Compare commits

..

1 Commits

Author SHA1 Message Date
voidarclabs
495738e490 adding neorg 2026-02-12 17:29:00 +00:00
30 changed files with 532 additions and 1072 deletions

102
README.md
View File

@@ -1,102 +0,0 @@
# NVIM For Voidfiles
Built using vim.pack and lots of mini plugins
## Installation
### Try with no install
Run the following command:
```bash
nix run git+https://git.voidarc.co.uk/voidarc/nvim#remote
```
This will use NVIM_APPNAME="nvim-remote", and pull config from the git repo without you having to install it to your system.
You will have to wait for the initial plugin install, so I advise just pressing "always" when prompted. Due to autocommands,
when the plugins have installed you will have to restart nvim with the same run command to enter the editor properly.
### Install into nix config without adding config
You can add the repo to your flake like this:
```nix
{
inputs = {
nvim-voidarc.url = "git+https://git.voidarc.co.uk/voidarc/nvim"
}
}
```
And then add this to your package list:
```nix
inputs.nvim-voidarc.packages.${stdenv.hostPlatform.system}.remote
```
I don't recommend making it follow the system nixpkgs as treesitter needs unstable in order to work properly.
### Install into nix config and add local config
Clone this repo into your nvim config directory (make sure to back up beforehand):
```
git clone https://git.voidarc.co.uk/voidarc/nvim ~/.config/nvim
```
Then add that folder as an input to your flake:
```nix
{
inputs = {
nvim-voidarc.url = "git+file:///home/username/.config/nvim";
}
}
```
Adjust the path and the username to what they are on your system. The input should be the path of the directory
that contains the flake, in this case the flake's path would be `/home/username/.config/nvim/flake.nix`.
Then add the default package to your system package:
```nix
inputs.nvim-voidarc.packages.${stdenv.hostPlatform.system}.default
```
Adding the remote package here will still work, but defeats the point of cloning it locally.
## Usage
This is a very esoteric config. I am quite opinionated, so there isn't any nice stuff like a homepage or which-keys.
Instead, there is efficiency. This is the minimum amount of pacakges required in order to support full functionality,
while also being highly extensible and adaptable to any programming language that I could want to program in.
### Keybinds
All keybinds can be found in the `lua/config/binds.lua` file, with a few exceptions. The `Keybind` function is a shorthand for the vim api.
All default vim bindings remain untouched, with almost all of the set binds having a leader prefix.
The leader key is space, configurable at the top of the `init.lua` file. When referring to the leader key, assume I mean space.
#### Navigation
- \<leader\>ff - Open Telescope fuzzy finder
- \<leader\>fn - Open Telescope file manager
- \<leader\>fg - Telescope live grep (only works in git repos afaik)
- \<leader\>fb - Telescope list of open buffers
- \<leader\>bd - Delete focused buffer
If a file is open, Telescope is configured to jump to the pane/tab where that file is open, rather than open it in the current pane.
This allows for a more consistent editing experience, such as having seperate tabs for backend and frontend files.
- \<C-t\>l - Next tab
- \<C-t\>h - Previous tab
- \<C-t\>j - New tab to the right
- \<C-t\>q - Close tab (Keeps buffers open)
Instead of using \<C-t\>j, I prefer to find the file in Telescope and use <C-t>, which opens the file in a new tab. This ovverides the
regular Telescope behaviour of jumping to the relevant pane, which only applies to enter. Similarly, <C-v> in Telescope opens the
selected file in a split to the right in the current tab. All <C-w> binds for navigating windows remain unchanged
#### Editing
- \<leader\>d - Open vim.lsp.diagnostic float menu
- gd - Go to definition of function
- ss - Open flash.nvim menu
Flash nvim has no leader key for ease of access. Non-text based flash functions are available according to the binds, but I don't use them.
#### Session management
- \<leader\>qj - Save session and exit
- \<leader\>qd - Delete session and exit
Both of these commands run `wqa`, meaning that even when deleting a session no data is ever lost (not that autosave isn't on by default lol).
When opening nvim in a folder with a `.session` file, the session will automatically be restored, including window layout. For more info, see
the mini.sessions documentation. Sessions autosave, but it is faster to use the save keybind than quit all windows one by one or run `:wqa`

62
flake.lock generated
View File

@@ -1,62 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1782467914,
"narHash": "sha256-pGvFkM8N0xEkIIXDe5YYfbEAvHrk4IxBrjB/x8OomhE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1780336545,
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"wrappers": "wrappers"
}
},
"wrappers": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1782135443,
"narHash": "sha256-vAmbArdCyjqpVW+37aCy/PMBOLIqukUXLQuEKLwUhA4=",
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"rev": "6e7f66fa2cdf4d63162580b438f7fcf87c28a46f",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,62 +0,0 @@
{
description = "Neovim with LSP dev shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
wrappers.url = "github:BirdeeHub/nix-wrapper-modules";
};
outputs = {
self,
nixpkgs,
...
} @ inputs: let
# Define the systems you want to support
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
# A helper function to generate outputs for each system
# It imports nixpkgs for the system and passes the resulting 'pkgs' to the function 'f'
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f (import nixpkgs {inherit system;}));
in {
# Use the helper to generate the packages attribute for every system
packages = forAllSystems (
pkgs: let
pkgList = with pkgs; [
# LSPs
lua-language-server
vscode-langservers-extracted
emmet-language-server
svelte-language-server
rust-analyzer
ast-grep
prettier
black
alejandra
rustfmt
python313Packages.python-lsp-server
typescript-language-server
tailwindcss-language-server
stylua
nixd
# other tools
lua5_1
tree-sitter
ripgrep
gcc
fzf
gnumake
imagemagick
luarocks
];
in {
# Define the default package for this system
default = inputs.wrappers.wrappers.neovim.wrap {
inherit pkgs;
runtimePkgs = pkgList;
settings.config_directory = ./.;
};
}
);
};
}

View File

@@ -1,16 +1,8 @@
vim.g.mapleader = " " -- Set mapleader
vim.g.maplocalleader = "," vim.g.mapleader = "<Space>"
-- Scrolloff -- Lazy
local scrolloff = math.floor(vim.o.lines / 2) - 3 require("config.lazy")
vim.opt.scrolloff = scrolloff
require("plugins.init")
require("config.autocmd")
require("config.binds")
-- Colorcheme
vim.cmd.colorscheme("catppuccin-mocha")
-- Line numbers -- Line numbers
vim.opt.cursorline = true vim.opt.cursorline = true
@@ -24,6 +16,14 @@ vim.opt.splitbelow = true
vim.opt.splitright = true vim.opt.splitright = true
vim.o.winborder = "rounded" vim.o.winborder = "rounded"
-- Sane keymaps
vim.keymap.set("i", "jj", "<Esc>")
vim.keymap.set("n", "q:", ":", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>bd", function() -- delete buffer
vim.cmd("bd")
vim.cmd("echo 'Buffer deleted'")
end, { noremap = true })
-- Sane tab management -- Sane tab management
vim.opt.tabstop = 2 vim.opt.tabstop = 2
vim.opt.softtabstop = 2 vim.opt.softtabstop = 2
@@ -43,12 +43,33 @@ vim.opt.incsearch = true
-- Nowrap -- Nowrap
vim.opt.wrap = false vim.opt.wrap = false
-- Indent -- Colorcheme
vim.o.autoindent = true vim.cmd.colorscheme("catppuccin-mocha")
-- Undotree -- Scrolloff
vim.cmd("packadd nvim.undotree") vim.opt.scrolloff = math.floor(vim.o.lines / 2) - 3
vim.keymap.set("n", "<leader>u", require("undotree").open)
-- Local project config -- Force proper keybindings
vim.o.exrc = true vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
-- C-BS for deleting whole word in insert mode
vim.keymap.set("i", "<C-BS>", "<C-W>", { noremap = true })
-- Keybinds for MiniSessions
vim.keymap.set("n", "<leader>qs", function() -- quit and save session local
MiniSessions.write(".session")
vim.cmd("wqa")
end, { noremap = true })
vim.keymap.set("n", "<leader>qw", function() -- quit and save session global
MiniSessions.write()
vim.cmd("wqa")
end, { noremap = true })
vim.keymap.set("n", "<leader>qd", function() -- quit and delete session
MiniSessions.delete(".session")
vim.cmd("wqa")
end, { noremap = true })

View File

@@ -1,82 +0,0 @@
-- Autocommand to check git status
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
-- Verify if the current directory is a git repo
local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1")
if is_git ~= 0 then
return
end
-- Perform an async fetch to avoid startup lag
vim.fn.jobstart("git fetch", {
on_exit = function()
-- Get the number of commits the remote is ahead of local HEAD
local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "")
if count ~= "" and tonumber(count) > 0 then
vim.schedule(function()
vim.notify(
"󰊢 " .. count .. " new commit(s) available on remote.",
vim.log.levels.INFO,
{ title = "Git Status", icon = "󰊢" }
)
end)
end
end,
})
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "svelte" },
callback = function()
vim.treesitter.start()
end,
})
local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true })
vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, {
group = cursorline_group,
callback = function()
vim.opt_local.cursorline = true
end,
})
vim.api.nvim_create_autocmd({ "WinLeave" }, {
group = cursorline_group,
callback = function()
vim.opt_local.cursorline = false
end,
})
local group = vim.api.nvim_create_augroup("autosave", {})
-- Notification to say when a file is saved by autosave
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveWritePre",
group = group,
callback = function(opts)
if opts.data.saved_buffer ~= nil then
local filename = vim.fn.expand("%:t")
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
end
end,
})
-- Notification when enabling/disabling autosave for a buffer
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveEnable",
group = group,
callback = function()
print("AutoSave enabled")
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveDisable",
group = group,
callback = function()
print("AutoSave disabled")
end,
})

View File

@@ -1,117 +0,0 @@
-- Keymap function
function Keymap(mode, key, binding, opts)
local options = { noremap = true, silent = true }
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.keymap.set(mode, key, binding, options)
end
Keymap("n", "q:", ":") -- remove nonsense command
Keymap("n", "<leader>bd", function() -- delete buffer
vim.cmd("bd")
vim.cmd("echo 'Buffer deleted'")
end)
for _, bind in ipairs({ "i", "a", "A" }) do
-- Pass { expr = true } as the fourth argument
Keymap("n", bind, function()
if vim.fn.getline("."):match("^%s*$") then
return [["_cc]]
else
return bind
end
end, { expr = true })
end
Keymap("i", "<C-BS>", "<C-W>") -- C-Backscpace for whole words
Keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>") -- Diagnostics for Linter
Keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>") -- Diagnostics for Linter
-- Terminal Keymaps
Keymap("n", "<leader>tj", function() -- open term in new pane
vim.cmd.vnew()
vim.cmd.term()
vim.cmd.startinsert()
end)
Keymap("n", "<leader>tk", function() -- open term in new tab
vim.cmd.tabnew()
vim.cmd.term()
vim.cmd.startinsert()
end)
Keymap("t", "<C-D>", "<C-\\><C-n>") -- escape terminal with c-d
-- Flash keymaps
Keymap("n", "ss", function()
require("flash").jump()
end)
Keymap("n", "S", function()
require("flash").treesitter()
end)
Keymap("n", "<leader>r", function()
require("flash").remote()
end)
Keymap("n", "<leader>R", function()
require("flash").treesitter_search()
end)
-- Mini Session Keybinds
Keymap("n", "<leader>qj", function() -- quit and save session local
require("mini.sessions").write(".session")
vim.cmd("wqa")
end)
Keymap("n", "<leader>qd", function() -- quit and delete session
require("mini.sessions").delete(".session")
vim.cmd("wqa")
end)
-- Telescope
local builtin = require("telescope.builtin")
Keymap("n", "<leader>ff", function()
builtin.find_files({ hidden = true })
end)
Keymap("n", "<space>fn", function()
local full_path = vim.api.nvim_buf_get_name(0)
local dir = vim.fn.fnamemodify(full_path, ":h")
require("telescope").extensions.file_browser.file_browser({
path = dir,
})
end)
Keymap("n", "<space>fs", function() -- select sessions
MiniSessions.select()
end)
Keymap("n", "<space>fd", function() -- select sessions
MiniSessions.select("delete")
end)
Keymap("n", "<leader>fg", function()
builtin.live_grep({ hidden = true })
end)
Keymap("n", "<leader>fb", function()
builtin.buffers({ show_all_buffers = true })
end)
-- Tab binds
Keymap("n", "<C-T>l", function()
vim.cmd("tabnext")
end)
Keymap("n", "<C-T>h", function()
vim.cmd("tabprevious")
end)
Keymap("n", "<C-T>j", function()
vim.cmd("tabnew")
end)
Keymap("n", "<C-T>q", function()
vim.cmd("tabclose")
end)

44
lua/config/lazy.lua Normal file
View File

@@ -0,0 +1,44 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
{ import = "plugins.completion" },
{ import = "plugins.ui" },
{ import = "plugins.functional" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "catppuccin" } },
ui = {
border = "rounded",
},
-- automatically check for plugin updates
checker = { enabled = false },
performance = {
reset_packpath = false,
},
})

View File

@@ -0,0 +1,48 @@
return {
"saghen/blink.cmp",
dependencies = {
"L3MON4D3/LuaSnip",
},
opts = {
-- Snippet configuration
snippets = {
preset = "luasnip", -- Tells blink.cmp to use LuaSnip
},
fuzzy = { implementation = "lua" },
signature = { enabled = true },
completion = {
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
},
-- Keymaps
keymap = {
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
},
sources = {
default = {
"lazydev",
"lsp", -- (Equivalent to cmp-nvim-lsp)
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
"buffer", -- (Equivalent to cmp-buffer)
"path", -- (Equivalent to cmp-path)
-- "cmdline", -- Generally configured separately, but often included by default
},
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
},
},
},
},
}

View File

@@ -1,52 +1,14 @@
vim.pack.add({ return {
{ src = "https://github.com/stevearc/conform.nvim", name = "conform" }, "stevearc/conform.nvim",
{ src = "https://github.com/mfussenegger/nvim-lint", name = "lint" }, config = function()
}) require("conform").setup({
formatters_by_ft = {
require("conform").setup({ lua = { "stylua" },
formatters_by_ft = { javascript = { "prettier" },
lua = { "stylua" }, python = { "black" },
javascript = { "prettier" }, nix = { "nixfmt" },
typescriptreact = { "prettier" }, },
typescript = { "prettier" }, format_on_save = true,
html = { "prettier" }, })
svelte = { "prettier" },
python = { "black" },
nix = { "alejandra" },
css = { "prettier" },
rust = { "rustfmt" },
},
format_on_save = true,
undojoin = true,
})
local lint = require("lint")
-- Only show diagnostics close to the cursor
vim.diagnostic.config({
virtual_text = {
spacing = 4,
prefix = function(diagnostic)
local icons = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "󰉀 ",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰌵 ",
}
return icons[diagnostic.severity] or ""
end,
},
signs = false,
underline = true,
update_in_insert = false,
})
-- Auto-run the linter only for the configured filetypes
vim.api.nvim_create_autocmd("BufWritePost", {
callback = function()
local ft = vim.bo.filetype
if lint.linters_by_ft[ft] then
lint.try_lint()
end
end, end,
}) }

View File

@@ -0,0 +1,11 @@
return {
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
}

View File

@@ -0,0 +1,44 @@
return {
"mfussenegger/nvim-lint",
config = function()
local lint = require("lint")
-- Explicitly define linters for each file type (without ast_grep)
lint.linters_by_ft = {
python = { "flake8" },
javascript = { "eslint" },
typescript = { "eslint" },
}
-- Only show diagnostics close to the cursor
vim.diagnostic.config({
virtual_text = {
spacing = 4,
-- You can make prefix dynamic based on severity using a function
prefix = function(diagnostic)
local icons = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "",
}
return icons[diagnostic.severity] or ""
end,
},
signs = false,
underline = true,
update_in_insert = false,
})
-- Auto-run the linter only for the configured filetypes
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "!*.lua",
callback = function()
local ft = vim.bo.filetype
if lint.linters_by_ft[ft] then
lint.try_lint()
end
end,
})
end,
}

View File

@@ -1,133 +1,38 @@
vim.pack.add({ return {
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" }, "neovim/nvim-lspconfig",
{ src = "https://github.com/saghen/blink.cmp", name = "blink" }, config = function()
{ src = "https://github.com/saghen/blink.lib", name = "blink-lib" }, vim.lsp.config("lua_ls", {
}) settings = {
Lua = {
local hostname = vim.uv.os_gethostname() -- Tell the server to let Neovim handle snippet expansion
local lowerHostname = string.lower(hostname) completion = {
callSnippet = "Replace",
vim.lsp.config("nixd", { },
cmd = { "nixd" }, -- Use LuaJIT (which Neovim uses)
filetypes = { "nix" }, runtime = {
root_markers = { "flake.nix", ".git" }, version = "LuaJIT",
settings = {
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
formatting = {
command = { "alejandra" },
},
options = {
nixos = {
expr = '(builtins.getFlake "~/.dotfiles/.nixos").nixosConfigurations.'
.. lowerHostname
.. ".options",
},
},
},
},
})
vim.lsp.config("lua_ls", {
settings = {
Lua = {
-- Tell the server to let Neovim handle snippet expansion
completion = {
callSnippet = "Replace",
},
-- Use LuaJIT (which Neovim uses)
runtime = {
version = "LuaJIT",
},
},
},
})
vim.lsp.enable({
"lua_ls",
"ts_ls",
"pylsp",
"cssls",
"svelte",
"nixd",
"rust_analyzer",
"emmet_language_server",
})
vim.o.pumborder = "rounded"
require("blink.cmp").setup({
fuzzy = { implementation = "lua" },
signature = {
enabled = false,
},
completion = {
trigger = {
show_on_insert = true,
show_on_trigger_character = true,
show_on_keyword = true,
show_on_backspace = true,
},
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
menu = {
auto_show = true,
border = "rounded",
min_width = 35,
auto_show_delay_ms = 100,
},
},
-- Keymaps
keymap = {
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
},
sources = {
default = {
"lsp", -- (Equivalent to cmp-nvim-lsp)
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
"buffer", -- (Equivalent to cmp-buffer)
"path", -- (Equivalent to cmp-path)
},
providers = {
-- lazydev = {
-- name = "LazyDev",
-- module = "lazydev.integrations.blink",
-- -- make lazydev completions top priority (see `:h blink.cmp`)
-- score_offset = 100,
-- },
},
},
})
vim.api.nvim_create_autocmd("FileType", { -- Lazy load lazydev when in lua file (no pun intended)
pattern = "lua",
callback = function()
vim.pack.add({
{ src = "https://github.com/folke/lazydev.nvim", name = "lazydev" },
})
require("lazydev").setup()
require("blink.cmp").setup({ -- Reload blink with lazydev as a source
sources = {
-- add lazydev to your completion providers
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
}, },
}, },
}, },
}) })
vim.lsp.config("emmet_ls", {
-- capabilities = require("cmp_nvim_lsp").default_capabilities(),
filetypes = { "html", "css", "javascriptreact", "typescriptreact" },
init_options = {
html = {
options = {
["bem.enabled"] = true,
},
},
},
})
vim.lsp.enable({
"lua_ls",
"ts_ls",
"cssls",
"nixd",
"rust_analyzer",
"emmet_ls",
})
end, end,
}) }

View File

@@ -1,25 +1,13 @@
vim.pack.add({ { src = "https://github.com/nvim-treesitter/nvim-treesitter", name = "treesitter" } }) return {
"nvim-treesitter/nvim-treesitter",
require("nvim-treesitter").setup({ -- Important: On NixOS, we don't want lazy to build it
highlight = { enable = true }, build = false,
indent = { enable = true }, lazy = false,
}) config = function()
require("nvim-treesitter").setup({
require("nvim-treesitter").install({ -- Disable auto_install so it doesn't try to use 'git' or 'curl'
"bash", auto_install = false,
"html", highlight = { enable = true },
"svelte", })
"latex", end,
"javascript", }
"json",
"lua",
"markdown",
"markdown_inline",
"query",
"regex",
"tsx",
"typescript",
"python",
"vim",
"yaml",
})

View File

@@ -0,0 +1,48 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
keys = {
{
"ss",
mode = { "n", "x", "o" },
function()
require("flash").jump()
end,
desc = "Flash",
},
{
"S",
mode = { "n", "x", "o" },
function()
require("flash").treesitter()
end,
desc = "Flash Treesitter",
},
{
"<leader>r",
mode = "o",
function()
require("flash").remote()
end,
desc = "Remote Flash",
},
{
"<leader>R",
mode = { "o", "x" },
function()
require("flash").treesitter_search()
end,
desc = "Treesitter Search",
},
{
"<leader><c-s>",
mode = { "c" },
function()
require("flash").toggle()
end,
desc = "Toggle Flash Search",
},
},
}

View File

@@ -0,0 +1,66 @@
return {
"echasnovski/mini.nvim",
version = "",
config = function()
local animate = require("mini.animate")
require("mini.pairs").setup() -- Bracket pairs and stuff
require("mini.ai").setup() -- Around and In extension for visual mode
require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d)
require("mini.indentscope").setup({
symbol = "",
draw = {
delay = 10,
animation = require("mini.indentscope").gen_animation.linear({
duration = 15,
unit = "step",
easing = "out",
}),
},
}) -- Indent lines
require("mini.trailspace").setup() -- Shows useless spaces
require("mini.sessions").setup({
autoread = true,
autowrite = true,
file = ".session",
force = { read = false, write = true, delete = true },
})
require("mini.notify").setup() -- Better Notifications
require("mini.surround").setup() -- Suround selections with characters
require("mini.move").setup({
mappings = {
down = "J",
up = "K",
},
})
require("mini.icons").setup() -- Icon provider
require("mini.animate").setup({
cursor = {
enable = false,
},
scroll = {
-- Animate for 200 milliseconds with linear easing
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
-- Animate equally but with at most 120 steps instead of default 60
subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }),
},
open = {
-- Animate for 400 milliseconds with linear easing
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
-- Animate with wiping from nearest edge instead of default static one
winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }),
-- Make bigger windows more transparent
winblend = animate.gen_winblend.linear({ from = 80, to = 100 }),
},
close = {
-- Animate for 400 milliseconds with linear easing
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
-- Animate with wiping to nearest edge instead of default static one
winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }),
-- Make bigger windows more transparent
winblend = animate.gen_winblend.linear({ from = 100, to = 80 }),
},
})
end,
}

View File

@@ -0,0 +1,21 @@
return {
"nvim-neorg/neorg",
build = false,
dependencies = { "nvim-lua/plenary.nvim", "nvim-neorg/tree-sitter-norg" },
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Loads default settings
["core.concealer"] = {}, -- Adds pretty icons/formatting
["core.dirman"] = { -- Manages your workspaces
config = {
workspaces = {
notes = "~/notes",
},
default_workspace = "notes",
},
},
},
})
end,
}

View File

@@ -0,0 +1,4 @@
return {
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
}

View File

@@ -0,0 +1,4 @@
return {
"nvim-telescope/telescope-ui-select.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
}

View File

@@ -0,0 +1,58 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("telescope").setup({
defaults = {
file_ignore_patterns = { ".git", ".node_modules" },
},
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*", "-L" },
},
},
extensions = {
file_browser = {
theme = "ivy",
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = true,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
},
},
})
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", function()
builtin.find_files({ hidden = true })
end, { desc = "Telescope find files (current file dir)" })
vim.keymap.set("n", "<space>fn", function()
require("telescope").extensions.file_browser.file_browser()
end)
vim.keymap.set("n", "<space>fs", function() -- select sessions
MiniSessions.select()
end)
vim.keymap.set("n", "<space>fd", function() -- select sessions
MiniSessions.select("delete")
end)
vim.keymap.set("n", "<leader>fg", function()
builtin.live_grep()
end, { desc = "Telescope live grep (current file dir)" })
vim.keymap.set("n", "<leader>fb", function()
builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers dont need cwd, but harmless
end, { desc = "Telescope buffers" })
require("telescope").load_extension("file_browser")
require("telescope").load_extension("ui-select")
end,
}

View File

@@ -0,0 +1,7 @@
return {
"mbbill/undotree",
lazy = false,
config = function()
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>")
end,
}

View File

@@ -1,35 +1 @@
local plugins = {} return { undefined }
-- 1. Setup paths
local lua_path = vim.fn.stdpath("config") .. "/lua"
local plugin_dir = lua_path .. "/plugins"
-- 2. Use ** to search recursively for all .lua files
local files = vim.fn.split(vim.fn.globpath(plugin_dir, "**/*.lua"), "\n")
for _, file in ipairs(files) do
-- Get path relative to the 'lua' directory
-- Example: /home/user/.config/nvim/lua/plugins/ui/statusline.lua
-- Becomes: plugins/ui/statusline.lua
local relative_path = file:sub(#lua_path + 2)
-- Remove the .lua extension
local module_path = relative_path:gsub("%.lua$", "")
-- Convert path slashes to Lua dots (plugins/ui/statusline -> plugins.ui.statusline)
module_path = module_path:gsub("/", ".")
-- 3. The Guard: Don't require the current file (plugins.init)
if not module_path:match("%.init$") and module_path ~= "plugins" then
local status_ok, module_content = pcall(require, module_path)
if status_ok then
table.insert(plugins, module_content)
else
-- Optional: notify if a file failed to load
vim.notify("Error loading " .. module_path .. ": " .. module_content, vim.log.levels.ERROR)
end
end
end
return plugins

View File

@@ -1,18 +0,0 @@
vim.pack.add({
{ src = "https://github.com/catppuccin/nvim", name = "catppuccin" },
{ src = "https://github.com/tadaa/vimade", name = "vimade" },
})
require("catppuccin").setup({
transparent_background = true, -- disables setting the background color.
float = {
transparent = true, -- enable transparent floating windows
solid = false, -- use solid styling for floating windows, see |winborder|
},
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
})
require("vimade").setup({
recipe = { "minimalist", { animate = true } },
fadelevel = 0.6,
})

View File

@@ -0,0 +1,12 @@
return {
"catppuccin/nvim",
name = "catppuccin",
opts = {
transparent_background = true, -- disables setting the background color.
float = {
transparent = true, -- enable transparent floating windows
solid = false, -- use solid styling for floating windows, see |winborder|
},
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
}
}

View File

@@ -1,71 +1,60 @@
vim.pack.add({ return {
{ src = "https://github.com/nvim-lualine/lualine.nvim", name = "lualine" }, "nvim-lualine/lualine.nvim",
{ src = "https://github.com/nvim-tree/nvim-web-devicons", name = "devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
{ src = "https://github.com/archibate/lualine-time", name = "lualine-time" }, config = function()
}) require("lualine").setup({
options = {
require("lualine").setup({ icons_enabled = true,
options = { theme = "auto",
icons_enabled = true, component_separators = { left = "", right = "" },
theme = "auto", section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" }, disabled_filetypes = {
section_separators = { left = "", right = "" }, statusline = {},
disabled_filetypes = { winbar = {},
statusline = {}, },
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
refresh_time = 16, -- ~60fps
events = {
"WinEnter",
"BufEnter",
"BufWritePost",
"SessionLoadPost",
"FileChangedShellPost",
"VimResized",
"Filetype",
"CursorMoved",
"CursorMovedI",
"ModeChanged",
},
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "lsp_status" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {}, winbar = {},
}, inactive_winbar = {},
ignore_focus = {}, extensions = {},
always_divide_middle = true, })
always_show_tabline = true, end,
globalstatus = false, }
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
refresh_time = 16, -- ~60fps
events = {
"WinEnter",
"BufEnter",
"BufWritePost",
"SessionLoadPost",
"FileChangedShellPost",
"VimResized",
"Filetype",
"CursorMoved",
"CursorMovedI",
"ModeChanged",
},
},
},
sections = {
lualine_a = {
"mode",
{
function()
local reg = vim.fn.reg_recording()
if reg == "" then
return ""
end -- not recording
return "MACRO " .. string.upper(tostring(reg))
end,
},
},
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "filetype" },
lualine_y = { "lsp_status" },
lualine_z = { "ctime" },
},
inactive_sections = {
lualine_a = {},
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
})

View File

@@ -1,41 +0,0 @@
vim.pack.add({
{ src = "https://github.com/folke/noice.nvim", name = "noice" },
{ src = "https://github.com/MunifTanjim/nui.nvim", name = "nui" },
{ src = "https://github.com/rcarriga/nvim-notify", name = "notify" },
})
vim.notify = require("notify").setup({
background_colour = "#000000",
render = "compact",
stages = "slide",
})
require("noice").setup({
messages = {
enabled = true,
view = "mini",
view_error = "notify", -- view for errors
view_warn = "notify", -- view for warnings
view_history = "messages", -- view for :messages
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
},
notify = {
enabled = true,
view = "notify",
},
hover = {
enabled = false,
},
lsp = {
hover = {
enabled = false,
},
signature = {
enabled = false,
},
},
presets = {
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})

6
lua/plugins/ui/tint.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
"levouh/tint.nvim",
config = function()
require("tint").setup()
end,
}

View File

@@ -1,35 +0,0 @@
vim.pack.add({
{ src = "https://github.com/okuuva/auto-save.nvim", name = "autosave" },
{ src = "https://github.com/vladdoster/remember.nvim", name = "remember" },
{ src = "https://github.com/Aasim-A/scrollEOF.nvim", name = "scrolleof" },
{ src = "https://github.com/folke/flash.nvim", name = "flash" },
})
require("auto-save").setup({
enabled = true,
trigger_events = {
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" },
defer_save = { "InsertLeave" }, -- save after debounce
cancel_deferred_save = { "InsertEnter" }, -- cancel pending save
},
debounce_delay = 1000,
noautocmd = true,
})
-- enable remember
require("remember").setup({})
-- enable scrolleof
require("scrollEOF").setup({
-- The pattern used for the internal autocmd to determine
-- where to run scrollEOF. See https://neovim.io/doc/user/autocmd.html#autocmd-pattern
pattern = "*",
-- Whether or not scrollEOF should be enabled in insert mode
insert_mode = false,
-- Whether or not scrollEOF should be enabled in floating windows
floating = true,
-- List of filetypes to disable scrollEOF for.
disabled_filetypes = { "terminal" },
-- List of modes to disable scrollEOF for. see https://neovim.io/doc/user/builtin.html#mode()
disabled_modes = { "t", "nt" },
})

View File

@@ -1,52 +0,0 @@
vim.pack.add({ { src = "https://github.com/echasnovski/mini.nvim", name = "mini" } })
require("mini.pairs").setup() -- Bracket pairs and stuff
require("mini.ai").setup() -- Around and In extension for visual mode
require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d)
require("mini.indentscope").setup({ -- shows indents
symbol = "",
draw = {
delay = 10,
animation = require("mini.indentscope").gen_animation.linear({
duration = 15,
unit = "step",
easing = "out",
}),
},
})
require("mini.trailspace").setup() -- Shows useless spaces
require("mini.sessions").setup({ -- dir based session management
autoread = true,
autowrite = true,
file = ".session",
force = { read = false, write = true, delete = true },
})
require("mini.surround").setup() -- Suround selections with characters
require("mini.move").setup({ -- move selection in visual mode
mappings = {
down = "J",
up = "K",
},
})
require("mini.icons").setup() -- Icon provider
local animate = require("mini.animate") -- animations ovs
require("mini.animate").setup({
cursor = {
enable = false,
},
scroll = {
-- Animate for 200 milliseconds with linear easing
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
-- Animate equally but with at most 120 steps instead of default 60
subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }),
},
})

View File

@@ -1,61 +0,0 @@
vim.pack.add({
{ src = "https://github.com/nvim-telescope/telescope.nvim", name = "telescope" },
{ src = "https://github.com/nvim-lua/plenary.nvim", name = "plenary" },
{ src = "https://github.com/nvim-telescope/telescope-symbols.nvim", name = "telescope-symbols" },
{ src = "https://github.com/nvim-telescope/telescope-ui-select.nvim", name = "telescope-ui-select" },
{ src = "https://github.com/nvim-telescope/telescope-fzf-native.nvim", name = "telescope-fzf" },
{ src = "https://github.com/nvim-telescope/telescope-file-browser.nvim", name = "telescope-file-browser" },
{ src = "https://github.com/2kabhishek/nerdy.nvim", name = "telescope-nerdy" },
})
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
file_ignore_patterns = { ".git", "%.csv", ".venv", ".node_modules", "node_modules", ".svelte-kit", ".vscode" },
},
pickers = {
buffers = {
show_all_buffers = true,
mappings = {
i = {
["<CR>"] = actions.select_drop,
},
n = {
["<CR>"] = actions.select_drop,
["d"] = actions.delete_buffer,
},
},
},
find_files = {
show_all_buffers = true,
mappings = {
i = {
["<CR>"] = actions.select_drop,
},
n = {
["<CR>"] = actions.select_drop,
},
},
},
live_grep = {
additional_args = function()
return { "--hidden" }
end,
},
},
extensions = {
file_browser = {
theme = "ivy",
hijack_netrw = true,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
},
},
})
require("telescope").load_extension("file_browser")
require("telescope").load_extension("ui-select")
require("telescope").load_extension("nerdy")

View File

@@ -1,112 +0,0 @@
{
"plugins": {
"autosave": {
"rev": "9aabcb8396224dcbf8d51c0c1d620d88a46e89d7",
"src": "https://github.com/okuuva/auto-save.nvim"
},
"blink": {
"rev": "3db7326f54b73df4789e0fd6274bedda33975fea",
"src": "https://github.com/saghen/blink.cmp"
},
"blink-lib": {
"rev": "b127d48bf8e9ac9cf41f6e0fbead317503f76558",
"src": "https://github.com/saghen/blink.lib"
},
"catppuccin": {
"rev": "0303a7208dba448c459767486a38a6ec05c4216b",
"src": "https://github.com/catppuccin/nvim"
},
"conform": {
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
"src": "https://github.com/stevearc/conform.nvim"
},
"devicons": {
"rev": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c",
"src": "https://github.com/nvim-tree/nvim-web-devicons"
},
"flash": {
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
"src": "https://github.com/folke/flash.nvim"
},
"lazydev": {
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
"src": "https://github.com/folke/lazydev.nvim"
},
"lint": {
"rev": "99cbc3ca8a76845fca50e496be7212bebf907dd3",
"src": "https://github.com/mfussenegger/nvim-lint"
},
"lspconfig": {
"rev": "229b79051b380377664edc4cbd534930154921a1",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"lualine": {
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
"src": "https://github.com/nvim-lualine/lualine.nvim"
},
"lualine-time": {
"rev": "8838875e2e787293bb905d23dbb91ef4bde188ea",
"src": "https://github.com/archibate/lualine-time"
},
"mini": {
"rev": "d5e6f5b843f1d813d9c4bfb242b751dc5ab6f8ae",
"src": "https://github.com/echasnovski/mini.nvim"
},
"noice": {
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
"src": "https://github.com/folke/noice.nvim"
},
"notify": {
"rev": "8701bece920b38ea289b457f902e2ad184131a5d",
"src": "https://github.com/rcarriga/nvim-notify"
},
"nui": {
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
"src": "https://github.com/MunifTanjim/nui.nvim"
},
"plenary": {
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"remember": {
"rev": "e73350b07afdd4242a57e2e7c2b7cd38fce31d59",
"src": "https://github.com/vladdoster/remember.nvim"
},
"scrolleof": {
"rev": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7",
"src": "https://github.com/Aasim-A/scrollEOF.nvim"
},
"telescope": {
"rev": "7d324792b7943e4aa16ad007212e6acc6f9fe335",
"src": "https://github.com/nvim-telescope/telescope.nvim"
},
"telescope-file-browser": {
"rev": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e",
"src": "https://github.com/nvim-telescope/telescope-file-browser.nvim"
},
"telescope-fzf": {
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
},
"telescope-nerdy": {
"rev": "8fd18f0075c480b4e0865464dcd4fb7a42c6889e",
"src": "https://github.com/2kabhishek/nerdy.nvim"
},
"telescope-symbols": {
"rev": "a6d0127a53d39b9fc2af75bd169d288166118aec",
"src": "https://github.com/nvim-telescope/telescope-symbols.nvim"
},
"telescope-ui-select": {
"rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim"
},
"treesitter": {
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"vimade": {
"rev": "a5323f4930e3f1f48c0329e50bd218ba61577aaf",
"src": "https://github.com/tadaa/vimade"
}
}
}