Browse Source

feat: updates

master
Tovi Jaeschke-Rogers 3 days ago
parent
commit
157d52a23e
34 changed files with 969 additions and 539 deletions
  1. +2
    -2
      .config/alacritty/alacritty.toml
  2. +79
    -0
      .config/alacritty/carbonfox.toml
  3. +2
    -2
      .config/hypr/hyprland.conf
  4. +0
    -16
      .config/nvim/lua/core/remaps.lua
  5. +31
    -0
      .config/nvim/lua/lsp/servers/clangd.lua
  6. +1
    -0
      .config/nvim/lua/lsp/servers/cssls.lua
  7. +18
    -0
      .config/nvim/lua/lsp/servers/gopls.lua
  8. +3
    -0
      .config/nvim/lua/lsp/servers/html.lua
  9. +86
    -0
      .config/nvim/lua/lsp/servers/intelephense.lua
  10. +10
    -0
      .config/nvim/lua/lsp/servers/jsonls.lua
  11. +11
    -0
      .config/nvim/lua/lsp/servers/kotlin_language_server.lua
  12. +22
    -0
      .config/nvim/lua/lsp/servers/lua_ls.lua
  13. +51
    -0
      .config/nvim/lua/lsp/servers/pyright.lua
  14. +21
    -0
      .config/nvim/lua/lsp/servers/rust_analyzer.lua
  15. +75
    -0
      .config/nvim/lua/lsp/servers/ts_ls.lua
  16. +14
    -0
      .config/nvim/lua/lsp/servers/yamlls.lua
  17. +78
    -0
      .config/nvim/lua/lsp/utils.lua
  18. +0
    -44
      .config/nvim/lua/plugins/alpha.lua
  19. +0
    -55
      .config/nvim/lua/plugins/avante.lua
  20. +41
    -9
      .config/nvim/lua/plugins/blink.lua
  21. +11
    -0
      .config/nvim/lua/plugins/claude-code.lua
  22. +9
    -0
      .config/nvim/lua/plugins/colorscheme.lua
  23. +144
    -23
      .config/nvim/lua/plugins/fugitive.lua
  24. +35
    -234
      .config/nvim/lua/plugins/lspconfig.lua
  25. +64
    -22
      .config/nvim/lua/plugins/lualine.lua
  26. +8
    -8
      .config/nvim/lua/plugins/neotest.lua
  27. +1
    -1
      .config/nvim/lua/plugins/nvim-go.lua
  28. +0
    -9
      .config/nvim/lua/plugins/refactor.lua
  29. +128
    -86
      .config/nvim/lua/plugins/telescope.lua
  30. +2
    -2
      .config/nvim/lua/plugins/telescope/multigrep.lua
  31. +0
    -6
      .config/nvim/lua/plugins/typr.lua
  32. +0
    -6
      .config/zsh/.zprofile
  33. +1
    -0
      .profile
  34. +21
    -14
      .tmux.conf

+ 2
- 2
.config/alacritty/alacritty.toml View File

@ -1,8 +1,8 @@
[general]
import = ["~/.config/alacritty/cyberdream.toml"]
import = ["~/.config/alacritty/carbonfox.toml"]
[window]
opacity = 0.90
opacity = 1
[font]
size = 10.0


+ 79
- 0
.config/alacritty/carbonfox.toml View File

@ -0,0 +1,79 @@
# Nightfox Alacritty Colors
## name: carbonfox
## upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/carbonfox/alacritty.toml
[colors.primary]
background = "#161616"
foreground = "#f2f4f8"
dim_foreground = "#b6b8bb"
bright_foreground = "#f9fbff"
[colors.cursor]
text = "#f2f4f8"
cursor = "#b6b8bb"
[colors.vi_mode_cursor]
text = "#f2f4f8"
cursor = "#33b1ff"
[colors.search.matches]
foreground = "#f2f4f8"
background = "#525253"
[colors.search.focused_match]
foreground = "#f2f4f8"
background = "#3ddbd9"
[colors.footer_bar]
foreground = "#f2f4f8"
background = "#353535"
[colors.hints.start]
foreground = "#f2f4f8"
background = "#3ddbd9"
[colors.hints.end]
foreground = "#f2f4f8"
background = "#353535"
[colors.selection]
text = "#f2f4f8"
background = "#2a2a2a"
[colors.normal]
black = "#282828"
red = "#ee5396"
green = "#25be6a"
yellow = "#08bdba"
blue = "#78a9ff"
magenta = "#be95ff"
cyan = "#33b1ff"
white = "#dfdfe0"
[colors.bright]
black = "#484848"
red = "#f16da6"
green = "#46c880"
yellow = "#2dc7c4"
blue = "#8cb6ff"
magenta = "#c8a5ff"
cyan = "#52bdff"
white = "#e4e4e5"
[colors.dim]
black = "#222222"
red = "#ca4780"
green = "#1fa25a"
yellow = "#07a19e"
blue = "#6690d9"
magenta = "#a27fd9"
cyan = "#2b96d9"
white = "#bebebe"
[[colors.indexed_colors]]
index = 16
color = "#3ddbd9"
[[colors.indexed_colors]]
index = 17
color = "#ff7eb6"

+ 2
- 2
.config/hypr/hyprland.conf View File

