Compare commits

..

5 Commits

Author SHA1 Message Date
09c4ed8e89 Revert "fixed svelte highlighting"
This reverts commit 67ef68769a.
2026-05-04 14:26:17 +01:00
44c6325b82 added prettier 2026-05-04 14:26:07 +01:00
907064cc73 added back eslint 2026-05-04 14:13:42 +01:00
fbe4ed549b fixed eslint 2026-05-04 14:05:28 +01:00
b3e1ed3aa8 added eslint for svelte files 2026-05-04 13:59:52 +01:00
11 changed files with 124 additions and 336 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`

43
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1782467914,
"narHash": "sha256-pGvFkM8N0xEkIIXDe5YYfbEAvHrk4IxBrjB/x8OomhE=",
"lastModified": 1777578337,
"narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
"rev": "15f4ee454b1dce334612fa6843b3e05cf546efab",
"type": "github"
},
"original": {
@@ -16,44 +16,9 @@
"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"
"nixpkgs": "nixpkgs"
}
}
},

View File

@@ -3,24 +3,13 @@
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
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux"; # change if needed
pkgs = import nixpkgs { inherit system; };
pkgList = with pkgs; [
# LSPs
lua-language-server
@@ -31,8 +20,10 @@
ast-grep
prettier
black
alejandra
nixfmt
rustfmt
eslint_d
nil
python313Packages.python-lsp-server
typescript-language-server
tailwindcss-language-server
@@ -49,14 +40,32 @@
imagemagick
luarocks
];
in {
# Define the default package for this system
default = inputs.wrappers.wrappers.neovim.wrap {
inherit pkgs;
runtimePkgs = pkgList;
settings.config_directory = ./.;
};
}
);
nvim-wrapped = pkgs.symlinkJoin {
name = "nvim-with-lsp";
paths = [ pkgs.neovim ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/nvim \
--prefix PATH : ${pkgs.lib.makeBinPath pkgList} \
--set TREE_SITTER_LIB_PATH "${pkgs.tree-sitter}/lib"
'';
};
in
{
packages.${system}.default = nvim-wrapped;
devShells.${system}.default = pkgs.mkShell {
packages = [
nvim-wrapped
];
shellHook = ''
export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib"
echo "Neovim LSP environment loaded"
export DEVSHELL_NAME="󱄅 flake/#89dceb"
'';
};
};
}

View File

@@ -1,10 +1,6 @@
vim.g.mapleader = " "
vim.g.maplocalleader = ","
-- Scrolloff
local scrolloff = math.floor(vim.o.lines / 2) - 3
vim.opt.scrolloff = scrolloff
require("plugins.init")
require("config.autocmd")
require("config.binds")
@@ -43,12 +39,13 @@ vim.opt.incsearch = true
-- Nowrap
vim.opt.wrap = false
-- Scrolloff
local scrolloff = math.floor(vim.o.lines / 2) - 3
vim.opt.scrolloff = scrolloff
-- Indent
vim.o.autoindent = true
-- Undotree
vim.cmd("packadd nvim.undotree")
vim.keymap.set("n", "<leader>u", require("undotree").open)
-- Local project config
vim.o.exrc = true

View File

@@ -27,13 +27,6 @@ vim.api.nvim_create_autocmd("VimEnter", {
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" }, {

View File

@@ -29,19 +29,6 @@ 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()
@@ -96,22 +83,5 @@ Keymap("n", "<leader>fg", function()
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")
builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers dont need cwd, but harmless
end)

View File

@@ -7,12 +7,10 @@ require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
typescriptreact = { "prettier" },
typescript = { "prettier" },
html = { "prettier" },
svelte = { "prettier" },
python = { "black" },
nix = { "alejandra" },
nix = { "nixfmt" },
css = { "prettier" },
rust = { "rustfmt" },
},

View File

@@ -1,33 +1,6 @@
vim.pack.add({
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" },
{ src = "https://github.com/saghen/blink.cmp", name = "blink" },
{ src = "https://github.com/saghen/blink.lib", name = "blink-lib" },
})
local hostname = vim.uv.os_gethostname()
local lowerHostname = string.lower(hostname)
vim.lsp.config("nixd", {
cmd = { "nixd" },
filetypes = { "nix" },
root_markers = { "flake.nix", ".git" },
settings = {
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
formatting = {
command = { "alejandra" },
},
options = {
nixos = {
expr = '(builtins.getFlake "~/.dotfiles/.nixos").nixosConfigurations.'
.. lowerHostname
.. ".options",
},
},
},
},
})
vim.lsp.config("lua_ls", {
@@ -44,12 +17,28 @@ vim.lsp.config("lua_ls", {
},
},
})
-- vim.lsp.config("emmet_language_server", {
-- -- capabilities = require("cmp_nvim_lsp").default_capabilities(),
-- filetypes = { "html", "css", "javascriptreact", "typescriptreact" },
-- init_options = {
-- preferences = {},
-- show_expanded_abbreviation = "always",
-- show_abbreviation_suggestions = true,
-- show_suggestions_as_snippets = true,
-- html = {
-- options = {
-- ["bem.enabled"] = true,
-- ["output.selfClosingStyle"] = "xhtml",
-- },
-- },
-- },
-- })
vim.lsp.enable({
"lua_ls",
"ts_ls",
"pylsp",
"cssls",
"svelte",
"svelte_language_server",
"nixd",
"rust_analyzer",
"emmet_language_server",
@@ -62,28 +51,16 @@ require("blink.cmp").setup({
fuzzy = { implementation = "lua" },
signature = {
enabled = false,
enabled = true,
},
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
@@ -92,6 +69,7 @@ require("blink.cmp").setup({
},
sources = {
default = {
-- "lazydev",
"lsp", -- (Equivalent to cmp-nvim-lsp)
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
"buffer", -- (Equivalent to cmp-buffer)

View File

@@ -20,16 +20,16 @@ require("auto-save").setup({
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" },
})
-- 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

@@ -8,35 +8,11 @@ vim.pack.add({
{ 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" },
file_ignore_patterns = { ".git", ".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" }

View File

@@ -5,23 +5,19 @@
"src": "https://github.com/okuuva/auto-save.nvim"
},
"blink": {
"rev": "3db7326f54b73df4789e0fd6274bedda33975fea",
"rev": "456d38d1cd3743926f329204c2340f3e7840aad6",
"src": "https://github.com/saghen/blink.cmp"
},
"blink-lib": {
"rev": "b127d48bf8e9ac9cf41f6e0fbead317503f76558",
"src": "https://github.com/saghen/blink.lib"
},
"catppuccin": {
"rev": "0303a7208dba448c459767486a38a6ec05c4216b",
"rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1",
"src": "https://github.com/catppuccin/nvim"
},
"conform": {
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
"src": "https://github.com/stevearc/conform.nvim"
},
"devicons": {
"rev": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c",
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
"src": "https://github.com/nvim-tree/nvim-web-devicons"
},
"flash": {
@@ -33,15 +29,19 @@
"src": "https://github.com/folke/lazydev.nvim"
},
"lint": {
"rev": "99cbc3ca8a76845fca50e496be7212bebf907dd3",
"rev": "eab58b48eb11d7745c11c505e0f3057165902461",
"src": "https://github.com/mfussenegger/nvim-lint"
},
"lspconfig": {
"rev": "229b79051b380377664edc4cbd534930154921a1",
"rev": "c588db330592fa477a70d2fee6ba20a57194bdc3",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"lspkind": {
"rev": "c7274c48137396526b59d86232eabcdc7fed8a32",
"src": "https://github.com/onsails/lspkind.nvim"
},
"lualine": {
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
"rev": "f5d2a8570f8b736ddb9bb4be504355bcd6e15ec8",
"src": "https://github.com/nvim-lualine/lualine.nvim"
},
"lualine-time": {
@@ -49,9 +49,13 @@
"src": "https://github.com/archibate/lualine-time"
},
"mini": {
"rev": "d5e6f5b843f1d813d9c4bfb242b751dc5ab6f8ae",
"rev": "69b7433355664cf76898eb86a12a019f39bd86d1",
"src": "https://github.com/echasnovski/mini.nvim"
},
"neorg": {
"rev": "1f14d72aad7165eac307a2a2f6be0fb97a04b3c2",
"src": "https://github.com/nvim-neorg/neorg"
},
"noice": {
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
"src": "https://github.com/folke/noice.nvim"
@@ -69,7 +73,7 @@
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"remember": {
"rev": "e73350b07afdd4242a57e2e7c2b7cd38fce31d59",
"rev": "85aff6dc0a5adab088ef6b9210585ded31c32c7b",
"src": "https://github.com/vladdoster/remember.nvim"
},
"scrolleof": {
@@ -77,7 +81,7 @@
"src": "https://github.com/Aasim-A/scrollEOF.nvim"
},
"telescope": {
"rev": "7d324792b7943e4aa16ad007212e6acc6f9fe335",
"rev": "471eebb1037899fd942cc0f52c012f8773505da1",
"src": "https://github.com/nvim-telescope/telescope.nvim"
},
"telescope-file-browser": {
@@ -85,11 +89,11 @@
"src": "https://github.com/nvim-telescope/telescope-file-browser.nvim"
},
"telescope-fzf": {
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
},
"telescope-nerdy": {
"rev": "8fd18f0075c480b4e0865464dcd4fb7a42c6889e",
"rev": "97b0914dece80204a777f04c94b9980da0f7ac88",
"src": "https://github.com/2kabhishek/nerdy.nvim"
},
"telescope-symbols": {
@@ -105,7 +109,7 @@
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"vimade": {
"rev": "a5323f4930e3f1f48c0329e50bd218ba61577aaf",
"rev": "9b2eacd9c97c0bb547f6f3a27e8b5b7a70ad4d03",
"src": "https://github.com/tadaa/vimade"
}
}