move to snowfall
This commit is contained in:
parent
9d7ad7c973
commit
769d4b0df5
188 changed files with 2203 additions and 3041 deletions
92
modules/home/apps/tools/git/default.nix
Normal file
92
modules/home/apps/tools/git/default.nix
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.apps.tools.git;
|
||||
in {
|
||||
options.apps.tools.git = with types; {
|
||||
enable = mkBoolOpt false "Enable Git Integration";
|
||||
|
||||
signByDefault = mkBoolOpt true "Sign by default";
|
||||
signingKey = mkStringOpt "5B53E53A9A514DBA" "The KeyID of your GPG signingKey";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [zsh-forgit gitflow];
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "zack";
|
||||
userEmail = "zackmyers@lavabit.com";
|
||||
ignores = [
|
||||
".cache/"
|
||||
".DS_Store"
|
||||
".idea/"
|
||||
"*.swp"
|
||||
"*.elc"
|
||||
"auto-save-list"
|
||||
".direnv/"
|
||||
"node_modules"
|
||||
"result"
|
||||
"result-*"
|
||||
];
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
signByDefault = cfg.signByDefault;
|
||||
};
|
||||
extraConfig = {
|
||||
init = {defaultBranch = "main";};
|
||||
delta = {
|
||||
options.map-styles = "bold purple => syntax #ca9ee6, bold cyan => syntax #8caaee";
|
||||
line-numbers = true;
|
||||
};
|
||||
branch.autosetupmerge = "true";
|
||||
push.default = "current";
|
||||
merge.stat = "true";
|
||||
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
|
||||
repack.usedeltabaseoffset = "true";
|
||||
pull.ff = "only";
|
||||
rebase = {
|
||||
autoSquash = true;
|
||||
autoStash = true;
|
||||
};
|
||||
rerere = {
|
||||
autoupdate = true;
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
lfs.enable = true;
|
||||
delta.enable = true;
|
||||
aliases = {
|
||||
essa = "push --force";
|
||||
co = "checkout";
|
||||
fuck = "commit --amend -m";
|
||||
c = "commit -m";
|
||||
ca = "commit -am";
|
||||
forgor = "commit --amend --no-edit";
|
||||
graph = "log --all --decorate --graph --oneline";
|
||||
oops = "checkout --";
|
||||
l = "log";
|
||||
r = "rebase";
|
||||
s = "status --short";
|
||||
ss = "status";
|
||||
d = "diff";
|
||||
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
|
||||
st = "status";
|
||||
br = "branch";
|
||||
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
|
||||
hist = ''
|
||||
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
|
||||
llog = ''
|
||||
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
|
||||
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/home/apps/tools/neovim/config/README.md
Normal file
26
modules/home/apps/tools/neovim/config/README.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# nvimrc
|
||||
|
||||
**NOTE:** Neovim [nightly](https://github.com/neovim/neovim/releases/nightly) is required for inlay hint.
|
||||
|
||||
This repository contains my personal Neovim configuration, designed to be comprehensive and to provide a feature-rich IDE experience with a polished UI.
|
||||
|
||||
It's my daily driver for Rust, Lua and Web stuff. I also have a backup configuration for Vscode Neovim just in case I'll be forced to use Vscode.
|
||||
|
||||

|
||||
|
||||
## Structure
|
||||
|
||||
```shell
|
||||
.
|
||||
├── after
|
||||
├── core
|
||||
├── lsp
|
||||
├── plugins
|
||||
│ ├── editor
|
||||
│ ├── lsp
|
||||
│ ├── tools
|
||||
│ ├── ui
|
||||
│ └── utils
|
||||
├── utils
|
||||
└── vscode
|
||||
```
|
||||
48
modules/home/apps/tools/neovim/config/init.lua
Executable file
48
modules/home/apps/tools/neovim/config/init.lua
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
local filetypes = require("core.filetypes")
|
||||
local configurer = require("utils.configurer")
|
||||
local opts = {}
|
||||
|
||||
if vim.g.vscode then
|
||||
-- VSCode Neovim
|
||||
opts.spec = "vscode.plugins"
|
||||
opts.options = require("vscode.options")
|
||||
opts.keymaps = require("vscode.keymaps")
|
||||
else
|
||||
-- Normal Neovim
|
||||
opts.spec = "plugins"
|
||||
opts.options = require("core.options")
|
||||
opts.keymaps = require("core.keymaps")
|
||||
opts.autocmd = require("core.autocmd")
|
||||
opts.signs = require("core.signs")
|
||||
end
|
||||
|
||||
configurer.setup(opts)
|
||||
|
||||
local handlers = require("lsp.handlers") -- Adjust the path as necessary
|
||||
|
||||
local function setup_all_servers()
|
||||
for server, setup_fn in pairs(handlers) do
|
||||
if type(setup_fn) == "function" then
|
||||
-- Call the setup function for each server
|
||||
setup_fn()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
setup_all_servers()
|
||||
|
||||
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
vim.keymap.set("i", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set("i", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set("i", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set("i", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
-- Neovide config
|
||||
vim.o.guifont = "Iosevka Nerd Font Mono:h14"
|
||||
vim.g.neovide_transparency = 0.75
|
||||
|
||||
-- vim.lsp.log.set_level(vim.lsp.log_levels.INFO)
|
||||
vim.filetype.add(filetypes)
|
||||
|
|
@ -0,0 +1 @@
|
|||
vim.opt_local.shiftwidth = 4
|
||||
21
modules/home/apps/tools/neovim/config/lua/core/autocmd.lua
Normal file
21
modules/home/apps/tools/neovim/config/lua/core/autocmd.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
{
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
local lsp = require("lsp.config")
|
||||
lsp.set_keymaps(client, bufnr)
|
||||
lsp.set_autocmd(client, bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
event = { "FileType" },
|
||||
opts = {
|
||||
pattern = { "help" },
|
||||
callback = require("utils.win").open_help_float,
|
||||
},
|
||||
},
|
||||
}
|
||||
10
modules/home/apps/tools/neovim/config/lua/core/filetypes.lua
Normal file
10
modules/home/apps/tools/neovim/config/lua/core/filetypes.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
extension = {
|
||||
ic = "icelang",
|
||||
rasi = "rasi",
|
||||
ebnf = "ebnf",
|
||||
},
|
||||
pattern = {
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
},
|
||||
}
|
||||
285
modules/home/apps/tools/neovim/config/lua/core/keymaps.lua
Normal file
285
modules/home/apps/tools/neovim/config/lua/core/keymaps.lua
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
local map = require("utils.mappings")
|
||||
local f = require("utils.functions")
|
||||
local fmt = require("utils.icons").fmt
|
||||
local fn = require("utils.functions")
|
||||
local l, cmd, rcmd, lua = map.leader, map.cmd, map.rcmd, map.lua
|
||||
local freeze, freeze_selection = fn.freeze, fn.freeze_selection
|
||||
|
||||
return {
|
||||
i = {
|
||||
["jj"] = { "<esc>", "Exit insert mode" },
|
||||
},
|
||||
n = {
|
||||
-- utils
|
||||
["vv"] = { "V", "Linewise visual" },
|
||||
[l("w")] = { cmd("w"), fmt("Save", "Save file") },
|
||||
[l("W")] = { cmd("w!"), fmt("Save", "Save file!") },
|
||||
[l("q")] = { cmd("q"), fmt("Exit", "Exit window") },
|
||||
[l("Q")] = { cmd("q!"), fmt("Exit", "Exit window!") },
|
||||
[l("p")] = { '"_dP', fmt("Clipboard", "Paste from clipboard") },
|
||||
[l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") },
|
||||
[l(":")] = { ":lua ", fmt("Lua", "Lua prompt") },
|
||||
[l("%")] = { cmd("luafile %"), fmt("Lua", "Luafile") },
|
||||
[l(";")] = { f.comment_line, fmt("Comment", "Comment line") },
|
||||
[l(" ")] = { cmd("wincmd w"), fmt("Window", "Switch window") },
|
||||
|
||||
-- UI utils
|
||||
[l("uw")] = { f.toggle_wrap, fmt("LineWrap", "Toggle wrap") },
|
||||
[l("ug")] = { cmd("GuessIndent"), fmt("Indent", "Guess indent") },
|
||||
[l("uf")] = { f.set_filetype, fmt("DefaultFile", "Set filetype") },
|
||||
[l("ui")] = { f.set_indent, fmt("Indent", "Set indentation") },
|
||||
[l("uI")] = { f.set_indent_type, fmt("Indent", "Set indentation type") },
|
||||
[l("us")] = { cmd("nohlsearch"), fmt("Clear", "Clear search highlights") },
|
||||
|
||||
["<C-F12>"] = { cmd("OverseerRun"), "Overseer Run" },
|
||||
["<C-S-F12>"] = { cmd("OverseerToggle"), "Overseer Toggle" },
|
||||
-- Neotree
|
||||
[l("e")] = { cmd("Neotree toggle"), fmt("FileTree", "Toggle Neotree") },
|
||||
|
||||
-- Neogit
|
||||
[l("ng")] = { cmd("Neogit"), fmt("Git", "Open Neogit") },
|
||||
|
||||
-- Cloak
|
||||
[l("ct")] = { cmd("CloakToggle"), "Cloak Toggle" },
|
||||
|
||||
-- Freeze
|
||||
[l("sc")] = { freeze, "Take code screenshot" },
|
||||
|
||||
-- Rest
|
||||
[l("rr")] = { cmd("Rest run"), "Run request in Rest" },
|
||||
|
||||
-- move.nvim
|
||||
["<A-j>"] = { cmd("MoveLine(1)"), "Move line down" },
|
||||
["<A-k>"] = { cmd("MoveLine(-1)"), "Move line up" },
|
||||
["<A-h>"] = { cmd("MoveHChar(-1)"), "Move character left" },
|
||||
["<A-l>"] = { cmd("MoveHChar(1)"), "Move character right" },
|
||||
|
||||
-- ccc
|
||||
[l("cp")] = { cmd("CccPick"), fmt("ColorPicker", "Pick color") },
|
||||
[l("cc")] = { cmd("CccConvert"), fmt("Swap", "Convert color") },
|
||||
[l("ce")] = { cmd("CccHighlighterEnable"), fmt("ColorOn", "Enable highlights") },
|
||||
[l("cd")] = { cmd("CccHighlighterDisable"), fmt("ColorOff", "Disable highlights") },
|
||||
|
||||
-- buffer utils
|
||||
[l("bq")] = { cmd("BufDel"), fmt("Close", "Close current buffer") },
|
||||
[l("bQ")] = { cmd("BufDel!"), fmt("Close", "close current buffer!") },
|
||||
[l("bb")] = { cmd("BufferLinePick"), fmt("Open", "Pick to open buffer") },
|
||||
[l("bd")] = { cmd("BufferLinePickClose"), fmt("Close", "Pick to close buffer") },
|
||||
[l("bl")] = { cmd("BufferLineCloseLeft"), fmt("CloseMultiple", "Close buffers to the left") },
|
||||
[l("br")] = { cmd("BufferLineCloseRight"), fmt("CloseMultiple", "Close buffers to the right") },
|
||||
[l("bn")] = { cmd("BufferLineCycleNext"), fmt("NextBuffer", "Move to next buffer") },
|
||||
[l("bp")] = { cmd("BufferLineCyclePrev"), fmt("PrevBuffer", "Move to previous buffer") },
|
||||
[l("bi")] = { cmd("BufferLineTogglePin"), fmt("Pin", "Pin buffer") },
|
||||
[l("bg")] = { f.first_buffer, fmt("PrevBuffer", "Move to first buffer") },
|
||||
[l("bG")] = { f.last_buffer, fmt("NextBuffer", "Move to last buffer") },
|
||||
[l("bv")] = { f.buf_vsplit, fmt("Vertical", "Vertical split") },
|
||||
[l("bh")] = { f.buf_hsplit, fmt("Horizontal", "Horizontal split") },
|
||||
|
||||
-- gitsigns
|
||||
[l("gb")] = { cmd("Gitsigns toggle_current_line_blame"), fmt("GitDiff", "Line blame") },
|
||||
[l("gd")] = { cmd("Gitsigns diffthis"), fmt("GitDiff", "Show diff") },
|
||||
[l("gD")] = { cmd("Gitsigns toggle_deleted"), fmt("DiffRemoved", "Toggle deleted") },
|
||||
[l("gp")] = { cmd("Gitsigns preview_hunk"), fmt("Popup", "Preview hunk") },
|
||||
[l("gP")] = { cmd("Gitsigns preview_hunk_inline"), fmt("Popup", "Preview hunk inline") },
|
||||
[l("gn")] = { cmd("Gitsigns next_hunk"), fmt("Down", "Next hunk") },
|
||||
[l("gN")] = { cmd("Gitsigns prev_hunk"), fmt("Up", "Previous hunk") },
|
||||
[l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") },
|
||||
[l("gs")] = { cmd("Gitsigns stage_hunk"), fmt("Save", "Stage hunk") },
|
||||
[l("gv")] = { cmd("Gitsigns select_hunk"), fmt("Visual", "Select hunk") },
|
||||
[l("gw")] = { cmd("Gitsigns toggle_word_diff"), fmt("GitDiff", "Toggle word diff") },
|
||||
[l("gg")] = { cmd("Telescope git_status"), fmt("Git", "Git status") },
|
||||
|
||||
-- toggleterm
|
||||
[l("th")] = { cmd("ToggleTerm direction=horizontal"), fmt("Horizontal", "Horizontal terminal") },
|
||||
[l("tv")] = {
|
||||
cmd("ToggleTerm direction=vertical size=60"),
|
||||
fmt("Vertical", "Vertical terminal"),
|
||||
},
|
||||
[l("tf")] = { cmd("ToggleTerm direction=float"), fmt("Window", "Floating terminal") },
|
||||
[l("tl")] = { f.open_lazygit, fmt("GitBranch", "Lazygit terminal") },
|
||||
[l("tg")] = { f.open_glow, fmt("Markdown", "Glow terminal") },
|
||||
|
||||
-- wincmd
|
||||
["<C-h>"] = { cmd("wincmd h"), "Move right" },
|
||||
["<C-j>"] = { cmd("wincmd j"), "Move down" },
|
||||
["<C-k>"] = { cmd("wincmd k"), "Move up" },
|
||||
["<C-l>"] = { cmd("wincmd l"), "Move left" },
|
||||
|
||||
-- telescope
|
||||
[l("ff")] = { cmd("Telescope find_files"), fmt("FileSearch", "Find files") },
|
||||
[l("fF")] = { cmd("Telescope find_files hidden=true"), fmt("FileSearch", "Find all files") },
|
||||
[l("fg")] = { cmd("Telescope live_grep"), fmt("TextSearch", "Live grep") },
|
||||
[l("fb")] = { cmd("Telescope buffers"), fmt("TabSearch", "Find buffer") },
|
||||
[l("fh")] = { cmd("Telescope help_tags"), fmt("Help", "Find help") },
|
||||
[l("fd")] = { cmd("Telescope diagnostics"), fmt("Warn", "Find diagnostic") },
|
||||
[l("fs")] = { cmd("Telescope lsp_document_symbols"), fmt("Braces", "Document symbol") },
|
||||
[l("fr")] = { cmd("Telescope resume"), fmt("Run", "Resume search") },
|
||||
[l("fn")] = { cmd("Telescope notify"), fmt("Notification", "Show notifications") },
|
||||
[l("fo")] = { cmd("Telescope vim_options"), fmt("Config", "Vim options") },
|
||||
[l("f:")] = { cmd("Telescope command_history"), fmt("History", "Command history") },
|
||||
[l("fm")] = { cmd("Telescope man_pages"), fmt("Info", "Search man") },
|
||||
[l("fR")] = { cmd("Telescope reloader"), fmt("Restore", "Reload module") },
|
||||
[l("fH")] = { cmd("Telescope highlights"), fmt("Color", "Highlight group") },
|
||||
[l("ft")] = { cmd("Telescope treesitter"), fmt("Symbol", "Treesitter") },
|
||||
[l("fz")] = { cmd("Telescope current_buffer_fuzzy_find"), fmt("Search", "Buffer fuzzy find") },
|
||||
[l("fp")] = { cmd("Telescope registers"), fmt("Clipboard", "Registers") },
|
||||
[l("fq")] = { cmd("Telescope quickfix"), fmt("Fix", "Quickfix") },
|
||||
[l("gc")] = { cmd("Telescope git_bcommits"), fmt("GitCommit", "Find branch commit") },
|
||||
[l("gC")] = { cmd("Telescope git_commits"), fmt("GitCommit", "Find commit") },
|
||||
[l("gB")] = { cmd("Telescope git_branches"), fmt("GitBranch", "Find git branch") },
|
||||
|
||||
-- Lazy
|
||||
[l("L")] = { cmd("Lazy"), fmt("Package", "Plugin manager") },
|
||||
|
||||
-- Mason
|
||||
[l("M")] = { cmd("Mason"), fmt("Package", "Mason") },
|
||||
|
||||
-- DAP
|
||||
[l("do")] = { f.open_dapui, fmt("Open", "Open debugger UI") },
|
||||
[l("dq")] = { f.close_dapui, fmt("Close", "Close debugger UI") },
|
||||
[l("dt")] = { f.toggle_dapui, fmt("Toggle", "Toggle debugger") },
|
||||
[l("dc")] = { cmd("DapTerminate"), fmt("Stop", "Terminate session") },
|
||||
[l("dr")] = { cmd("DapRestartFrame"), fmt("Restart", "Restart frame") },
|
||||
[l("db")] = { cmd("DapToggleBreakpoint"), fmt("Toggle", "Toggle breakpoint") },
|
||||
[l("dl")] = { cmd("DapShowLog"), fmt("DefaultFile", "Show logs") },
|
||||
["<F5>"] = { cmd("DapContinue"), "Continue session" },
|
||||
["<F9>"] = { cmd("DapToggleBreakpoint"), "Toggle breakpoint" },
|
||||
["<F11>"] = { cmd("DapStepInto"), "Step into" },
|
||||
["<F23>"] = { cmd("DapStepOut"), "Step out" },
|
||||
["<F12>"] = { cmd("DapStepOver"), "Step over" },
|
||||
|
||||
-- telescope DAP
|
||||
[l("dB")] = {
|
||||
lua("require('telescope').extensions.dap.list_breakpoints()"),
|
||||
fmt("Breakpoint", "List breakpoints"),
|
||||
},
|
||||
[l("dv")] = {
|
||||
lua("require('telescope').extensions.dap.variables()"),
|
||||
fmt("Variable", "List variables"),
|
||||
},
|
||||
[l("df")] = {
|
||||
lua("require('telescope').extensions.dap.frames()"),
|
||||
fmt("Stack", "List frames"),
|
||||
},
|
||||
[l("dF")] = {
|
||||
lua("require('telescope').extensions.dap.configurations()"),
|
||||
fmt("Config", "List configurations"),
|
||||
},
|
||||
[l("dC")] = {
|
||||
lua("require('telescope').extensions.dap.commands()"),
|
||||
fmt("Command", "List commands"),
|
||||
},
|
||||
|
||||
-- session-manager
|
||||
[l("Ss")] = { cmd("SessionManager save_current_session"), fmt("Save", "Save session") },
|
||||
[l("Sl")] = { cmd("SessionManager load_session"), fmt("Restore", "Load session") },
|
||||
[l("SL")] = { cmd("SessionManager load_last_session"), fmt("Restore", "Load last session") },
|
||||
[l("Sd")] = { cmd("SessionManager delete_session"), fmt("Trash", "Delete session") },
|
||||
[l("SD")] = {
|
||||
cmd("SessionManager load_current_dir_session"),
|
||||
fmt("FolderClock", "Load current directory session"),
|
||||
},
|
||||
|
||||
-- notify
|
||||
[l("nn")] = {
|
||||
lua("require('notify').dismiss()"),
|
||||
fmt("NotificationDismiss", "Dismiss notifications"),
|
||||
},
|
||||
|
||||
-- lspconfig
|
||||
[l("li")] = { cmd("LspInfo"), fmt("Info", "Server info") },
|
||||
[l("lI")] = { cmd("LspLog"), fmt("DefaultFile", "Server logs") },
|
||||
[l("lS")] = { ":LspStart ", fmt("Run", "Start server") },
|
||||
[l("lq")] = { ":LspStop ", fmt("Stop", "Stop server") },
|
||||
[l("lR")] = { cmd("LspRestart"), fmt("Restart", "Restart server") },
|
||||
|
||||
-- dropbar
|
||||
[l("ok")] = { lua("require('dropbar.api').goto_context_start()"), fmt("Up", "Context start") },
|
||||
[l("oo")] = { lua("require('dropbar.api').pick()"), fmt("Check", "Pick node") },
|
||||
|
||||
-- DbUI
|
||||
[l("Dd")] = { cmd("DBUIToggle"), fmt("Toggle", "Toggle DbUI") },
|
||||
[l("Da")] = { cmd("DBUIAddConnection"), fmt("Add", "Add connection") },
|
||||
|
||||
-- nvim-devdocs
|
||||
[l("v ")] = { cmd("DevdocsToggle"), fmt("Window", "Toggle floating window") },
|
||||
[l("vc")] = { cmd("DevdocsOpenCurrentFloat"), fmt("BookmarkSearch", "Open current file docs") },
|
||||
[l("vv")] = { cmd("DevdocsOpenFloat"), fmt("BookmarkSearch", "Open in floating window") },
|
||||
[l("vV")] = { cmd("DevdocsOpen"), fmt("BookmarkSearch", "Open in a normal buffer") },
|
||||
[l("vf")] = { ":DevdocsOpenFloat ", fmt("BookmarkSearch", "Open documentation") },
|
||||
[l("vi")] = { ":DevdocsInstall ", fmt("Install", "Install documentation") },
|
||||
[l("vu")] = { ":DevdocsUninstall ", fmt("Trash", "Install documentation") },
|
||||
|
||||
-- crates
|
||||
[l("Cv")] = {
|
||||
lua("require('crates').show_versions_popup()"),
|
||||
fmt("Info", "Show versions popup"),
|
||||
},
|
||||
[l("Cf")] = {
|
||||
lua("require('crates').show_features_popup()"),
|
||||
fmt("Stack", "Show features popup"),
|
||||
},
|
||||
[l("Cd")] = {
|
||||
lua("require('crates').show_dependencies_popup()"),
|
||||
fmt("Dependencies", "Show dependencies popup"),
|
||||
},
|
||||
[l("Cu")] = {
|
||||
lua("require('crates').update_crate()"),
|
||||
fmt("Update", "Update crate"),
|
||||
},
|
||||
[l("CU")] = {
|
||||
lua("require('crates').update_all_crates()"),
|
||||
fmt("Update", "Update all crates"),
|
||||
},
|
||||
[l("CD")] = {
|
||||
lua("require('crates').open_documentation()"),
|
||||
fmt("DefaultFile", "Open documentation"),
|
||||
},
|
||||
[l("Ch")] = {
|
||||
lua("require('crates').open_homepage()"),
|
||||
fmt("Web", "Open homepage"),
|
||||
},
|
||||
[l("Cc")] = {
|
||||
lua("require('crates').open_crates_io()"),
|
||||
fmt("Package", "Open crates.io"),
|
||||
},
|
||||
[l("Cr")] = {
|
||||
lua("require('crates').open_repository()"),
|
||||
fmt("Github", "Open repository"),
|
||||
},
|
||||
},
|
||||
v = {
|
||||
-- move.nvim
|
||||
["<A-k>"] = { rcmd("MoveBlock(-1)"), "Move line up" },
|
||||
["<A-j>"] = { rcmd("MoveBlock(1)"), "Move line down" },
|
||||
["<A-h>"] = { rcmd("MoveHBlock(-1)"), "Move character left" },
|
||||
["<A-l>"] = { rcmd("MoveHBlock(1)"), "Move character right" },
|
||||
|
||||
-- utils
|
||||
["q"] = { "<esc>" },
|
||||
[l("y")] = { '"+y', fmt("Clipboard", "yank to clipboard") },
|
||||
[l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") },
|
||||
[l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") },
|
||||
[l(";")] = { f.comment_selection, fmt("Comment", "Comment selection") },
|
||||
|
||||
-- Freeze
|
||||
[l("sc")] = { freeze_selection, "Take code screenshot" },
|
||||
|
||||
-- gitsigns
|
||||
[l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") },
|
||||
|
||||
-- crates
|
||||
[l("Cu")] = { lua("require('crates').update_crates()"), fmt("Update", "Update crates") },
|
||||
},
|
||||
|
||||
t = {
|
||||
-- toggleterm
|
||||
["<esc>"] = { [[<C-\><C-n>]] },
|
||||
|
||||
-- wincmd
|
||||
["<C-h>"] = { cmd("wincmd h"), "Move right" },
|
||||
["<C-j>"] = { cmd("wincmd j"), "Move down" },
|
||||
["<C-k>"] = { cmd("wincmd k"), "Move up" },
|
||||
["<C-l>"] = { cmd("wincmd l"), "Move left" },
|
||||
},
|
||||
}
|
||||
36
modules/home/apps/tools/neovim/config/lua/core/options.lua
Normal file
36
modules/home/apps/tools/neovim/config/lua/core/options.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
opt = {
|
||||
fileencoding = "utf-8",
|
||||
cmdheight = 0,
|
||||
number = true,
|
||||
relativenumber = true,
|
||||
history = 100,
|
||||
termguicolors = true,
|
||||
filetype = "on",
|
||||
cursorline = true,
|
||||
foldenable = true,
|
||||
foldlevel = 99,
|
||||
foldlevelstart = 99,
|
||||
ignorecase = true,
|
||||
shiftwidth = 2,
|
||||
showtabline = 0,
|
||||
tabstop = 2,
|
||||
expandtab = true,
|
||||
wrap = false,
|
||||
writebackup = false,
|
||||
laststatus = 0,
|
||||
updatetime = 200,
|
||||
fillchars = "eob: ",
|
||||
modeline = false,
|
||||
conceallevel = 2,
|
||||
mouse = "n",
|
||||
clipboard = "unnamedplus",
|
||||
scrolloff = 15,
|
||||
},
|
||||
|
||||
g = {
|
||||
mapleader = " ",
|
||||
maplocalleader = "_",
|
||||
highlighturl_enabled = true,
|
||||
},
|
||||
}
|
||||
9
modules/home/apps/tools/neovim/config/lua/core/signs.lua
Normal file
9
modules/home/apps/tools/neovim/config/lua/core/signs.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local icons = require("utils.icons").icons
|
||||
|
||||
return {
|
||||
{ name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticError" },
|
||||
{ name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticHint" },
|
||||
{ name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticWarn" },
|
||||
{ name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticInfo" },
|
||||
{ name = "DapBreakpoint", text = icons.Breakpoint, texthl = "Breakpoint" },
|
||||
}
|
||||
18
modules/home/apps/tools/neovim/config/lua/lsp/autocmd.lua
Normal file
18
modules/home/apps/tools/neovim/config/lua/lsp/autocmd.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
local lsp = require("lsp.functions")
|
||||
|
||||
return {
|
||||
-- ["textDocument/codeLens"] = {
|
||||
-- event = { "BufEnter", "InsertLeave" },
|
||||
-- opts = {
|
||||
-- group = vim.api.nvim_create_augroup("LspCodelens", {}),
|
||||
-- callback = lsp.refresh_codelens,
|
||||
-- },
|
||||
-- },
|
||||
["textDocument/formatting"] = {
|
||||
event = "BufWritePost",
|
||||
opts = {
|
||||
group = vim.api.nvim_create_augroup("LspFormatting", {}),
|
||||
callback = lsp.format,
|
||||
},
|
||||
},
|
||||
}
|
||||
27
modules/home/apps/tools/neovim/config/lua/lsp/config.lua
Normal file
27
modules/home/apps/tools/neovim/config/lua/lsp/config.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
local M = {}
|
||||
|
||||
M.set_autocmd = function(client, bufnr)
|
||||
local capability_map = require("lsp.autocmd")
|
||||
|
||||
for capability, map in pairs(capability_map) do
|
||||
if client.supports_method(capability) then
|
||||
vim.api.nvim_clear_autocmds({ group = map.opts.group, buffer = bufnr })
|
||||
map.opts.buffer = bufnr
|
||||
vim.api.nvim_create_autocmd(map.event, map.opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
M.set_keymaps = function(client, bufnr)
|
||||
local capability_map = require("lsp.keymaps")
|
||||
|
||||
for capability, maps in pairs(capability_map) do
|
||||
if client.supports_method(capability) then
|
||||
for key, map in pairs(maps) do
|
||||
vim.keymap.set("n", key, map[1], { desc = map[2], buffer = bufnr })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
72
modules/home/apps/tools/neovim/config/lua/lsp/functions.lua
Normal file
72
modules/home/apps/tools/neovim/config/lua/lsp/functions.lua
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
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.diagnostics = function()
|
||||
local _, win = vim.diagnostic.open_float()
|
||||
if win then
|
||||
vim.api.nvim_win_set_config(win, { border = "rounded" })
|
||||
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.format = function()
|
||||
vim.api.nvim_create_autocmd("TextChanged", {
|
||||
group = vim.api.nvim_create_augroup("ApplyFormattingEdit", {}),
|
||||
buffer = vim.api.nvim_get_current_buf(),
|
||||
callback = function()
|
||||
vim.cmd("silent noautocmd update")
|
||||
vim.diagnostic.show()
|
||||
vim.api.nvim_del_augroup_by_name("ApplyFormattingEdit")
|
||||
end,
|
||||
})
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
64
modules/home/apps/tools/neovim/config/lua/lsp/handlers.lua
Normal file
64
modules/home/apps/tools/neovim/config/lua/lsp/handlers.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
local M = {}
|
||||
|
||||
local make_config = function(name, config)
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities.textDocument.colorProvider = { dynamicRegistration = true }
|
||||
local extended_config = vim.tbl_extend("error", { capabilities = capabilities }, config)
|
||||
|
||||
return function()
|
||||
require("lspconfig")[name].setup(extended_config)
|
||||
end
|
||||
end
|
||||
|
||||
-- Default handler
|
||||
-- M[1] = function(server_name)
|
||||
-- make_config(server_name, {})()
|
||||
-- end
|
||||
|
||||
M.lua_ls = make_config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = {
|
||||
enable = true,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
M.nil_ls = make_config("nixd", {})
|
||||
|
||||
M.cssls = make_config("cssls", {
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
M.texlab = make_config("texlab", {})
|
||||
M.astro = make_config("astro", {})
|
||||
|
||||
M.tailwindcss = make_config("tailwindcss", {
|
||||
on_attach = function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
require("document-color").buf_attach(bufnr)
|
||||
end,
|
||||
})
|
||||
|
||||
M.clangd = make_config("clangd", {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--offset-encoding=utf-16",
|
||||
},
|
||||
})
|
||||
|
||||
M.tsserver = make_config("tsserver", {})
|
||||
|
||||
return M
|
||||
52
modules/home/apps/tools/neovim/config/lua/lsp/keymaps.lua
Normal file
52
modules/home/apps/tools/neovim/config/lua/lsp/keymaps.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
local map = require("utils.mappings")
|
||||
local lsp = require("lsp.functions")
|
||||
local l, cmd = map.leader, map.cmd
|
||||
local fmt = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
["textDocument/formatting"] = {
|
||||
[l("lf")] = { lsp.format, fmt("Format", "Format buffer") },
|
||||
},
|
||||
["textDocument/publishDiagnostics"] = {
|
||||
[l("ld")] = { lsp.diagnostics, fmt("Warn", "Hover diagnostic") },
|
||||
["<A-i>"] = { lsp.next_diagnostic, "Next diagnostic" },
|
||||
["<A-o>"] = { lsp.prev_diagnostic, "Previous diagnostic" },
|
||||
},
|
||||
["textDocument/codeAction"] = {
|
||||
[l("a ")] = { cmd("CodeActionToggleLabel"), fmt("Toggle", "Toggle label") },
|
||||
},
|
||||
["textDocument/definition"] = {
|
||||
["gd"] = { lsp.definitions, "Go to definition" },
|
||||
},
|
||||
["textDocument/declaration"] = {
|
||||
["gD"] = { lsp.declarations, "Go to declaration" },
|
||||
},
|
||||
["textDocument/hover"] = {
|
||||
["K"] = { lsp.hover, "Hover info" },
|
||||
},
|
||||
["textDocument/implementation"] = {
|
||||
["gI"] = { lsp.implementations, "Symbol implementation" },
|
||||
},
|
||||
["textDocument/references"] = {
|
||||
["gr"] = { lsp.references, "Go to reference" },
|
||||
},
|
||||
["textDocument/rename"] = {
|
||||
["<leader>lr"] = { lsp.rename, fmt("Edit", "Rename symbol") },
|
||||
},
|
||||
["textDocument/signatureHelp"] = {
|
||||
["<leader>lH"] = { lsp.signature_help, fmt("Help", "Signature help") },
|
||||
},
|
||||
["textDocument/typeDefinition"] = {
|
||||
["gT"] = { lsp.type_definition, "Go to type definition" },
|
||||
},
|
||||
-- ["textDocument/codeLens"] = {
|
||||
-- ["<leader>ll"] = { lsp.run_codelens, fmt("Run", "Run codelens") },
|
||||
-- ["<leader>lL"] = { lsp.refresh_codelens, fmt("Restart", "Refresh codelens") },
|
||||
-- },
|
||||
["workspace/symbol"] = {
|
||||
["<leader>ls"] = { lsp.symbols, fmt("Symbol", "Workspace symbols") },
|
||||
},
|
||||
["workspace/inlayHint"] = {
|
||||
["<leader>lh"] = { lsp.toggle_inlay_hint, fmt("Toggle", "Toggle inlay hint") },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
{
|
||||
"psliwka/vim-smoothie",
|
||||
keys = { "<C-u>", "<C-d>", "zz" },
|
||||
},
|
||||
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
keys = {
|
||||
{ "gcc", mode = { "n" }, desc = "Comment line" },
|
||||
{ "gc", mode = { "v" }, desc = "Comment selection" },
|
||||
},
|
||||
config = function()
|
||||
local ft = require("Comment.ft")
|
||||
|
||||
ft.hypr = { "# %s" }
|
||||
|
||||
require("Comment").setup({
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"NMAC427/guess-indent.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = {
|
||||
autocmd = true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"ojroques/nvim-bufdel",
|
||||
cmd = { "BufDel", "BufDelAll", "BufDelOthers" },
|
||||
opts = { quit = false },
|
||||
},
|
||||
|
||||
{
|
||||
"fedepujol/move.nvim",
|
||||
cmd = {
|
||||
"MoveLine",
|
||||
"MoveHChar",
|
||||
"MoveBlock",
|
||||
"MoveHBlock",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
keys = {
|
||||
{ "cs", mode = { "n" }, desc = "Change surrounding pair" },
|
||||
{ "ds", mode = { "n" }, desc = "Delete surrounding pair" },
|
||||
{ "ys", mode = { "n" }, desc = "Add surrounding pair" },
|
||||
{ "S", mode = { "v" }, desc = "Add surrounding pair" },
|
||||
},
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
opts = {
|
||||
provider_selector = function()
|
||||
return { "treesitter", "indent" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("illuminate").configure({
|
||||
filetypes_denylist = {
|
||||
"neo-tree",
|
||||
"dropbar_menu",
|
||||
"CodeAction",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"Wansmer/treesj",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
keys = {
|
||||
{ "<leader>j", mode = { "n" }, ":TSJSplit<CR>", desc = format("Down", "Split node") },
|
||||
{ "<leader>J", mode = { "n" }, ":TSJJoin<CR>", desc = format("Up", "Join node") },
|
||||
},
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "▎" },
|
||||
change = { hl = "GitSignsChange", text = "▎" },
|
||||
untracked = { hl = "GitSignsAdd", text = "▎" },
|
||||
delete = { hl = "GitSignsDelete", text = "▎" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "▎" },
|
||||
changedelete = { hl = "GitSignsChange", text = "▎" },
|
||||
},
|
||||
preview_config = {
|
||||
border = "none",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"NeogitOrg/neogit",
|
||||
branch = "master",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim", -- required
|
||||
"sindrets/diffview.nvim", -- optional - Diff integration
|
||||
|
||||
-- Only one of these is needed, not both.
|
||||
"nvim-telescope/telescope.nvim", -- optional
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
event = "InsertEnter",
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind-nvim",
|
||||
"windwp/nvim-autopairs",
|
||||
},
|
||||
opts = function()
|
||||
local cmp = require("cmp")
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
||||
local icons = {
|
||||
branch = "",
|
||||
bullet = "•",
|
||||
o_bullet = "○",
|
||||
check = "✔",
|
||||
d_chev = "∨",
|
||||
ellipses = "…",
|
||||
file = "╼",
|
||||
hamburger = "≡",
|
||||
lock = "",
|
||||
r_chev = ">",
|
||||
ballot_x = " ",
|
||||
up_tri = " ",
|
||||
info_i = " ",
|
||||
-- ballot_x = '✘',
|
||||
-- up_tri = '▲',
|
||||
-- info_i = '¡',
|
||||
}
|
||||
|
||||
local function get_lsp_completion_context(completion, source)
|
||||
local ok, source_name = pcall(function()
|
||||
return source.source.client.config.name
|
||||
end)
|
||||
if not ok then
|
||||
return nil
|
||||
end
|
||||
|
||||
if source_name == "tsserver" then
|
||||
return completion.detail
|
||||
elseif source_name == "pyright" and completion.labelDetails ~= nil then
|
||||
return completion.labelDetails.description
|
||||
elseif source_name == "clang_d" then
|
||||
local doc = completion.documentation
|
||||
if doc == nil then
|
||||
return
|
||||
end
|
||||
|
||||
local import_str = doc.value
|
||||
|
||||
local i, j = string.find(import_str, '["<].*[">]')
|
||||
if i == nil then
|
||||
return
|
||||
end
|
||||
|
||||
return string.sub(import_str, i, j)
|
||||
end
|
||||
end
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
return {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||
side_padding = 4,
|
||||
},
|
||||
documentation = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||
side_padding = 4,
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp", priority = 1000 },
|
||||
{ name = "crates", priority = 1000 },
|
||||
{ name = "luasnip", priority = 750 },
|
||||
{ name = "buffer", priority = 500 },
|
||||
{ name = "path", priority = 250 },
|
||||
{ name = "neorg", priority = 250 },
|
||||
}),
|
||||
mapping = {
|
||||
["<Up>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<Down>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
|
||||
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable,
|
||||
["<C-e>"] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
-- format = lspkind_status_ok and lspkind.cmp_format({
|
||||
-- mode = "symbol",
|
||||
-- maxwidth = 25,
|
||||
-- ellipsis_char = "...",
|
||||
-- before = function(entry, vim_item)
|
||||
-- if vim_item.kind == "Color" and entry.completion_item.documentation then
|
||||
-- local _, _, r, g, b =
|
||||
-- string.find(entry.completion_item.documentation, "^rgb%((%d+), (%d+), (%d+)")
|
||||
-- if r then
|
||||
-- local color = string.format("%02x", r)
|
||||
-- .. string.format("%02x", g)
|
||||
-- .. string.format("%02x", b)
|
||||
-- local group = "Tw_" .. color
|
||||
-- if vim.fn.hlID(group) < 1 then
|
||||
-- vim.api.nvim_set_hl(0, group, { fg = "#" .. color })
|
||||
-- end
|
||||
-- vim_item.kind_hl_group = group
|
||||
-- return vim_item
|
||||
-- end
|
||||
-- end
|
||||
-- return vim_item
|
||||
-- end,
|
||||
-- }),
|
||||
format = function(entry, vim_item)
|
||||
if not require("cmp.utils.api").is_cmdline_mode() then
|
||||
local abbr_width_max = 25
|
||||
local menu_width_max = 20
|
||||
|
||||
local choice = require("lspkind").cmp_format({
|
||||
ellipsis_char = icons.ellipsis,
|
||||
maxwidth = abbr_width_max,
|
||||
mode = "symbol",
|
||||
})(entry, vim_item)
|
||||
|
||||
choice.abbr = vim.trim(choice.abbr)
|
||||
|
||||
local abbr_width = string.len(choice.abbr)
|
||||
if abbr_width < abbr_width_max then
|
||||
local padding = string.rep(" ", abbr_width_max - abbr_width)
|
||||
vim_item.abbr = choice.abbr .. padding
|
||||
end
|
||||
|
||||
local cmp_ctx = get_lsp_completion_context(entry.completion_item, entry.source)
|
||||
if cmp_ctx ~= nil and cmp_ctx ~= "" then
|
||||
choice.menu = cmp_ctx
|
||||
else
|
||||
choice.menu = ""
|
||||
end
|
||||
|
||||
local menu_width = string.len(choice.menu)
|
||||
if menu_width > menu_width_max then
|
||||
choice.menu = vim.fn.strcharpart(choice.menu, 0, menu_width_max - 1)
|
||||
choice.menu = choice.menu .. icons.ellipses
|
||||
else
|
||||
local padding = string.rep(" ", menu_width_max - menu_width)
|
||||
choice.menu = padding .. choice.menu
|
||||
end
|
||||
|
||||
return choice
|
||||
else
|
||||
local abbr_width_min = 20
|
||||
local abbr_width_max = 50
|
||||
|
||||
local choice = require("lspkind").cmp_format({
|
||||
ellipsis_char = icons.ellipses,
|
||||
maxwidth = abbr_width_max,
|
||||
mode = "symbol",
|
||||
})(entry, vim_item)
|
||||
|
||||
choice.abbr = vim.trim(choice.abbr)
|
||||
|
||||
local abbr_width = string.len(choice.abbr)
|
||||
if abbr_width < abbr_width_min then
|
||||
local padding = string.rep(" ", abbr_width_min - abbr_width)
|
||||
vim_item.abbr = choice.abbr .. padding
|
||||
end
|
||||
|
||||
return choice
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
keys = {
|
||||
{ "<leader>d", mode = { "n" } },
|
||||
},
|
||||
cmd = { "DapContinue", "DapToggleBreakpoint" },
|
||||
dependencies = {
|
||||
{ "rcarriga/nvim-dap-ui", opts = {} },
|
||||
{ "nvim-neotest/nvim-nio" },
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {
|
||||
virt_text_pos = "eol",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
return {
|
||||
"nvim-treesitter/playground",
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = { "windwp/nvim-ts-autotag" },
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
cmd = {
|
||||
"TSBufDisable",
|
||||
"TSBufEnable",
|
||||
"TSBufToggle",
|
||||
"TSDisable",
|
||||
"TSEnable",
|
||||
"TSToggle",
|
||||
"TSInstall",
|
||||
"TSInstallInfo",
|
||||
"TSInstallSync",
|
||||
"TSModuleInfo",
|
||||
"TSUninstall",
|
||||
"TSUpdate",
|
||||
"TSUpdateSync",
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(_, bufnr)
|
||||
return vim.api.nvim_buf_line_count(bufnr) > 10000
|
||||
end,
|
||||
},
|
||||
incremental_selection = { enable = true },
|
||||
indent = { enable = true },
|
||||
autotag = { enable = true },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"json",
|
||||
"toml",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"rust",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
"sql",
|
||||
"query",
|
||||
"java",
|
||||
"http",
|
||||
"rasi",
|
||||
"haskell",
|
||||
"ebnf",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"stevearc/overseer.nvim",
|
||||
opts = {
|
||||
task_list = {
|
||||
direction = "bottom",
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"Shatur/neovim-session-manager",
|
||||
cmd = { "SessionManager" },
|
||||
config = function()
|
||||
local config = require("session_manager.config")
|
||||
require("session_manager").setup({
|
||||
autoload_mode = config.AutoloadMode.Disabled,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = { "Telescope" },
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
border = true,
|
||||
prompt_prefix = " ",
|
||||
selection_caret = format("Right", ""),
|
||||
},
|
||||
extensions = {
|
||||
fzf = {},
|
||||
aerial = {},
|
||||
dap = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
cmd = { "ToggleTerm" },
|
||||
opts = {
|
||||
shade_terminals = false,
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "rounded",
|
||||
width = 80,
|
||||
},
|
||||
highlights = {
|
||||
FloatBorder = {
|
||||
link = "FloatBorder",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
{ import = "plugins.ui" },
|
||||
{ import = "plugins.editor" },
|
||||
{ import = "plugins.lsp" },
|
||||
{ import = "plugins.tools" },
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
sources = {
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
null_ls.builtins.formatting.alejandra,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.rustfmt.with({
|
||||
extra_args = { "--edition=2021" },
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
filetypes = { "sh", "zsh" },
|
||||
extra_args = { "--indent-type Spaces" },
|
||||
}),
|
||||
null_ls.builtins.formatting.clang_format.with({
|
||||
extra_args = { "-style={IndentWidth: 4, AllowShortFunctionsOnASingleLine: Empty}" },
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
{ "folke/neodev.nvim", ft = "lua", opts = {} },
|
||||
{
|
||||
"b0o/schemastore.nvim",
|
||||
ft = "json",
|
||||
config = function()
|
||||
require("lspconfig").jsonls.setup({
|
||||
capabilities = require("lsp.capabilities"),
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^4", -- Recommended
|
||||
ft = { "rust" },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"FabijanZulj/blame.nvim",
|
||||
config = function()
|
||||
require("blame").setup()
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"uga-rosa/ccc.nvim",
|
||||
cmd = {
|
||||
"CccPick",
|
||||
"CccConvert",
|
||||
"CccHighlighterEnable",
|
||||
"CccHighlighterDisable",
|
||||
"CccHighlighterToggle",
|
||||
},
|
||||
opts = {
|
||||
alpha_show = "show",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
"luckasRanarison/clear-action.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
signs = {
|
||||
show_count = false,
|
||||
show_label = true,
|
||||
combine = true,
|
||||
},
|
||||
popup = {
|
||||
hide_cursor = true,
|
||||
},
|
||||
mappings = {
|
||||
code_action = { "<leader>la", format("Fix", "Code action") },
|
||||
apply_first = { "<leader>aa", format("Fix", "Apply") },
|
||||
quickfix = { "<leader>aq", format("Fix", "Quickfix") },
|
||||
quickfix_next = { "<leader>an", format("Fix", "Quickfix next") },
|
||||
quickfix_prev = { "<leader>ap", format("Fix", "Quickfix prev") },
|
||||
refactor = { "<leader>ar", format("Fix", "Refactor") },
|
||||
refactor_inline = { "<leader>aR", format("Fix", "Refactor inline") },
|
||||
actions = {
|
||||
["rust_analyzer"] = {
|
||||
["Import"] = { "<leader>ai", format("Fix", "Import") },
|
||||
["Replace if"] = { "<leader>am", format("Fix", "Replace if with match") },
|
||||
["Fill match"] = { "<leader>af", format("Fix", "Fill match arms") },
|
||||
["Wrap"] = { "<leader>aw", format("Fix", "Wrap") },
|
||||
["Insert `mod"] = { "<leader>aM", format("Fix", "Insert mod") },
|
||||
["Insert `pub"] = { "<leader>aP", format("Fix", "Insert pub mod") },
|
||||
["Add braces"] = { "<leader>ab", format("Fix", "Add braces") },
|
||||
},
|
||||
},
|
||||
},
|
||||
quickfix_filters = {
|
||||
["rust_analyzer"] = {
|
||||
["E0412"] = "Import",
|
||||
["E0425"] = "Import",
|
||||
["E0433"] = "Import",
|
||||
["unused_imports"] = "remove",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
{ "laytan/cloak.nvim", lazy = false, opts = { cloak_length = 64 } },
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"saecki/crates.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
},
|
||||
event = { "BufRead Cargo.toml" },
|
||||
opts = {
|
||||
null_ls = {
|
||||
enabled = true,
|
||||
name = "Crates",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"mrshmllow/document-color.nvim",
|
||||
lazy = true,
|
||||
opts = {},
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
local lua = require("utils.mappings").lua
|
||||
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
keys = {
|
||||
{ "f", mode = { "n", "v" } },
|
||||
{ "F", mode = { "n", "v" } },
|
||||
{ "t", mode = { "n", "v" } },
|
||||
{ "T", mode = { "n", "v" } },
|
||||
|
||||
{ "s", mode = { "n", "v" }, lua('require("flash").jump()') },
|
||||
{ "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('<cword>') })") },
|
||||
{ "S", mode = "n", lua("require('flash').treesitter()") },
|
||||
{ "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" },
|
||||
{ "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" },
|
||||
},
|
||||
opts = {},
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"isabelroses/charm-freeze.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("charm-freeze").setup({
|
||||
command = "freeze",
|
||||
output = function()
|
||||
return "./" .. "._freeze.png"
|
||||
end,
|
||||
show_line_numbers = true,
|
||||
theme = "catppuccin-mocha",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
-- {
|
||||
-- "nvim-neorg/neorg",
|
||||
-- dependencies = { "luarocks.nvim" },
|
||||
-- lazy = false,
|
||||
-- version = "*",
|
||||
-- config = function()
|
||||
-- require("neorg").setup({
|
||||
-- load = {
|
||||
-- ["core.defaults"] = {},
|
||||
-- ["core.concealer"] = {},
|
||||
-- ["core.dirman"] = {
|
||||
-- config = {
|
||||
-- workspaces = {
|
||||
-- dev = "~/notes",
|
||||
-- },
|
||||
-- default_workspace = "dev",
|
||||
-- index = "index.norg",
|
||||
-- },
|
||||
-- },
|
||||
-- ["core.completion"] = {
|
||||
-- config = {
|
||||
-- engine = "nvim-cmp",
|
||||
-- },
|
||||
-- },
|
||||
-- ["core.keybinds"] = {},
|
||||
-- ["core.ui.calendar"] = {},
|
||||
-- ["core.export"] = {},
|
||||
-- ["core.looking-glass"] = {},
|
||||
-- ["core.qol.toc"] = {},
|
||||
-- ["core.qol.todo_items"] = {},
|
||||
-- ["core.esupports.hop"] = {},
|
||||
-- ["core.esupports.indent"] = {},
|
||||
-- ["core.summary"] = {},
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
return {
|
||||
-- "luckasRanarison/nvim-devdocs",
|
||||
dir = "~/Projects/nvim-devdocs",
|
||||
branch = "master",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
cmd = {
|
||||
"DevdocsFetch",
|
||||
"DevdocsInstall",
|
||||
"DevdocsUninstall",
|
||||
"DevdocsOpen",
|
||||
"DevdocsOpenFloat",
|
||||
"DevdocsOpenCurrent",
|
||||
"DevdocsOpenCurrentFloat",
|
||||
"DevdocsUpdate",
|
||||
"DevdocsUpdateAll",
|
||||
"DevdocsBuild",
|
||||
},
|
||||
opts = {
|
||||
format = "markdown",
|
||||
filetypes = {
|
||||
javascript = { "html", "javascript" },
|
||||
},
|
||||
-- use_node = false,
|
||||
ensure_installed = {
|
||||
-- "git",
|
||||
-- "bash",
|
||||
-- "rust",
|
||||
-- "lua-5.4",
|
||||
-- "html",
|
||||
-- "css",
|
||||
-- "javascript",
|
||||
-- "typescript",
|
||||
-- "react",
|
||||
-- "web_extensions",
|
||||
},
|
||||
wrap = true,
|
||||
previewer_cmd = "glow",
|
||||
cmd_args = { "-s", "auto", "-w", "97" },
|
||||
cmd_ignore = {},
|
||||
picker_cmd = true,
|
||||
picker_cmd_args = { "-s", "auto", "-w", "45" },
|
||||
mappings = {
|
||||
open_in_browser = "<leader>vb",
|
||||
toggle_rendering = "<leader>vr",
|
||||
},
|
||||
log_level = "debug",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
{
|
||||
"rest-nvim/rest.nvim",
|
||||
ft = "http",
|
||||
config = function()
|
||||
|
||||
require("rest-nvim").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
"tpope/vim-dadbod",
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
},
|
||||
cmd = {
|
||||
"DBUI",
|
||||
"DBUIAddConnection",
|
||||
"DBUIClose",
|
||||
"DBUIToggle",
|
||||
"DBUIFindBuffer",
|
||||
"DBUIRenameBuffer",
|
||||
"DBUILastQueryInfo",
|
||||
},
|
||||
config = function()
|
||||
vim.g.db_ui_notification_width = 1
|
||||
vim.g.db_ui_debug = 1
|
||||
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup.filetype({ "sql" }, {
|
||||
sources = {
|
||||
{ name = "vim-dadbod-completion" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ████ ██████ █████ ██ ]],
|
||||
[[ ███████████ █████ ]],
|
||||
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||
[[ ]],
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
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("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) })
|
||||
dashboard.config.layout[3].val = 2
|
||||
alpha.setup(dashboard.config)
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
after = "catppuccin",
|
||||
opts = {
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = true,
|
||||
diagnostics_indicator = nil,
|
||||
indicator = "none",
|
||||
offsets = {
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = format("Folder", "NeoTree"),
|
||||
text_align = "left",
|
||||
separator = "│",
|
||||
},
|
||||
{
|
||||
filetype = "dapui_watches",
|
||||
text = format("Debugger", "DapUI"),
|
||||
text_align = "left",
|
||||
separator = "│",
|
||||
},
|
||||
{
|
||||
filetype = "dbui",
|
||||
text = format("Database", "DbUI"),
|
||||
text_align = "left",
|
||||
separator = "│",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- local colors = require("tokyonight.colors")
|
||||
--
|
||||
-- vim.opt.showtabline = 2
|
||||
-- opts.highlights = {
|
||||
-- background = { bg = colors.night.bg },
|
||||
-- close_button = { bg = colors.night.bg },
|
||||
-- separator = { fg = colors.night.bg, bg = colors.night.bg },
|
||||
-- offset_separator = { bg = colors.night.bg },
|
||||
-- pick = { bg = colors.night.bg },
|
||||
-- }
|
||||
|
||||
local mocha = require("catppuccin.palettes").get_palette("mocha")
|
||||
|
||||
opts = {
|
||||
highlights = require("catppuccin.groups.integrations.bufferline").get({
|
||||
styles = { "italic", "bold" },
|
||||
}),
|
||||
}
|
||||
|
||||
require("bufferline").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
init = function()
|
||||
vim.cmd.colorscheme("catppuccin-mocha")
|
||||
end,
|
||||
opts = {
|
||||
transparent_background = true,
|
||||
custom_highlights = function(colors)
|
||||
return {
|
||||
Pmenu = { bg = colors.base },
|
||||
}
|
||||
end,
|
||||
flavor = "mocha",
|
||||
integrations = {
|
||||
cmp = true,
|
||||
noice = true,
|
||||
treesitter = true,
|
||||
neotree = true,
|
||||
overseer = true,
|
||||
notify = true,
|
||||
telescope = {
|
||||
enabled = true,
|
||||
style = "nvchad",
|
||||
},
|
||||
which_key = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
inlay_hints = {
|
||||
background = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
priority = 1000,
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local theme = require("telescope.themes").get_dropdown()
|
||||
|
||||
theme.layout_config = {
|
||||
width = 60,
|
||||
height = 17,
|
||||
}
|
||||
|
||||
require("dressing").setup({
|
||||
input = {
|
||||
enabled = false,
|
||||
},
|
||||
select = {
|
||||
backend = { "telescope" },
|
||||
telescope = theme,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
{
|
||||
"Bekaboo/dropbar.nvim",
|
||||
event = { "BufRead", "BufNewFile" },
|
||||
opts = {
|
||||
icons = {
|
||||
enable = true,
|
||||
kinds = {
|
||||
use_devicons = false,
|
||||
symbols = {
|
||||
File = "",
|
||||
Folder = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"rachartier/tiny-devicons-auto-colors.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("tiny-devicons-auto-colors").setup()
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
exclude = {
|
||||
buftypes = {
|
||||
"nofile",
|
||||
"terminal",
|
||||
},
|
||||
filetypes = {
|
||||
"help",
|
||||
"startify",
|
||||
"aerial",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"lazy",
|
||||
"neogitstatus",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"dbout",
|
||||
"TelescopePrompt",
|
||||
},
|
||||
},
|
||||
scope = {
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
highlight = { "@keyword" },
|
||||
char = "▏",
|
||||
include = {
|
||||
node_type = {
|
||||
lua = { "table_constructor" },
|
||||
},
|
||||
},
|
||||
},
|
||||
whitespace = {
|
||||
remove_blankline_trail = true,
|
||||
},
|
||||
indent = { char = "▏" },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
local sources = require("plugins.utils.lualine_sources")
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function(_, opts)
|
||||
-- local colors = require("tokyonight.colors")
|
||||
-- local tokyonight = require("lualine.themes.catppuccin")
|
||||
--
|
||||
-- vim.opt.laststatus = 3
|
||||
-- tokyonight.normal.c.bg = colors.night.bg
|
||||
opts.options.theme = "catppuccin"
|
||||
|
||||
require("lualine").setup(opts)
|
||||
end,
|
||||
opts = {
|
||||
options = {
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
"rest",
|
||||
},
|
||||
-- lualine_a = { sources.mode },
|
||||
-- lualine_b = { sources.branch, sources.diff },
|
||||
-- lualine_c = { sources.filetype, sources.macro },
|
||||
-- lualine_x = { sources.lsp, sources.diagnostics },
|
||||
-- lualine_y = { sources.indentation, sources.encoding, sources.fileformat },
|
||||
-- lualine_z = { sources.progress, sources.location },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
local icons = require("utils.icons").icons
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"luckasRanarison/neo-rename.nvim",
|
||||
},
|
||||
cmd = "Neotree",
|
||||
opts = {
|
||||
enable_git_status = true,
|
||||
close_if_last_window = true,
|
||||
auto_clean_after_session_restore = true,
|
||||
window = {
|
||||
width = 30,
|
||||
mappings = {
|
||||
["<space>"] = false,
|
||||
["s"] = false,
|
||||
["l"] = "open",
|
||||
["v"] = "open_vsplit",
|
||||
["gA"] = "git_add_all",
|
||||
["ga"] = "git_add_file",
|
||||
["gu"] = "git_unstage_file",
|
||||
["gr"] = "git_revert_file",
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
follow_current_file = { enabled = true },
|
||||
hijack_netrw_behavior = "open_current",
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
default_component_configs = {
|
||||
icon = {
|
||||
folder_empty = icons.EmptyFolder,
|
||||
default = icons.DefaultFile,
|
||||
},
|
||||
indent = {
|
||||
padding = 0,
|
||||
indent_size = 1,
|
||||
},
|
||||
modified = {
|
||||
symbol = icons.SmallDot,
|
||||
},
|
||||
name = {
|
||||
use_git_status_colors = true,
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
deleted = "D",
|
||||
renamed = "R",
|
||||
modified = "M",
|
||||
added = "A",
|
||||
untracked = "U",
|
||||
ignored = "",
|
||||
staged = "",
|
||||
unstaged = "!",
|
||||
conflict = "C",
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
symbols = {
|
||||
hint = icons.Hint,
|
||||
info = icons.Info,
|
||||
warn = icons.Warn,
|
||||
error = icons.Error,
|
||||
},
|
||||
highlights = {
|
||||
hint = "DiagnosticSignHint",
|
||||
info = "DiagnosticSignInfo",
|
||||
warn = "DiagnosticSignWarn",
|
||||
error = "DiagnosticSignError",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("neo-tree").setup(opts)
|
||||
require("neo-rename").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
local icons = require("utils.icons").icons
|
||||
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
{ "rcarriga/nvim-notify" },
|
||||
},
|
||||
opts = {
|
||||
cmdline = {
|
||||
format = {
|
||||
cmdline = { pattern = "^:", icon = icons.Command, lang = "vim" },
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
hover = {
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = false,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = false,
|
||||
lsp_doc_border = "rounded",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
local format = require("utils.icons").fmt
|
||||
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
require("which-key").register({
|
||||
a = { name = format("Fix", "Actions") },
|
||||
c = { name = format("Color", "Color") },
|
||||
b = { name = format("Windows", "Buffers") },
|
||||
u = { name = format("Window", "UI") },
|
||||
g = { name = format("Git", "Git") },
|
||||
t = { name = format("Terminal", "Terminal") },
|
||||
f = { name = format("Search", "Telescope") },
|
||||
l = { name = format("Braces", "LSP") },
|
||||
d = { name = format("Debugger", "Debugger") },
|
||||
n = { name = format("Notification", "Notification") },
|
||||
S = { name = format("FolderClock", "Session") },
|
||||
r = { name = format("Code", "SnipRun") },
|
||||
o = { name = format("DropDown", "Dropbar") },
|
||||
v = { name = format("Book", "DevDocs") },
|
||||
C = { name = format("Package", "Crates") },
|
||||
D = { name = format("Database", "DbUI") },
|
||||
}, { prefix = "<leader>" })
|
||||
end,
|
||||
opts = {
|
||||
key_labels = {
|
||||
["<space>"] = " ",
|
||||
},
|
||||
icons = {
|
||||
group = "",
|
||||
},
|
||||
window = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
local icons = require("utils.icons").icons
|
||||
local fmt = require("utils.icons").fmt
|
||||
local M = {}
|
||||
|
||||
M.mode = {
|
||||
"mode",
|
||||
fmt = function(name)
|
||||
local map = {
|
||||
NORMAL = icons.Normal,
|
||||
INSERT = icons.Insert,
|
||||
TERMINAL = icons.Terminal,
|
||||
VISUAL = icons.Visual,
|
||||
["V-LINE"] = icons.Visual,
|
||||
["V-BLOCK"] = icons.Visual,
|
||||
["O-PENDING"] = icons.Ellipsis,
|
||||
COMMAND = icons.Command,
|
||||
REPLACE = icons.Edit,
|
||||
SELECT = icons.Visual,
|
||||
}
|
||||
local icon = map[name] and map[name] or icons.Vim
|
||||
return icon .. " " .. name
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
local mode = vim.fn.mode()
|
||||
local map = {
|
||||
n = colors.default.blue,
|
||||
i = colors.default.green,
|
||||
c = colors.default.yellow,
|
||||
t = colors.default.cyan,
|
||||
R = colors.default.red,
|
||||
v = colors.default.magenta,
|
||||
V = colors.default.magenta,
|
||||
s = colors.default.magenta,
|
||||
S = colors.default.magenta,
|
||||
}
|
||||
return {
|
||||
fg = map[mode] or colors.default.magenta,
|
||||
bg = colors.night.bg,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
M.branch = {
|
||||
"branch",
|
||||
icon = icons.GitBranch,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.diff = {
|
||||
"diff",
|
||||
symbols = {
|
||||
added = fmt("Add", ""),
|
||||
modified = fmt("Modified", ""),
|
||||
removed = fmt("Removed", ""),
|
||||
},
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.filetype = { "filetype" }
|
||||
|
||||
M.diagnostics = {
|
||||
"diagnostics",
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.encoding = {
|
||||
"encoding",
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.blue, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.fileformat = {
|
||||
"fileformat",
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.blue, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.indentation = {
|
||||
"indentation",
|
||||
fmt = function()
|
||||
local type = vim.bo[0].expandtab and "spaces" or "tabs"
|
||||
local value = vim.bo[0].shiftwidth
|
||||
return type .. ": " .. value
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.blue, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.progress = {
|
||||
"progress",
|
||||
fmt = function(location)
|
||||
return vim.trim(location)
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.purple, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.location = {
|
||||
"location",
|
||||
fmt = function(location)
|
||||
return vim.trim(location)
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.purple, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.macro = {
|
||||
function()
|
||||
return vim.fn.reg_recording()
|
||||
end,
|
||||
icon = icons.Recording,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.red }
|
||||
end,
|
||||
}
|
||||
|
||||
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)
|
||||
return table.concat(attached_clients, ", ")
|
||||
end,
|
||||
icon = icons.Braces,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { fg = colors.default.comment, bg = colors.night.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
M.gap = {
|
||||
function()
|
||||
return " "
|
||||
end,
|
||||
color = function()
|
||||
local colors = require("tokyonight.colors")
|
||||
return { bg = colors.night.bg }
|
||||
end,
|
||||
padding = 0,
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
local M = {}
|
||||
|
||||
local set_options = function(options)
|
||||
for prop, variables in pairs(options) do
|
||||
for key, value in pairs(variables) do
|
||||
vim[prop][key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local set_keymaps = function(keymaps)
|
||||
for mode, maps in pairs(keymaps) do
|
||||
for key, map in pairs(maps) do
|
||||
vim.keymap.set(mode, key, map[1], { desc = map[2] })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local set_autocmd = function(autocmd)
|
||||
for _, cmd in ipairs(autocmd) do
|
||||
vim.api.nvim_create_autocmd(cmd.event, cmd.opts)
|
||||
end
|
||||
end
|
||||
|
||||
local set_signs = function(signs)
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, sign)
|
||||
end
|
||||
end
|
||||
|
||||
local init_lazy = function(spec)
|
||||
local opts = {
|
||||
ui = { border = "rounded" },
|
||||
spec = { import = spec },
|
||||
}
|
||||
|
||||
require("lazy").setup(opts)
|
||||
end
|
||||
|
||||
M.setup = function(opts)
|
||||
set_options(opts.options or {})
|
||||
set_keymaps(opts.keymaps or {})
|
||||
set_autocmd(opts.autocmd or {})
|
||||
set_signs(opts.signs or {})
|
||||
init_lazy(opts.spec)
|
||||
end
|
||||
|
||||
return M
|
||||
170
modules/home/apps/tools/neovim/config/lua/utils/functions.lua
Normal file
170
modules/home/apps/tools/neovim/config/lua/utils/functions.lua
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
local M = {}
|
||||
|
||||
local input = function(prompt, callback)
|
||||
local value = vim.fn.input(prompt)
|
||||
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
|
||||
end)
|
||||
end
|
||||
|
||||
M.freeze = function()
|
||||
local path = "./._freeze.png"
|
||||
|
||||
vim.cmd("Freeze")
|
||||
|
||||
-- Run the shell command 'wl-copy <path>' after 'Freeze' completes
|
||||
vim.fn.system("wl-copy < " .. path)
|
||||
vim.fn.system("rm " .. path)
|
||||
end
|
||||
|
||||
M.freeze_selection = function()
|
||||
local path = "./._freeze.png"
|
||||
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", false, true, true), "nx", false)
|
||||
-- Retrieve buffer ID for the current buffer
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- Get positions of the start ('<') and end ('>') of the visual selection
|
||||
local start_pos = vim.api.nvim_buf_get_mark(buf, "<")
|
||||
local end_pos = vim.api.nvim_buf_get_mark(buf, ">")
|
||||
|
||||
-- Retrieve the line numbers from the positions
|
||||
local start_line = start_pos[1]
|
||||
local end_line = end_pos[1]
|
||||
|
||||
-- Execute the 'Freeze' command on the selected range
|
||||
vim.cmd(start_line .. "," .. end_line .. "Freeze")
|
||||
|
||||
-- Run the shell command 'wl-copy <path>' after 'Freeze' completes
|
||||
vim.fn.system("wl-copy < " .. path)
|
||||
vim.fn.system("rm " .. path)
|
||||
end
|
||||
|
||||
M.set_filetype = function()
|
||||
input("Set filetype: ", function(value)
|
||||
vim.bo[0].filetype = value
|
||||
vim.notify("Filetype set to " .. value)
|
||||
end)
|
||||
end
|
||||
|
||||
M.set_indent = function()
|
||||
input("Set indentation: ", function(value)
|
||||
local type = vim.bo[0].expandtab and "spaces" or "tabs"
|
||||
local parsed = tonumber(value)
|
||||
|
||||
if parsed then
|
||||
vim.bo[0].shiftwidth = parsed
|
||||
vim.notify("Indentation set to " .. value .. " " .. type)
|
||||
else
|
||||
vim.notify("Invalid value", vim.log.levels.ERROR)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
M.set_indent_type = function()
|
||||
select("Indent using: ", function(choice)
|
||||
if choice == "spaces" then
|
||||
vim.o.expandtab = true
|
||||
else
|
||||
vim.o.expandtab = false
|
||||
end
|
||||
|
||||
vim.notify("Indentation using " .. choice)
|
||||
end)
|
||||
end
|
||||
|
||||
M.toggle_wrap = function()
|
||||
vim.wo.wrap = not vim.wo.wrap
|
||||
vim.wo.linebreak = not vim.wo.linebreak
|
||||
end
|
||||
|
||||
M.comment_line = function()
|
||||
require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1)
|
||||
end
|
||||
|
||||
M.comment_selection = function()
|
||||
vim.cmd("normal <esc>")
|
||||
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.buf_hsplit = function()
|
||||
require("bufferline.pick").choose_then(function(id)
|
||||
local name = vim.api.nvim_buf_get_name(id)
|
||||
vim.cmd("sp" .. name)
|
||||
vim.cmd("wincmd x")
|
||||
vim.cmd("wincmd w")
|
||||
end)
|
||||
end
|
||||
|
||||
M.buf_vsplit = function()
|
||||
require("bufferline.pick").choose_then(function(id)
|
||||
local name = vim.api.nvim_buf_get_name(id)
|
||||
vim.cmd("vsp" .. name)
|
||||
vim.cmd("wincmd x")
|
||||
vim.cmd("wincmd w")
|
||||
end)
|
||||
end
|
||||
|
||||
M.open_lazygit = function()
|
||||
require("toggleterm.terminal").Terminal
|
||||
:new({
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
float_opts = {
|
||||
width = 100,
|
||||
height = 25,
|
||||
},
|
||||
on_close = function()
|
||||
if package.loaded["neo-tree"] then
|
||||
require("neo-tree.events").fire_event("git_event")
|
||||
end
|
||||
end,
|
||||
})
|
||||
:open()
|
||||
end
|
||||
|
||||
M.open_glow = function()
|
||||
require("toggleterm.terminal").Terminal
|
||||
:new({
|
||||
cmd = "glow",
|
||||
hidden = true,
|
||||
float_opts = {
|
||||
width = 100,
|
||||
height = 25,
|
||||
},
|
||||
})
|
||||
:open()
|
||||
end
|
||||
|
||||
M.open_dapui = function()
|
||||
require("neo-tree").close_all()
|
||||
require("dapui").open()
|
||||
end
|
||||
|
||||
M.close_dapui = function()
|
||||
require("dapui").close()
|
||||
end
|
||||
|
||||
M.toggle_dapui = function()
|
||||
vim.cmd("NeoTreeShowToggle")
|
||||
require("dapui").toggle()
|
||||
end
|
||||
|
||||
return M
|
||||
113
modules/home/apps/tools/neovim/config/lua/utils/icons.lua
Normal file
113
modules/home/apps/tools/neovim/config/lua/utils/icons.lua
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
local M = {}
|
||||
|
||||
M.icons = {
|
||||
Vim = "",
|
||||
Config = "",
|
||||
Normal = "",
|
||||
Insert = "",
|
||||
Terminal = "",
|
||||
Visual = "",
|
||||
Command = "",
|
||||
Save = "",
|
||||
NotSaved = "",
|
||||
Restore = "",
|
||||
Trash = "",
|
||||
Fedora = "",
|
||||
Lua = "",
|
||||
Github = "",
|
||||
Git = "",
|
||||
GitDiff = "",
|
||||
GitBranch = "",
|
||||
GitCommit = "",
|
||||
Add = "",
|
||||
Modified = "",
|
||||
Removed = "",
|
||||
DiffRemoved = "",
|
||||
Error = "",
|
||||
Info = "",
|
||||
Warn = "",
|
||||
Hint = "",
|
||||
Package = "",
|
||||
FileTree = "",
|
||||
Folder = "",
|
||||
EmptyFolder = "",
|
||||
FolderClock = "",
|
||||
FolderOpened = "",
|
||||
File = "",
|
||||
NewFile = "",
|
||||
DefaultFile = "",
|
||||
Color = "",
|
||||
ColorPicker = "",
|
||||
ColorOn = "",
|
||||
ColorOff = "",
|
||||
Swap = "",
|
||||
Minimap = "",
|
||||
Window = "",
|
||||
Windows = "",
|
||||
Ellipsis = "…",
|
||||
Search = "",
|
||||
TextSearch = "",
|
||||
TabSearch = "",
|
||||
FileSearch = "",
|
||||
Clear = "",
|
||||
Braces = "",
|
||||
Exit = "",
|
||||
Debugger = "",
|
||||
Breakpoint = "",
|
||||
History = "",
|
||||
Check = "",
|
||||
SmallDot = "",
|
||||
Dots = "",
|
||||
Install = "",
|
||||
Help = "",
|
||||
Clipboard = "",
|
||||
Indent = "",
|
||||
LineWrap = "",
|
||||
Comment = "",
|
||||
Close = "",
|
||||
Open = "",
|
||||
Toggle = "",
|
||||
Stop = "",
|
||||
Restart = "",
|
||||
CloseMultiple = "",
|
||||
NextBuffer = ",",
|
||||
PrevBuffer = "",
|
||||
FoldClose = "",
|
||||
FoldOpen = "",
|
||||
Popup = "",
|
||||
Vertical = "",
|
||||
Horizontal = "",
|
||||
Markdown = "",
|
||||
Up = "",
|
||||
Down = "",
|
||||
Left = "",
|
||||
Right = "",
|
||||
Variable = "",
|
||||
Symbol = "",
|
||||
Stack = "",
|
||||
Format = "",
|
||||
Edit = "",
|
||||
Fix = "",
|
||||
Run = "",
|
||||
Twilight = "",
|
||||
Recording = "",
|
||||
Notification = "",
|
||||
NotificationDismiss = "",
|
||||
NotificationLog = "",
|
||||
Code = "",
|
||||
DropDown = "",
|
||||
Web = "",
|
||||
Dependencies = "",
|
||||
Update = "",
|
||||
Database = "",
|
||||
Pin = "",
|
||||
Book = "",
|
||||
BookmarkSearch = "",
|
||||
Download = "",
|
||||
}
|
||||
|
||||
M.fmt = function(icon, text, space)
|
||||
return M.icons[icon] .. string.rep(" ", space or 1) .. text
|
||||
end
|
||||
|
||||
return M
|
||||
19
modules/home/apps/tools/neovim/config/lua/utils/mappings.lua
Normal file
19
modules/home/apps/tools/neovim/config/lua/utils/mappings.lua
Normal file
|
|
@ -0,0 +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
|
||||
|
||||
return M
|
||||
61
modules/home/apps/tools/neovim/config/lua/utils/win.lua
Normal file
61
modules/home/apps/tools/neovim/config/lua/utils/win.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
local M = {}
|
||||
|
||||
local make_float_config = function(minimal)
|
||||
local ui = vim.api.nvim_list_uis()[1]
|
||||
local width = 80
|
||||
local height = 25
|
||||
local row = (ui.height - height) * 0.4
|
||||
local col = (ui.width - width) * 0.5
|
||||
|
||||
return {
|
||||
col = col,
|
||||
row = row,
|
||||
width = width,
|
||||
height = height,
|
||||
border = "rounded",
|
||||
relative = "editor",
|
||||
style = minimal and "minimal" or nil,
|
||||
zindex = 10,
|
||||
}
|
||||
end
|
||||
|
||||
M.open_help_float = function()
|
||||
local win = vim.api.nvim_get_current_win()
|
||||
local buf = vim.api.nvim_win_get_buf(win)
|
||||
local config = make_float_config(true)
|
||||
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
M.open_lua_win = function()
|
||||
local buf = vim.api.nvim_create_buf(true, false)
|
||||
local config = make_float_config(false)
|
||||
local temp = vim.fn.tempname()
|
||||
local win = vim.api.nvim_open_win(buf, true, config)
|
||||
|
||||
vim.bo[buf].ft = "lua"
|
||||
vim.api.nvim_buf_set_name(buf, temp)
|
||||
vim.cmd("silent w")
|
||||
|
||||
vim.keymap.set("n", "<leader>w", function()
|
||||
vim.cmd("w")
|
||||
vim.cmd("luafile %")
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, { buffer = buf, remap = true, silent = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(win),
|
||||
callback = function()
|
||||
vim.fn.delete(temp)
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
50
modules/home/apps/tools/neovim/config/lua/vscode/keymaps.lua
Normal file
50
modules/home/apps/tools/neovim/config/lua/vscode/keymaps.lua
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
local map = require("utils.mappings")
|
||||
local l, cmd, rcmd, notify = map.leader, map.cmd, map.rcmd, map.notify
|
||||
|
||||
return {
|
||||
n = {
|
||||
-- utils
|
||||
[l("p")] = { '"+p' },
|
||||
[l("P")] = { '"+P' },
|
||||
[l(":")] = { ":lua " },
|
||||
|
||||
[l("us")] = { cmd("nohlsearch") },
|
||||
[l(";")] = { cmd("VSCodeCommentary") },
|
||||
|
||||
-- vscode actions
|
||||
[l("w")] = { notify("workbench.action.files.save") },
|
||||
[l("e")] = { notify("workbench.view.explorer") },
|
||||
[l("bq")] = { notify("workbench.action.closeActiveEditor") },
|
||||
[l("bn")] = { notify("workbench.action.nextEditorInGroup") },
|
||||
[l("bp")] = { notify("workbench.action.previousEditorInGroup") },
|
||||
[l("um")] = { notify("editor.action.toggleMinimap") },
|
||||
[l("ff")] = { notify("workbench.action.quickOpen") },
|
||||
[l("fs")] = { notify("workbench.action.gotoSymbol") },
|
||||
[l("nn")] = { notify("notifications.clearAll") },
|
||||
[l("nl")] = { notify("notifications.showList") },
|
||||
|
||||
["gr"] = { notify("editor.action.goToReferences") },
|
||||
[l("lr")] = { notify("editor.action.rename") },
|
||||
|
||||
-- move.nvim
|
||||
["<A-j>"] = { cmd("MoveLine(1)") },
|
||||
["<A-k>"] = { cmd("MoveLine(-1)") },
|
||||
["<A-h>"] = { cmd("MoveHChar(-1)") },
|
||||
["<A-l>"] = { cmd("MoveHChar(1)") },
|
||||
},
|
||||
v = {
|
||||
-- utils
|
||||
["q"] = { "<esc>" },
|
||||
[l("y")] = { '"+y' },
|
||||
[l("p")] = { '"+p' },
|
||||
[l("P")] = { '"+P' },
|
||||
|
||||
[l(";")] = { cmd("VSCodeCommentary") },
|
||||
|
||||
-- move.nvim
|
||||
["<A-j>"] = { rcmd("MoveBlock(1)") },
|
||||
["<A-k>"] = { rcmd("MoveBlock(-1)") },
|
||||
["<A-h>"] = { rcmd("MoveHBlock(-1)") },
|
||||
["<A-l>"] = { rcmd("MoveHBlock(1)") },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
g = {
|
||||
mapleader = " ",
|
||||
},
|
||||
}
|
||||
38
modules/home/apps/tools/neovim/config/lua/vscode/plugins.lua
Normal file
38
modules/home/apps/tools/neovim/config/lua/vscode/plugins.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
local lua = require("utils.mappings").lua
|
||||
|
||||
return {
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
keys = {
|
||||
{ "cs", mode = { "n" } },
|
||||
{ "ds", mode = { "n" } },
|
||||
{ "ys", mode = { "n" } },
|
||||
{ "S", mode = { "v" } },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"fedepujol/move.nvim",
|
||||
cmd = {
|
||||
"MoveLine",
|
||||
"MoveHChar",
|
||||
"MoveBlock",
|
||||
"MoveHBlock",
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
keys = {
|
||||
{ "f", mode = { "n", "v" } },
|
||||
{ "F", mode = { "n", "v" } },
|
||||
{ "t", mode = { "n", "v" } },
|
||||
{ "T", mode = { "n", "v" } },
|
||||
{ "s", mode = { "n", "v" }, lua('require("flash").jump()') },
|
||||
{ "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('<cword>') })") },
|
||||
{ "S", mode = "n", lua("require('flash').treesitter()") },
|
||||
{ "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" },
|
||||
{ "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
98
modules/home/apps/tools/neovim/default.nix
Normal file
98
modules/home/apps/tools/neovim/default.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.apps.tools.neovim;
|
||||
|
||||
nvimDir = "/home/${config.home.username}/nixos/modules/home/apps/tools/neovim";
|
||||
in {
|
||||
options.apps.tools.neovim = with types; {
|
||||
enable = mkBoolOpt false "Enable Neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
extraPackages = with pkgs; [
|
||||
# Formatters
|
||||
alejandra # Nix
|
||||
black # Python
|
||||
prettierd # Multi-language
|
||||
shfmt
|
||||
isort
|
||||
stylua
|
||||
|
||||
# LSP
|
||||
lua-language-server
|
||||
nixd
|
||||
rust-analyzer
|
||||
nodePackages.bash-language-server
|
||||
vscode-langservers-extracted
|
||||
nodePackages.vscode-json-languageserver
|
||||
nodePackages.typescript-language-server
|
||||
tailwindcss-language-server
|
||||
|
||||
# Tools
|
||||
git
|
||||
html-tidy
|
||||
cmake
|
||||
fzf
|
||||
charm-freeze
|
||||
gcc
|
||||
gnumake
|
||||
nodejs
|
||||
fswatch # File watcher utility, replacing libuv.fs_event for neovim 10.0
|
||||
sqlite
|
||||
postgresql
|
||||
mongosh
|
||||
gerbera
|
||||
vscode-extensions.vadimcn.vscode-lldb.adapter
|
||||
];
|
||||
plugins = [
|
||||
pkgs.vimPlugins.lazy-nvim # All other plugins are managed by lazy-nvim
|
||||
];
|
||||
extraLuaPackages = with pkgs; [
|
||||
lua51Packages.lua-curl
|
||||
lua51Packages.nvim-nio
|
||||
lua51Packages.xml2lua
|
||||
lua51Packages.mimetypes
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
# Raw symlink to the plugin manager lock file, so that it stays writeable
|
||||
"nvim/lazy-lock.json".source = config.lib.file.mkOutOfStoreSymlink "${nvimDir}/lazy-lock.json";
|
||||
"nvim" = {
|
||||
source = ./config;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
# home.activation.neovim = hm.dag.entryAfter ["linkGeneration"] ''
|
||||
# #! /bin/bash
|
||||
# NVIM_WRAPPER=~/.nix-profile/bin/nvim
|
||||
# STATE_DIR=~/.local/state/nix/
|
||||
# STATE_FILE=$STATE_DIR/lazy-lock-checksum
|
||||
# LOCK_FILE=~/.config/nvim/lazy-lock.json
|
||||
# HASH=$(nix-hash --flat $LOCK_FILE)
|
||||
# CURL_DIR=${pkgs.curl}
|
||||
#
|
||||
# [ ! -d $STATE_DIR ] && mkdir -p $STATE_DIR
|
||||
# [ ! -f $STATE_FILE ] && touch $STATE_FILE
|
||||
#
|
||||
# if [ "$(cat $STATE_FILE)" != "$HASH" ]; then
|
||||
# echo "Syncing neovim plugins"
|
||||
# PATH="$PATH:${pkgs.git}/bin" $DRY_RUN_CMD $NVIM_WRAPPER --headless "+Lazy! restore" +qa
|
||||
# $DRY_RUN_CMD echo $HASH >$STATE_FILE
|
||||
# else
|
||||
# $VERBOSE_ECHO "Neovim plugins already synced, skipping"
|
||||
# fi
|
||||
# '';
|
||||
};
|
||||
}
|
||||
74
modules/home/apps/tools/neovim/lazy-lock.json
Normal file
74
modules/home/apps/tools/neovim/lazy-lock.json
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" },
|
||||
"blame.nvim": { "branch": "main", "commit": "dedbcdce857f708c63f261287ac7491a893912d0" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "0dfc19b7a15a3bc47b975fcffde03859c46dd097" },
|
||||
"catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
|
||||
"ccc.nvim": { "branch": "main", "commit": "f388f1981d222967c741fe9927edf9ba5fa3bcbe" },
|
||||
"charm-freeze.nvim": { "branch": "main", "commit": "3ad4dd739b97d92adb219a5752a8734fc8579055" },
|
||||
"clear-action.nvim": { "branch": "master", "commit": "2854c3fda5720c7e53b5a9537774fae212224484" },
|
||||
"cloak.nvim": { "branch": "main", "commit": "6e5bcd50bebc5cdb7cd3a00eb3d97ab7c4cc3b94" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"crates.nvim": { "branch": "main", "commit": "d556c00d60c9421c913ee54ff690df2a34f6264e" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" },
|
||||
"document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" },
|
||||
"dropbar.nvim": { "branch": "master", "commit": "9fc10fa1a34ec3e55b470962e4e94644611bd209" },
|
||||
"flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "ece00d5fb44d196680a81fd2761062d2fa44663b" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"move.nvim": { "branch": "main", "commit": "cccbd4ea9049ca5f99f025ffaddb7392359c7d6a" },
|
||||
"neo-rename.nvim": { "branch": "master", "commit": "d3f065ab1168fe95ea3ab939fbc659de47e130fc" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "8c75e8a2949cd6cd35525799200a8d34471ee9eb" },
|
||||
"neocord": { "branch": "main", "commit": "aa7a58023166533da83ca7b11c0d2569e45d7381" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"neogit": { "branch": "master", "commit": "b93316d15c590377f50ca61e70e9129e4aa9b848" },
|
||||
"neovim-session-manager": { "branch": "master", "commit": "a0b9d25154be573bc0f99877afb3f57cf881cce7" },
|
||||
"noice.nvim": { "branch": "main", "commit": "9f6f6ba74f8bfbf7e43d6302cf86b070362f6203" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
|
||||
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
|
||||
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "71bfe9bd6b3465e169b53bea4f83775034d822dd" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9bda20fb967075355f253911bc066a8b5a03c77e" },
|
||||
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
|
||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "7c9c5bed8340031f8a6dad47a58a26eaf15b9a56" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "cb57b07803476ee902c89412aeff219a9a58be13" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cbab9ad88036915beebd13b47e100743ff2ed2d5" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "4b4077850d1b3af09f4957b67144943cf3da401a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "7a9b654df4b3b246d05fff857f32e9fb8ddfb013" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" },
|
||||
"promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" },
|
||||
"rest.nvim": { "branch": "main", "commit": "f96edb54a2940322bc7ed81a1031be04db7d3a99" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "66466d4fe0b8988ba9e2932d3c41782c2efb683b" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "de73a884679a2461c53f96035894ef073a5a7f4f" },
|
||||
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "4aed63995a69e343b068c7469491a8d1592c339f" },
|
||||
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "c6a9196f6e35218b8972717a1557618ec69c8e88" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
|
||||
"treesj": { "branch": "main", "commit": "e1e82ab4237619d342c7102c9f13d4b9833bfd39" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "37523ffe0849b51db07fa7f48430c2aca5420a0e" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "5d5ad196fcde223509d7dabbade0148f7884c5e3" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "c365064cd5bc625d1aebab6235d504bd91274cdb" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "c600cf10db1bf933aab9e357158bf9b202ecf99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
42
modules/home/apps/tools/starship/default.nix
Normal file
42
modules/home/apps/tools/starship/default.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.apps.tools.starship;
|
||||
in {
|
||||
options.apps.tools.starship = with types; {
|
||||
enable = mkBoolOpt false "Enable Tmux";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = config.programs.zsh.enable;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
command_timeout = 1000;
|
||||
scan_timeout = 3;
|
||||
character = {
|
||||
error_symbol = "[](bold red)";
|
||||
success_symbol = "[](bold green)";
|
||||
vicmd_symbol = "[](bold yellow)";
|
||||
format = "$symbol [|](bold bright-black) ";
|
||||
};
|
||||
git_commit = {commit_hash_length = 7;};
|
||||
line_break.disabled = false;
|
||||
lua.symbol = "[](blue) ";
|
||||
python.symbol = "[](blue) ";
|
||||
hostname = {
|
||||
ssh_only = true;
|
||||
format = "[$hostname](bold blue) ";
|
||||
disabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
89
modules/home/apps/tools/tmux/default.nix
Normal file
89
modules/home/apps/tools/tmux/default.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.apps.tools.tmux;
|
||||
in {
|
||||
options.apps.tools.tmux = with types; {
|
||||
enable = mkBoolOpt false "Enable Tmux";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.tmux = let
|
||||
dreamsofcode-io-catppuccin-tmux =
|
||||
pkgs.tmuxPlugins.mkTmuxPlugin
|
||||
{
|
||||
pluginName = "catppuccin";
|
||||
version = "unstable-2023-01-06";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "dreamsofcode-io";
|
||||
repo = "catppuccin-tmux";
|
||||
rev = "b4e0715356f820fc72ea8e8baf34f0f60e891718";
|
||||
sha256 = "sha256-FJHM6LJkiAwxaLd5pnAoF3a7AE1ZqHWoCpUJE0ncCA8=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
shell = "${pkgs.zsh}/bin/zsh";
|
||||
historyLimit = 100000;
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = dreamsofcode-io-catppuccin-tmux;
|
||||
extraConfig = "";
|
||||
}
|
||||
tmuxPlugins.sensible
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
tmuxPlugins.yank
|
||||
];
|
||||
extraConfig = ''
|
||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||
set -g mouse on
|
||||
|
||||
set -g @catppuccin-flavor 'mocha'
|
||||
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
setw -g mode-keys vi
|
||||
set-window-option -g pane-base-index 1
|
||||
set-option -g renumber-windows on
|
||||
set -g @catppuccin_window_left_separator ""
|
||||
set -g @catppuccin_window_right_separator " "
|
||||
set -g @catppuccin_window_middle_separator " █"
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
set -g @catppuccin_window_default_fill "number"
|
||||
set -g @catppuccin_window_default_text "#W"
|
||||
set -g @catppuccin_window_current_fill "number"
|
||||
set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}"
|
||||
set -g @catppuccin_status_modules_right "directory meetings date_time"
|
||||
set -g @catppuccin_status_modules_left "session"
|
||||
set -g @catppuccin_status_left_separator " "
|
||||
set -g @catppuccin_status_right_separator " "
|
||||
set -g @catppuccin_status_right_separator_inverse "no"
|
||||
set -g @catppuccin_status_fill "icon"
|
||||
set -g @catppuccin_status_connect_separator "no"
|
||||
set -g @catppuccin_directory_text "#{b:pane_current_path}"
|
||||
set -g @catppuccin_meetings_text "#($HOME/.config/tmux/scripts/cal.sh)"
|
||||
set -g @catppuccin_date_time_text "%H:%M"
|
||||
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
bind % split-window -v -c "#{pane_current_path}"
|
||||
|
||||
unbind C-b
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
|
||||
bind -n M-H previous-window
|
||||
bind -n M-L next-window
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue