mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
nvim: qol on lualine, bufferline, use nixd as nix lsp
This commit is contained in:
parent
6fb3efd1dc
commit
cd9c91b9bc
11 changed files with 76 additions and 67 deletions
|
|
@ -1,3 +1,3 @@
|
||||||
git:
|
git:
|
||||||
paging:
|
paging:
|
||||||
- pager: delta --dark --paging=never
|
pager: delta --dark --paging=never
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ return {
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
-- Lua LS offers a code formatter
|
-- Lua LS offers a code formatter
|
||||||
-- Ref: https://github.com/LuaLS/lua-language-server/wiki/Formatter
|
-- Ref: https://github.com/LuaLS/lua-language-server/wiki/Formatter
|
||||||
-- format = {
|
-- format = {
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
-- <nixCats>/lsp/nil.lua
|
|
||||||
-- Nil LSP config
|
|
||||||
|
|
||||||
vim.lsp.config("nil", {
|
|
||||||
cmd = { "nil" },
|
|
||||||
root_markers = {
|
|
||||||
"flake.nix",
|
|
||||||
"flake.lock",
|
|
||||||
},
|
|
||||||
filetypes = {
|
|
||||||
"nix",
|
|
||||||
},
|
|
||||||
-- Global config options
|
|
||||||
settings = {
|
|
||||||
["nil"] = {
|
|
||||||
formatting = {
|
|
||||||
command = { "alejandra" },
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
ignored = {},
|
|
||||||
},
|
|
||||||
nix = {
|
|
||||||
maxMemoryMB = 2560,
|
|
||||||
},
|
|
||||||
flake = {
|
|
||||||
autoArchive = false,
|
|
||||||
autoEvalImputs = true,
|
|
||||||
nixpkgsInputName = "nixpkgs",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
22
home/dot_config/nvim/lsp/nixd.lua
Normal file
22
home/dot_config/nvim/lsp/nixd.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
return {
|
||||||
|
cmd = { "nixd" },
|
||||||
|
root_markers = { "flake.nix", "flake.lock" },
|
||||||
|
filetypes = { "nix" },
|
||||||
|
settings = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
command = { "alejandra" },
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
nixos = {
|
||||||
|
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options',
|
||||||
|
},
|
||||||
|
home_manager = {
|
||||||
|
expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -23,7 +23,7 @@ return {
|
||||||
integrations = {
|
integrations = {
|
||||||
-- lualine = true,
|
-- lualine = true,
|
||||||
"lualine",
|
"lualine",
|
||||||
"blink_cmp"
|
"blink_cmp",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -90,11 +90,11 @@ return {
|
||||||
{ "]g", "<cmd>Gitsigns next_hunk<CR>", desc = "Next hunk" },
|
{ "]g", "<cmd>Gitsigns next_hunk<CR>", desc = "Next hunk" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- { -- Highlight and navigate between TODOs
|
{ -- Highlight and navigate between TODOs
|
||||||
-- "folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
-- cmd = { "TodoTelescope" },
|
cmd = { "TodoTelescope" },
|
||||||
-- event = "BufRead",
|
event = "BufRead",
|
||||||
-- opts = {},
|
opts = {},
|
||||||
-- dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
-- },
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,6 @@ return {
|
||||||
-- configuration goes here
|
-- configuration goes here
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ import = "plugins.mod.image-nvim" },
|
-- { import = "plugins.mod.image-nvim" },
|
||||||
{ import = "plugins.mod.snacks-nvim" },
|
{ import = "plugins.mod.snacks-nvim" },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ return {
|
||||||
|
|
||||||
-- use a release tag to download pre-built binaries
|
-- use a release tag to download pre-built binaries
|
||||||
version = "*",
|
version = "*",
|
||||||
event = "InsertEnter",
|
event = { "InsertEnter", "CmdlineEnter" },
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
---@type blink.cmp.Config
|
---@type blink.cmp.Config
|
||||||
|
|
@ -49,6 +49,16 @@ return {
|
||||||
preset = "luasnip",
|
preset = "luasnip",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cmdline = {
|
||||||
|
keymap = {
|
||||||
|
preset = "cmdline",
|
||||||
|
["<CR>"] = { "fallback" },
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
menu = { auto_show = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
|
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
|
||||||
per_filetype = {
|
per_filetype = {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ return {
|
||||||
{ "<leader>b7", "<cmd>BufferLineGotoBuffer 7<CR>", desc = "Switch to Buffer #7" },
|
{ "<leader>b7", "<cmd>BufferLineGotoBuffer 7<CR>", desc = "Switch to Buffer #7" },
|
||||||
{ "<leader>b8", "<cmd>BufferLineGotoBuffer 8<CR>", desc = "Switch to Buffer #8" },
|
{ "<leader>b8", "<cmd>BufferLineGotoBuffer 8<CR>", desc = "Switch to Buffer #8" },
|
||||||
{ "<leader>b9", "<cmd>BufferLineGotoBuffer 9<CR>", desc = "Switch to Buffer #9" },
|
{ "<leader>b9", "<cmd>BufferLineGotoBuffer 9<CR>", desc = "Switch to Buffer #9" },
|
||||||
|
{ "<leader>b#", "<cmd>BufferLineGotoBuffer #<CR>", desc = "Switch to Buffer #" },
|
||||||
{ "<leader>bb", "<cmd>BufferLinePick<CR>", desc = "Quick Switch Buffers" },
|
{ "<leader>bb", "<cmd>BufferLinePick<CR>", desc = "Quick Switch Buffers" },
|
||||||
{ "<leader>bD", "<cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
{ "<leader>bD", "<cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
||||||
{ "<leader>bxx", "<cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
{ "<leader>bxx", "<cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
||||||
|
|
@ -48,7 +49,7 @@ return {
|
||||||
offsets = {
|
offsets = {
|
||||||
{ filetype = "NvimTree", text = "资源管理器", text_align = "center" },
|
{ filetype = "NvimTree", text = "资源管理器", text_align = "center" },
|
||||||
},
|
},
|
||||||
separator_style = "thin",
|
separator_style = "slope",
|
||||||
},
|
},
|
||||||
highlights = get_highlight(),
|
highlights = get_highlight(),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
|
-- I forgot why I keep this plugin, I use snacks.nvim currently
|
||||||
|
|
||||||
|
return {}
|
||||||
|
|
||||||
-- 2025-03-03
|
-- 2025-03-03
|
||||||
-- If current session is not spawn by neovide, do not load image.nvim
|
-- If current session is not spawn by neovide, do not load image.nvim
|
||||||
-- neovide did not support image viewer yet
|
-- neovide did not support image viewer yet
|
||||||
-- https://github.com/neovide/neovide/issues/2088
|
-- https://github.com/neovide/neovide/issues/2088
|
||||||
-- Disable on: Neovide, alacritty and windows
|
-- Disable on: Neovide, alacritty and windows
|
||||||
if vim.g.neovide then
|
-- if vim.g.neovide then
|
||||||
return {}
|
-- return {}
|
||||||
elseif vim.env.TERM_PROGRAM == "alacritty" then
|
-- elseif vim.env.TERM_PROGRAM == "alacritty" then
|
||||||
return {}
|
-- return {}
|
||||||
elseif vim.loop.os_uname().sysname:lower() == "windows_nt" then
|
-- elseif vim.loop.os_uname().sysname:lower() == "windows_nt" then
|
||||||
return {}
|
-- return {}
|
||||||
else
|
-- else
|
||||||
return {
|
-- return {
|
||||||
"3rd/image.nvim",
|
-- "3rd/image.nvim",
|
||||||
opts = {},
|
-- opts = {},
|
||||||
event = "BufReadPre",
|
-- event = "BufReadPre",
|
||||||
}
|
-- }
|
||||||
end
|
-- end
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ local config = {
|
||||||
component_separators = { left = "", right = "" },
|
component_separators = { left = "", right = "" },
|
||||||
section_separators = { left = "", right = "" },
|
section_separators = { left = "", right = "" },
|
||||||
-- theme = "catppuccin",
|
-- theme = "catppuccin",
|
||||||
theme = vim.g.colors_name,
|
theme = "auto",
|
||||||
-- IDE-like Global Status
|
-- IDE-like Global Status
|
||||||
globalstaus = true,
|
globalstaus = true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,8 @@
|
||||||
"Nix": {
|
"Nix": {
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"external": {
|
"external": {
|
||||||
"command": "alejandra"
|
"command": "alejandra",
|
||||||
|
"arguments": ["--quiet", "--"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"completions": {
|
"completions": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue