should work better now

This commit is contained in:
Zoty 2026-04-13 15:49:15 -03:00
parent 8f05b02766
commit 32f636c41b
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
34 changed files with 233 additions and 2298 deletions

View file

@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/zoty/.config/nvim" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/zoty/.config/nvim")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/zoty/.config/nvim" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/zoty/.config/nvim/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/zoty/.config/nvim/.envrc" "/home/zoty/.config/nvim/.direnv"/*.rc

View file

@ -1 +0,0 @@
/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source

View file

@ -1 +0,0 @@
/nix/store/dx2qikyb4dyb6hbdfywbmsyla0z5a1h3-source

View file

@ -1 +0,0 @@
/nix/store/x43jzyi7i3jpz7b6jfll97wbmzfqxlpm-source

View file

@ -1 +0,0 @@
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source

View file

@ -1 +0,0 @@
/nix/store/9556mmcf407574ldxfcx0gf3ycsd2i23-nix-shell-env

1
.envrc
View file

@ -1 +0,0 @@
use flake

61
flake.lock generated
View file

@ -1,61 +0,0 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771369470,
"narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0182a361324364ae3f436a63005877674cf45efb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,27 +0,0 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
neovim
gcc
tree-sitter
fzf
# LSPs
lua-language-server
nixd
rust-analyzer
];
};
}
);
}

View file

@ -1,7 +1,26 @@
require("config.lazy")
-- Enables LSPs
vim.lsp.enable({ "lua_ls", "nixd" })
vim.lsp.enable({
"lua_ls",
"nixd",
"angularls",
"ts_ls",
"sqls",
"jsonls",
"html",
"bashls",
"yamlls",
"dockerls",
"marksman",
"clangd",
"pyright",
"taplo",
"astro",
"volar",
"tailwindcss",
"cssls",
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)

View file

@ -1,18 +1,19 @@
{
"blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "bde73a6886b607246095aa59f396de5e0d036890" },
"gitsigns.nvim": { "branch": "main", "commit": "0d797daee85366bc242580e352a4f62d67557b84" },
"fzf-lua": { "branch": "main", "commit": "1e866cce085cc6df3d3e4fb59f00105fa84cef6c" },
"gitsigns.nvim": { "branch": "main", "commit": "8d82c240f190fc33723d48c308ccc1ed8baad69d" },
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-treesitter": { "branch": "main", "commit": "7caec274fd19c12b55902a5b795100d21531391f" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8fe8a95630f4f2c72a87ba1927af649e0bfaa244" },
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
"nvim-web-devicons": { "branch": "master", "commit": "c72328a5494b4502947a022fe69c0c47e53b6aa6" },
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
"rustaceanvim": { "branch": "master", "commit": "f2f0c1231a5b019dbc1fd6dafac1751c878925a3" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }
"rainbow-delimiters.nvim": { "branch": "master", "commit": "aab6caaffd79b8def22ec4320a5344f7c42f58d2" },
"rustaceanvim": { "branch": "master", "commit": "f69c85a955b9a83d495e3dc8d43adb6364a0b765" }
}

14
lsp/angularls.lua Normal file
View file

@ -0,0 +1,14 @@
return {
cmd = { 'ngserver', '--stdio', '--tsProbeLocations', '', '--ngProbeLocations', '' },
filetypes = { 'typescript', 'html', 'htmlangular' },
root_markers = { 'angular.json' },
on_new_config = function(new_config, new_root_dir)
local node_modules = new_root_dir .. '/node_modules'
new_config.cmd = {
'ngserver',
'--stdio',
'--tsProbeLocations', node_modules,
'--ngProbeLocations', node_modules,
}
end,
}

4
lsp/astro.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "astro-ls", "--stdio" },
filetypes = { "astro" },
}

4
lsp/bashls.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "bash-language-server", "start" },
filetypes = { "sh", "bash" },
}

4
lsp/clangd.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "clangd", "--background-index" },
filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
}

4
lsp/cssls.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "vscode-css-language-server", "--stdio" },
filetypes = { "css", "scss", "less" },
}

4
lsp/dockerls.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "docker-langserver", "--stdio" },
filetypes = { "dockerfile" },
}

8
lsp/html.lua Normal file
View file

@ -0,0 +1,8 @@
return {
cmd = { 'vscode-html-language-server', '--stdio' },
filetypes = { 'html' },
root_markers = { 'package.json', '.git' },
init_options = {
provideFormatter = true,
},
}

9
lsp/jsonls.lua Normal file
View file

@ -0,0 +1,9 @@
return {
cmd = { 'vscode-json-language-server', '--stdio' },
filetypes = { 'json', 'jsonc' },
settings = {
json = {
validate = { enable = true },
},
},
}

4
lsp/marksman.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "marksman", "server" },
filetypes = { "markdown" },
}

13
lsp/pyright.lua Normal file
View file

@ -0,0 +1,13 @@
return {
cmd = { "pyright-langserver", "--stdio" },
filetypes = { "python" },
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
},
},
},
}

5
lsp/sqls.lua Normal file
View file

@ -0,0 +1,5 @@
return {
cmd = { 'sqls' },
filetypes = { 'sql', 'mysql' },
root_markers = { '.git', 'flake.nix' },
}

4
lsp/tailwindcss.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "tailwindcss-language-server", "--stdio" },
filetypes = { "html", "css", "scss", "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "astro" },
}

4
lsp/taplo.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "taplo", "lsp", "stdio" },
filetypes = { "toml" },
}

5
lsp/ts_ls.lua Normal file
View file

@ -0,0 +1,5 @@
return {
cmd = { 'typescript-language-server', '--stdio' },
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' },
}

4
lsp/volar.lua Normal file
View file

@ -0,0 +1,4 @@
return {
cmd = { "vue-language-server", "--stdio" },
filetypes = { "vue" },
}

14
lsp/yamlls.lua Normal file
View file

@ -0,0 +1,14 @@
return {
cmd = { "yaml-language-server", "--stdio" },
filetypes = { "yaml" },
settings = {
yaml = {
schemas = {
kubernetes = "*.yaml",
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
},
},
},
}

View file

@ -12,7 +12,9 @@ return {
{ '<leader>fb', function() require('fzf-lua').buffers() end, desc = 'Buffers' },
{ '<leader>fh', function() require('fzf-lua').help_tags() end, desc = 'Help tags' },
{ '<leader>fr', function() require('fzf-lua').oldfiles() end, desc = 'Recent files' },
{ '<leader>fd', function() require('fzf-lua').diagnostic_document() end, desc = 'Diagnostics' },
{ '<leader>fd', function() require('fzf-lua').diagnostics_document() end, desc = 'Diagnostics (buffer)' },
{ '<leader>fD', function() require('fzf-lua').diagnostics_workspace() end, desc = 'Diagnostics (workspace)' },
{ '<leader>fs', function() require('fzf-lua').lsp_document_symbols() end, desc = 'LSP symbols' },
{ '<leader>fS', function() require('fzf-lua').lsp_workspace_symbols() end, desc = 'LSP workspace symbols' },
},
}

View file

@ -0,0 +1,29 @@
return {
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',
opts = {
indent = {
char = '',
tab_char = '',
},
scope = {
enabled = true,
show_start = true,
show_end = false,
highlight = { 'Function', 'Label' },
},
exclude = {
filetypes = {
'help',
'dashboard',
'neo-tree',
'Trouble',
'lazy',
'mason',
'notify',
'toggleterm',
'lazyterm',
},
},
},
}

View file

@ -0,0 +1,31 @@
return {
'HiPhish/rainbow-delimiters.nvim',
event = 'VeryLazy',
config = function()
local rainbow = require('rainbow-delimiters')
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow.strategy['global'],
vim = rainbow.strategy['local'],
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
},
priority = {
[''] = 110,
lua = 210,
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
}
end,
}

View file

@ -1,6 +1,34 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = {
'lua',
'vim',
'vimdoc',
'rust',
'typescript',
'javascript',
'html',
'css',
'scss',
'json',
'sql',
'nix',
'bash',
'yaml',
'dockerfile',
'markdown',
'markdown_inline',
'c',
'cpp',
'python',
'toml',
'astro',
'vue',
'java',
},
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
},

View file

@ -1,23 +0,0 @@
return {
'folke/trouble.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
modes = {
diagnostics = {
mode = "diagnostics",
preview = {
type = "diagnostics",
relative = "win",
position = "right",
size = 0.4,
},
},
},
},
keys = {
{ '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', desc = 'Diagnostics (workspace)' },
{ '<leader>xd', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', desc = 'Diagnostics (buffer)' },
{ ']t', function() require('trouble').next({ skip_groups = true, jump = true }) end, desc = 'Next trouble item' },
{ '[t', function() require('trouble').prev({ skip_groups = true, jump = true }) end, desc = 'Prev trouble item' },
}
}

View file

@ -34,6 +34,7 @@ vim.opt.splitright = true -- vertical splits open to the right
-- Misc
vim.opt.undofile = true -- persist between sessions
vim.opt.updatetime = 250 -- lower the update delay
vim.opt.swapfile = false -- disable this useless shit
-- Diagnostics
vim.diagnostic.config({