Compare commits
10
Commits
xcode
..
11f21ffaab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11f21ffaab | ||
|
|
ecb6f9329a | ||
|
|
2215365e05 | ||
|
|
6bfddba4e1 | ||
|
|
bc3f6d4a06 | ||
|
|
2dc0392bf9 | ||
|
|
295aa41395 | ||
|
|
86d6e13813 | ||
|
|
9fefc102c9 | ||
|
|
602aa05e5c |
+8
-20
@@ -1,16 +1,9 @@
|
||||
cask "ghostty"
|
||||
# cask "localsend"
|
||||
cask "tailscale-app"
|
||||
# cask "zen"
|
||||
cask "autodesk-fusion"
|
||||
cask "logi-options+"
|
||||
cask "font-jetbrains-mono-nerd-font"
|
||||
# cask "utm"
|
||||
cask "bitwarden"
|
||||
# cask "modrinth"
|
||||
# cask "vlc"
|
||||
cask "prismlauncher"
|
||||
cask "google-chrome"
|
||||
cask "tailscale-app"
|
||||
|
||||
brew "mole"
|
||||
brew "ripgrep"
|
||||
brew "neovim"
|
||||
brew "tree-sitter" # dep to neovim
|
||||
@@ -19,22 +12,17 @@ brew "eza"
|
||||
brew "starship"
|
||||
brew "tmux"
|
||||
brew "bat"
|
||||
brew "python"
|
||||
brew "cmake"
|
||||
brew "fd"
|
||||
brew "fzf"
|
||||
brew "git"
|
||||
brew "zoxide"
|
||||
brew "stow"
|
||||
brew "mosh"
|
||||
brew "go"
|
||||
# brew "jpeg-turbo"
|
||||
brew "jpeg-turbo"
|
||||
brew "pkgconfig"
|
||||
brew "npm"
|
||||
brew "go"
|
||||
brew "wget"
|
||||
brew "opencode"
|
||||
brew "xcp"
|
||||
brew "xcbeautify"
|
||||
brew "pipx"
|
||||
brew "jq"
|
||||
brew "coreutils"
|
||||
brew "xcode-build-server"
|
||||
# brew "podman"
|
||||
brew "ruby"
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
font-size = 14
|
||||
theme = "rose-pine-default"
|
||||
macos-titlebar-style = tabs
|
||||
theme = "/Users/andrew/.config/ghostty/themes/kanso-zen"
|
||||
font-family = "JetBrainsMono Nerd Font Medium"
|
||||
font-thicken = true
|
||||
font-thicken-strength = 10
|
||||
font-size = 14
|
||||
|
||||
background = 000000
|
||||
# background-opacity = 0.85
|
||||
# background-blur = true
|
||||
macos-titlebar-style = transparent
|
||||
macos-titlebar-proxy-icon = hidden
|
||||
title = " "
|
||||
background-opacity = 0.92
|
||||
background-blur = 64
|
||||
confirm-close-surface = false
|
||||
window-padding-x = 6
|
||||
window-padding-y = 6
|
||||
window-padding-x = 15
|
||||
window-padding-y = 15
|
||||
mouse-hide-while-typing = true
|
||||
adjust-cell-height = 5%
|
||||
adjust-cell-width = -5%
|
||||
alpha-blending = linear-corrected
|
||||
bold-is-bright = 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
|
||||
+4
-4
@@ -13,10 +13,10 @@ if ! command -v brew &> /dev/null; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
echo "Installing Cargo"
|
||||
curl https://sh.rustup.rs -sSf | sh
|
||||
fi
|
||||
# if ! command -v cargo &> /dev/null; then
|
||||
# echo "Installing Cargo"
|
||||
# curl https://sh.rustup.rs -sSf | sh
|
||||
# fi
|
||||
if ! command -v zinit &> /dev/null; then
|
||||
echo "Installing zinit"
|
||||
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+25
-373
@@ -1,376 +1,28 @@
|
||||
--- Options
|
||||
require('DarthMooMancer.plugins')
|
||||
require('DarthMooMancer.opts')
|
||||
require('DarthMooMancer.colors')
|
||||
require('DarthMooMancer.keymaps')
|
||||
require('DarthMooMancer.ui')
|
||||
require('DarthMooMancer.lsp')
|
||||
require('DarthMooMancer.tools')
|
||||
|
||||
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 = 4
|
||||
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
|
||||
vim.opt.showmode = false
|
||||
vim.opt.cmdheight = 0
|
||||
vim.opt.smoothscroll = 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.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,
|
||||
})
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
||||
{ src = "https://github.com/brenoprata10/nvim-highlight-colors" },
|
||||
{ src = "https://github.com/mbbill/undotree" },
|
||||
{ src = "https://github.com/nvim-mini/mini.pairs", version = vim.version.range('*') },
|
||||
{ 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" },
|
||||
{ src = "https://github.com/b0o/incline.nvim" },
|
||||
{ src = "https://github.com/windwp/nvim-ts-autotag" },
|
||||
{ src = "https://github.com/folke/which-key.nvim" },
|
||||
|
||||
--- XCode Plugins
|
||||
{ src = "https://github.com/MunifTanjim/nui.nvim" },
|
||||
{ src = "https://github.com/mfussenegger/nvim-dap" },
|
||||
{ src = "https://github.com/rcarriga/nvim-dap-ui" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||
{ src = "https://github.com/nvim-neo-tree/neo-tree.nvim" },
|
||||
{ src = "https://github.com/wojciech-kulik/xcodebuild.nvim" },
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||
{ src = "https://github.com/folke/noice.nvim" },
|
||||
{ src = "https://github.com/folke/snacks.nvim" },
|
||||
})
|
||||
|
||||
--- 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 })
|
||||
|
||||
|
||||
local function xcodebuild_device()
|
||||
if not vim.g.xcodebuild_platform then return " macOS" end
|
||||
|
||||
if vim.g.xcodebuild_platform == "macOS" then
|
||||
return " macOS"
|
||||
end
|
||||
|
||||
local deviceIcon = ""
|
||||
if vim.g.xcodebuild_platform:match("watch") then
|
||||
deviceIcon = ""
|
||||
elseif vim.g.xcodebuild_platform:match("tv") then
|
||||
deviceIcon = " "
|
||||
elseif vim.g.xcodebuild_platform:match("vision") then
|
||||
deviceIcon = " "
|
||||
end
|
||||
|
||||
if vim.g.xcodebuild_os then
|
||||
return deviceIcon .. " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
|
||||
end
|
||||
|
||||
return deviceIcon .. " " .. (vim.g.xcodebuild_device_name or "Unknown")
|
||||
end
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'auto', -- Or try 'catppuccin' if you use it
|
||||
component_separators = '|',
|
||||
section_separators = { left = '', right = '' },
|
||||
globalstatus = true, -- Crucial for clean look with cmdheight=0
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } },
|
||||
lualine_b = { 'filename', 'branch' },
|
||||
lualine_c = { 'diff', 'diagnostics' },
|
||||
lualine_x = {
|
||||
{
|
||||
function() return ' ' .. (vim.g.xcodebuild_last_status or "Idle") end,
|
||||
color = { fg = "Gray" }
|
||||
},
|
||||
{
|
||||
function() return ' ' .. (vim.g.xcodebuild_test_plan or "No Plan") end,
|
||||
color = { fg = "#a6e3a1" }
|
||||
},
|
||||
{
|
||||
xcodebuild_device,
|
||||
color = { fg = "#f9e2af" }
|
||||
},
|
||||
},
|
||||
lualine_y = { 'filetype', 'progress' },
|
||||
lualine_z = { { 'location', separator = { right = '' }, left_padding = 2 } },
|
||||
},
|
||||
})
|
||||
require("snacks").setup({
|
||||
image = { enabled = true },
|
||||
})
|
||||
require('which-key').setup({
|
||||
preset = "helix"
|
||||
})
|
||||
vim.schedule(function()
|
||||
-- Mason & LSP
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "vtsls", "lua_ls", "pylsp", "gopls", "html", "tailwindcss", "bashls", },
|
||||
automatic_enable = true,
|
||||
})
|
||||
|
||||
-- Noice & Xcodebuild
|
||||
require("xcodebuild").setup()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
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
|
||||
},
|
||||
})
|
||||
|
||||
-- Blink & Fzf
|
||||
require("blink.cmp").setup({
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
columns = { { "label", gap = 1 }, { "kind_icon", gap = 1, "kind" } },
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("fzf-lua").setup({
|
||||
winopts = {
|
||||
height = 0.50,
|
||||
width = 0.45,
|
||||
-- row = 0.35,
|
||||
-- col = 0.50,
|
||||
border = "rounded",
|
||||
-- backdrop = 100,
|
||||
-- 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",
|
||||
},
|
||||
})
|
||||
|
||||
-- Treesitter
|
||||
require('nvim-treesitter').install { 'swift', 'rust', 'c', 'cpp', 'lua', 'javascript', 'go', 'typescript', 'css', 'html', 'python' }
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'c', 'cpp', 'rust', 'lua', 'typescript', 'javascript', 'css', 'html', 'python', 'go', 'swift' },
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
end)
|
||||
|
||||
--- Configurations
|
||||
local helpers = require 'incline.helpers'
|
||||
local devicons = require 'nvim-web-devicons'
|
||||
require('incline').setup {
|
||||
window = {
|
||||
padding = 0,
|
||||
margin = { horizontal = 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
|
||||
return {
|
||||
ft_icon and { ' ', ft_icon, ' ', guibg = ft_color, guifg = helpers.contrast_color(ft_color) } or
|
||||
'',
|
||||
' ',
|
||||
{ filename, gui = modified and 'bold,italic' or 'bold' },
|
||||
' ',
|
||||
guibg = '#44406e',
|
||||
}
|
||||
end,
|
||||
}
|
||||
require 'nvim-tmux-navigation'.setup {
|
||||
disable_when_zoomed = true -- defaults to false
|
||||
}
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
rust = { "rustfmt", lsp_format = "fallback" },
|
||||
lua = { "emmylua-codeformat", lsp_format = "fallback" },
|
||||
javascript = { "prettier", stop_after_first = true },
|
||||
typescript = { "prettier", stop_after_first = true },
|
||||
json = { "prettier" },
|
||||
html = { "prettier" },
|
||||
go = { "goimports" },
|
||||
c = { "lsp" },
|
||||
cpp = { "lsp" },
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
})
|
||||
|
||||
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 </
|
||||
},
|
||||
})
|
||||
require('nvim-highlight-colors').turnOn()
|
||||
require("Polydev").setup()
|
||||
require('mini.pairs').setup()
|
||||
|
||||
--- 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.config("vtsls", {
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = {
|
||||
parameterNames = { enabled = "all" },
|
||||
variableTypes = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer", "vtsls", "tailwindcss-language-server",
|
||||
"vscode-html-language-server", "gopls", "xcode-build-server", "sourcekit" })
|
||||
|
||||
--- 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>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>', ":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 })
|
||||
vim.keymap.set("n", "<leader>nn", ":Neotree toggle<CR>")
|
||||
vim.keymap.set("n", "<leader>X", "<cmd>XcodebuildPicker<cr>", { desc = "Show Xcodebuild Actions" })
|
||||
vim.keymap.set("n", "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", { desc = "Show Project Manager Actions" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xb", "<cmd>XcodebuildBuild<cr>", { desc = "Build Project" })
|
||||
vim.keymap.set("n", "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", { desc = "Build For Testing" })
|
||||
vim.keymap.set("n", "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", { desc = "Build & Run Project" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xt", "<cmd>XcodebuildTest<cr>", { desc = "Run Tests" })
|
||||
vim.keymap.set("v", "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", { desc = "Run Selected Tests" })
|
||||
vim.keymap.set("n", "<leader>xT", "<cmd>XcodebuildTestClass<cr>", { desc = "Run Current Test Class" })
|
||||
vim.keymap.set("n", "<leader>x.", "<cmd>XcodebuildTestRepeat<cr>", { desc = "Repeat Last Test Run" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", { desc = "Toggle Xcodebuild Logs" })
|
||||
vim.keymap.set("n", "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", { desc = "Toggle Code Coverage" })
|
||||
vim.keymap.set("n", "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", { desc = "Show Code Coverage Report" })
|
||||
vim.keymap.set("n", "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", { desc = "Toggle Test Explorer" })
|
||||
vim.keymap.set("n", "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", { desc = "Show Failing Snapshots" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xp", "<cmd>XcodebuildPreviewGenerateAndShow<cr>", { desc = "Generate Preview" })
|
||||
vim.keymap.set("n", "<leader>x<cr>", "<cmd>XcodebuildPreviewToggle<cr>", { desc = "Toggle Preview" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", { desc = "Select Device" })
|
||||
vim.keymap.set("n", "<leader>xq", "<cmd>Telescope quickfix<cr>", { desc = "Show QuickFix List" })
|
||||
|
||||
vim.keymap.set("n", "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", { desc = "Quickfix Line" })
|
||||
vim.keymap.set("n", "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", { desc = "Show Code Actions" })
|
||||
|
||||
@@ -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,25 @@
|
||||
require('kanso').setup({
|
||||
transparent = true,
|
||||
-- foreground = {
|
||||
-- dark = "saturated", -- Use default colors in dark mode
|
||||
-- },
|
||||
overrides = function(colors)
|
||||
local theme = colors.theme
|
||||
return {
|
||||
Normal = { bg = "none" },
|
||||
NormalFloat = { bg = "none" },
|
||||
FloatBorder = { bg = "none" },
|
||||
FloatTitle = { bg = "none" },
|
||||
TelescopeBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopePromptBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopeResultsBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopePreviewBorder = { fg = theme.ui.special, bg = "none" },
|
||||
NotifyBackground = { bg = "none" },
|
||||
NotifyBorder = { fg = theme.ui.special, bg = "none" },
|
||||
NotifyBody = { fg = theme.ui.fg, bg = "none" },
|
||||
NotifyTitle = { fg = theme.ui.special, bg = "none" },
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme('kanso-zen')
|
||||
@@ -0,0 +1,68 @@
|
||||
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]])
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader><leader>',
|
||||
builtin.find_files,
|
||||
{ desc = 'Telescope find files' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fh',
|
||||
builtin.help_tags,
|
||||
{ desc = 'Telescope help tags' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fg',
|
||||
builtin.live_grep,
|
||||
{ desc = 'Telescope live grep' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fm',
|
||||
builtin.man_pages,
|
||||
{ desc = 'Telescope man_pages' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>xn',
|
||||
':Telescope notify<CR>',
|
||||
{ desc = 'Telescope notify' }
|
||||
)
|
||||
|
||||
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', '<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', ':ZenMode<cr>')
|
||||
local dropbar_api = require("dropbar.api")
|
||||
vim.keymap.set("n", "<Leader>;", dropbar_api.pick, { desc = "Pick symbols in winbar" })
|
||||
vim.keymap.set("n", "[;", dropbar_api.goto_context_start, { desc = "Go to start of current context" })
|
||||
vim.keymap.set("n", "];", dropbar_api.select_next_context, { desc = "Select next context" })
|
||||
@@ -0,0 +1,90 @@
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'vtsls',
|
||||
'lua_ls',
|
||||
'pylsp',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
'bashls',
|
||||
},
|
||||
automatic_enable = false,
|
||||
})
|
||||
|
||||
require('nvim-treesitter').install({
|
||||
'rust',
|
||||
'c',
|
||||
'cpp',
|
||||
'lua',
|
||||
'javascript',
|
||||
'go',
|
||||
'typescript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'yaml',
|
||||
})
|
||||
|
||||
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',
|
||||
},
|
||||
})
|
||||
|
||||
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,65 @@
|
||||
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.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 = 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"
|
||||
@@ -0,0 +1,43 @@
|
||||
vim.pack.add({
|
||||
-- Themes
|
||||
{ src = 'https://github.com/webhooked/kanso.nvim' },
|
||||
|
||||
-- The rest
|
||||
{ src = 'https://github.com/mbbill/undotree' },
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.pairs',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.hipatterns',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||
{ src = 'https://github.com/nvim-telescope/telescope.nvim' },
|
||||
{
|
||||
src = 'https://github.com/saghen/blink.cmp',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'https://git.moomancer.xyz/DarthMooMancer/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' },
|
||||
{ src = 'https://github.com/b0o/incline.nvim' },
|
||||
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
|
||||
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
|
||||
{ src = 'https://github.com/folke/noice.nvim' },
|
||||
-- { src = 'https://github.com/stevearc/dressing.nvim' },
|
||||
{ src = 'https://github.com/rcarriga/nvim-notify' },
|
||||
{ src = 'https://github.com/folke/trouble.nvim' },
|
||||
{ src = 'https://github.com/brianhuster/live-preview.nvim' },
|
||||
{ src = 'https://github.com/m4xshen/hardtime.nvim' },
|
||||
{ src = 'https://github.com/Bekaboo/dropbar.nvim' },
|
||||
{ src = 'https://github.com/folke/zen-mode.nvim' },
|
||||
})
|
||||
@@ -0,0 +1,87 @@
|
||||
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('nvim-tmux-navigation').setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
-- require("zen-mode").toggle({
|
||||
-- })
|
||||
|
||||
require('blink.cmp').setup({
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 100,
|
||||
window = {
|
||||
winhighlight = 'Normal:NormalFloat,FloatBorder:TelescopeBorder,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:TelescopeBorder,PmenuSel:TelescopeSelection,CursorLine:TelescopeSelection,Search:None',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('Polydev').setup()
|
||||
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 </
|
||||
},
|
||||
})
|
||||
|
||||
require('trouble').setup({})
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
prompt_prefix = " ", -- Changes the search icon/prompt prefix
|
||||
selection_caret = " ", -- Changes the arrow/caret next to the selected item
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = 'top',
|
||||
prompt_min_width = 40,
|
||||
prompt_max_width = 80,
|
||||
preview_width = 80,
|
||||
},
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
preview = {
|
||||
hide_on_startup = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("hardtime").setup()
|
||||
@@ -0,0 +1,328 @@
|
||||
--- Derive a highlight from an existing scheme group.
|
||||
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
|
||||
--- Derive a mode highlight where bg comes from a syntax group and fg contrasts.
|
||||
local function derive_mode_hl(name, color_group)
|
||||
local color = vim.api.nvim_get_hl(0, { name = color_group })
|
||||
local status_bg = vim.api.nvim_get_hl(0, { name = 'StatusLine' })
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
bg = color.fg,
|
||||
fg = status_bg.bg or '#191724',
|
||||
bold = true,
|
||||
})
|
||||
end
|
||||
|
||||
--- (Re)build all statusline highlight groups from current scheme.
|
||||
local function setup_statusline_highlights()
|
||||
derive_mode_hl('StatusModeNormal', 'Type')
|
||||
derive_mode_hl('StatusModeInsert', 'String')
|
||||
derive_mode_hl('StatusModeVisual', 'Statement')
|
||||
derive_mode_hl('StatusModeCommand', 'PreProc')
|
||||
derive_mode_hl('StatusModeReplace', 'WarningMsg')
|
||||
derive_mode_hl('StatusModeTerminal', 'Special')
|
||||
derive_hl('StatusGit', { base = 'CursorLine', fg = 'LineNr' })
|
||||
derive_hl('StatusLsp', { base = 'StatusLine', fg = 'DiagnosticInfo' })
|
||||
derive_hl('StatusLspSpinner', { base = 'StatusLine', fg = 'Constant' })
|
||||
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 = 'OkMsg' })
|
||||
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'MoreMsg' })
|
||||
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()
|
||||
|
||||
--- Mode text mapping.
|
||||
local mode_map = {
|
||||
['n'] = ' NORM ',
|
||||
['i'] = ' INS ',
|
||||
['v'] = ' VIS ',
|
||||
['V'] = ' V-LINE ',
|
||||
[''] = ' V-BLK ',
|
||||
['R'] = ' REPL ',
|
||||
['c'] = ' CMD ',
|
||||
['t'] = ' TERM ',
|
||||
}
|
||||
local mode_hl_map = {
|
||||
['n'] = 'StatusModeNormal',
|
||||
['i'] = 'StatusModeInsert',
|
||||
['v'] = 'StatusModeVisual',
|
||||
['V'] = 'StatusModeVisual',
|
||||
[''] = 'StatusModeVisual',
|
||||
['R'] = 'StatusModeReplace',
|
||||
['c'] = 'StatusModeCommand',
|
||||
['t'] = 'StatusModeTerminal',
|
||||
}
|
||||
|
||||
--- Git branch (async, cached per buffer, refreshed every 5s)
|
||||
local function update_git_branch()
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'branch', '--show-current' },
|
||||
{ text = true },
|
||||
function(out)
|
||||
vim.b.git_branch = (out.code == 0 and out.stdout or ''):gsub(
|
||||
'%s+',
|
||||
''
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
vim.uv.new_timer():start(5000, 5000, vim.schedule_wrap(update_git_branch))
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained' }, {
|
||||
callback = function()
|
||||
update_git_branch()
|
||||
end,
|
||||
})
|
||||
|
||||
--- LSP progress (Neovim 0.10+ built-in handler)
|
||||
local progress = {}
|
||||
local spinner_frames =
|
||||
{ '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' }
|
||||
|
||||
local frame = 0
|
||||
--- Clean stale progress messages periodically
|
||||
local progress_timer = vim.uv.new_timer()
|
||||
local function start_progress_timer()
|
||||
if not progress_timer:is_active() then
|
||||
progress_timer:start(0, 200, function()
|
||||
local now = vim.loop.now()
|
||||
for k, v in pairs(progress) do
|
||||
local ttl = v.done and 2000 or 10000
|
||||
if now - v.t > ttl then
|
||||
progress[k] = nil
|
||||
end
|
||||
end
|
||||
if next(progress) then
|
||||
frame = (frame % #spinner_frames) + 1
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
else
|
||||
progress_timer:stop()
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('LspProgress', {
|
||||
callback = function(ev)
|
||||
local d = ev.data
|
||||
if not d then
|
||||
return
|
||||
end
|
||||
local params = d.params
|
||||
if not params or not params.token then
|
||||
return
|
||||
end
|
||||
local key = d.client_id .. ':' .. tostring(params.token)
|
||||
local value = params.value or {}
|
||||
if value.kind == 'begin' then
|
||||
progress[key] = {
|
||||
msg = (value.message or 'working...'):gsub('%%', '%%%%'),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
start_progress_timer()
|
||||
elseif value.kind == 'report' then
|
||||
local msg_parts = {}
|
||||
if value.message then
|
||||
msg_parts[#msg_parts + 1] = value.message
|
||||
end
|
||||
if value.percentage ~= nil then
|
||||
msg_parts[#msg_parts + 1] = '(' .. value.percentage .. '%%)'
|
||||
end
|
||||
progress[key] = {
|
||||
msg = table.concat(msg_parts, ' '),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
elseif value.kind == 'end' then
|
||||
if progress[key] then
|
||||
progress[key].done = true
|
||||
end
|
||||
vim.cmd('redrawstatus')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, {
|
||||
callback = function(args)
|
||||
local names = {}
|
||||
for _, c in ipairs(vim.lsp.get_clients({ bufnr = args.buf })) do
|
||||
table.insert(names, c.name)
|
||||
end
|
||||
vim.b[args.buf].lsp_names = #names > 0
|
||||
and (' ● ' .. table.concat(names, ', ') .. ' ')
|
||||
or ''
|
||||
end,
|
||||
})
|
||||
|
||||
local function lsp_section()
|
||||
local client_ids = {}
|
||||
for _, c in
|
||||
ipairs(vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() }))
|
||||
do
|
||||
client_ids[c.id] = true
|
||||
end
|
||||
local latest = nil
|
||||
for key, p in pairs(progress) do
|
||||
local cid = tonumber(key:match('^(%d+):'))
|
||||
if cid and client_ids[cid] then
|
||||
if not latest or p.t > latest.t then
|
||||
latest = p
|
||||
end
|
||||
end
|
||||
end
|
||||
if latest and (not latest.done or (vim.loop.now() - latest.t < 2000)) then
|
||||
return '%#StatusLspSpinner# ○ ' .. latest.msg .. ' %*'
|
||||
end
|
||||
return '%#StatusLsp#' .. (vim.b.lsp_names or '') .. '%*'
|
||||
end
|
||||
|
||||
local diag_cache = {}
|
||||
local function build_diag_string(counts)
|
||||
local parts = {}
|
||||
if counts[1] and counts[1] > 0 then
|
||||
table.insert(parts, '%#StatusDiagError# E' .. counts[1] .. ' %*')
|
||||
end
|
||||
if counts[2] and counts[2] > 0 then
|
||||
table.insert(parts, '%#StatusDiagWarn# W' .. counts[2] .. ' %*')
|
||||
end
|
||||
if counts[4] and counts[4] > 0 then
|
||||
table.insert(parts, '%#StatusDiagHint# H' .. counts[4] .. ' %*')
|
||||
end
|
||||
return table.concat(parts)
|
||||
end
|
||||
|
||||
local function update_diag_cache(ev)
|
||||
diag_cache[ev.buf] = build_diag_string(vim.diagnostic.count(ev.buf))
|
||||
end
|
||||
vim.api.nvim_create_autocmd(
|
||||
'DiagnosticChanged',
|
||||
{ callback = update_diag_cache }
|
||||
)
|
||||
|
||||
local function update_git_diff()
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
local file = vim.fn.expand('%:p')
|
||||
if file == '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
|
||||
{ text = true },
|
||||
function(out)
|
||||
if out.code ~= 0 or out.stdout == '' then
|
||||
vim.b.git_diff = nil
|
||||
return
|
||||
end
|
||||
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
|
||||
vim.b.git_diff = {
|
||||
added = tonumber(added) or 0,
|
||||
removed = tonumber(removed) or 0,
|
||||
}
|
||||
end
|
||||
)
|
||||
end
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained', 'BufWritePost' }, {
|
||||
callback = update_git_diff,
|
||||
})
|
||||
|
||||
function _G.__statusline()
|
||||
local m = vim.fn.mode()
|
||||
local mode_hl = mode_hl_map[m] or 'StatusModeNormal'
|
||||
local git = vim.b.git_branch or ''
|
||||
local cur_buf = vim.api.nvim_get_current_buf()
|
||||
local parts = {
|
||||
'%#' .. mode_hl .. '#' .. (mode_map[m] or ' ?? ') .. '%*',
|
||||
git ~= '' and ('%#StatusGit# ' .. git .. ' %*') or '',
|
||||
}
|
||||
local diff = vim.b.git_diff
|
||||
if diff and (diff.added > 0 or diff.removed > 0) then
|
||||
if diff.added > 0 then
|
||||
table.insert(parts, '%#StatusGitAdded# +' .. diff.added .. ' %*')
|
||||
end
|
||||
if diff.removed > 0 then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusGitRemoved# -' .. diff.removed .. ' %*'
|
||||
)
|
||||
end
|
||||
end
|
||||
table.insert(parts, lsp_section())
|
||||
table.insert(parts, '%=')
|
||||
local recording = vim.fn.reg_recording()
|
||||
if recording ~= '' then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusRecording# ● Rec @' .. recording .. ' %*'
|
||||
)
|
||||
end
|
||||
table.insert(
|
||||
parts,
|
||||
diag_cache[cur_buf] or build_diag_string(vim.diagnostic.count(cur_buf))
|
||||
)
|
||||
table.insert(parts, '%#StatusCursor# %l:%-2c %*')
|
||||
table.insert(parts, '%#' .. mode_hl .. '# %p%% %*')
|
||||
return table.concat(parts)
|
||||
end
|
||||
|
||||
vim.o.statusline = '%!v:lua.__statusline()'
|
||||
|
||||
require('incline').setup({
|
||||
window = { margin = { vertical = 0, horizontal = 1 } },
|
||||
hide = { cursorline = true },
|
||||
render = function(props)
|
||||
local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
|
||||
if vim.bo[props.buf].modified then
|
||||
filename = "[+] " .. filename
|
||||
end
|
||||
|
||||
local icon, color = require("nvim-web-devicons").get_icon_color(filename)
|
||||
return { { icon, guifg = color }, { " " }, { filename } }
|
||||
end,
|
||||
})
|
||||
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
|
||||
},
|
||||
})
|
||||
require('notify').setup({
|
||||
background_colour = '#000000',
|
||||
})
|
||||
@@ -5,89 +5,70 @@
|
||||
"src": "https://github.com/saghen/blink.cmp",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"colorizer": {
|
||||
"rev": "a065833f35a3a7cc3ef137ac88b5381da2ba302e",
|
||||
"src": "https://github.com/norcalli/nvim-colorizer.lua"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "dca1a190aa85f9065979ef35802fb77131911106",
|
||||
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"fzf-lua": {
|
||||
"rev": "17e3507b788699776ba6d2f8dd101ec177f37a96",
|
||||
"src": "https://github.com/ibhagwan/fzf-lua"
|
||||
"dropbar.nvim": {
|
||||
"rev": "808ba31cde89aec8833e9789f5e04557cd31c9e1",
|
||||
"src": "https://github.com/Bekaboo/dropbar.nvim"
|
||||
},
|
||||
"hardtime.nvim": {
|
||||
"rev": "5165840fe680eab46de1fc6dbff48f148fdcf018",
|
||||
"src": "https://github.com/m4xshen/hardtime.nvim"
|
||||
},
|
||||
"incline.nvim": {
|
||||
"rev": "8b54c59bcb23366645ae10edca6edfb9d3a0853e",
|
||||
"rev": "debd628e9395f7a9da57bdc31ce75ca6b40a880b",
|
||||
"src": "https://github.com/b0o/incline.nvim"
|
||||
},
|
||||
"lackluster.nvim": {
|
||||
"rev": "70dd682e564784893b984deb51dd5ddd263c8cc7",
|
||||
"src": "https://github.com/slugbyte/lackluster.nvim"
|
||||
"kanso.nvim": {
|
||||
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
|
||||
"src": "https://github.com/webhooked/kanso.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "131a558e13f9f28b15cd235557150ccb23f89286",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
"live-preview.nvim": {
|
||||
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
||||
"src": "https://github.com/brianhuster/live-preview.nvim"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "0c2823e0418f3d9230ff8b201c976e84de1cb401",
|
||||
"rev": "b5576cd62899a1a478d0e67ef3d378ee55dba82d",
|
||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "cb8445f8ce85d957416c106b780efd51c6298f89",
|
||||
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"mini.pairs": {
|
||||
"rev": "d5a29b6254dad07757832db505ea5aeab9aad43a",
|
||||
"src": "https://github.com/nvim-mini/mini.pairs",
|
||||
"mini.hipatterns": {
|
||||
"rev": "607d604e650cdf21d71f863d040c496a1d0cb320",
|
||||
"src": "https://github.com/nvim-mini/mini.hipatterns",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"muted.nvim": {
|
||||
"rev": "6967424df29fecf248f58a5a597b9ec94cc8b36a",
|
||||
"src": "https://github.com/pisgahk/muted.nvim"
|
||||
},
|
||||
"neo-tree.nvim": {
|
||||
"rev": "ff84e6e1608b24773f1b73cd4182e0bcf2b3d637",
|
||||
"src": "https://github.com/nvim-neo-tree/neo-tree.nvim"
|
||||
},
|
||||
"neogen": {
|
||||
"rev": "23e7e9f883d01289ebd90e98025acc860ea26366",
|
||||
"src": "https://github.com/danymat/neogen"
|
||||
"mini.pairs": {
|
||||
"rev": "4a014143fcb4e9df26198ccb3ecff3b9e77a048c",
|
||||
"src": "https://github.com/nvim-mini/mini.pairs",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"noice.nvim": {
|
||||
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
|
||||
"src": "https://github.com/folke/noice.nvim"
|
||||
},
|
||||
"nui.nvim": {
|
||||
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
|
||||
"rev": "10fc361835c856ba4233ef5ea135b919bf3dce97",
|
||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||
},
|
||||
"nvim-colorizer.lua": {
|
||||
"rev": "a065833f35a3a7cc3ef137ac88b5381da2ba302e",
|
||||
"src": "https://github.com/norcalli/nvim-colorizer.lua"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"rev": "45a69eba683a2c448dd9ecfc4de89511f0646b5f",
|
||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||
},
|
||||
"nvim-dap-ui": {
|
||||
"rev": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49",
|
||||
"src": "https://github.com/rcarriga/nvim-dap-ui"
|
||||
},
|
||||
"nvim-highlight-colors": {
|
||||
"rev": "e4c7af0211866162d999ce0bdd6a029302e19139",
|
||||
"src": "https://github.com/brenoprata10/nvim-highlight-colors"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "31026a13eefb20681124706a79fc1df6bf11ab27",
|
||||
"rev": "84b6b6c3f13cb34a6c8a0354b0da4c67d8ccf867",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-notify": {
|
||||
"rev": "8701bece920b38ea289b457f902e2ad184131a5d",
|
||||
"src": "https://github.com/rcarriga/nvim-notify"
|
||||
},
|
||||
"nvim-tmux-navigation": {
|
||||
"rev": "4898c98702954439233fdaf764c39636681e2861",
|
||||
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"rev": "5cb0114e6242625db56dd6440e945ed1ece10bc7",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-ts-autotag": {
|
||||
@@ -95,7 +76,7 @@
|
||||
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "4fc505ac7bd7692824a142e96e5f529c133862f8",
|
||||
"rev": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
@@ -103,28 +84,24 @@
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"polydev": {
|
||||
"rev": "8d41141e9ab68c271bb8bb2db5528bb0a61c78eb",
|
||||
"src": "git@moo:dmm/polydev.git"
|
||||
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
||||
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
||||
},
|
||||
"rose-pine": {
|
||||
"rev": "6a961effd67f6130d36df6d1c05c48c739796dd2",
|
||||
"src": "https://github.com/rose-pine/neovim"
|
||||
"telescope.nvim": {
|
||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"snacks.nvim": {
|
||||
"rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e",
|
||||
"src": "https://github.com/folke/snacks.nvim"
|
||||
"trouble.nvim": {
|
||||
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
|
||||
"src": "https://github.com/folke/trouble.nvim"
|
||||
},
|
||||
"undotree": {
|
||||
"rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d",
|
||||
"src": "https://github.com/mbbill/undotree"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
},
|
||||
"xcodebuild.nvim": {
|
||||
"rev": "59ee76b947cfd680b0354f3318aec2cab71a18db",
|
||||
"src": "https://github.com/wojciech-kulik/xcodebuild.nvim"
|
||||
"zen-mode.nvim": {
|
||||
"rev": "8564ce6d29ec7554eb9df578efa882d33b3c23a7",
|
||||
"src": "https://github.com/folke/zen-mode.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+9
-4
@@ -4,13 +4,18 @@ Host *
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
|
||||
Host moo
|
||||
HostName git.local.moomancer.xyz
|
||||
# HostName 192.168.5.16
|
||||
HostName 100.78.144.113
|
||||
User git
|
||||
IdentityFile ~/.ssh/id_ed25519 # Path to your private key
|
||||
|
||||
Host oasis
|
||||
HostName 100.111.101.97
|
||||
User oasis
|
||||
HostName 100.78.144.113
|
||||
User andrew
|
||||
Port 2222
|
||||
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
+29
-22
@@ -6,34 +6,42 @@ set -g focus-events on
|
||||
set -ga terminal-features ',xterm-ghostty:RGB'
|
||||
set -as terminal-overrides ',xterm-ghostty:Tc'
|
||||
set-option -g default-shell $SHELL
|
||||
# --- Visual Flair Enhancements ---
|
||||
|
||||
set -g status-position top
|
||||
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 "#[fg=#31748f,bg=default,bold] #S #[fg=#444444,nobold]│ "
|
||||
set -g status-left "#[fg=#090E13,bg=colour6,bold] #S "
|
||||
# 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
|
||||
|
||||
# Right Side: Clean icons with no unnecessary labels
|
||||
set -g status-right-length 150
|
||||
set -g status-right "#[fg=#c4a7e7] %m-%d #[fg=#444444]│ #[fg=#eb6f92] %H:%M "
|
||||
set -g status-right ""
|
||||
|
||||
# Window Status: The "Flare"
|
||||
# Using a dot or a subtle block to indicate the active window
|
||||
# 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"
|
||||
set -g window-status-current-format "#[fg=colour1,bg=default] #F#I:#W "
|
||||
set -g window-status-format "#[fg=colour7,bg=default] #I:#W "
|
||||
|
||||
# Message styling (Command mode)
|
||||
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 message-style 'fg=colour3 bg=default bold'
|
||||
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
@@ -45,7 +53,6 @@ set -g status-position top
|
||||
|
||||
bind-key h previous-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-key z resize-pane -Z
|
||||
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
|
||||
+7
-2
@@ -35,8 +35,8 @@ alias enix="nvim /etc/nix-darwin/flake.nix"
|
||||
alias v="nvim"
|
||||
alias ls="eza -a"
|
||||
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"
|
||||
|
||||
# alias grep="rg"
|
||||
#
|
||||
@@ -46,6 +46,7 @@ if [[ $(uname) != "Darwin" ]]; then
|
||||
else
|
||||
alias env='sh ~/personal/dotfiles/env_mac.sh'
|
||||
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -l man'"
|
||||
# export PATH="$HOME/.flutter/bin/:$PATH"
|
||||
export GOOGLE_CLOUD_PROJECT="development-477121"
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
@@ -62,3 +63,7 @@ fi
|
||||
# bun
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
|
||||
export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"
|
||||
export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"
|
||||
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
|
||||
|
||||
Reference in New Issue
Block a user