@ -139,8 +139,8 @@ input {
kb_layout = us
kb_variant =
kb_model =
# kb_options = kb_options = caps:swapescape
kb_options = =
kb_options = kb_options = caps:swapescape
# kb_options = =
kb_rules =
follow_mouse = 1


+ 0
- 16
.config/nvim/lua/core/remaps.lua View File

@ -35,22 +35,6 @@ vim.keymap.set("v", "<leader>d", '"_d', { desc = "Delete into black hole registe
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Scroll down half page" })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Scroll up half page" })
-- -- Keep cursor centered
-- vim.keymap.set("n", "n", function()
-- if vim.bo.filetype == "fugitive" then
-- return "n"
-- else
-- return "nzzzv"
-- end
-- end, { desc = "Next search result" })
-- vim.keymap.set("n", "N", function()
-- if vim.bo.filetype == "fugitive" then
-- return "N"
-- else
-- return "Nzzzv"
-- end
-- end, { desc = "Previous search result" })
--
-- Keep cursor centered when jumping through quickfix list
vim.keymap.set("n", "<leader>N", "<cmd>cprev<CR>zz", { desc = "Previous item in quickfix list" })
vim.keymap.set("n", "<leader>n", "<cmd>cnext<CR>zz", { desc = "Next item in quickfix list" })


+ 31
- 0
.config/nvim/lua/lsp/servers/clangd.lua View File

@ -0,0 +1,31 @@
local util = require("lspconfig.util")
return {
cmd = {
"clangd",
"--compile-commands-dir=.",
"--header-insertion=never",
"--cross-file-rename",
"--clang-tidy",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
root_dir = util.root_pattern(
'.clangd',
'.clang-tidy',
'.clang-format',
'compile_commands.json',
'compile_flags.txt',
'configure.in',
'.git',
'Makefile'
),
single_file_support = true,
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
}

+ 1
- 0
.config/nvim/lua/lsp/servers/cssls.lua View File

@ -0,0 +1 @@
return {}

+ 18
- 0
.config/nvim/lua/lsp/servers/gopls.lua View File

@ -0,0 +1,18 @@
local util = require("lspconfig.util")
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
staticcheck = true,
gofumpt = true,
},
},
}

+ 3
- 0
.config/nvim/lua/lsp/servers/html.lua View File

@ -0,0 +1,3 @@
return {
filetypes = { "html", "templ" },
}

+ 86
- 0
.config/nvim/lua/lsp/servers/intelephense.lua View File

@ -0,0 +1,86 @@
local util = require("lspconfig.util")
local utils = require("lsp.utils")
-- Only setup if license file exists
local license_path = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt")
if not utils.file_exists(license_path) then
vim.notify("Intelephense license not found at: " .. license_path, vim.log.levels.WARN)
end
return {
root_dir = function(pattern)
local root = util.root_pattern("composer.json", "composer.lock")(pattern)
return root or vim.fn.getcwd()
end,
single_file_support = false,
init_options = {
licenceKey = license_path,
},
settings = {
intelephense = {
format = {
enable = true,
sortUseStatements = true,
},
stubs = {
"bcmath",
"bz2",
"calendar",
"Core",
"curl",
"date",
"dba",
"dom",
"enchant",
"fileinfo",
"filter",
"ftp",
"gd",
"gettext",
"hash",
"iconv",
"imap",
"intl",
"json",
"libxml",
"mbstring",
"mcrypt",
"mysql",
"mysqli",
"password",
"pcntl",
"pcre",
"PDO",
"pdo_mysql",
"Phar",
"readline",
"recode",
"Reflection",
"regex",
"session",
"SimpleXML",
"soap",
"sockets",
"sodium",
"SPL",
"standard",
"superglobals",
"sysvsem",
"sysvshm",
"tokenizer",
"xml",
"xdebug",
"xmlreader",
"xmlwriter",
"yaml",
"zip",
"zlib",
"wordpress",
"woocommerce",
"acf-pro",
"wordpress-globals",
"wp-cli",
},
},
},
}

+ 10
- 0
.config/nvim/lua/lsp/servers/jsonls.lua View File

@ -0,0 +1,10 @@
return {
settings = {
json = {
validate = { enable = true },
format = {
enable = true,
},
},
},
}

+ 11
- 0
.config/nvim/lua/lsp/servers/kotlin_language_server.lua View File

@ -0,0 +1,11 @@
return {
settings = {
kotlin = {
compiler = {
jvm = {
target = "1.8"
}
}
}
},
}

+ 22
- 0
.config/nvim/lua/lsp/servers/lua_ls.lua View File

@ -0,0 +1,22 @@
return {
settings = {
Lua = {
-- Make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- Make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
-- Disable the luassert warning
checkThirdParty = false,
},
telemetry = {
enable = false,
},
},
},
}

+ 51
- 0
.config/nvim/lua/lsp/servers/pyright.lua View File

@ -0,0 +1,51 @@
local util = require("lspconfig.util")
-- Function to get python path (you can customize this)
local function get_python_path(workspace)
-- Check for virtual environment
if vim.env.VIRTUAL_ENV then
return vim.env.VIRTUAL_ENV .. "/bin/python"
end
-- Check for poetry
if util.root_pattern("pyproject.toml")(workspace) then
local handle = io.popen("cd " .. workspace .. " && poetry env info --path 2>/dev/null")
if handle then
local poetry_venv = handle:read("*a"):gsub("\n", "")
handle:close()
if poetry_venv ~= "" then
return poetry_venv .. "/bin/python"
end
end
end
-- Check for pipenv
if util.root_pattern("Pipfile")(workspace) then
local handle = io.popen("cd " .. workspace .. " && pipenv --venv 2>/dev/null")
if handle then
local pipenv_venv = handle:read("*a"):gsub("\n", "")
handle:close()
if pipenv_venv ~= "" then
return pipenv_venv .. "/bin/python"
end
end
end
-- Default to system python
return "python3"
end
return {
before_init = function(_, config)
config.settings.python.pythonPath = get_python_path(config.root_dir)
end,
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
},
},
},
}

+ 21
- 0
.config/nvim/lua/lsp/servers/rust_analyzer.lua View File

@ -0,0 +1,21 @@
return {
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
checkOnSave = {
command = "clippy",
},
procMacro = {
enable = true,
},
diagnostics = {
enable = true,
experimental = {
enable = true,
},
},
},
},
}

+ 75
- 0
.config/nvim/lua/lsp/servers/ts_ls.lua View File

@ -0,0 +1,75 @@
local util = require("lspconfig.util")
local utils = require("lsp.utils")
-- Determine base path for node_modules
local base_path = utils.find_node_modules_path()
if not base_path then
vim.notify("No global node_modules found for TypeScript server", vim.log.levels.WARN)
base_path = ""
end
local function get_typescript_server_path(root_dir)
local global_ts = base_path .. "/typescript/lib"
local found_ts = ""
local function check_dir(path)
found_ts = table.concat({ path, "typescript", "lib" }, "/")
if vim.loop.fs_stat(found_ts) then
return path
end
end
-- Check frontend/node_modules first
if util.search_ancestors(root_dir .. '/frontend/node_modules', check_dir) then
return found_ts
end
-- Check root node_modules
if util.search_ancestors(root_dir .. '/node_modules', check_dir) then
return found_ts
end
return global_ts
end
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
title = ""
}
vim.lsp.buf.execute_command(params)
end
return {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = base_path .. "/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue", "react" },
},
},
},
filetypes = {
"javascript",
"typescript",
"vue",
"typescriptreact",
},
commands = {
OrganizeImports = {
organize_imports,
description = "Organize Imports"
}
},
on_new_config = function(new_config, new_root_dir)
if get_typescript_server_path then
new_config.init_options.typescript = new_config.init_options.typescript or {}
new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir)
else
vim.notify("get_typescript_server_path is not defined", vim.log.levels.ERROR)
end
end,
}

+ 14
- 0
.config/nvim/lua/lsp/servers/yamlls.lua View File

@ -0,0 +1,14 @@
return {
settings = {
yaml = {
keyOrdering = false,
format = {
enable = true,
},
validate = true,
schemaStore = {
enable = true,
},
},
},
}

+ 78
- 0
.config/nvim/lua/lsp/utils.lua View File

@ -0,0 +1,78 @@
local M = {}
-- Find global node_modules path
function M.find_node_modules_path()
local paths = {
"/usr/lib/node_modules",
"/usr/local/lib/node_modules",
"/opt/homebrew/lib/node_modules"
}
for _, path in ipairs(paths) do
if vim.loop.fs_stat(path) then
return path
end
end
return nil
end
-- Check if a file exists
function M.file_exists(path)
return vim.fn.filereadable(path) == 1
end
-- Check if a directory exists
function M.dir_exists(path)
return vim.fn.isdirectory(path) == 1
end
-- Get project root directory
function M.get_project_root()
return vim.loop.cwd()
end
-- Setup common LSP keymaps (you can move the keymap logic here if desired)
function M.setup_lsp_keymaps(bufnr)
local keymap = vim.keymap
local function map(mode, lhs, rhs, desc)
keymap.set(mode, lhs, rhs, {
buffer = bufnr,
noremap = true,
silent = true,
desc = desc
})
end
-- Navigation
map("n", "gr", "<cmd>Telescope lsp_references<CR>", "Show LSP references")
map("n", "gD", vim.lsp.buf.declaration, "Go to declaration")
map("n", "gd", "<cmd>Telescope lsp_definitions<CR>", "Show LSP definitions")
map("n", "gi", "<cmd>Telescope lsp_implementations<CR>", "Show LSP implementations")
map("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", "Show LSP type definitions")
-- Actions
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, "See available code actions")
map("n", "<leader>rn", vim.lsp.buf.rename, "Smart rename")
-- Diagnostics
map("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", "Show buffer diagnostics")
map("n", "<leader>d", vim.diagnostic.open_float, "Show line diagnostics")
map("n", "[d", function()
vim.diagnostic.jump({ count = -1, float = true })
end, "Go to previous diagnostic")
map("n", "]d", function()
vim.diagnostic.jump({ count = 1, float = true })
end, "Go to next diagnostic")
map("n", "[e", function()
vim.diagnostic.jump({ count = -1, float = true, severity = vim.diagnostic.severity.ERROR })
end, "Go to previous diagnostic (error only)")
map("n", "]e", function()
vim.diagnostic.jump({ count = 1, float = true, severity = vim.diagnostic.severity.ERROR })
end, "Go to next diagnostic (error only)")
-- Documentation
map("n", "K", vim.lsp.buf.hover, "Show documentation for what is under cursor")
end
return M

+ 0
- 44
.config/nvim/lua/plugins/alpha.lua View File

@ -1,44 +0,0 @@
return {
'goolord/alpha-nvim',
dependencies = {
'echasnovski/mini.icons',
'MaximilianLloyd/ascii.nvim',
},
enabled = false,
config = function ()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
local neovim_lean = {
[[ ]],
[[ _/ _/ _/ _/ _/ ]],
[[ _/_/ _/ _/_/ _/_/ _/ _/ _/_/_/ _/_/ ]],
[[ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ ]],
[[ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ ]],
[[ _/ _/ _/_/_/ _/_/ _/ _/ _/ _/ _/ ]],
[[ ]],
}
-- Set the ASCII art
dashboard.section.header.val = require('ascii').get_random('text', 'slogons')
-- Remove other sections (buttons, footer, etc.) to show only the ASCII art
dashboard.section.buttons.val = {}
dashboard.section.footer.val = {}
local function get_center_padding()
local total_lines = vim.fn.winheight(0)
local art_lines = #dashboard.section.header.val
return math.floor((total_lines - art_lines) / 2)
end
-- Center the header
dashboard.opts.layout = {
{ type = "padding", val = get_center_padding() }, -- Add some vertical padding
dashboard.section.header,
}
-- Set up alpha with the modified dashboard
alpha.setup(dashboard.opts)
end
}

+ 0
- 55
.config/nvim/lua/plugins/avante.lua View File

@ -1,55 +0,0 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
version = false,
keys = {
"<leader>A",
"<cmd>AvanteToggle<cr>"
},
opts = {
behaviour = {
auto_suggestions = false, -- Experimental stage
auto_set_highlight_group = true,
auto_set_keymaps = false,
auto_apply_diff_after_generation = false,
support_paste_from_clipboard = false,
minimize_diff = true, -- Whether to remove unchanged lines when applying a code block
enable_token_counting = true, -- Whether to enable token counting. Default to true.
},
},
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"echasnovski/mini.pick",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}

+ 41
- 9
.config/nvim/lua/plugins/blink.lua View File

@ -2,10 +2,9 @@ return {
'saghen/blink.cmp',
lazy = false,
dependencies = {
'rafamadriz/friendly-snippets',
'mikavilpas/blink-ripgrep.nvim',
{ 'rafamadriz/friendly-snippets' },
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true },
{ 'saghen/blink.compat', version = '2.*', lazy = true, opts = {} },
{ 'saghen/blink.compat', version = '2.*', lazy = true, opts = {} },
},
version = '1.*',
@ -13,18 +12,38 @@ return {
completion = {
menu = {
auto_show = true,
winblend = vim.o.pumblend,
scrollbar = true,
border = 'single',
draw = {
columns = {
{ "label", "label_description", gap = 1 },
{ "kind_icon", "kind", gap = 1 }
{ "label", "label_description", gap = 1 },
{ "kind_icon", "kind", gap = 1 }
},
components = {
kind_icon = {
ellipsis = false,
text = function(ctx)
return ctx.kind_icon .. ctx.icon_gap
end,
highlight = function(ctx)
return 'BlinkCmpKind' .. ctx.kind
end,
}
}
}
},
documentation = { auto_show = true, auto_show_delay_ms = 500 },
documentation = {
auto_show = true,
auto_show_delay_ms = 200, -- Faster doc display
window = {
border = 'single',
winblend = vim.o.pumblend,
max_width = 80,
max_height = 20,
}
},
ghost_text = { enabled = false },
},
@ -56,9 +75,22 @@ return {
signature = {
enabled = true,
window = {
border = 'single',
winblend = vim.o.pumblend,
},
},
},
opts_extend = { "sources.default" }
opts_extend = { "sources.default" },
config = function(_, opts)
require('blink.cmp').setup(opts)
-- Optional: Set up highlights
vim.api.nvim_set_hl(0, 'BlinkCmpMenu', { link = 'Pmenu' })
vim.api.nvim_set_hl(0, 'BlinkCmpMenuBorder', { link = 'Pmenu' })
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'PmenuSel' })
vim.api.nvim_set_hl(0, 'BlinkCmpDoc', { link = 'NormalFloat' })
vim.api.nvim_set_hl(0, 'BlinkCmpDocBorder', { link = 'FloatBorder' })
vim.api.nvim_set_hl(0, 'BlinkCmpSignatureHelp', { link = 'NormalFloat' })
vim.api.nvim_set_hl(0, 'BlinkCmpSignatureHelpBorder', { link = 'FloatBorder' })
end
}

+ 11
- 0
.config/nvim/lua/plugins/claude-code.lua View File

@ -0,0 +1,11 @@
return {
"greggh/claude-code.nvim",
dependencies = {
"nvim-lua/plenary.nvim", -- Required for git operations
},
config = function()
require("claude-code").setup()
vim.keymap.set('n', '<leader>CC', '<cmd>ClaudeCode<CR>', { desc = 'Toggle Claude Code' })
end
}

+ 9
- 0
.config/nvim/lua/plugins/colorscheme.lua View File

@ -38,6 +38,7 @@ return {
"scottmckendry/cyberdream.nvim",
lazy = false,
priority = 1000,
enabled = false,
config = function()
require("cyberdream").setup({
variant = "default",
@ -79,4 +80,12 @@ return {
vim.cmd("colorscheme cyberdream")
end
},
{
"EdenEast/nightfox.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme carbonfox")
end
}
}

+ 144
- 23
.config/nvim/lua/plugins/fugitive.lua View File

@ -6,46 +6,167 @@ return {
"shumphrey/fugitive-gitlab.vim",
},
config = function()
vim.opt.diffopt = vim.opt.diffopt + "vertical"
vim.opt.display = vim.opt.display + "lastline"
-- Git diff settings
vim.opt.diffopt:append("vertical")
vim.opt.display:append("lastline")
local fugitive_augroup = vim.api.nvim_create_augroup("fugitive_mappings", { clear = true })
-- Helper function for consistent keymap creation
local function map(mode, lhs, rhs, desc, opts)
opts = opts or {}
opts.desc = desc
opts.noremap = true
opts.silent = true
vim.keymap.set(mode, lhs, rhs, opts)
end
-- Buffer-local mappings for fugitive buffers
local function set_fugitive_buffer_mappings()
local buf_opts = { buffer = 0, noremap = true, silent = true }
local function set_fugitive_mappings()
local opts = { noremap = true, silent = true }
-- Git operations
map("n", "<leader>gp", "<cmd>Git push<CR>", "Git push", buf_opts)
map("n", "<leader>gP", "<cmd>Git pull<CR>", "Git pull", buf_opts)
map("n", "<leader>gc", "<cmd>Git commit<CR>", "Git commit", buf_opts)
vim.api.nvim_buf_set_keymap(0, "n", "<leader>gp", "<cmd>Git push<CR>", opts)
vim.api.nvim_buf_set_keymap(0, "n", "<leader>gP", "<cmd>Git pull<CR>", opts)
vim.api.nvim_buf_set_keymap(0, "n", "<leader>gc", "<cmd>Git commit<CR>", opts)
-- Additional useful fugitive buffer mappings
map("n", "q", "<cmd>close<CR>", "Close fugitive buffer", buf_opts)
map("n", "<leader>gd", "<cmd>Gvdiffsplit<CR>", "Git diff split", buf_opts)
map("n", "<leader>gb", "<cmd>Git blame<CR>", "Git blame", buf_opts)
end
-- Create an autocmd to trigger the function when entering a Fugitive buffer
-- Auto-command for fugitive buffer mappings
local fugitive_augroup = vim.api.nvim_create_augroup("fugitive_mappings", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
group = fugitive_augroup,
pattern = "fugitive",
callback = set_fugitive_mappings,
callback = set_fugitive_buffer_mappings,
desc = "Set fugitive buffer-local mappings",
})
local opts = { noremap = true, silent = true }
-- Enhanced line-based git log function
local function git_log_range()
local mode = vim.fn.mode()
local start_line, end_line
if mode == 'V' or mode == 'v' then
-- Visual mode - get selected range
local start_pos = vim.fn.getpos("'<")
local end_pos = vim.fn.getpos("'>")
start_line = start_pos[2]
end_line = end_pos[2]
else
-- Normal mode - use current line
start_line = vim.fn.line(".")
end_line = start_line
end
-- Validate line numbers
if start_line <= 0 or end_line <= 0 then
vim.notify("Invalid line range selected", vim.log.levels.WARN)
return
end
vim.keymap.set("n", "<leader>gg", function ()
local filepath = vim.fn.expand("%:.")
if filepath == "" then
vim.notify("No file in current buffer", vim.log.levels.WARN)
return
end
-- Ensure proper order
if start_line > end_line then
start_line, end_line = end_line, start_line
end
local cmd = string.format("Git log -L %d,%d:%s", start_line, end_line, filepath)
vim.cmd(cmd)
end
-- Global git mappings
map("n", "<leader>gg", function()
vim.cmd("Git")
end, opts)
end, "Open git status")
vim.keymap.set("v", "<leader>gl", function()
local startPos = vim.fn.getpos("v")
local endPos = vim.fn.getpos(".")
map("n", "<leader>gl", function()
vim.cmd("Git log --oneline -20")
end, "Git log (last 20)")
local startLine = math.min(startPos[2], endPos[2])
local endLine = math.max(startPos[2], endPos[2])
map("n", "<leader>gL", function()
vim.cmd("Git log")
end, "Git log (detailed)")
if startLine == 0 or endLine == 0 then
vim.notify(vim.inspect(vim.fn.getpos("'<")) .. " to " .. vim.inspect(vim.fn.getpos("'>")))
return
map({ "n", "v" }, "<leader>gr", git_log_range, "Git log for range/line")
map("n", "<leader>gs", function()
vim.cmd("Git status")
end, "Git status")
map("n", "<leader>gd", function()
vim.cmd("Gvdiffsplit")
end, "Git diff split")
map("n", "<leader>gb", function()
vim.cmd("Git blame")
end, "Git blame")
map("n", "<leader>ga", function()
vim.cmd("Git add %")
end, "Git add current file")
map("n", "<leader>gA", function()
vim.cmd("Git add .")
end, "Git add all")
-- Git stash operations
map("n", "<leader>gss", function()
vim.cmd("Git stash")
end, "Git stash")
map("n", "<leader>gsp", function()
vim.cmd("Git stash pop")
end, "Git stash pop")
map("n", "<leader>gsl", function()
vim.cmd("Git stash list")
end, "Git stash list")
-- Branch operations
map("n", "<leader>gco", function()
local branch = vim.fn.input("Branch name: ")
if branch ~= "" then
vim.cmd("Git checkout " .. branch)
end
end, "Git checkout branch")
vim.cmd(string.format("Git log -L %d,%d:%s", startLine, endLine, vim.fn.expand("%:.")))
end, opts)
map("n", "<leader>gcb", function()
local branch = vim.fn.input("New branch name: ")
if branch ~= "" then
vim.cmd("Git checkout -b " .. branch)
end
end, "Git create and checkout branch")
-- Additional autocmds for better fugitive experience
vim.api.nvim_create_autocmd("FileType", {
group = fugitive_augroup,
pattern = "gitcommit",
callback = function()
-- Enable spell checking for commit messages
vim.opt_local.spell = true
vim.opt_local.spelllang = "en_us"
-- Position cursor at the beginning
vim.cmd("startinsert")
end,
desc = "Git commit buffer settings",
})
-- Auto-close fugitive buffers when done
vim.api.nvim_create_autocmd("BufReadPost", {
group = fugitive_augroup,
pattern = "fugitive:*",
callback = function()
vim.opt_local.bufhidden = "delete"
end,
desc = "Auto-delete fugitive buffers",
})
end,
},
{


+ 35
- 234
.config/nvim/lua/plugins/lspconfig.lua View File

@ -5,70 +5,21 @@ return {
{ "saghen/blink.cmp" },
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim" },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "j-hui/fidget.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
{ "williamboman/mason-lspconfig.nvim" },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "j-hui/fidget.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
{ 'dmmulroy/ts-error-translator.nvim', opts = {} },
},
config = function()
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")
local keymap = vim.keymap
local utils = require("lsp.utils")
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
callback = function(event)
local opts = { noremap = true, silent = true }
opts.desc = "Show LSP references"
keymap.set("n", "gr", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1, float = true })
end, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1, float = true })
end, opts)
opts.desc = "Go to previous diagnostic (error only)"
keymap.set("n", "[e", function()
vim.diagnostic.jump({ count = -1, float = true, severity = vim.diagnostic.severity.ERROR })
end, opts)
opts.desc = "Go to next diagnostic (error only)"
keymap.set("n", "]e", function()
vim.diagnostic.jump({ count = 1, float = true, severity = vim.diagnostic.severity.ERROR })
end, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts)
-- Use the utility function to setup keymaps
utils.setup_lsp_keymaps(event.buf)
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then
@ -82,6 +33,20 @@ return {
end,
})
vim.diagnostic.config({
virtual_text = {
prefix = "",
source = "if_many",
},
float = {
border = "rounded",
},
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend(
"force",
@ -89,186 +54,22 @@ return {
require('blink.cmp').get_lsp_capabilities()
)
local base_path = ""
if (vim.loop.fs_stat("/usr/lib/node_modules")) then
base_path = "/usr/lib/node_modules"
elseif (vim.loop.fs_stat("/usr/local/lib/node_modules")) then
base_path = "/usr/local/lib/node_modules"
elseif (vim.loop.fs_stat("/opt/homebrew/lib/node_modules")) then
base_path = "/opt/homebrew/lib/node_modules"
end
local function get_typescript_server_path(root_dir)
local global_ts = base_path .. "/typescript/lib"
local found_ts = ""
local function check_dir(path)
found_ts = table.concat({ path, "typescript", "lib" }, "/")
if vim.loop.fs_stat(found_ts) then
return path
end
end
if util.search_ancestors(root_dir .. '/frontend/node_modules', check_dir) then
return found_ts
end
if util.search_ancestors(root_dir .. '/node_modules', check_dir) then
return found_ts
-- Load server configurations from separate files
local servers_path = vim.fn.stdpath("config") .. "/lua/lsp/servers"
local server_files = vim.fn.glob(servers_path .. "/*.lua", false, true)
local servers = {}
for _, file in ipairs(server_files) do
local server_name = vim.fn.fnamemodify(file, ":t:r")
local ok, server_config = pcall(require, "lsp.servers." .. server_name)
if ok then
servers[server_name] = server_config
else
vim.notify("Failed to load server config: " .. server_name, vim.log.levels.WARN)
end
return global_ts
end
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
title = ""
}
vim.lsp.buf.execute_command(params)
end
local servers = {
ts_ls = {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = base_path .. "/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue", "react" },
},
},
},
filetypes = {
"javascript",
"typescript",
"vue",
"typescriptreact",
},
commands = {
OrganizeImports = {
organize_imports,
description = "Organize Imports"
}
},
on_new_config = function(new_config, new_root_dir)
if get_typescript_server_path then
new_config.init_options.typescript = new_config.init_options.typescript or {}
new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir)
else
vim.notify("get_typescript_server_path is not defined", vim.log.levels.ERROR)
end
end,
},
cssls = {},
intelephense = {
root_dir = function(pattern)
local root = util.root_pattern("composer.json", "composer.lock")(pattern)
return root or vim.fn.getcwd()
end,
single_file_support = false,
init_options = {
licenceKey = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt"),
},
settings = {
intelephense = {
format = {
enable = true,
sortUseStatements = true,
},
},
},
},
gopls = {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
},
},
},
lua_ls = {
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
},
-- dartls = {
-- cmd = { "/opt/flutter/bin/dart", "language-server", "--protocol=lsp" },
-- },
rust_analyzer = {
diagnostics = {
enable = false,
},
},
pyright = {
-- before_init = function(_, config)
-- config.settings.python.pythonpath = get_python_path(config.root_dir)
-- end
},
yamlls = {
settings = {
yaml = {
keyOrdering = false,
},
},
},
clangd = {
cmd = {
"clangd",
"--compile-commands-dir=.",
"--header-insertion=never",
"--cross-file-rename",
"--clang-tidy"
},
filetypes = { "c", "cpp" },
root_dir = require('lspconfig.util').root_pattern(
'.clangd',
'.clang-tidy',
'.clang-format',
'compile_commands.json',
'compile_flags.txt',
'configure.in',
'.git',
'Makefile'
),
},
}
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {},
automatic_enable = false,
})
-- Setup all servers
for server_name, server in pairs(servers) do
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
lspconfig[server_name].setup(server)


+ 64
- 22
.config/nvim/lua/plugins/lualine.lua View File

@ -8,43 +8,76 @@ return {
local lualine = require("lualine")
local lazy_status = require("lazy.status")
local function macro_recording()
local recording_register = vim.fn.reg_recording()
if recording_register == "" then
return ""
else
return "Recording @" .. recording_register
end
end
-- Custom components
local function macro_recording()
local recording_register = vim.fn.reg_recording()
if recording_register == "" then
return ""
else
return "Recording @" .. recording_register
end
end
local function buffer_count()
local buffers = vim.fn.getbufinfo({ buflisted = 1 })
return "Buffers: " .. #buffers
end
lualine.setup({
options = {
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
globalstatus = true,
refresh = {
statusline = 1000, -- Refresh every second for macro recording
},
},
extensions = {
"fugitive",
"oil",
"quickfix",
"trouble", -- Add if you use trouble.nvim
"mason", -- Add if you use mason.nvim
},
sections = {
lualine_a = {
{ "mode", fmt = function(str) return str:sub(1,1) end }, -- Shorter mode display
},
lualine_b = {
{ "branch" },
{ "diff" },
{ "diagnostics" },
{ "branch", icon = "" },
{
function()
local buffers = vim.fn.getbufinfo({ buflisted = true })
return "Buffers: " .. #buffers
end,
"diff",
colored = true,
symbols = { added = " ", modified = " ", removed = " " }
},
{
"diagnostics",
sources = { "nvim_lsp" },
symbols = { error = " ", warn = " ", info = " ", hint = " " }
},
},
lualine_c = {
{ "filename", file_status = true, path = 1 },
{
"filename",
file_status = true,
path = 1, -- Show relative path
shorting_target = 40, -- Shorten long paths
symbols = {
modified = "",
readonly = "",
unnamed = "[No Name]",
newfile = "[New]",
}
},
{ "harpoon2" },
{ macro_recording, color = { fg = "#ff9e64", gui = "bold" } },
{
macro_recording,
color = { fg = "#ff9e64", gui = "bold" },
separator = { left = "" }
},
{ buffer_count, color = { fg = "#7aa2f7" } },
},
lualine_x = {
{
@ -52,14 +85,23 @@ return {
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
{ "fileformat" },
{ "filetype" },
-- Remove fileformat unless you really need it
-- { "fileformat" },
{ "filetype", colored = true },
},
lualine_y = {
{ "progress" },
},
lualine_z = {
{ "location" }
{ "location" },
},
},
inactive_sections = {
lualine_c = {
{ "filename", file_status = true, path = 1 }
},
lualine_x = {
{ "filetype" }
},
},
})


+ 8
- 8
.config/nvim/lua/plugins/neotest.lua View File

@ -1,5 +1,6 @@
return {
"nvim-neotest/neotest",
commit = '52fca6717ef972113ddd6ca223e30ad0abb2800c',
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
@ -9,7 +10,6 @@ return {
-- Adapters
"tovijaeschke/neotest-phpunit",
"nvim-neotest/neotest-go",
'nvim-neotest/neotest-jest',
},
config = function()
local neotest = require("neotest")
@ -63,13 +63,13 @@ return {
},
args = { "-count=1", "-timeout=60s" },
}),
require('neotest-jest')({
jestCommand = "npm test --",
env = { CI = true },
cwd = function(path)
return vim.fn.getcwd()
end,
}),
-- require('neotest-jest')({
-- jestCommand = "npm test --",
-- env = { CI = true },
-- cwd = function(path)
-- return vim.fn.getcwd()
-- end,
-- }),
},
})
end,


+ 1
- 1
.config/nvim/lua/plugins/nvim-go.lua View File

@ -5,7 +5,7 @@ return {
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
event = { "CmdlineEnter" },
event = "VeryLazy",
ft = { "go", 'gomod' },
build = ':lua require("go.install").update_all_sync()',
config = function()


+ 0
- 9
.config/nvim/lua/plugins/refactor.lua View File

@ -1,9 +0,0 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
lazy = false,
opts = {},
}

+ 128
- 86
.config/nvim/lua/plugins/telescope.lua View File

@ -10,31 +10,31 @@ return {
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local action_state = require('telescope.actions.state')
local builtin = require("telescope.builtin")
local previewers = require("telescope.previewers")
local previewers_utils = require("telescope.previewers.utils")
local sorters = require("telescope.sorters")
local builtin = require("telescope.builtin")
-- Configuration constants
local MAX_FILE_SIZE = 100000
-- Enable line numbers in telescope previews
vim.api.nvim_create_autocmd('User', {
pattern = 'TelescopePreviewerLoaded',
callback = function(args)
callback = function()
vim.wo.number = true
end,
})
local max_size = 100000
local truncate_large_files = function(filepath, bufnr, opts)
-- Truncate large files in preview to improve performance
local function truncate_large_files(filepath, bufnr, opts)
opts = opts or {}
filepath = vim.fn.expand(filepath)
---@diagnostic disable-next-line: undefined-field
vim.loop.fs_stat(filepath, function(_, stat)
if not stat then
return
end
if stat.size > max_size then
local cmd = { "head", "-c", max_size, filepath }
vim.uv.fs_stat(filepath, function(_, stat)
if not stat then return end
if stat.size > MAX_FILE_SIZE then
local cmd = { "head", "-c", tostring(MAX_FILE_SIZE), filepath }
previewers_utils.job_maker(cmd, bufnr, opts)
else
previewers.buffer_previewer_maker(filepath, bufnr, opts)
@ -42,9 +42,32 @@ return {
end)
end
-- Cache git status to avoid repeated system calls
local is_inside_work_tree = {}
local function smart_project_files()
local cwd = vim.fn.getcwd()
if is_inside_work_tree[cwd] == nil then
vim.fn.system("git rev-parse --is-inside-work-tree")
is_inside_work_tree[cwd] = vim.v.shell_error == 0
end
local opts = is_inside_work_tree[cwd]
and { show_untracked = true, hidden = true }
or {}
local picker = is_inside_work_tree[cwd]
and builtin.git_files
or builtin.find_files
picker(opts)
end
-- Telescope setup
telescope.setup({
defaults = {
file_sorter = sorters.get_fzy_sorter,
file_sorter = require("telescope.sorters").get_fzy_sorter,
color_devicons = true,
buffer_previewer_maker = truncate_large_files,
@ -55,13 +78,20 @@ return {
layout_config = {
prompt_position = "top",
horizontal = {
preview_width = 0.6,
},
vertical = {
mirror = false,
},
},
border = {},
-- borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
-- Modern borderchars
borderchars = { "", "", "", "", "", "", "", "" },
-- Performance optimizations
use_less = true,
set_env = { ['COLORTERM'] = 'truecolor' },
set_env = { COLORTERM = "truecolor" },
mappings = {
i = {
@ -70,9 +100,15 @@ return {
["<C-j>"] = actions.cycle_history_next,
["<C-k>"] = actions.cycle_history_prev,
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
["<C-u>"] = false, -- Clear prompt
["<C-c>"] = actions.close, -- Close prompt
},
n = {
["q"] = actions.close,
},
},
},
pickers = {
diagnostics = {
initial_mode = "normal",
@ -80,10 +116,31 @@ return {
preview_cutoff = 9999,
},
},
buffers = {
sort_mru = true,
sort_lastused = true,
mappings = {
i = {
["<C-d>"] = actions.delete_buffer,
},
n = {
["dd"] = actions.delete_buffer,
},
},
},
find_files = {
hidden = true,
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
extensions = {
undo = {
side_by_side = true,
layout_strategy = "vertical",
layout_config = {
preview_height = 0.8,
},
mappings = {
i = {
["<CR>"] = require("telescope-undo.actions").restore,
@ -96,91 +153,76 @@ return {
},
},
},
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
-- Load extensions
telescope.load_extension("fzf")
telescope.load_extension("undo")
telescope.load_extension("ui-select")
-- We cache the results of "git rev-parse"
-- Process creation is expensive in Windows, so this reduces latency
local is_inside_work_tree = {}
local project_files = function()
local cwd = vim.fn.getcwd()
if is_inside_work_tree[cwd] == nil then
vim.fn.system("git rev-parse --is-inside-work-tree")
is_inside_work_tree[cwd] = vim.v.shell_error == 0
end
if is_inside_work_tree[cwd] then
builtin.git_files({ show_untracked = true, hidden = true })
else
builtin.find_files({})
end
-- Keymaps
local function map(mode, lhs, rhs, desc)
vim.keymap.set(mode, lhs, rhs, { desc = desc, noremap = true, silent = true })
end
-- set keymaps
local keymap = vim.keymap
keymap.set("n", "<leader>ff", function()
-- File navigation
map("n", "<leader>ff", function()
require("plugins.telescope.multigrep").live_multgrep()
end, {})
keymap.set("n", "<leader>p", project_files, {})
keymap.set("n", "<leader>fr", builtin.resume, {})
end, "Live multigrep")
keymap.set("n", "<leader>ss", builtin.spell_suggest, {})
map("n", "<leader>p", smart_project_files, "Find project files")
map("n", "<leader>fr", builtin.resume, "Resume last telescope")
map("n", "<leader>fb", builtin.buffers, "Find buffers")
map("n", "<leader>fo", builtin.oldfiles, "Find recent files")
keymap.set("n", "<leader>ql", builtin.quickfix, {})
keymap.set("n", "<leader>qhl", builtin.quickfixhistory, {})
-- Search
map("n", "<leader>gf", function()
builtin.grep_string({ search = vim.fn.expand("<cword>") })
end, "Grep word under cursor")
keymap.set("n", "<leader>fb", builtin.buffers, {})
keymap.set("n", "<leader>fo", builtin.oldfiles, {})
map("n", "<leader>gF", function()
builtin.grep_string({ search = vim.fn.expand("<cWORD>") })
end, "Grep WORD under cursor")
keymap.set("n", "<leader>m", builtin.marks, {})
map("n", "<leader>gD", function()
builtin.find_files({ search_file = vim.fn.expand("<cword>") })
end, "Find file with name under cursor")
keymap.set("n", "<leader>cc", builtin.commands, {})
keymap.set("n", "<leader>ch", builtin.command_history, {})
keymap.set("n", "<leader>gb", function()
-- Git
map("n", "<leader>gb", function()
builtin.git_branches({
attach_mappings = function(_, map)
map("i", "<c-d>", actions.git_delete_branch)
map("n", "<c-d>", actions.git_delete_branch)
attach_mappings = function(_, map_func)
map_func("i", "<C-d>", actions.git_delete_branch)
map_func("n", "<C-d>", actions.git_delete_branch)
return true
end,
})
end, {})
keymap.set("n", "<leader>gc", builtin.git_commits, {})
keymap.set("n", "<leader>vh", builtin.help_tags, {})
keymap.set("n", "<leader>ds", builtin.lsp_document_symbols, {})
keymap.set("n", "<leader>ws", builtin.lsp_workspace_symbols, {})
keymap.set("n", "<leader>dws", builtin.lsp_dynamic_workspace_symbols, {})
keymap.set("n", "<leader>gf", function()
builtin.grep_string({
search = vim.fn.expand("<cword>"),
})
end)
keymap.set("n", "<leader>gF", function()
builtin.grep_string({
search = vim.fn.expand("<cWORD>"),
})
end)
keymap.set("n", "<leader>gD", function()
builtin.find_files({
search_file = vim.fn.expand("<cword>"),
})
end)
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
end, "Git branches")
map("n", "<leader>gc", builtin.git_commits, "Git commits")
-- LSP
map("n", "<leader>ds", builtin.lsp_document_symbols, "Document symbols")
map("n", "<leader>ws", builtin.lsp_workspace_symbols, "Workspace symbols")
map("n", "<leader>dws", builtin.lsp_dynamic_workspace_symbols, "Dynamic workspace symbols")
-- Utilities
map("n", "<leader>u", "<cmd>Telescope undo<cr>", "Undo history")
map("n", "<leader>ss", builtin.spell_suggest, "Spell suggestions")
map("n", "<leader>m", builtin.marks, "Marks")
map("n", "<leader>cc", builtin.commands, "Commands")
map("n", "<leader>ch", builtin.command_history, "Command history")
map("n", "<leader>vh", builtin.help_tags, "Help tags")
-- Quickfix
map("n", "<leader>ql", builtin.quickfix, "Quickfix list")
map("n", "<leader>qhl", builtin.quickfixhistory, "Quickfix history")
end,
}

+ 2
- 2
.config/nvim/lua/plugins/telescope/multigrep.lua View File

@ -29,7 +29,7 @@ M.live_multgrep = function (opts)
end
---@diagnostic disable-next-line: deprecated
return vim.tbl_flatten({
return vim.iter({
args,
{
"--color=never",
@ -40,7 +40,7 @@ M.live_multgrep = function (opts)
"--smart-case",
"--hidden",
}
})
}):flatten():totable()
end,
entry_maker = make_entry.gen_from_vimgrep(opts),
cwd = opts.cwd


+ 0
- 6
.config/nvim/lua/plugins/typr.lua View File

@ -1,6 +0,0 @@
return {
"nvzone/typr",
dependencies = "nvzone/volt",
opts = {},
cmd = { "Typr", "TyprStats" },
}

+ 0
- 6
.config/zsh/.zprofile View File

@ -1,6 +0,0 @@
#!/bin/zsh
if [[ -z "$WAYLAND_DISPLAY" ]] && [[ -z "$DISPLAY" ]] && [[ "$XDG_VTNR" = 1 ]] && [[ $(tty) = /dev/tty1 ]]; then
if uwsm check may-start; then
exec uwsm start hyprland.desktop
fi
fi

+ 1
- 0
.profile View File

@ -1,5 +1,6 @@
#!/bin/sh
if uwsm check may-start && uwsm select; then
echo "starting..."
exec systemd-cat -t uwsm_start uwsm start default
fi

+ 21
- 14
.tmux.conf View File

@ -1,5 +1,5 @@
# set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",xterm*:Tc"
set-option -a terminal-features 'alacritty:RGB'
# easy reload config
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
@ -75,23 +75,30 @@ bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
bind-key -r m run-shell "~/.local/bin/tmux-music"
set -g mode-style "fg=#0c0c0c,bg=#b6b8bb"
set -g message-style "fg=#0c0c0c,bg=#b6b8bb"
set -g message-command-style "fg=#0c0c0c,bg=#b6b8bb"
set -g pane-border-style "fg=#b6b8bb"
set -g pane-active-border-style "fg=#78a9ff"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#b6b8bb,bg=#0c0c0c"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#0c0c0c,bg=#78a9ff,bold] #S #[fg=#78a9ff,bg=#0c0c0c,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#0c0c0c,bg=#0c0c0c,nobold,nounderscore,noitalics]#[fg=#78a9ff,bg=#0c0c0c] #{prefix_highlight} #[fg=#b6b8bb,bg=#0c0c0c,nobold,nounderscore,noitalics]#[fg=#0c0c0c,bg=#b6b8bb] %Y-%m-%d  %I:%M %p #[fg=#78a9ff,bg=#b6b8bb,nobold,nounderscore,noitalics]#[fg=#0c0c0c,bg=#78a9ff,bold] #h "
setw -g window-status-activity-style "underscore,fg=#7b7c7e,bg=#0c0c0c"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#7b7c7e,bg=#0c0c0c"
setw -g window-status-format "#[fg=#0c0c0c,bg=#0c0c0c,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#0c0c0c,bg=#0c0c0c,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#0c0c0c,bg=#b6b8bb,nobold,nounderscore,noitalics]#[fg=#0c0c0c,bg=#b6b8bb,bold] #I  #W #F #[fg=#b6b8bb,bg=#0c0c0c,nobold,nounderscore,noitalics]"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin "janoamaral/tokyo-night-tmux"
# set -g @tokyo-night-tmux_window_id_style digital
# set -g @plugin 'Nybkox/tmux-kanagawa'
# set -g @kanagawa-show-powerline true
# set -g @kanagawa-theme 'wave'
# set -g @kanagawa-ignore-window-colors true
set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @catppuccin_flavour "cyberdream"
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"


Loading…
Cancel
Save