Compare commits
17
Commits
xcode
...
5e8d29a82b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e8d29a82b | ||
|
|
75e4e77dba | ||
|
|
f74d475dfb | ||
|
|
bf1b2d5042 | ||
|
|
9ea6881d0e | ||
|
|
f242ace8a6 | ||
|
|
f8578e46c8 | ||
|
|
11f21ffaab | ||
|
|
ecb6f9329a | ||
|
|
2215365e05 | ||
|
|
6bfddba4e1 | ||
|
|
bc3f6d4a06 | ||
|
|
2dc0392bf9 | ||
|
|
295aa41395 | ||
|
|
86d6e13813 | ||
|
|
9fefc102c9 | ||
|
|
602aa05e5c |
+9
-10
@@ -1,13 +1,9 @@
|
|||||||
cask "ghostty"
|
cask "ghostty"
|
||||||
# cask "localsend"
|
|
||||||
cask "tailscale-app"
|
|
||||||
# cask "zen"
|
|
||||||
cask "autodesk-fusion"
|
|
||||||
cask "logi-options+"
|
|
||||||
cask "font-jetbrains-mono-nerd-font"
|
cask "font-jetbrains-mono-nerd-font"
|
||||||
# cask "utm"
|
cask "google-chrome"
|
||||||
cask "bitwarden"
|
cask "tailscale-app"
|
||||||
|
|
||||||
|
brew "mole"
|
||||||
brew "ripgrep"
|
brew "ripgrep"
|
||||||
brew "neovim"
|
brew "neovim"
|
||||||
brew "tree-sitter" # dep to neovim
|
brew "tree-sitter" # dep to neovim
|
||||||
@@ -16,15 +12,18 @@ brew "eza"
|
|||||||
brew "starship"
|
brew "starship"
|
||||||
brew "tmux"
|
brew "tmux"
|
||||||
brew "bat"
|
brew "bat"
|
||||||
|
brew "python"
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
brew "fd"
|
brew "fd"
|
||||||
brew "fzf"
|
brew "fzf"
|
||||||
brew "git"
|
brew "git"
|
||||||
brew "zoxide"
|
brew "zoxide"
|
||||||
brew "stow"
|
brew "stow"
|
||||||
brew "mosh"
|
brew "jpeg-turbo"
|
||||||
# brew "jpeg-turbo"
|
brew "pkgconfig"
|
||||||
brew "npm"
|
brew "npm"
|
||||||
|
brew "go"
|
||||||
brew "wget"
|
brew "wget"
|
||||||
|
brew "jq"
|
||||||
|
brew "ruby"
|
||||||
brew "opencode"
|
brew "opencode"
|
||||||
# brew "podman"
|
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
font-size = 14
|
theme = "/Users/andrew/.config/ghostty/themes/kanso-zen"
|
||||||
theme = "rose-pine-default"
|
|
||||||
macos-titlebar-style = tabs
|
|
||||||
font-family = "JetBrainsMono Nerd Font Medium"
|
font-family = "JetBrainsMono Nerd Font Medium"
|
||||||
font-thicken = true
|
font-thicken = true
|
||||||
font-thicken-strength = 10
|
font-size = 14
|
||||||
|
|
||||||
background = 000000
|
macos-titlebar-style = transparent
|
||||||
# background-opacity = 0.85
|
macos-titlebar-proxy-icon = hidden
|
||||||
# background-blur = true
|
title = " "
|
||||||
|
background-opacity = 0.92
|
||||||
|
background-blur = 64
|
||||||
confirm-close-surface = false
|
confirm-close-surface = false
|
||||||
window-padding-x = 6
|
window-padding-x = 15
|
||||||
window-padding-y = 6
|
window-padding-y = 15
|
||||||
mouse-hide-while-typing = true
|
mouse-hide-while-typing = true
|
||||||
adjust-cell-height = 5%
|
adjust-cell-height = 5%
|
||||||
adjust-cell-width = -5%
|
adjust-cell-width = -5%
|
||||||
alpha-blending = linear-corrected
|
alpha-blending = linear-corrected
|
||||||
bold-is-bright = true
|
|
||||||
mouse-hide-while-typing = true
|
mouse-hide-while-typing = true
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
palette = 0=#090E13
|
||||||
|
palette = 1=#c4746e
|
||||||
|
palette = 2=#8a9a7b
|
||||||
|
palette = 3=#c4b28a
|
||||||
|
palette = 4=#8ba4b0
|
||||||
|
palette = 5=#a292a3
|
||||||
|
palette = 6=#8ea4a2
|
||||||
|
palette = 7=#a4a7a4
|
||||||
|
palette = 8=#5C6066
|
||||||
|
palette = 9=#e46876
|
||||||
|
palette = 10=#87a987
|
||||||
|
palette = 11=#e6c384
|
||||||
|
palette = 12=#7fb4ca
|
||||||
|
palette = 13=#938aa9
|
||||||
|
palette = 14=#7aa89f
|
||||||
|
palette = 15=#c5c9c7
|
||||||
|
|
||||||
|
background = #090E13
|
||||||
|
foreground = #c5c9c7
|
||||||
|
cursor-color = #c5c9c7
|
||||||
|
selection-background = #22262D
|
||||||
|
selection-foreground = #c5c9c7
|
||||||
+9
-5
@@ -13,10 +13,10 @@ if ! command -v brew &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v cargo &> /dev/null; then
|
# if ! command -v cargo &> /dev/null; then
|
||||||
echo "Installing Cargo"
|
# echo "Installing Cargo"
|
||||||
curl https://sh.rustup.rs -sSf | sh
|
# curl https://sh.rustup.rs -sSf | sh
|
||||||
fi
|
# fi
|
||||||
if ! command -v zinit &> /dev/null; then
|
if ! command -v zinit &> /dev/null; then
|
||||||
echo "Installing zinit"
|
echo "Installing zinit"
|
||||||
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
|
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
|
||||||
@@ -26,7 +26,6 @@ DOTFILES_DIR="$HOME/dotfiles"
|
|||||||
if [ ! -d "$DOTFILES_DIR" ]; then
|
if [ ! -d "$DOTFILES_DIR" ]; then
|
||||||
echo "Cloning dotfiles..."
|
echo "Cloning dotfiles..."
|
||||||
git clone https://git@moo:dmm/dotfiles.git
|
git clone https://git@moo:dmm/dotfiles.git
|
||||||
cd dotfiles
|
|
||||||
fi
|
fi
|
||||||
cd "$DOTFILES_DIR"
|
cd "$DOTFILES_DIR"
|
||||||
brew bundle --file=.Brewfile
|
brew bundle --file=.Brewfile
|
||||||
@@ -34,6 +33,11 @@ brew bundle --file=.Brewfile
|
|||||||
stow .
|
stow .
|
||||||
|
|
||||||
cd ~/
|
cd ~/
|
||||||
|
TPM_DIR="$HOME/.config/tmux/plugins/tpm/"
|
||||||
|
if [ ! -d "$TPM_DIR" ]; then
|
||||||
|
echo "Cloning tpm..."
|
||||||
|
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Enable Touch ID for sudo
|
# Enable Touch ID for sudo
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+5
-203
@@ -1,203 +1,5 @@
|
|||||||
vim.pack.add({
|
require('DarthMooMancer.opts')
|
||||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
require('DarthMooMancer.plugins')
|
||||||
{ src = "https://github.com/brenoprata10/nvim-highlight-colors" },
|
require('DarthMooMancer.keymaps')
|
||||||
{ src = "https://github.com/mbbill/undotree" },
|
require('DarthMooMancer.statusline')
|
||||||
{ src = "https://github.com/nvim-mini/mini.pairs", version = vim.version.range('*') },
|
require('DarthMooMancer.lsp')
|
||||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
|
||||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
|
||||||
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range('*'), },
|
|
||||||
{ src = "git@moo:dmm/polydev.git" },
|
|
||||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
|
||||||
{ src = "https://github.com/alexghergh/nvim-tmux-navigation" },
|
|
||||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
|
||||||
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
|
|
||||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
|
||||||
{ src = "https://github.com/stevearc/conform.nvim" },
|
|
||||||
})
|
|
||||||
|
|
||||||
--- Configurations
|
|
||||||
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = { "ts_ls", "lua_ls", "ts_ls" },
|
|
||||||
automatic_enable = true,
|
|
||||||
})
|
|
||||||
require 'nvim-tmux-navigation'.setup {
|
|
||||||
disable_when_zoomed = true -- defaults to false
|
|
||||||
}
|
|
||||||
require('nvim-treesitter').install { 'rust', 'c', 'cpp', 'lua', 'javascript' }
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = { 'c', 'cpp', 'rust', 'lua', 'javascript' },
|
|
||||||
callback = function()
|
|
||||||
vim.treesitter.start()
|
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
require("conform").setup({
|
|
||||||
formatters_by_ft = {
|
|
||||||
rust = { "rustfmt", lsp_format = "fallback" },
|
|
||||||
lua = { "emmylua-codeformat", lsp_format = "fallback" },
|
|
||||||
javascript = { "ts_ls", stop_after_first = true },
|
|
||||||
["_"] = { "trim_whitespace" },
|
|
||||||
},
|
|
||||||
format_on_save = {
|
|
||||||
timeout_ms = 500,
|
|
||||||
lsp_format = "fallback",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require('nvim-highlight-colors').turnOn()
|
|
||||||
require("Polydev").setup({
|
|
||||||
-- terminal = {
|
|
||||||
-- mode = "split",
|
|
||||||
-- win = {
|
|
||||||
-- type = "vertical",
|
|
||||||
-- anchor = "right",
|
|
||||||
-- -- size = "20"
|
|
||||||
-- },
|
|
||||||
--
|
|
||||||
-- },
|
|
||||||
})
|
|
||||||
require("blink.cmp").setup({
|
|
||||||
completion = {
|
|
||||||
menu = {
|
|
||||||
draw = {
|
|
||||||
columns = { { "label", gap = 1 }, { "kind_icon", gap = 1, "kind" } },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
require('mini.pairs').setup()
|
|
||||||
require("fzf-lua").setup({
|
|
||||||
"border-fused",
|
|
||||||
previewers = {
|
|
||||||
builtin = {
|
|
||||||
syntax_limit_b = -51200, -- 50KB limit on highlighting files
|
|
||||||
},
|
|
||||||
},
|
|
||||||
winopts = {
|
|
||||||
height = 0.50,
|
|
||||||
width = 0.45,
|
|
||||||
row = 0.35,
|
|
||||||
col = 0.50,
|
|
||||||
border = "rounded",
|
|
||||||
backdrop = 0,
|
|
||||||
fullscreen = false,
|
|
||||||
preview = {
|
|
||||||
hidden = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
grep = {
|
|
||||||
rg_glob = true,
|
|
||||||
rg_glob_fn = function(query)
|
|
||||||
local regex, flags = query:match("^(.-)%s%-%-(.*)$")
|
|
||||||
return (regex or query), flags
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
defaults = {
|
|
||||||
formatter = "path.filename_first",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
--- LSP
|
|
||||||
|
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
|
||||||
vim.lsp.config("lua_ls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = { globals = { "vim" } },
|
|
||||||
workspace = {
|
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
|
||||||
checkThirdParty = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer", "ts_ls" })
|
|
||||||
|
|
||||||
--- Options
|
|
||||||
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.tabstop = 8 -- Number of spaces a <Tab> counts for
|
|
||||||
vim.opt.shiftwidth = 8 -- Number of spaces for autoindent (>>, <<, etc.)
|
|
||||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
|
||||||
vim.opt.autoindent = true -- Copy indent from current line when starting a new line
|
|
||||||
vim.opt.softtabstop = 8 -- Number of spaces for <Tab> in insert mode (backspace deletes 4 spaces)
|
|
||||||
vim.opt.wrap = false
|
|
||||||
vim.opt.swapfile = false
|
|
||||||
vim.opt.signcolumn = "yes"
|
|
||||||
vim.opt.undofile = true -- Keeps undo history even after we close a file
|
|
||||||
vim.opt.scrolloff = 8
|
|
||||||
vim.opt.sidescrolloff = 8
|
|
||||||
vim.opt.hlsearch = false
|
|
||||||
vim.opt.completeopt = { "menuone", "noselect", "popup" }
|
|
||||||
vim.g.netrw_browse_split = 0
|
|
||||||
vim.g.netrw_banner = 0
|
|
||||||
vim.g.netrw_liststyle = 3
|
|
||||||
vim.g.netrw_winsize = 25
|
|
||||||
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
|
|
||||||
vim.opt.cursorline = true -- enable cursorline
|
|
||||||
vim.opt.cursorlineopt = { "screenline", "number" } -- cursorline look
|
|
||||||
vim.opt.foldmethod = "indent"
|
|
||||||
vim.opt.foldcolumn = "1"
|
|
||||||
vim.opt.foldenable = false
|
|
||||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
|
||||||
vim.opt.ignorecase = true -- ignore cases when searching
|
|
||||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
|
||||||
vim.opt.smartindent = false -- smarter indentation
|
|
||||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
|
||||||
vim.opt.laststatus = 3
|
|
||||||
|
|
||||||
--- COLORS
|
|
||||||
|
|
||||||
vim.cmd.colorscheme("rose-pine")
|
|
||||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "StatusLine", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "StatusLineTerm", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "StatusLineNC", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "SignColumn", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, 'LineNrAbove', { link = 'NonText', bold = true })
|
|
||||||
vim.api.nvim_set_hl(0, 'LineNrBelow', { link = 'NonText', bold = true })
|
|
||||||
vim.api.nvim_set_hl(0, "LineNr", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "FoldColumn", { link = 'Normal' })
|
|
||||||
vim.api.nvim_set_hl(0, "CursorLineNr", { bg = "none", link = 'MatchParen', bold = true })
|
|
||||||
|
|
||||||
--- KEYMAPS
|
|
||||||
|
|
||||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
|
||||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
|
||||||
vim.keymap.set("n", "<leader>ff", vim.lsp.buf.format)
|
|
||||||
vim.keymap.set("n", "<leader>vs", ":vsplit<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>ss", ":split<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>E", ":Ex<CR>")
|
|
||||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
|
||||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
|
||||||
vim.keymap.set("n", "n", "nzzzv")
|
|
||||||
vim.keymap.set("n", "N", "Nzzzv")
|
|
||||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
|
||||||
vim.keymap.set('n', '<leader><leader>', ":FzfLua files<CR>")
|
|
||||||
vim.keymap.set('n', '<leader>fh', ":FzfLua helptags<CR>")
|
|
||||||
vim.keymap.set('n', '<leader>fg', ":FzfLua live_grep<CR>")
|
|
||||||
vim.keymap.set('n', '<leader>fm', ":FzfLua manpages<CR>")
|
|
||||||
vim.keymap.set('n', '<leader>xx', ":FzfLua diagnostics_workspace<CR>")
|
|
||||||
vim.keymap.set('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
|
||||||
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition)
|
|
||||||
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references)
|
|
||||||
vim.keymap.set("n", "<leader>gR", vim.lsp.buf.rename)
|
|
||||||
vim.keymap.set("n", "<leader>gc", vim.lsp.buf.code_action)
|
|
||||||
vim.keymap.set("n", "<leader>uu", ":UndotreeToggle<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>[", "<c-w>H", { silent = true, noremap = true, })
|
|
||||||
vim.keymap.set("n", "<leader>]", "<c-w>K", { silent = true, noremap = true, })
|
|
||||||
vim.keymap.set("n", "[q", ":cprev<CR>zz", { desc = "Previous Quickfix Item" })
|
|
||||||
vim.keymap.set("n", "]q", ":cnext<CR>zz", { desc = "Next Quickfix Item" })
|
|
||||||
vim.keymap.set("n", "<leader>qo", ":copen<CR>", { desc = "Open Quickfix" })
|
|
||||||
vim.keymap.set("n", "<leader>qc", ":cclose<CR>", { desc = "Close Quickfix" })
|
|
||||||
vim.keymap.set("n", "<C-h>", ":NvimTmuxNavigateLeft<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<C-j>", ":NvimTmuxNavigateDown<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<C-k>", ":NvimTmuxNavigateUp<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<C-l>", ":NvimTmuxNavigateRight<CR>", { silent = true })
|
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.termguicolors = true
|
|
||||||
|
|
||||||
vim.o.nu = true
|
|
||||||
vim.o.relativenumber = true
|
|
||||||
vim.o.cursorline = true
|
|
||||||
vim.o.expandtab = true
|
|
||||||
vim.o.tabstop = 4
|
|
||||||
vim.o.shiftwidth = 4
|
|
||||||
vim.o.hlsearch = false
|
|
||||||
vim.o.incsearch = true
|
|
||||||
vim.o.swapfile = false
|
|
||||||
vim.o.backup = false
|
|
||||||
vim.o.wrap = false
|
|
||||||
vim.o.undofile = true
|
|
||||||
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
|
|
||||||
vim.o.list = true
|
|
||||||
--vim.o.listchars = "tabs:> "
|
|
||||||
vim.o.path = "**"
|
|
||||||
|
|
||||||
vim.cmd(":colorscheme retrobox")
|
|
||||||
vim.cmd(":command! -nargs=+ Grep execute 'silent grep! <args>' | copen")
|
|
||||||
|
|
||||||
vim.treesitter.language.register("cpp", "c")
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = {
|
|
||||||
"c", "h", "cpp",
|
|
||||||
"lua"
|
|
||||||
},
|
|
||||||
callback = function() vim.treesitter.start() end,
|
|
||||||
})
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
|
||||||
map("n", "<C-h>", "<C-w><C-h>")
|
|
||||||
map("n", "<C-j>", "<C-w><C-j>")
|
|
||||||
map("n", "<C-k>", "<C-w><C-k>")
|
|
||||||
map("n", "<C-l>", "<C-w><C-l>")
|
|
||||||
|
|
||||||
map("n", "<C-d>", "<C-d>zz")
|
|
||||||
map("n", "<C-u>", "<C-u>zz")
|
|
||||||
|
|
||||||
map({ "i", "n" }, "<C-n>", "<C-x><C-]>")
|
|
||||||
map({ "i", "n" }, "<C- >", "<C-x><C-o>")
|
|
||||||
|
|
||||||
map("n", "n", "nzzzv")
|
|
||||||
map("n", "N", "Nzzzv")
|
|
||||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
|
||||||
map("v", "K", ":m '<-2<CR>gv=gv")
|
|
||||||
map("n", ";", "q:")
|
|
||||||
map("t", "<ESC>", "<C-\\><C-n>")
|
|
||||||
map("n", "<A-h>", ":below term<CR>i")
|
|
||||||
|
|
||||||
map("n", "<leader>w", ":write<CR>")
|
|
||||||
map("n", "<leader>q", ":quit<CR>")
|
|
||||||
map("n", "<leader>Q", ":quit!<CR>")
|
|
||||||
map("n", "<leader>y", "\"+y")
|
|
||||||
map("n", "<leader>e", ":Ex<CR>")
|
|
||||||
map("n", "<leader>v", ":edit $MYVIMRC<CR>")
|
|
||||||
map("n", "<leader>ff", ":find ")
|
|
||||||
map("n", "<leader>fg", ":Grep ")
|
|
||||||
map("n", "<leader>r", ":make!<CR>")
|
|
||||||
map("n", "<leader>R", ":set makeprg=")
|
|
||||||
map("n", "<leader>x", ":copen<CR>")
|
|
||||||
map("n", "<leader>c", ":!ctags -R .<CR>")
|
|
||||||
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
local function switch_source_header(bufnr)
|
|
||||||
local method_name = 'textDocument/switchSourceHeader'
|
|
||||||
local client = vim.lsp.get_clients({ bufnr = bufnr, name = 'clangd' })[1]
|
|
||||||
if not client then
|
|
||||||
return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name))
|
|
||||||
end
|
|
||||||
local params = vim.lsp.util.make_text_document_params(bufnr)
|
|
||||||
client.request(method_name, params, function(err, result)
|
|
||||||
if err then
|
|
||||||
error(tostring(err))
|
|
||||||
end
|
|
||||||
if not result then
|
|
||||||
vim.notify('corresponding file cannot be determined')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
vim.cmd.edit(vim.uri_to_fname(result))
|
|
||||||
end, bufnr)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function symbol_info()
|
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
|
||||||
local clangd_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'clangd' })[1]
|
|
||||||
if not clangd_client or not clangd_client.supports_method 'textDocument/symbolInfo' then
|
|
||||||
return vim.notify('Clangd client not found', vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
local win = vim.api.nvim_get_current_win()
|
|
||||||
local params = vim.lsp.util.make_position_params(win, clangd_client.offset_encoding)
|
|
||||||
clangd_client.request('textDocument/symbolInfo', params, function(err, res)
|
|
||||||
if err or #res == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local container = string.format('container: %s', res[1].containerName) ---@type string
|
|
||||||
local name = string.format('name: %s', res[1].name) ---@type string
|
|
||||||
vim.lsp.util.open_floating_preview({ name, container }, '', {
|
|
||||||
height = 2,
|
|
||||||
width = math.max(string.len(name), string.len(container)),
|
|
||||||
focusable = false,
|
|
||||||
focus = false,
|
|
||||||
border = 'single',
|
|
||||||
title = 'Symbol Info',
|
|
||||||
})
|
|
||||||
end, bufnr)
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
cmd = { 'clangd' },
|
|
||||||
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
|
|
||||||
root_markers = {
|
|
||||||
'.clangd',
|
|
||||||
'.clang-tidy',
|
|
||||||
'.clang-format',
|
|
||||||
'compile_commands.json',
|
|
||||||
'compile_flags.txt',
|
|
||||||
'configure.ac', -- AutoTools
|
|
||||||
'.git',
|
|
||||||
},
|
|
||||||
capabilities = {
|
|
||||||
textDocument = {
|
|
||||||
completion = {
|
|
||||||
editsNearCursor = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
offsetEncoding = { 'utf-8', 'utf-16' },
|
|
||||||
},
|
|
||||||
on_init = function(client, init_result)
|
|
||||||
if init_result.offsetEncoding then
|
|
||||||
client.offset_encoding = init_result.offsetEncoding
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
on_attach = function(_, bufnr)
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdSwitchSourceHeader', function()
|
|
||||||
switch_source_header(bufnr)
|
|
||||||
end, { desc = 'Switch between source/header' })
|
|
||||||
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdShowSymbolInfo', function()
|
|
||||||
symbol_info()
|
|
||||||
end, { desc = 'Show symbol info' })
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/denoland/deno
|
|
||||||
---
|
|
||||||
--- Deno's built-in language server
|
|
||||||
---
|
|
||||||
--- To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages
|
|
||||||
--- in your init.lua. Example:
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.g.markdown_fenced_languages = {
|
|
||||||
--- "ts=typescript"
|
|
||||||
--- }
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Some care must be taken here to correctly infer whether a file is part of a Deno program, or a TS program that
|
|
||||||
--- expects to run in Node or Web Browsers. This supports having a Deno module that is a part of a mostly-not-Deno
|
|
||||||
--- monorepo. We do this by finding the nearest package manager lock file, and the nearest deno.json or deno.jsonc.
|
|
||||||
--- Note that this means that without a deno.json, deno.jsonc, or deno.lock file, this LSP client will not attach.
|
|
||||||
---
|
|
||||||
--- Example:
|
|
||||||
---
|
|
||||||
--- ```
|
|
||||||
--- project-root
|
|
||||||
--- +-- node_modules/...
|
|
||||||
--- +-- package-lock.json
|
|
||||||
--- +-- package.json
|
|
||||||
--- +-- packages
|
|
||||||
--- +-- deno-module
|
|
||||||
--- | +-- deno.json
|
|
||||||
--- | +-- package.json <-- It's normal for Deno projects to have package.json files!
|
|
||||||
--- | +-- src
|
|
||||||
--- | +-- index.ts <-- this is a Deno file
|
|
||||||
--- +-- node-module
|
|
||||||
--- +-- package.json
|
|
||||||
--- +-- src
|
|
||||||
--- +-- index.ts <-- a non-Deno file (ie, should use ts_ls or tsgo)
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- From the file being edited, we walk up to find the nearest package manager lockfile. This is PROJECT ROOT.
|
|
||||||
--- From the file being edited, find the nearest deno.json or deno.jsonc. This is DENO ROOT.
|
|
||||||
--- From the file being edited, find the nearest deno.lock. This is DENO LOCK ROOT
|
|
||||||
--- If DENO LOCK ROOT is found, and PROJECT ROOT is missing or shorter, then this is a deno file, and we attach.
|
|
||||||
--- If DENO ROOT is found, and it's longer than or equal to PROJECT ROOT, then this is a Deno file, and we attach.
|
|
||||||
--- Otherwise, we abort, because this is a non-Deno TS file.
|
|
||||||
|
|
||||||
local lsp = vim.lsp
|
|
||||||
|
|
||||||
local function virtual_text_document_handler(uri, res, client)
|
|
||||||
if not res then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local lines = vim.split(res.result, '\n')
|
|
||||||
local bufnr = vim.uri_to_bufnr(uri)
|
|
||||||
|
|
||||||
local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
|
|
||||||
if #current_buf ~= 0 then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
|
|
||||||
vim.api.nvim_set_option_value('readonly', true, { buf = bufnr })
|
|
||||||
vim.api.nvim_set_option_value('modified', false, { buf = bufnr })
|
|
||||||
vim.api.nvim_set_option_value('modifiable', false, { buf = bufnr })
|
|
||||||
lsp.buf_attach_client(bufnr, client.id)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function virtual_text_document(uri, client)
|
|
||||||
local params = {
|
|
||||||
textDocument = {
|
|
||||||
uri = uri,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
local result = client:request_sync('deno/virtualTextDocument', params)
|
|
||||||
virtual_text_document_handler(uri, result, client)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function denols_handler(err, result, ctx, config)
|
|
||||||
if not result or vim.tbl_isempty(result) then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
|
||||||
for _, res in pairs(result) do
|
|
||||||
local uri = res.uri or res.targetUri
|
|
||||||
if uri:match '^deno:' then
|
|
||||||
virtual_text_document(uri, client)
|
|
||||||
res['uri'] = uri
|
|
||||||
res['targetUri'] = uri
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
lsp.handlers[ctx.method](err, result, ctx, config)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'deno', 'lsp' },
|
|
||||||
cmd_env = { NO_COLOR = true },
|
|
||||||
filetypes = {
|
|
||||||
'javascript',
|
|
||||||
'javascriptreact',
|
|
||||||
'typescript',
|
|
||||||
'typescriptreact',
|
|
||||||
},
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
-- The project root is where the LSP can be started from
|
|
||||||
local root_markers = { 'deno.lock', 'deno.json', 'deno.jsonc' }
|
|
||||||
-- Give the root markers equal priority by wrapping them in a table
|
|
||||||
root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, { '.git' } }
|
|
||||||
or vim.list_extend(root_markers, { '.git' })
|
|
||||||
-- only include deno projects
|
|
||||||
local deno_root = vim.fs.root(bufnr, { 'deno.json', 'deno.jsonc' })
|
|
||||||
local deno_lock_root = vim.fs.root(bufnr, { 'deno.lock' })
|
|
||||||
local project_root = vim.fs.root(bufnr, root_markers)
|
|
||||||
if
|
|
||||||
(deno_lock_root and (not project_root or #deno_lock_root > #project_root))
|
|
||||||
or (deno_root and (not project_root or #deno_root >= #project_root))
|
|
||||||
then
|
|
||||||
-- deno config is closer than or equal to package manager lock,
|
|
||||||
-- or deno lock is closer than package manager lock. Attach at the project root,
|
|
||||||
-- or deno lock or deno config path. At least one of these is always set at this point.
|
|
||||||
on_dir(project_root or deno_lock_root or deno_root)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
---@type lspconfig.settings.denols
|
|
||||||
settings = {
|
|
||||||
deno = {
|
|
||||||
enable = true,
|
|
||||||
suggest = {
|
|
||||||
imports = {
|
|
||||||
hosts = {
|
|
||||||
['https://deno.land'] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
handlers = {
|
|
||||||
['textDocument/definition'] = denols_handler,
|
|
||||||
['textDocument/typeDefinition'] = denols_handler,
|
|
||||||
['textDocument/references'] = denols_handler,
|
|
||||||
},
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspDenolsCache', function()
|
|
||||||
client:exec_cmd({
|
|
||||||
title = 'DenolsCache',
|
|
||||||
command = 'deno.cache',
|
|
||||||
arguments = { {}, vim.uri_from_bufnr(bufnr) },
|
|
||||||
}, { bufnr = bufnr }, function(err, _, ctx)
|
|
||||||
if err then
|
|
||||||
local uri = ctx.params.arguments[2]
|
|
||||||
vim.notify('cache command failed for' .. vim.uri_to_fname(uri),
|
|
||||||
vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end, {
|
|
||||||
desc = 'Cache a module and all of its dependencies.',
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
return {
|
|
||||||
cmd = { 'lua-language-server' },
|
|
||||||
filetypes = { 'lua' },
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
root_markers = {
|
|
||||||
'.luarc.json',
|
|
||||||
'.luarc.jsonc',
|
|
||||||
'.luacheckrc',
|
|
||||||
'.stylua.toml',
|
|
||||||
'stylua.toml',
|
|
||||||
'selene.toml',
|
|
||||||
'selene.yml',
|
|
||||||
'.git',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
-- ~/.config/nvim/lsp/rust-analyzer.lua
|
|
||||||
return {
|
|
||||||
cmd = { "rust-analyzer" },
|
|
||||||
filetypes = { "rust" },
|
|
||||||
root_markers = { "Cargo.toml", ".git" },
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
diagnostics = {
|
|
||||||
enable = false, -- As you requested
|
|
||||||
},
|
|
||||||
checkOnSave = {
|
|
||||||
enable = true,
|
|
||||||
command = "clippy",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
||||||
|
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
||||||
|
vim.keymap.set('n', '<leader>ff', function()
|
||||||
|
require('conform').format({ async = true, lsp_format = 'never' })
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>vs', ':vsplit<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>ss', ':split<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>E', ':Ex<CR>')
|
||||||
|
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||||
|
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||||
|
vim.keymap.set('n', 'n', 'nzzzv')
|
||||||
|
vim.keymap.set('n', 'N', 'Nzzzv')
|
||||||
|
vim.keymap.set('x', '<leader>p', [["_dP]])
|
||||||
|
vim.keymap.set('n', '<leader><leader>', function()
|
||||||
|
Snacks.picker.files()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>fh', function()
|
||||||
|
Snacks.picker.help()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>fg', function()
|
||||||
|
Snacks.picker.grep()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>fm', function()
|
||||||
|
Snacks.picker.man()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>xn', function()
|
||||||
|
Snacks.picker.notifications()
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>uu', function()
|
||||||
|
Snacks.picker.undo()
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
||||||
|
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition)
|
||||||
|
vim.keymap.set('n', '<leader>gr', vim.lsp.buf.references)
|
||||||
|
vim.keymap.set('n', '<leader>gR', vim.lsp.buf.rename)
|
||||||
|
vim.keymap.set('n', '<leader>gc', vim.lsp.buf.code_action)
|
||||||
|
vim.keymap.set('n', '<leader>[', '<c-w>H', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set('n', '<leader>]', '<c-w>K', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set('n', '[q', ':cprev<CR>zz', { desc = 'Previous Quickfix Item' })
|
||||||
|
vim.keymap.set('n', ']q', ':cnext<CR>zz', { desc = 'Next Quickfix Item' })
|
||||||
|
vim.keymap.set('n', '<leader>qo', ':copen<CR>', { desc = 'Open Quickfix' })
|
||||||
|
vim.keymap.set('n', '<leader>qc', ':cclose<CR>', { desc = 'Close Quickfix' })
|
||||||
|
vim.keymap.set('n', '<leader>lp', ':LivePreview pick<cr>')
|
||||||
|
vim.keymap.set('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-l>', ':NvimTmuxNavigateRight<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<leader>xx', ':Trouble diagnostics toggle<cr>')
|
||||||
|
vim.keymap.set('n', '<leader>zz', function()
|
||||||
|
Snacks.zen()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>mp', ':Vellum<cr>', { desc = 'Markdown preview' })
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { 'vim' } },
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.lsp.config('vtsls', {
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
updateImportsOnFileMove = { enabled = 'always' },
|
||||||
|
inlayHints = {
|
||||||
|
parameterNames = { enabled = 'all' },
|
||||||
|
variableTypes = { enabled = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('html', {
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable({
|
||||||
|
'lua_ls',
|
||||||
|
'clangd',
|
||||||
|
'rust-analyzer',
|
||||||
|
'vtsls',
|
||||||
|
'tailwindcss-language-server',
|
||||||
|
'cssls',
|
||||||
|
'html',
|
||||||
|
'gopls',
|
||||||
|
'pylsp'
|
||||||
|
})
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.tabstop = 8 -- Number of spaces a <Tab> counts for
|
||||||
|
vim.opt.shiftwidth = 8 -- Number of spaces for autoindent (>>, <<, etc.)
|
||||||
|
vim.opt.softtabstop = 8 -- Number of spaces for <Tab> in insert mode (backspace deletes 4 spaces)
|
||||||
|
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
callback = function(ev)
|
||||||
|
local map = {
|
||||||
|
rust = { ts = 4, sw = 4, sts = 4 },
|
||||||
|
lua = { ts = 4, sw = 4, sts = 4 },
|
||||||
|
python = { ts = 4, sw = 4, sts = 4 },
|
||||||
|
dart = { ts = 2, sw = 2, sts = 2 },
|
||||||
|
html = { ts = 2, sw = 2, sts = 2 },
|
||||||
|
javascript = { ts = 2, sw = 2, sts = 2 },
|
||||||
|
typescript = { ts = 2, sw = 2, sts = 2 },
|
||||||
|
}
|
||||||
|
local ft = map[ev.match]
|
||||||
|
if ft then
|
||||||
|
vim.bo[ev.buf].tabstop = ft.ts
|
||||||
|
vim.bo[ev.buf].shiftwidth = ft.sw
|
||||||
|
vim.bo[ev.buf].softtabstop = ft.sts
|
||||||
|
vim.bo[ev.buf].expandtab = ft.et ~= nil and ft.et or true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.opt.autoindent = true -- Copy indent from current line when starting a new line
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.signcolumn = 'yes'
|
||||||
|
vim.opt.undofile = true -- Keeps undo history even after we close a file
|
||||||
|
vim.opt.scrolloff = 4
|
||||||
|
vim.opt.sidescrolloff = 8
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.completeopt = { 'menuone', 'noselect', 'popup' }
|
||||||
|
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
|
||||||
|
vim.opt.cursorline = true -- enable cursorline
|
||||||
|
vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look
|
||||||
|
vim.opt.foldmethod = 'indent'
|
||||||
|
vim.opt.foldcolumn = '1'
|
||||||
|
vim.opt.foldenable = false
|
||||||
|
vim.opt.shortmess = 'aFI' -- abbreviates messages and prevents file name being echoed when opened
|
||||||
|
vim.opt.ignorecase = false -- ignore cases when searching
|
||||||
|
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||||
|
vim.opt.smartindent = false -- smarter indentation
|
||||||
|
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
vim.opt.showmode = false
|
||||||
|
vim.opt.cmdheight = 0
|
||||||
|
vim.opt.smoothscroll = true
|
||||||
|
vim.opt.spell = true
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = true, -- This is the magic line
|
||||||
|
signs = true, -- Shows icons in the gutter
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false, -- Don't clutter the screen while typing
|
||||||
|
severity_sort = true,
|
||||||
|
})
|
||||||
|
vim.o.winborder = 'rounded'
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = { 'text', 'plaintex' },
|
||||||
|
callback = function()
|
||||||
|
-- Enable visual soft-wrapping
|
||||||
|
vim.opt_local.wrap = true
|
||||||
|
vim.opt_local.linebreak = true
|
||||||
|
vim.opt_local.breakindent = true
|
||||||
|
|
||||||
|
-- Remap j/k to visual lines only inside this buffer
|
||||||
|
vim.keymap.set('n', 'j', 'gj', { buffer = true })
|
||||||
|
vim.keymap.set('n', 'k', 'gk', { buffer = true })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
require('DarthMooMancer.plugins.utils')
|
||||||
|
require('DarthMooMancer.plugins.blink-cmp')
|
||||||
|
require('DarthMooMancer.plugins.kanso')
|
||||||
|
require('DarthMooMancer.plugins.mini-nvim')
|
||||||
|
require('DarthMooMancer.plugins.polydev')
|
||||||
|
require('DarthMooMancer.plugins.treesitter')
|
||||||
|
require('DarthMooMancer.plugins.incline')
|
||||||
|
require('DarthMooMancer.plugins.mason')
|
||||||
|
require('DarthMooMancer.plugins.noice')
|
||||||
|
require('DarthMooMancer.plugins.snacks')
|
||||||
|
require('DarthMooMancer.plugins.trouble')
|
||||||
|
require('DarthMooMancer.plugins.conform')
|
||||||
|
require('DarthMooMancer.plugins.vellum')
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{
|
||||||
|
src = 'https://github.com/saghen/blink.cmp',
|
||||||
|
version = vim.version.range('*'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require('blink.cmp').setup({
|
||||||
|
completion = {
|
||||||
|
documentation = {
|
||||||
|
auto_show = true,
|
||||||
|
auto_show_delay_ms = 100,
|
||||||
|
window = {
|
||||||
|
winhighlight = 'Normal:NormalFloat,FloatBorder:SnacksPickerBorder,CursorLine:Visual,Search:None',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
menu = {
|
||||||
|
draw = {
|
||||||
|
columns = {
|
||||||
|
{ 'label', 'label_description', gap = 1 },
|
||||||
|
{ 'kind_icon', 'kind', gap = 1 },
|
||||||
|
{ 'source_name', gap = 1 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
scrollbar = false,
|
||||||
|
winhighlight = 'Pmenu:NormalFloat,FloatBorder:SnacksPickerBorder,PmenuSel:Visual,CursorLine:Visual,Search:None',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
vim.pack.add({ 'https://github.com/stevearc/conform.nvim' })
|
||||||
|
|
||||||
|
require('conform').setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||||
|
lua = { 'stylua', lsp_format = 'fallback' },
|
||||||
|
javascript = { 'prettier', stop_after_first = true },
|
||||||
|
typescript = { 'prettier', stop_after_first = true },
|
||||||
|
json = { 'prettier' },
|
||||||
|
html = { 'prettier' },
|
||||||
|
go = { 'goimports' },
|
||||||
|
c = { 'clang-format' },
|
||||||
|
cpp = { 'clang-format' },
|
||||||
|
css = { 'csskit' },
|
||||||
|
dart = { 'dart_format', lsp_format = 'fallback' },
|
||||||
|
python = { 'autopep8' },
|
||||||
|
['_'] = { 'trim_whitespace' },
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
timeout_ms = 2000,
|
||||||
|
lsp_format = 'fallback',
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = 'https://github.com/b0o/incline.nvim' },
|
||||||
|
{ src = 'https://github.com/SmiteshP/nvim-navic' },
|
||||||
|
})
|
||||||
|
|
||||||
|
local helpers = require('incline.helpers')
|
||||||
|
local navic = require('nvim-navic')
|
||||||
|
local devicons = require('nvim-web-devicons')
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('UserNavicAttach', { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
if client and client.server_capabilities.documentSymbolProvider then
|
||||||
|
navic.attach(client, args.buf)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require('incline').setup({
|
||||||
|
window = {
|
||||||
|
padding = 0,
|
||||||
|
margin = { horizontal = 0, vertical = 0 },
|
||||||
|
},
|
||||||
|
render = function(props)
|
||||||
|
local filename =
|
||||||
|
vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
|
||||||
|
if filename == '' then
|
||||||
|
filename = '[No Name]'
|
||||||
|
end
|
||||||
|
local ft_icon, ft_color = devicons.get_icon_color(filename)
|
||||||
|
local modified = vim.bo[props.buf].modified
|
||||||
|
local res = {
|
||||||
|
ft_icon and {
|
||||||
|
' ',
|
||||||
|
ft_icon,
|
||||||
|
' ',
|
||||||
|
guibg = ft_color,
|
||||||
|
guifg = helpers.contrast_color(ft_color),
|
||||||
|
} or '',
|
||||||
|
' ',
|
||||||
|
{ filename, gui = modified and 'bold,italic' or 'bold' },
|
||||||
|
guibg = 'none',
|
||||||
|
}
|
||||||
|
if props.focused then
|
||||||
|
for _, item in ipairs(navic.get_data(props.buf) or {}) do
|
||||||
|
table.insert(res, {
|
||||||
|
{ ' > ', group = 'NavicSeparator' },
|
||||||
|
{ item.icon, group = 'NavicIcons' .. item.type },
|
||||||
|
{ item.name, group = 'NavicText' },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(res, ' ')
|
||||||
|
return res
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
vim.pack.add({'https://github.com/webhooked/kanso.nvim' })
|
||||||
|
|
||||||
|
require('kanso').setup({
|
||||||
|
transparent = true,
|
||||||
|
overrides = function(colors)
|
||||||
|
local theme = colors.theme
|
||||||
|
return {
|
||||||
|
Normal = { bg = "none" },
|
||||||
|
NormalFloat = { bg = "none" },
|
||||||
|
FloatBorder = { bg = "none" },
|
||||||
|
FloatTitle = { bg = "none" },
|
||||||
|
SnacksPickerBorder = { fg = theme.ui.special, bg = "none" },
|
||||||
|
SnacksPickerTitle = { fg = theme.ui.special, bg = "none" },
|
||||||
|
SnacksInputBorder = { fg = theme.ui.special, bg = "none" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd.colorscheme('kanso-zen')
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = 'https://github.com/mason-org/mason.nvim' },
|
||||||
|
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
|
||||||
|
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
||||||
|
})
|
||||||
|
|
||||||
|
require('mason').setup()
|
||||||
|
require('mason-lspconfig').setup({
|
||||||
|
ensure_installed = {
|
||||||
|
'vtsls',
|
||||||
|
'lua_ls',
|
||||||
|
'pylsp',
|
||||||
|
'gopls',
|
||||||
|
'html',
|
||||||
|
'cssls',
|
||||||
|
'bashls',
|
||||||
|
},
|
||||||
|
automatic_enable = false,
|
||||||
|
})
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{
|
||||||
|
src = 'https://github.com/nvim-mini/mini.nvim.git',
|
||||||
|
version = vim.version.range('*')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
local hipatterns = require('mini.hipatterns')
|
||||||
|
hipatterns.setup({
|
||||||
|
highlighters = {
|
||||||
|
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||||
|
fixme = {
|
||||||
|
pattern = '%f[%w]()FIXME()%f[%W]',
|
||||||
|
group = 'MiniHipatternsFixme',
|
||||||
|
},
|
||||||
|
hack = {
|
||||||
|
pattern = '%f[%w]()HACK()%f[%W]',
|
||||||
|
group = 'MiniHipatternsHack',
|
||||||
|
},
|
||||||
|
todo = {
|
||||||
|
pattern = '%f[%w]()TODO()%f[%W]',
|
||||||
|
group = 'MiniHipatternsTodo',
|
||||||
|
},
|
||||||
|
note = {
|
||||||
|
pattern = '%f[%w]()NOTE()%f[%W]',
|
||||||
|
group = 'MiniHipatternsNote',
|
||||||
|
},
|
||||||
|
|
||||||
|
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require('mini.pairs').setup()
|
||||||
|
-- require('mini.icons').setup()
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = 'https://github.com/folke/noice.nvim' },
|
||||||
|
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
|
||||||
|
})
|
||||||
|
|
||||||
|
require('noice').setup({
|
||||||
|
lsp = {
|
||||||
|
override = {
|
||||||
|
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||||
|
['vim.lsp.util.stylize_markdown'] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
presets = {
|
||||||
|
bottom_search = true, -- use a classic bottom cmdline for search
|
||||||
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
vim.pack.add({'https://git.moomancer.xyz/DarthMooMancer/polydev.git' })
|
||||||
|
|
||||||
|
require('Polydev').setup()
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
vim.pack.add({ 'https://github.com/folke/snacks.nvim' })
|
||||||
|
|
||||||
|
require('snacks').setup({
|
||||||
|
notifier = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
animate = { enabled = true },
|
||||||
|
input = { enabled = true },
|
||||||
|
picker = {
|
||||||
|
enabled = true,
|
||||||
|
prompt = ' ',
|
||||||
|
|
||||||
|
icons = {
|
||||||
|
ui = {
|
||||||
|
selected = ' ',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
files = {
|
||||||
|
layout = {
|
||||||
|
preview = false, -- This now ONLY applies to Snacks.picker.files()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
zen = {
|
||||||
|
enabled = true,
|
||||||
|
toggles = {
|
||||||
|
dim = false,
|
||||||
|
diagnostics = true,
|
||||||
|
inlay_hints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{
|
||||||
|
src = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
},
|
||||||
|
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||||
|
})
|
||||||
|
|
||||||
|
require('nvim-treesitter').install({
|
||||||
|
'rust',
|
||||||
|
'c',
|
||||||
|
'cpp',
|
||||||
|
'lua',
|
||||||
|
'javascript',
|
||||||
|
'go',
|
||||||
|
'typescript',
|
||||||
|
'css',
|
||||||
|
'html',
|
||||||
|
'python',
|
||||||
|
'yaml',
|
||||||
|
})
|
||||||
|
|
||||||
|
require('nvim-ts-autotag').setup({
|
||||||
|
opts = {
|
||||||
|
enable_close = true, -- Auto close tags
|
||||||
|
enable_rename = true, -- Auto rename pairs of tags
|
||||||
|
enable_close_on_slash = false, -- Auto close on trailing </
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = {
|
||||||
|
'c',
|
||||||
|
'cpp',
|
||||||
|
'rust',
|
||||||
|
'lua',
|
||||||
|
'typescript',
|
||||||
|
'javascript',
|
||||||
|
'css',
|
||||||
|
'html',
|
||||||
|
'python',
|
||||||
|
'go',
|
||||||
|
'yaml',
|
||||||
|
},
|
||||||
|
callback = function()
|
||||||
|
vim.treesitter.start()
|
||||||
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
vim.pack.add({ 'https://github.com/folke/trouble.nvim' })
|
||||||
|
require('trouble').setup({})
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||||
|
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
|
||||||
|
|
||||||
|
{ src = 'https://github.com/brianhuster/live-preview.nvim' },
|
||||||
|
{ src = 'https://github.com/m4xshen/hardtime.nvim' },
|
||||||
|
})
|
||||||
|
|
||||||
|
require('nvim-tmux-navigation').setup({
|
||||||
|
disable_when_zoomed = true, -- defaults to false
|
||||||
|
})
|
||||||
|
|
||||||
|
require("hardtime").setup()
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{
|
||||||
|
src = 'https://github.com/blackhat-7/vellum.nvim',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'markdown',
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
local ok, vellum = pcall(require, 'vellum')
|
||||||
|
if ok then
|
||||||
|
vellum.setup({})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,416 @@
|
|||||||
|
local function derive_hl(name, opts)
|
||||||
|
local base = opts.base and vim.api.nvim_get_hl(0, { name = opts.base })
|
||||||
|
or {}
|
||||||
|
local fg = opts.fg and vim.api.nvim_get_hl(0, { name = opts.fg }) or {}
|
||||||
|
local bg = opts.bg and vim.api.nvim_get_hl(0, { name = opts.bg }) or {}
|
||||||
|
vim.api.nvim_set_hl(
|
||||||
|
0,
|
||||||
|
name,
|
||||||
|
{ fg = fg.fg or base.fg, bg = bg.bg or base.bg, bold = opts.bold }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function setup_statusline_highlights()
|
||||||
|
local st = vim.api.nvim_get_hl(0, { name = 'StatusLine' })
|
||||||
|
for name, link in pairs({
|
||||||
|
Normal = 'Type',
|
||||||
|
Insert = 'String',
|
||||||
|
Visual = 'Statement',
|
||||||
|
Command = 'PreProc',
|
||||||
|
Replace = 'WarningMsg',
|
||||||
|
Terminal = 'Special',
|
||||||
|
}) do
|
||||||
|
local c = vim.api.nvim_get_hl(0, { name = link })
|
||||||
|
vim.api.nvim_set_hl(
|
||||||
|
0,
|
||||||
|
'StatusMode' .. name,
|
||||||
|
{ bg = c.fg, fg = st.bg or '#191724', bold = true }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
derive_hl('StatusGit', { base = 'CursorLine', fg = 'Normal' })
|
||||||
|
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
|
||||||
|
derive_hl(
|
||||||
|
'StatusLspWorking',
|
||||||
|
{ base = 'StatusLine', fg = 'DiagnosticInfo' }
|
||||||
|
)
|
||||||
|
derive_hl('StatusLspReady', { base = 'StatusLine', fg = 'Constant' })
|
||||||
|
derive_hl('StatusLspNone', { base = 'StatusLine', fg = 'NonText' })
|
||||||
|
derive_hl(
|
||||||
|
'StatusDiagError',
|
||||||
|
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||||
|
)
|
||||||
|
derive_hl('StatusDiagWarn', { base = 'StatusLine', fg = 'DiagnosticWarn' })
|
||||||
|
derive_hl('StatusDiagHint', { base = 'StatusLine', fg = 'DiagnosticHint' })
|
||||||
|
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
|
||||||
|
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'DiagnosticOk' })
|
||||||
|
derive_hl(
|
||||||
|
'StatusGitRemoved',
|
||||||
|
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||||
|
)
|
||||||
|
derive_hl('StatusRecording', { base = 'StatusLine', fg = 'WarningMsg' })
|
||||||
|
end
|
||||||
|
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||||
|
callback = setup_statusline_highlights,
|
||||||
|
})
|
||||||
|
setup_statusline_highlights()
|
||||||
|
|
||||||
|
local modes = {
|
||||||
|
n = { ' NORM ', 'StatusModeNormal' },
|
||||||
|
i = { ' INS ', 'StatusModeInsert' },
|
||||||
|
v = { ' VIS ', 'StatusModeVisual' },
|
||||||
|
V = { ' V-LINE ', 'StatusModeVisual' },
|
||||||
|
['\22'] = { ' V-BLK ', 'StatusModeVisual' },
|
||||||
|
['\19'] = { ' V-BLK ', 'StatusModeVisual' },
|
||||||
|
s = { ' VIS ', 'StatusModeVisual' },
|
||||||
|
S = { ' V-LINE ', 'StatusModeVisual' },
|
||||||
|
R = { ' REPL ', 'StatusModeReplace' },
|
||||||
|
c = { ' CMD ', 'StatusModeCommand' },
|
||||||
|
r = { ' PROMPT ', 'StatusModeCommand' },
|
||||||
|
t = { ' TERM ', 'StatusModeTerminal' },
|
||||||
|
['!'] = { ' SHELL ', 'StatusModeCommand' },
|
||||||
|
}
|
||||||
|
|
||||||
|
local mode_statusline =
|
||||||
|
{ default = { '%#StatusModeNormal# ?? %*', 'StatusModeNormal' } }
|
||||||
|
for k, v in pairs(modes) do
|
||||||
|
mode_statusline[k] = { '%#' .. v[2] .. '#' .. v[1] .. '%*', v[2] }
|
||||||
|
end
|
||||||
|
|
||||||
|
local redraw_scheduled = false
|
||||||
|
local function schedule_redraw()
|
||||||
|
if redraw_scheduled then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
redraw_scheduled = true
|
||||||
|
vim.schedule(function()
|
||||||
|
redraw_scheduled = false
|
||||||
|
vim.cmd.redrawstatus()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function refresh_status(buf)
|
||||||
|
local b = vim.b[buf]
|
||||||
|
local l, r = '', ''
|
||||||
|
|
||||||
|
if b.git_branch and b.git_branch ~= '' then
|
||||||
|
l = l .. '%#StatusGit# ' .. b.git_branch .. ' %*'
|
||||||
|
end
|
||||||
|
if b.git_diff then
|
||||||
|
if b.git_diff.added > 0 then
|
||||||
|
l = l .. '%#StatusGitAdded# +' .. b.git_diff.added .. '%*'
|
||||||
|
end
|
||||||
|
if b.git_diff.removed > 0 then
|
||||||
|
l = l .. '%#StatusGitRemoved# -' .. b.git_diff.removed .. '%*'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if b.recording then
|
||||||
|
r = r .. '%#StatusRecording# ' .. b.recording .. ' %*'
|
||||||
|
end
|
||||||
|
if b.diag_str then
|
||||||
|
r = r .. b.diag_str
|
||||||
|
end
|
||||||
|
if b.lsp_icon and b.lsp_icon ~= '' then
|
||||||
|
r = r
|
||||||
|
.. '%#'
|
||||||
|
.. b.lsp_hl
|
||||||
|
.. '#'
|
||||||
|
.. b.lsp_icon
|
||||||
|
.. (b.lsp_name or '')
|
||||||
|
.. ' %*'
|
||||||
|
end
|
||||||
|
|
||||||
|
b.status_left, b.status_right = l, r
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp_states = {
|
||||||
|
none = { '', 'StatusLspNone' },
|
||||||
|
starting = { '', 'StatusLspNone' },
|
||||||
|
working = { ' ', 'StatusLspWorking' },
|
||||||
|
ready = { ' ', 'StatusLspReady' },
|
||||||
|
}
|
||||||
|
local active_progress = {}
|
||||||
|
|
||||||
|
local function refresh_lsp(buf)
|
||||||
|
local state, clients = 'ready', vim.lsp.get_clients({ bufnr = buf })
|
||||||
|
if #clients == 0 then
|
||||||
|
state, vim.b[buf].lsp_name = 'none', ''
|
||||||
|
else
|
||||||
|
local names = {}
|
||||||
|
for _, c in ipairs(clients) do
|
||||||
|
names[#names + 1] = c.name
|
||||||
|
local p = active_progress[c.id]
|
||||||
|
if p and p.is_starting and state ~= 'working' then
|
||||||
|
state = 'starting'
|
||||||
|
elseif p and next(p.tokens) then
|
||||||
|
state = 'working'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.b[buf].lsp_name = table.concat(names, '/')
|
||||||
|
end
|
||||||
|
if vim.b[buf].lsp_state == state then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
vim.b[buf].lsp_state = state
|
||||||
|
vim.b[buf].lsp_icon, vim.b[buf].lsp_hl =
|
||||||
|
lsp_states[state][1], lsp_states[state][2]
|
||||||
|
refresh_status(buf)
|
||||||
|
schedule_redraw()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, {
|
||||||
|
callback = function(ev)
|
||||||
|
local cid = ev.data.client_id
|
||||||
|
if ev.event == 'LspAttach' then
|
||||||
|
local p = active_progress[cid] or { tokens = {} }
|
||||||
|
active_progress[cid] = p
|
||||||
|
if not p.is_starting and not next(p.tokens) then
|
||||||
|
p.is_starting = true
|
||||||
|
p.timer_id = (p.timer_id or 0) + 1
|
||||||
|
local current_id = p.timer_id
|
||||||
|
vim.defer_fn(function()
|
||||||
|
local curr = active_progress[cid]
|
||||||
|
if
|
||||||
|
curr
|
||||||
|
and curr.is_starting
|
||||||
|
and curr.timer_id == current_id
|
||||||
|
then
|
||||||
|
curr.is_starting = nil
|
||||||
|
if vim.api.nvim_buf_is_valid(ev.buf) then
|
||||||
|
refresh_lsp(ev.buf)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, 500) -- 500ms grace period to wait for LspProgress
|
||||||
|
end
|
||||||
|
elseif ev.event == 'LspDetach' then
|
||||||
|
active_progress[cid] = nil
|
||||||
|
end
|
||||||
|
refresh_lsp(ev.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('LspProgress', {
|
||||||
|
callback = function(ev)
|
||||||
|
local cid = ev.data.client_id
|
||||||
|
local p = active_progress[cid] or { tokens = {} }
|
||||||
|
active_progress[cid] = p
|
||||||
|
|
||||||
|
if p.is_starting then
|
||||||
|
p.is_starting = nil
|
||||||
|
p.timer_id = (p.timer_id or 0) + 1 -- Invalidate pending start timer safely
|
||||||
|
end
|
||||||
|
|
||||||
|
local val = type(ev.data.params.value) == 'table'
|
||||||
|
and ev.data.params.value
|
||||||
|
or {}
|
||||||
|
local kind = val.kind or ev.match
|
||||||
|
local token = ev.data.params.token or 'fallback'
|
||||||
|
|
||||||
|
if kind == 'begin' or (kind == 'report' and val.percentage ~= 100) then
|
||||||
|
p.tokens[token] = true
|
||||||
|
elseif
|
||||||
|
kind == 'end' or (kind == 'report' and val.percentage == 100)
|
||||||
|
then
|
||||||
|
p.tokens[token] = nil
|
||||||
|
end
|
||||||
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
if client then
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win)
|
||||||
|
if client.attached_buffers[buf] then
|
||||||
|
refresh_lsp(buf)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local BRANCH_ICON = ' '
|
||||||
|
local branch_jobs = {}
|
||||||
|
local diff_jobs = {}
|
||||||
|
local git_root_cache = {}
|
||||||
|
local function get_git_root(buf, file)
|
||||||
|
local dir = vim.fs.dirname(file)
|
||||||
|
if git_root_cache[dir] ~= nil then
|
||||||
|
return git_root_cache[dir]
|
||||||
|
end
|
||||||
|
local root = vim.fs.root(buf, '.git') or dir
|
||||||
|
git_root_cache[dir] = root
|
||||||
|
return root
|
||||||
|
end
|
||||||
|
|
||||||
|
local function refresh_branch(buf)
|
||||||
|
local file = vim.api.nvim_buf_get_name(buf)
|
||||||
|
if file == '' or vim.bo[buf].buftype ~= '' then
|
||||||
|
vim.b[buf].git_branch = ''
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local cwd = get_git_root(buf, file)
|
||||||
|
|
||||||
|
if branch_jobs[buf] then
|
||||||
|
branch_jobs[buf]:kill(9)
|
||||||
|
end
|
||||||
|
|
||||||
|
branch_jobs[buf] = vim.system(
|
||||||
|
{ 'git', 'branch', '--show-current' },
|
||||||
|
{ text = true, cwd = cwd },
|
||||||
|
vim.schedule_wrap(function(out)
|
||||||
|
branch_jobs[buf] = nil
|
||||||
|
if not vim.api.nvim_buf_is_valid(buf) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local branch = (out.code == 0 and out.stdout or ''):gsub('%s+', '')
|
||||||
|
vim.b[buf].git_branch = branch ~= '' and (BRANCH_ICON .. branch)
|
||||||
|
or ''
|
||||||
|
refresh_status(buf)
|
||||||
|
schedule_redraw()
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function refresh_diff(buf, force)
|
||||||
|
local file = vim.api.nvim_buf_get_name(buf)
|
||||||
|
if file == '' or vim.bo[buf].buftype ~= '' then
|
||||||
|
vim.b[buf].git_diff = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if
|
||||||
|
not force
|
||||||
|
and vim.b[buf].git_diff_fetched
|
||||||
|
and not vim.bo[buf].modified
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local cwd = get_git_root(buf, file)
|
||||||
|
|
||||||
|
if diff_jobs[buf] then
|
||||||
|
diff_jobs[buf]:kill(9)
|
||||||
|
end
|
||||||
|
|
||||||
|
diff_jobs[buf] = vim.system(
|
||||||
|
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
|
||||||
|
{ text = true, cwd = cwd },
|
||||||
|
vim.schedule_wrap(function(out)
|
||||||
|
diff_jobs[buf] = nil
|
||||||
|
if not vim.api.nvim_buf_is_valid(buf) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
vim.b[buf].git_diff_fetched = true
|
||||||
|
if out.code ~= 0 or out.stdout == '' then
|
||||||
|
vim.b[buf].git_diff = nil
|
||||||
|
else
|
||||||
|
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
|
||||||
|
if added and removed then
|
||||||
|
vim.b[buf].git_diff = {
|
||||||
|
added = tonumber(added) or 0,
|
||||||
|
removed = tonumber(removed) or 0,
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vim.b[buf].git_diff = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
refresh_status(buf)
|
||||||
|
schedule_redraw()
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function refresh_diag(buf)
|
||||||
|
local c, s = vim.diagnostic.count(buf), vim.diagnostic.severity
|
||||||
|
local e, w, h = c[s.ERROR] or 0, c[s.WARN] or 0, c[s.HINT] or 0
|
||||||
|
vim.b[buf].diag_str = (e > 0 and '%#StatusDiagError# E' .. e .. ' %*' or '')
|
||||||
|
.. (w > 0 and '%#StatusDiagWarn# W' .. w .. ' %*' or '')
|
||||||
|
.. (h > 0 and '%#StatusDiagHint# H' .. h .. ' %*' or '')
|
||||||
|
refresh_status(buf)
|
||||||
|
schedule_redraw()
|
||||||
|
end
|
||||||
|
|
||||||
|
local grp = vim.api.nvim_create_augroup('StatuslineEvents', { clear = true })
|
||||||
|
local current_mode = 'n'
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('ModeChanged', {
|
||||||
|
group = grp,
|
||||||
|
pattern = '*:*',
|
||||||
|
callback = function()
|
||||||
|
current_mode = vim.api.nvim_get_mode().mode
|
||||||
|
schedule_redraw()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNewFile' }, {
|
||||||
|
group = grp,
|
||||||
|
callback = function(ev)
|
||||||
|
if vim.bo[ev.buf].buftype == '' then
|
||||||
|
refresh_branch(ev.buf)
|
||||||
|
refresh_diff(ev.buf, false)
|
||||||
|
end
|
||||||
|
refresh_lsp(ev.buf)
|
||||||
|
refresh_diag(ev.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FocusGained', {
|
||||||
|
group = grp,
|
||||||
|
callback = function()
|
||||||
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
if vim.bo[buf].buftype == '' then
|
||||||
|
refresh_branch(buf)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||||
|
group = grp,
|
||||||
|
callback = function(ev)
|
||||||
|
refresh_diff(ev.buf, true)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('DiagnosticChanged', {
|
||||||
|
group = grp,
|
||||||
|
callback = function(ev)
|
||||||
|
refresh_diag(ev.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'RecordingEnter', 'RecordingLeave' }, {
|
||||||
|
group = grp,
|
||||||
|
callback = function(ev)
|
||||||
|
if ev.event == 'RecordingEnter' then
|
||||||
|
vim.b[ev.buf].recording = 'Rec @' .. vim.fn.reg_recording()
|
||||||
|
else
|
||||||
|
vim.b[ev.buf].recording = nil
|
||||||
|
end
|
||||||
|
refresh_status(ev.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
function _G.__statusline()
|
||||||
|
local current_win = vim.api.nvim_get_current_win()
|
||||||
|
local win_id = vim.g.statusline_winid or current_win
|
||||||
|
local is_active = win_id == current_win
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win_id)
|
||||||
|
local b = vim.b[buf]
|
||||||
|
|
||||||
|
if not is_active then
|
||||||
|
return '%#StatusLineNC# '
|
||||||
|
.. (b.status_left or '')
|
||||||
|
.. '%='
|
||||||
|
.. (b.status_right or '')
|
||||||
|
.. ' %#StatusLineNC# %l:%-2c '
|
||||||
|
end
|
||||||
|
|
||||||
|
local m = current_mode
|
||||||
|
local key = (m == '\22' or m == '\19') and m or m:sub(1, 1)
|
||||||
|
local md = mode_statusline[key] or mode_statusline.default
|
||||||
|
|
||||||
|
return md[1]
|
||||||
|
.. (b.status_left or '')
|
||||||
|
.. '%='
|
||||||
|
.. (b.status_right or '')
|
||||||
|
.. '%#StatusCursor# %l:%-2c %#'
|
||||||
|
.. md[2]
|
||||||
|
.. '# %p%% %*'
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.o.statusline = '%!v:lua.__statusline()'
|
||||||
@@ -1,70 +1,90 @@
|
|||||||
{
|
{
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"blink.cmp": {
|
"blink.cmp": {
|
||||||
"rev": "451168851e8e2466bc97ee3e026c3dcb9141ce07",
|
"rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
|
||||||
"src": "https://github.com/saghen/blink.cmp",
|
"src": "https://github.com/saghen/blink.cmp",
|
||||||
"version": ">=0.0.0"
|
"version": ">=0.0.0"
|
||||||
},
|
},
|
||||||
"colorizer": {
|
|
||||||
"rev": "a065833f35a3a7cc3ef137ac88b5381da2ba302e",
|
|
||||||
"src": "https://github.com/norcalli/nvim-colorizer.lua"
|
|
||||||
},
|
|
||||||
"conform.nvim": {
|
"conform.nvim": {
|
||||||
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
|
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
||||||
"src": "https://github.com/stevearc/conform.nvim"
|
"src": "https://github.com/stevearc/conform.nvim"
|
||||||
},
|
},
|
||||||
"fzf-lua": {
|
"hardtime.nvim": {
|
||||||
"rev": "bde73a6886b607246095aa59f396de5e0d036890",
|
"rev": "721a75b9a0c2eb1fb811d34507708ee315cb04eb",
|
||||||
"src": "https://github.com/ibhagwan/fzf-lua"
|
"src": "https://github.com/m4xshen/hardtime.nvim"
|
||||||
|
},
|
||||||
|
"incline.nvim": {
|
||||||
|
"rev": "debd628e9395f7a9da57bdc31ce75ca6b40a880b",
|
||||||
|
"src": "https://github.com/b0o/incline.nvim"
|
||||||
|
},
|
||||||
|
"kanso.nvim": {
|
||||||
|
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
|
||||||
|
"src": "https://github.com/webhooked/kanso.nvim"
|
||||||
|
},
|
||||||
|
"live-preview.nvim": {
|
||||||
|
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
||||||
|
"src": "https://github.com/brianhuster/live-preview.nvim"
|
||||||
},
|
},
|
||||||
"mason-lspconfig.nvim": {
|
"mason-lspconfig.nvim": {
|
||||||
"rev": "38499e0bda64bc0f3ec6e7f03f8e13dd11c0fa00",
|
"rev": "b3298993d55fa194279b5eb9dbfb3a43da65cadf",
|
||||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||||
},
|
},
|
||||||
"mason.nvim": {
|
"mason.nvim": {
|
||||||
"rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65",
|
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||||
"src": "https://github.com/mason-org/mason.nvim"
|
"src": "https://github.com/mason-org/mason.nvim"
|
||||||
},
|
},
|
||||||
"mini.pairs": {
|
"mini.nvim": {
|
||||||
"rev": "d5a29b6254dad07757832db505ea5aeab9aad43a",
|
"rev": "1345d191bb3da9c7b0e977f4387c5761f9bff68d",
|
||||||
"src": "https://github.com/nvim-mini/mini.pairs",
|
"src": "https://github.com/nvim-mini/mini.nvim.git",
|
||||||
"version": ">=0.0.0"
|
"version": ">=0.0.0"
|
||||||
},
|
},
|
||||||
"nvim-colorizer.lua": {
|
"noice.nvim": {
|
||||||
"rev": "a065833f35a3a7cc3ef137ac88b5381da2ba302e",
|
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
|
||||||
"src": "https://github.com/norcalli/nvim-colorizer.lua"
|
"src": "https://github.com/folke/noice.nvim"
|
||||||
},
|
},
|
||||||
"nvim-highlight-colors": {
|
"nui.nvim": {
|
||||||
"rev": "e2cb22089cc2358b2b995c09578224f142de6039",
|
"rev": "10fc361835c856ba4233ef5ea135b919bf3dce97",
|
||||||
"src": "https://github.com/brenoprata10/nvim-highlight-colors"
|
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||||
},
|
},
|
||||||
"nvim-lspconfig": {
|
"nvim-lspconfig": {
|
||||||
"rev": "8e2084bf5e40c79c1f42210a6ef96a0a4793a763",
|
"rev": "910f0c4d46aa186641518395bc7e6fffb4d23baf",
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
|
"nvim-navic": {
|
||||||
|
"rev": "455808fd0fae06e6d70fadfd61432275db8f34ce",
|
||||||
|
"src": "https://github.com/SmiteshP/nvim-navic"
|
||||||
|
},
|
||||||
"nvim-tmux-navigation": {
|
"nvim-tmux-navigation": {
|
||||||
"rev": "4898c98702954439233fdaf764c39636681e2861",
|
"rev": "4898c98702954439233fdaf764c39636681e2861",
|
||||||
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
||||||
},
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
"rev": "7caec274fd19c12b55902a5b795100d21531391f",
|
"rev": "e289100ff98969e118c702199d88b764ce9e7fdf",
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
},
|
},
|
||||||
|
"nvim-ts-autotag": {
|
||||||
|
"rev": "d7220b55e16ed3c04e88086256def5d282429493",
|
||||||
|
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||||
|
},
|
||||||
"nvim-web-devicons": {
|
"nvim-web-devicons": {
|
||||||
"rev": "d7462543c9e366c0d196c7f67a945eaaf5d99414",
|
"rev": "58447c1fca354bbf184425e4a8d01deecbd6f3c4",
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
},
|
},
|
||||||
"polydev": {
|
"polydev": {
|
||||||
"rev": "8d41141e9ab68c271bb8bb2db5528bb0a61c78eb",
|
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
||||||
"src": "git@moo:dmm/polydev.git"
|
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
||||||
},
|
},
|
||||||
"rose-pine": {
|
"snacks.nvim": {
|
||||||
"rev": "cf2a288696b03d0934da713d66c6d71557b5c997",
|
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
|
||||||
"src": "https://github.com/rose-pine/neovim"
|
"src": "https://github.com/folke/snacks.nvim"
|
||||||
},
|
},
|
||||||
"undotree": {
|
"trouble.nvim": {
|
||||||
"rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d",
|
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
|
||||||
"src": "https://github.com/mbbill/undotree"
|
"src": "https://github.com/folke/trouble.nvim"
|
||||||
|
},
|
||||||
|
"vellum.nvim": {
|
||||||
|
"rev": "c9a8665c5d306bf56c6df89896fed8bfaf3110b3",
|
||||||
|
"src": "https://github.com/blackhat-7/vellum.nvim"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+9
-4
@@ -4,13 +4,18 @@ Host *
|
|||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
|
|
||||||
Host moo
|
Host moo
|
||||||
HostName git.local.moomancer.xyz
|
# HostName 192.168.5.16
|
||||||
|
HostName 100.78.144.113
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/id_ed25519 # Path to your private key
|
IdentityFile ~/.ssh/id_ed25519 # Path to your private key
|
||||||
|
|
||||||
Host oasis
|
Host oasis
|
||||||
HostName 100.90.3.48
|
HostName 100.78.144.113
|
||||||
User oasis
|
User andrew
|
||||||
Port 2222
|
Port 2222
|
||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
|
Ciphers aes128-gcm@openssh.com
|
||||||
|
Compression no
|
||||||
|
IPQoS throughput
|
||||||
|
ServerAliveInterval 15
|
||||||
|
ServerAliveCountMax 3
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Submodule tmux/.config/tmux/plugins/tpm updated: 99469c4a9b...e261deb1b4
@@ -6,34 +6,20 @@ set -g focus-events on
|
|||||||
set -ga terminal-features ',xterm-ghostty:RGB'
|
set -ga terminal-features ',xterm-ghostty:RGB'
|
||||||
set -as terminal-overrides ',xterm-ghostty:Tc'
|
set -as terminal-overrides ',xterm-ghostty:Tc'
|
||||||
set-option -g default-shell $SHELL
|
set-option -g default-shell $SHELL
|
||||||
# --- Visual Flair Enhancements ---
|
|
||||||
set -g status-position top
|
set -g status-position top
|
||||||
set -g status-justify left
|
set -g status-justify left
|
||||||
set -g status-style 'bg=default' # Makes the bar transparent/seamless
|
set -g status-style 'bg=default' # Completely transparent container
|
||||||
|
|
||||||
# Left Side: Minimal Session Name with a pill-style look
|
|
||||||
set -g status-left-length 100
|
set -g status-left-length 100
|
||||||
set -g status-left "#[fg=#31748f,bg=default,bold] #S #[fg=#444444,nobold]│ "
|
set -g status-left "#[fg=#090E13,bg=colour6,bold] #S "
|
||||||
|
|
||||||
# Right Side: Clean icons with no unnecessary labels
|
set -g status-right ""
|
||||||
set -g status-right-length 150
|
|
||||||
set -g status-right "#[fg=#c4a7e7] %m-%d #[fg=#444444]│ #[fg=#eb6f92] %H:%M "
|
|
||||||
|
|
||||||
# Window Status: The "Flare"
|
set -g window-status-current-format "#[fg=colour1,bg=default] #F#I:#W "
|
||||||
# Using a dot or a subtle block to indicate the active window
|
set -g window-status-format "#[fg=colour7,bg=default] #I:#W "
|
||||||
# set -g window-status-current-format "#[fg=#9ccfd8,bg=default,bold] ● #W"
|
|
||||||
# set -g window-status-format "#[fg=#6e6a86,bg=default] ○ #W"
|
|
||||||
set -g window-status-current-format "#[fg=#9ccfd8,bg=default,bold] #F#I:#W"
|
|
||||||
set -g window-status-format "#[fg=#6e6a86,bg=default] #I:#W"
|
|
||||||
|
|
||||||
# Message styling (Command mode)
|
set -g message-style 'fg=colour3 bg=default bold'
|
||||||
set -g message-style 'fg=#ebbcba bg=default bold'
|
|
||||||
# ---------------------------------
|
|
||||||
# set -g status-style 'fg=#9ccfd8 bg=#000000'
|
|
||||||
# set -g status-left-length 100
|
|
||||||
# set -g status-right-length 30
|
|
||||||
# set -g status-left "#[fg=#31748f, bold][#S]#[fg=#908caa,nobold] | "
|
|
||||||
# set -g status-right "#[fg=#c4a7e7] %m-%d-%Y #[fg=#eb6f92] %H:%M"
|
|
||||||
|
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
set -g pane-base-index 1
|
set -g pane-base-index 1
|
||||||
@@ -45,7 +31,6 @@ set -g status-position top
|
|||||||
|
|
||||||
bind-key h previous-window
|
bind-key h previous-window
|
||||||
bind-key l next-window
|
bind-key l next-window
|
||||||
bind -r f run-shell "tmux neww ~/.local/bin/tmux-windowizer"
|
|
||||||
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
||||||
bind-key z resize-pane -Z
|
bind-key z resize-pane -Z
|
||||||
bind -n C-h select-pane -L
|
bind -n C-h select-pane -L
|
||||||
|
|||||||
Executable
+62
@@ -0,0 +1,62 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# 1. Get active tmux sessions
|
||||||
|
sessions=$(tmux list-sessions -F "#S" 2>/dev/null)
|
||||||
|
|
||||||
|
# 2. Get directories from key work paths
|
||||||
|
dirs=$(find ~ ~/.config ~/Projects ~/dotfiles ~/personal \
|
||||||
|
-mindepth 1 -maxdepth 4 \
|
||||||
|
\( -name ".git" -o -name "node_modules" -o -name ".cache" -o -name "Library" \) -prune \
|
||||||
|
-o -type d -print 2>/dev/null)
|
||||||
|
|
||||||
|
# 3. Dynamic Previewer (Tree view for folders, Window list for sessions)
|
||||||
|
preview_cmd='
|
||||||
|
if [ -d {} ]; then
|
||||||
|
if command -v eza &>/dev/null; then
|
||||||
|
eza --tree --level=2 --icons --color=always {}
|
||||||
|
elif command -v tree &>/dev/null; then
|
||||||
|
tree -C -L 2 {}
|
||||||
|
else
|
||||||
|
ls -la --color=always {}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
tmux list-windows -t {} 2>/dev/null
|
||||||
|
fi'
|
||||||
|
|
||||||
|
# 4. Kanagawa Wave Themed FZF Selector
|
||||||
|
selected=$(printf "%s\n%s" "$sessions" "$dirs" | grep -v '^$' | fzf \
|
||||||
|
--layout=reverse \
|
||||||
|
--border=rounded \
|
||||||
|
--margin=1 \
|
||||||
|
--padding=1 \
|
||||||
|
--height=100% \
|
||||||
|
--prompt=" " \
|
||||||
|
--color="bg:#1F1F28,bg+:#223249,fg:#DCD7BA,fg+:#DCD7BA" \
|
||||||
|
--color="hl:#2D4F67,hl+:#7E9CD8,prompt:#957FB8,pointer:#7E9CD8" \
|
||||||
|
--color="info:#98BB6C,spinner:#957FB8,header:#7AA89F,border:#54546D" \
|
||||||
|
--color="marker:#98BB6C" \
|
||||||
|
--preview="$preview_cmd" \
|
||||||
|
--preview-window="right:55%:border-left")
|
||||||
|
|
||||||
|
# Exit if fzf was cancelled
|
||||||
|
[[ -z "$selected" ]] && exit 0
|
||||||
|
|
||||||
|
# 5. Handle Session Creation / Switching
|
||||||
|
if [[ -d "$selected" ]]; then
|
||||||
|
# Selection is a DIRECTORY -> Create session named after folder
|
||||||
|
session_name=$(basename "$selected" | tr '.: ' '_')
|
||||||
|
|
||||||
|
if ! tmux has-session -t "=$session_name" 2>/dev/null; then
|
||||||
|
tmux new-session -d -s "$session_name" -c "$selected"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Selection is an EXISTING SESSION -> Connect directly
|
||||||
|
session_name="$selected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Attach or Switch
|
||||||
|
if [[ -z "$TMUX" ]]; then
|
||||||
|
exec tmux attach-session -t "$session_name"
|
||||||
|
else
|
||||||
|
tmux switch-client -t "$session_name"
|
||||||
|
fi
|
||||||
+18
-33
@@ -1,14 +1,3 @@
|
|||||||
if [[ $(uname) != "Darwin" ]]; then
|
|
||||||
if [ -z "${WAYLAND_DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
|
||||||
XDG_CURRENT_DESKTOP=sway dbus-run-session sway
|
|
||||||
fi
|
|
||||||
bindkey "^[[1;5C" forward-word
|
|
||||||
bindkey "^[[1;5D" backward-word
|
|
||||||
bindkey "^[[3~" delete-char
|
|
||||||
bindkey "^[[5~" up-line
|
|
||||||
bindkey "^[[6~" down-line
|
|
||||||
fi
|
|
||||||
|
|
||||||
HISTFILE=~/.zsh_history
|
HISTFILE=~/.zsh_history
|
||||||
HISTSIZE=100
|
HISTSIZE=100
|
||||||
SAVEHIST=200
|
SAVEHIST=200
|
||||||
@@ -17,9 +6,7 @@ source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
|
|||||||
|
|
||||||
zinit light zsh-users/zsh-autosuggestions
|
zinit light zsh-users/zsh-autosuggestions
|
||||||
zinit light zdharma-continuum/fast-syntax-highlighting
|
zinit light zdharma-continuum/fast-syntax-highlighting
|
||||||
if [[ $(uname) == "Darwin" ]]; then
|
zinit light junegunn/fzf
|
||||||
zinit light junegunn/fzf
|
|
||||||
fi
|
|
||||||
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
eval "$(zoxide init --cmd cd zsh)"
|
eval "$(zoxide init --cmd cd zsh)"
|
||||||
@@ -30,28 +17,26 @@ autoload -Uz _zinit
|
|||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
alias cat="bat"
|
alias cat="bat"
|
||||||
alias rebuild="sudo darwin-rebuild switch --flake /etc/nix-darwin/#Andrews-MacBook-Air";
|
|
||||||
alias enix="nvim /etc/nix-darwin/flake.nix"
|
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
alias ls="eza -a"
|
alias ls="eza -a"
|
||||||
alias brew-update="brew update && brew upgrade && brew bundle --cleanup --zap --file=~/.Brewfile"
|
alias brew-update="brew update && brew upgrade && brew bundle --cleanup --zap --file=~/.Brewfile"
|
||||||
|
alias cmake-update="sudo rm -rd build && cmake -S . -B build && cmake --build build"
|
||||||
|
alias oasis="ssh oasis"
|
||||||
|
|
||||||
|
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -l man'"
|
||||||
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
export HOMEBREW_NO_ENV_HINTS=1
|
||||||
|
export HOMEBREW_DISPLAY_INSTALL_TIMES=0
|
||||||
|
export HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=1
|
||||||
|
export HOMEBREW_NO_EMOJI=1
|
||||||
|
|
||||||
|
# bun completions
|
||||||
|
[ -s "/Users/andrew/.bun/_bun" ] && source "/Users/andrew/.bun/_bun"
|
||||||
|
|
||||||
# alias grep="rg"
|
# bun
|
||||||
#
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
if [[ $(uname) != "Darwin" ]]; then
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
alias update_world='doas emerge --ask --update --newuse --deep @world'
|
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
|
||||||
alias env="sh /home/andrew/personal/dotfiles/env_linux.sh"
|
export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"
|
||||||
else
|
export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"
|
||||||
alias env='sh ~/personal/dotfiles/env_mac.sh'
|
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
|
||||||
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -l man'"
|
|
||||||
export GOOGLE_CLOUD_PROJECT="development-477121"
|
|
||||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
|
||||||
export HOMEBREW_NO_ENV_HINTS=1
|
|
||||||
export HOMEBREW_DISPLAY_INSTALL_TIMES=0
|
|
||||||
export HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=1
|
|
||||||
export HOMEBREW_NO_EMOJI=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
### End of Zinit's installer chunk
|
|
||||||
|
|||||||
Reference in New Issue
Block a user