yes
This commit is contained in:
parent
2198ddb21e
commit
9df01f6576
4 changed files with 161 additions and 67 deletions
|
|
@ -17,7 +17,8 @@
|
||||||
################
|
################
|
||||||
|
|
||||||
# See https://wiki.hypr.land/Configuring/Monitors/
|
# See https://wiki.hypr.land/Configuring/Monitors/
|
||||||
monitor=,preferred,auto,auto
|
monitor=eDP-2,2560x1600@165.0,1920x80,1.6
|
||||||
|
monitor=DP-5,1920x1080@60.0,0x0,1.0
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,8 @@ wallpaper {
|
||||||
monitor = eDP-2
|
monitor = eDP-2
|
||||||
path = ~/wallpaper.png
|
path = ~/wallpaper.png
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wallpaper {
|
||||||
|
monitor = DP-5
|
||||||
|
path = ~/wallpaper.png
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,91 +2,176 @@
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
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
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- === NIXOS HELPER (Simplified) ===
|
||||||
|
local function get_tsserver_path()
|
||||||
|
-- 1. Try to find 'tsserver' in the current shell (direnv/nix-shell)
|
||||||
|
local bin = vim.fn.exepath("tsserver")
|
||||||
|
if bin == "" then
|
||||||
|
vim.notify("WARN: tsserver not found in PATH. Are you in a nix-shell?", vim.log.levels.WARN)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 2. Follow the Nix symlinks to find the actual .js file
|
||||||
|
-- On NixOS, 'bin/tsserver' is a shell script wrapper. We need the .js file it points to.
|
||||||
|
local resolved = vim.fn.resolve(bin)
|
||||||
|
|
||||||
|
-- Logic: Check if the resolved path is already the js file or needs traversal
|
||||||
|
if resolved:match("%.js$") then
|
||||||
|
return resolved
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Common NixOS pattern: /nix/store/.../bin/tsserver -> points near lib/node_modules
|
||||||
|
return vim.fn.fnamemodify(resolved, ":h") .. "/../lib/node_modules/typescript/lib/tsserver.js"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{ "catppuccin/nvim", name = "catppuccin" },
|
------------------------------ UI ------------------------------
|
||||||
"neovim/nvim-lspconfig",
|
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||||
{"nvim-treesitter/nvim-treesitter", lazy = false, branch = "main", build = ":TSUpdate", opts = {}},
|
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", opts = {} },
|
||||||
{ "nvim-tree/nvim-tree.lua", opts = {} },
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
{ "nvim-tree/nvim-tree.lua", opts = {} },
|
||||||
"romgrk/barbar.nvim",
|
"romgrk/barbar.nvim",
|
||||||
{ "nvim-lualine/lualine.nvim", opts = {} },
|
{ "nvim-lualine/lualine.nvim", opts = {} },
|
||||||
{ "windwp/nvim-autopairs", opts = {} },
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
"hrsh7th/vim-vsnip",
|
|
||||||
"voldikss/vim-floaterm",
|
|
||||||
{
|
{
|
||||||
'IogaMaster/neocord',
|
'windwp/nvim-autopairs',
|
||||||
event = "VeryLazy",
|
event = "InsertEnter",
|
||||||
opts = {}
|
opts = {}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- DIRENV (Crucial for NixOS shells)
|
||||||
|
{ "direnv/direnv.vim" },
|
||||||
|
|
||||||
|
------------------------------ DIAGNOSTICS & UI ------------------------------
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
cmd = "Trouble",
|
||||||
|
opts = {},
|
||||||
|
keys = { { "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics" } },
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"rachartier/tiny-inline-diagnostic.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("tiny-inline-diagnostic").setup()
|
||||||
|
vim.diagnostic.config({ virtual_text = false })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvimdev/lspsaga.nvim",
|
||||||
|
opts = {
|
||||||
|
lightbulb = {
|
||||||
|
enable = true,
|
||||||
|
virtual_text = false,
|
||||||
|
sign = true,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
------------------------------ COMPLETION ------------------------------
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
keymap = { preset = "default" },
|
||||||
|
sources = { default = { "lsp", "path", "snippets", "buffer" } },
|
||||||
|
signature = { enabled = true }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
------------------------------ FORMATTING ------------------------------
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufWritePre" },
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "ruff_format" },
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
vue = { "prettierd" },
|
||||||
|
},
|
||||||
|
format_on_save = { timeout_ms = 500, lsp_fallback = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
------------------------------ SPECIALISTS ------------------------------
|
||||||
|
{ "mrcjkb/rustaceanvim", version = '^5', lazy = false },
|
||||||
|
{ "pmizio/typescript-tools.nvim", dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" } },
|
||||||
|
"esmuellert/nvim-eslint",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
------------------------------ CONFIGURATION ------------------------------
|
||||||
vim.o.tabstop = 2
|
vim.o.tabstop = 2
|
||||||
vim.o.shiftwidth = 2
|
vim.o.shiftwidth = 2
|
||||||
vim.o.expandtab = true
|
vim.o.expandtab = true
|
||||||
vim.o.smarttab = true
|
|
||||||
vim.o.cursorline = true
|
|
||||||
vim.o.laststatus = 3
|
|
||||||
vim.o.background = "dark"
|
|
||||||
vim.o.termguicolors = true
|
|
||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
vim.o.relativenumber = true
|
vim.o.signcolumn = "yes"
|
||||||
|
vim.o.cursorline = true
|
||||||
vim.cmd.colorscheme "catppuccin-mocha"
|
vim.cmd.colorscheme "catppuccin-mocha"
|
||||||
vim.o.guifont = "CaskaydiaCove Nerd Font:h11"
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
------------------------------ NATIVE LSP SETUP ------------------------------
|
||||||
virtual_text = true, -- Show inline error messages
|
|
||||||
signs = true, -- Show signs in the gutter
|
|
||||||
underline = true, -- Underline errors
|
|
||||||
update_in_insert = false,
|
|
||||||
severity_sort = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
local cmp = require'cmp'
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
-- 1. TYPESCRIPT TOOLS (Specialist)
|
||||||
expand = function(args)
|
require("typescript-tools").setup({
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
capabilities = capabilities,
|
||||||
end,
|
|
||||||
|
-- CRITICAL: This must be a string. If nil, the plugin defaults to internal logic.
|
||||||
|
tsserver_path = get_tsserver_path(),
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
-- Remove the 'tsserver_plugins' block for now.
|
||||||
|
-- It causes the "table at index 1" crash if the paths are wrong.
|
||||||
|
|
||||||
|
tsserver_file_preferences = {
|
||||||
|
includeCompletionsForModuleExports = true,
|
||||||
|
quotePreference = "auto",
|
||||||
|
importModuleSpecifierPreference = "non-relative",
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
},
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
-- Only run on standard JS/TS files for now
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact" },
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
})
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
-- 2. ESLINT (Specialist)
|
||||||
}),
|
require("nvim-eslint").setup({
|
||||||
sources = cmp.config.sources({
|
capabilities = capabilities,
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'vsnip' },
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
-- 3. RUST (Specialist)
|
||||||
|
vim.g.rustaceanvim = {
|
||||||
|
server = {
|
||||||
|
capabilities = capabilities,
|
||||||
|
default_settings = { ['rust-analyzer'] = { checkOnSave = { command = "clippy" } } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vim.lsp.enable("rust_analyzer")
|
-- 4. GENERICS (Native Loop)
|
||||||
vim.lsp.enable("pylsp")
|
-- NOTE: "vue_ls" is the new name for Volar.
|
||||||
vim.lsp.enable("biome")
|
local generic_servers = { "basedpyright", "ruff", "lua_ls", "html", "svelte", "vue_ls", "nil_ls" }
|
||||||
vim.lsp.enable("eslint")
|
|
||||||
vim.lsp.enable("ccls")
|
|
||||||
|
|
||||||
|
for _, name in ipairs(generic_servers) do
|
||||||
|
-- Apply caps
|
||||||
|
vim.lsp.config(name, {
|
||||||
|
capabilities = capabilities,
|
||||||
|
-- NixOS Tip: This prevents Neovim from yelling if a server is missing from your shell
|
||||||
|
on_init = function(client)
|
||||||
|
-- Optional: logic to check if root_dir is valid
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Enable
|
||||||
|
vim.lsp.enable(name)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>ca", "<cmd>Lspsaga code_action<CR>", { desc = "Code Action" })
|
||||||
|
|
|
||||||
3
home.nix
3
home.nix
|
|
@ -94,6 +94,9 @@
|
||||||
"spotify" = "${pkgs.firejail}/bin/firejail ${config.programs.spicetify.spicedSpotify}/bin/spotify";
|
"spotify" = "${pkgs.firejail}/bin/firejail ${config.programs.spicetify.spicedSpotify}/bin/spotify";
|
||||||
};
|
};
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
|
initContent = ''
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
programs.starship.enable = true;
|
programs.starship.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue