358 current 2024-04-16 14:38:00 24.05.20240416.c04952a 6.8.4-zen1 *
This commit is contained in:
parent
76e98d422e
commit
38c95e923d
47 changed files with 1991 additions and 1876 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
use flake;
|
||||
16
flake.lock
generated
16
flake.lock
generated
|
|
@ -557,6 +557,7 @@
|
|||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"rio-term": "rio-term",
|
||||
"systems": "systems_6",
|
||||
"waybar": "waybar"
|
||||
}
|
||||
},
|
||||
|
|
@ -674,6 +675,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_6": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"waybar": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
|
|
|
|||
18
flake.nix
18
flake.nix
|
|
@ -48,11 +48,14 @@
|
|||
rio-term = {
|
||||
url = "github:zackartz/rio";
|
||||
};
|
||||
|
||||
systems.url = "github:nix-systems/default";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
systems,
|
||||
...
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
|
|
@ -60,6 +63,11 @@
|
|||
overlays = [
|
||||
inputs.neovim-nightly-overlay.overlay
|
||||
];
|
||||
eachSystem = f:
|
||||
nixpkgs.lib.genAttrs (import systems) (
|
||||
system:
|
||||
f nixpkgs.legacyPackages.${system}
|
||||
);
|
||||
in {
|
||||
nixosConfigurations.earth = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
|
|
@ -68,5 +76,15 @@
|
|||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
devShells = eachSystem (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.nil
|
||||
pkgs.stylua
|
||||
pkgs.nodePackages.coc-sumneko-lua
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,8 @@ return {
|
|||
[l("uI")] = { f.set_indent_type, fmt("Indent", "Set indentation type") },
|
||||
[l("us")] = { cmd("nohlsearch"), fmt("Clear", "Clear search highlights") },
|
||||
|
||||
|
||||
["<F36>"] = { cmd("OverseerRun"), "Overseer Run" },
|
||||
["<F48>"] = { cmd("OverseerToggle"), "Overseer Toggle" },
|
||||
["<C-F12>"] = { cmd("OverseerRun"), "Overseer Run" },
|
||||
["<C-S-F12>"] = { cmd("OverseerToggle"), "Overseer Toggle" },
|
||||
-- Neotree
|
||||
[l("e")] = { cmd("Neotree toggle"), fmt("FileTree", "Toggle Neotree") },
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,41 @@
|
|||
local M = {}
|
||||
|
||||
M.definitions = function() vim.cmd("Telescope lsp_definitions") end
|
||||
M.type_definition = function() vim.lsp.buf.type_definition() end
|
||||
M.declarations = function() vim.lsp.buf.declaration() end
|
||||
M.implementations = function() vim.cmd("Telescope lsp_implementations") end
|
||||
M.references = function() vim.cmd("Telescope lsp_references") end
|
||||
M.hover = function() vim.lsp.buf.hover() end
|
||||
M.rename = function() vim.lsp.buf.rename() end
|
||||
M.signature_help = function() vim.lsp.buf.signature_help() end
|
||||
M.symbols = function() vim.cmd("Telescope lsp_workspace_symbols") end
|
||||
M.refresh_codelens = function() vim.lsp.codelens.refresh() end
|
||||
M.run_codelens = function() vim.lsp.codelens.run() end
|
||||
M.toggle_inlay_hint = function() vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) end
|
||||
M.definitions = function()
|
||||
vim.cmd("Telescope lsp_definitions")
|
||||
end
|
||||
M.type_definition = function()
|
||||
vim.lsp.buf.type_definition()
|
||||
end
|
||||
M.declarations = function()
|
||||
vim.lsp.buf.declaration()
|
||||
end
|
||||
M.implementations = function()
|
||||
vim.cmd("Telescope lsp_implementations")
|
||||
end
|
||||
M.references = function()
|
||||
vim.cmd("Telescope lsp_references")
|
||||
end
|
||||
M.hover = function()
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
M.rename = function()
|
||||
vim.lsp.buf.rename()
|
||||
end
|
||||
M.signature_help = function()
|
||||
vim.lsp.buf.signature_help()
|
||||
end
|
||||
M.symbols = function()
|
||||
vim.cmd("Telescope lsp_workspace_symbols")
|
||||
end
|
||||
M.refresh_codelens = function()
|
||||
vim.lsp.codelens.refresh()
|
||||
end
|
||||
M.run_codelens = function()
|
||||
vim.lsp.codelens.run()
|
||||
end
|
||||
M.toggle_inlay_hint = function()
|
||||
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0))
|
||||
end
|
||||
|
||||
M.diagnostics = function()
|
||||
local _, win = vim.diagnostic.open_float()
|
||||
|
|
@ -20,8 +44,12 @@ M.diagnostics = function()
|
|||
vim.wo[win].signcolumn = "yes:1"
|
||||
end
|
||||
end
|
||||
M.next_diagnostic = function() vim.diagnostic.goto_next() end
|
||||
M.prev_diagnostic = function() vim.diagnostic.goto_prev() end
|
||||
M.next_diagnostic = function()
|
||||
vim.diagnostic.goto_next()
|
||||
end
|
||||
M.prev_diagnostic = function()
|
||||
vim.diagnostic.goto_prev()
|
||||
end
|
||||
|
||||
M.format = function()
|
||||
vim.api.nvim_create_autocmd("TextChanged", {
|
||||
|
|
@ -35,7 +63,9 @@ M.format = function()
|
|||
})
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
filter = function(client) return client.name == "null-ls" end,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@ local make_config = function(name, config)
|
|||
capabilities.textDocument.colorProvider = { dynamicRegistration = true }
|
||||
local extended_config = vim.tbl_extend("error", { capabilities = capabilities }, config)
|
||||
|
||||
return function() require("lspconfig")[name].setup(extended_config) end
|
||||
return function()
|
||||
require("lspconfig")[name].setup(extended_config)
|
||||
end
|
||||
end
|
||||
|
||||
-- Default handler
|
||||
M[1] = function(server_name) make_config(server_name, {})() end
|
||||
M[1] = function(server_name)
|
||||
make_config(server_name, {})()
|
||||
end
|
||||
|
||||
M.lua_ls = make_config("lua_ls", {
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ return {
|
|||
{ "ys", mode = { "n" }, desc = "Add surrounding pair" },
|
||||
{ "S", mode = { "v" }, desc = "Add surrounding pair" },
|
||||
},
|
||||
config = function() require("nvim-surround").setup() end,
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -70,7 +72,9 @@ return {
|
|||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
opts = {
|
||||
provider_selector = function() return { "treesitter", "indent" } end,
|
||||
provider_selector = function()
|
||||
return { "treesitter", "indent" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ return {
|
|||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
event = "InsertEnter",
|
||||
build = "make install_jsregexp",
|
||||
config = function() require("luasnip.loaders.from_vscode").lazy_load() end,
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -39,7 +41,9 @@ return {
|
|||
local lspkind_status_ok, lspkind = pcall(require, "lspkind")
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
|
||||
if not snip_status_ok then return end
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local win_conf = cmp.config.window.bordered({
|
||||
winhighlight = "FloatBorder:FloatBorder",
|
||||
|
|
@ -48,7 +52,9 @@ return {
|
|||
|
||||
return {
|
||||
snippet = {
|
||||
expand = function(args) luasnip.lsp_expand(args.body) end,
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = win_conf,
|
||||
|
|
@ -95,8 +101,7 @@ return {
|
|||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind_status_ok
|
||||
and lspkind.cmp_format({
|
||||
format = lspkind_status_ok and lspkind.cmp_format({
|
||||
mode = "symbol",
|
||||
maxwidth = 25,
|
||||
ellipsis_char = "...",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ return {
|
|||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(_, bufnr) return vim.api.nvim_buf_line_count(bufnr) > 10000 end,
|
||||
disable = function(_, bufnr)
|
||||
return vim.api.nvim_buf_line_count(bufnr) > 10000
|
||||
end,
|
||||
},
|
||||
incremental_selection = { enable = true },
|
||||
indent = { enable = true },
|
||||
|
|
@ -60,6 +62,8 @@ return {
|
|||
"ebnf",
|
||||
},
|
||||
},
|
||||
config = function(_, opts) require("nvim-treesitter.configs").setup(opts) end,
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
'stevearc/overseer.nvim',
|
||||
"stevearc/overseer.nvim",
|
||||
opts = {
|
||||
task_list = {
|
||||
direction = "bottom",
|
||||
|
|
@ -7,8 +7,8 @@ task_list = {
|
|||
},
|
||||
dependencies = {
|
||||
{
|
||||
'stevearc/dressing.nvim',
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {},
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ return {
|
|||
"CccHighlighterToggle",
|
||||
},
|
||||
opts = {
|
||||
alpha_show = "show"
|
||||
alpha_show = "show",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@ return {
|
|||
dashboard.button("n", format("NewFile", "New file", 2), ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("f", format("Search", "Find file", 2), ":Telescope find_files<CR>"),
|
||||
dashboard.button("l", format("History", "Recents", 2), ":SessionManager load_session<CR>"),
|
||||
dashboard.button(
|
||||
"L",
|
||||
format("FolderOpened", "Last session", 2),
|
||||
":SessionManager load_last_session<CR>"
|
||||
),
|
||||
dashboard.button("L", format("FolderOpened", "Last session", 2), ":SessionManager load_last_session<CR>"),
|
||||
dashboard.button("q", format("Exit", "Quit", 2), ":qa<CR>"),
|
||||
}
|
||||
dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ return {
|
|||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function() vim.cmd.colorscheme("tokyonight-night") end,
|
||||
init = function()
|
||||
vim.cmd.colorscheme("tokyonight-night")
|
||||
end,
|
||||
opts = {
|
||||
styles = {
|
||||
keywords = { italic = false },
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@ M.indentation = {
|
|||
|
||||
M.progress = {
|
||||
"progress",
|
||||
fmt = function(location) return vim.trim(location) end,
|
||||
fmt = function(location)
|
||||
return vim.trim(location)
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.purple, bg = colors.night.bg }
|
||||
|
|
@ -113,7 +115,9 @@ M.progress = {
|
|||
|
||||
M.location = {
|
||||
"location",
|
||||
fmt = function(location) return vim.trim(location) end,
|
||||
fmt = function(location)
|
||||
return vim.trim(location)
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.purple, bg = colors.night.bg }
|
||||
|
|
@ -121,7 +125,9 @@ M.location = {
|
|||
}
|
||||
|
||||
M.macro = {
|
||||
function() return vim.fn.reg_recording() end,
|
||||
function()
|
||||
return vim.fn.reg_recording()
|
||||
end,
|
||||
icon = icons.Recording,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
|
|
@ -133,8 +139,12 @@ M.lsp = {
|
|||
function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
if next(clients) == nil then return "" end
|
||||
local attached_clients = vim.tbl_map(function(client) return client.name end, clients)
|
||||
if next(clients) == nil then
|
||||
return ""
|
||||
end
|
||||
local attached_clients = vim.tbl_map(function(client)
|
||||
return client.name
|
||||
end, clients)
|
||||
return table.concat(attached_clients, ", ")
|
||||
end,
|
||||
icon = icons.Braces,
|
||||
|
|
@ -145,7 +155,9 @@ M.lsp = {
|
|||
}
|
||||
|
||||
M.gap = {
|
||||
function() return " " end,
|
||||
function()
|
||||
return " "
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { bg = colors.night.bg }
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ local M = {}
|
|||
|
||||
local input = function(prompt, callback)
|
||||
local value = vim.fn.input(prompt)
|
||||
if value:len() ~= 0 then callback(value) end
|
||||
if value:len() ~= 0 then
|
||||
callback(value)
|
||||
end
|
||||
end
|
||||
|
||||
local select = function(prompt, callback)
|
||||
vim.ui.select({ "tabs", "spaces" }, {
|
||||
prompt = prompt,
|
||||
}, function(choice)
|
||||
if choice then callback(choice) end
|
||||
if choice then
|
||||
callback(choice)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
@ -60,8 +64,12 @@ M.comment_selection = function()
|
|||
require("Comment.api").toggle.linewise(vim.fn.visualmode())
|
||||
end
|
||||
|
||||
M.first_buffer = function() require("bufferline").go_to(1) end
|
||||
M.last_buffer = function() require("bufferline").go_to(-1) end
|
||||
M.first_buffer = function()
|
||||
require("bufferline").go_to(1)
|
||||
end
|
||||
M.last_buffer = function()
|
||||
require("bufferline").go_to(-1)
|
||||
end
|
||||
|
||||
M.buf_hsplit = function()
|
||||
require("bufferline.pick").choose_then(function(id)
|
||||
|
|
@ -91,7 +99,9 @@ M.open_lazygit = function()
|
|||
height = 25,
|
||||
},
|
||||
on_close = function()
|
||||
if package.loaded["neo-tree"] then require("neo-tree.events").fire_event("git_event") end
|
||||
if package.loaded["neo-tree"] then
|
||||
require("neo-tree.events").fire_event("git_event")
|
||||
end
|
||||
end,
|
||||
})
|
||||
:open()
|
||||
|
|
|
|||
|
|
@ -106,6 +106,8 @@ M.icons = {
|
|||
Download = "",
|
||||
}
|
||||
|
||||
M.fmt = function(icon, text, space) return M.icons[icon] .. string.rep(" ", space or 1) .. text end
|
||||
M.fmt = function(icon, text, space)
|
||||
return M.icons[icon] .. string.rep(" ", space or 1) .. text
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
local M = {}
|
||||
|
||||
M.leader = function(key) return "<leader>" .. key end
|
||||
M.cmd = function(cmd) return "<cmd>" .. cmd .. "<CR>" end
|
||||
M.rcmd = function(cmd) return ":" .. cmd .. "<CR>" end
|
||||
M.lua = function(cmd) return "<cmd>lua " .. cmd .. "<CR>" end
|
||||
M.notify = function(cmd) return M.cmd("call VSCodeNotify('" .. cmd .. "')") end
|
||||
M.leader = function(key)
|
||||
return "<leader>" .. key
|
||||
end
|
||||
M.cmd = function(cmd)
|
||||
return "<cmd>" .. cmd .. "<CR>"
|
||||
end
|
||||
M.rcmd = function(cmd)
|
||||
return ":" .. cmd .. "<CR>"
|
||||
end
|
||||
M.lua = function(cmd)
|
||||
return "<cmd>lua " .. cmd .. "<CR>"
|
||||
end
|
||||
M.notify = function(cmd)
|
||||
return M.cmd("call VSCodeNotify('" .. cmd .. "')")
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ M.open_help_float = function()
|
|||
vim.api.nvim_win_set_config(win, config)
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(win),
|
||||
callback = function() vim.api.nvim_buf_delete(buf, {}) end,
|
||||
callback = function()
|
||||
vim.api.nvim_buf_delete(buf, {})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue