Browse Source

feat: add conform and blink back to nvim config

master
Tovi Jaeschke-Rogers 1 week ago
parent
commit
9400b59cd2
14 changed files with 243 additions and 2074 deletions
  1. +1
    -1
      .config/alacritty/alacritty.toml
  2. +10
    -0
      .config/lazysql/config.toml
  3. +10
    -0
      .config/lazysql/history/local.json
  4. +133
    -0
      .config/nvim/lua/plugins/blink_cmp.lua
  5. +56
    -0
      .config/nvim/lua/plugins/conform_nvim.lua
  6. +0
    -0
      .config/nvim/lua/plugins/diffview_nvim.lua
  7. +0
    -0
      .config/nvim/lua/plugins/gitsigns_nvim.lua
  8. +0
    -1
      .config/nvim/lua/plugins/harpoon.lua
  9. +7
    -30
      .config/nvim/lua/plugins/lspconfig.lua
  10. +0
    -0
      .config/nvim/lua/plugins/oil_nvim.lua
  11. +6
    -6
      .config/nvim/lua/plugins/treesitter-textobjects.lua
  12. +4
    -1
      .config/nvim/lua/plugins/treesitter.lua
  13. +16
    -0
      .config/nvim/nvim-pack-lock.json
  14. +0
    -2035
      .config/tmux/plugins/catppuccin/tmux/themes/catppuccin_cyberdream_tmux.conf

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

@ -1,5 +1,5 @@
[general]
import = ["~/.config/alacritty/kanagawa.toml"]
import = ["~/.config/alacritty/kanagawa_wave.toml"]
[window]
opacity = 1


+ 10
- 0
.config/lazysql/config.toml View File

@ -0,0 +1,10 @@
[[database]]
Name = 'Local'
Provider = 'mysql'
DBName = 'jack'
URL = 'mysql://jack:secret@localhost:33061/jack'
[application]
DefaultPageSize = 300
DisableSidebar = true
SidebarOverlay = false

+ 10
- 0
.config/lazysql/history/local.json View File

@ -0,0 +1,10 @@
[
{
"QueryText": "SELECT * FROM `jack`.`users` WHERE true = true LIMIT 0, 300",
"Timestamp": "2026-01-02T01:28:34.964780276Z"
},
{
"QueryText": "SELECT * FROM `jack`.`users` WHERE id = 1 LIMIT 0, 300",
"Timestamp": "2026-01-02T01:27:13.955906205Z"
}
]

+ 133
- 0
.config/nvim/lua/plugins/blink_cmp.lua View File

@ -0,0 +1,133 @@
local M = {}
M.install = { src = "https://github.com/saghen/blink.cmp" }
M.dependencies = {
{ src = "https://github.com/rafamadriz/friendly-snippets" },
}
M.setup = function()
require("blink.cmp").setup({
completion = {
accept = {
auto_brackets = {
enabled = true,
},
},
menu = {
auto_show = true,
winblend = vim.o.pumblend,
scrollbar = true,
border = 'rounded',
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None',
draw = {
padding = 1,
gap = 1,
columns = {
{ "kind_icon" },
{ "label", "label_description", gap = 1 },
{ "kind" }
},
components = {
kind_icon = {
ellipsis = false,
text = function(ctx)
return ctx.kind_icon .. " "
end,
highlight = function(ctx)
return 'BlinkCmpKind' .. ctx.kind
end,
},
kind = {
text = function(ctx)
return "(" .. ctx.kind .. ")"
end,
highlight = "Comment",
},
label = {
width = { fill = true, max = 60 },
text = function(ctx)
return ctx.label
end,
highlight = function(ctx)
return ctx.deprecated and "BlinkCmpLabelDeprecated" or "BlinkCmpLabel"
end,
},
},
treesitter = { "lsp" }
}
},
documentation = {
auto_show = true,
auto_show_delay_ms = 200,
update_delay_ms = 50,
window = {
border = 'rounded',
winblend = vim.o.pumblend,
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder',
max_width = 80,
max_height = 20,
}
},
ghost_text = {
enabled = vim.g.ai_cmp or false,
},
},
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = 'mono'
},
sources = {
default = {
'lsp',
'path',
'snippets',
'buffer',
},
providers = {
lsp = {
name = "LSP",
module = "blink.cmp.sources.lsp",
score_offset = 90,
},
path = {
name = "Path",
module = "blink.cmp.sources.path",
score_offset = 3,
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function (context) return vim.fn.getcwd() end,
show_hidden_files_by_default = true,
}
},
snippets = {
name = "Snippets",
module = "blink.cmp.sources.snippets",
score_offset = 85,
opts = {
friendly_snippets = true,
search_paths = { vim.fn.stdpath("config") .. "/snippets" },
global_snippets = { "all" },
extended_filetypes = {},
ignored_filetypes = {},
}
},
buffer = {
name = "Buffer",
module = "blink.cmp.sources.buffer",
},
cmdline = {
name = "Cmdline",
module = "blink.cmp.sources.cmdline",
},
},
},
})
end
return M

+ 56
- 0
.config/nvim/lua/plugins/conform_nvim.lua View File

@ -0,0 +1,56 @@
local M = {}
M.install = { src = "https://github.com/stevearc/conform.nvim" }
M.setup = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
go = { "goimports", "gofmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
vue = { "prettierd" },
css = { "prettierd" },
html = { "prettierd" },
markdown = { "prettierd" },
json = { "fixjson" },
rust = { "rustfmt" },
shell = { "shfmt", "shellcheck" },
python = { "isort", "black" },
php = { "phpcbf", "php_cs_fixer" },
blade = { "blade-formatter" }
},
log_level = vim.log.levels.WARN,
notify_on_error = false,
})
vim.keymap.set({ "n", "v" }, "<leader>F", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end)
vim.fn.mkdir(vim.fn.expand("~/.cache/php-cs-fixer"), "p")
conform.formatters.php_cs_fixer = {
prepend_args = {
"--config=" .. vim.fn.expand("~/.config/php-cs-fixer.php"),
"--cache-file=" .. vim.fn.expand("~/.cache/php-cs-fixer/cache"),
},
env = {
PHP_CS_FIXER_IGNORE_ENV = "1",
},
}
conform.formatters.phpcbf = {
prepend_args = { "--standard=~/.config/phpcs.xml" },
}
end
return M

.config/nvim/lua/plugins/diffview.lua → .config/nvim/lua/plugins/diffview_nvim.lua View File


.config/nvim/lua/plugins/gitsigns.lua → .config/nvim/lua/plugins/gitsigns_nvim.lua View File


+ 0
- 1
.config/nvim/lua/plugins/harpoon.lua View File

@ -6,7 +6,6 @@ M.dependencies = {
{ src = "https://github.com/nvim-lua/plenary.nvim" },
}
M.setup = function()
local harpoon = require("harpoon")


+ 7
- 30
.config/nvim/lua/plugins/lspconfig.lua View File

@ -55,7 +55,7 @@ M.setup = function()
end, { desc = 'Buffer diagnostics' })
-- LSP Format
vim.keymap.set("n", "<leader>F", function()
vim.keymap.set("n", "<leader>lF", function()
vim.lsp.buf.format()
end, { desc = "LSP Format" })
@ -108,34 +108,6 @@ M.setup = function()
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client:supports_method('textDocument/completion') then
-- Optional: trigger autocompletion on EVERY keypress. May be slow!
local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
client.server_capabilities.completionProvider.triggerCharacters = chars
vim.lsp.completion.enable(true, client.id, event.buf, {
autotrigger = true,
-- Prevent auto-selection of first item
autocomplete = false
})
-- Map Ctrl+y to select first item and accept completion
vim.keymap.set('i', '<C-y>', function()
if vim.fn.pumvisible() == 1 then
-- If completion menu is visible, select first item if nothing selected, then accept
local selected = vim.fn.complete_info({'selected'}).selected
if selected == -1 then
-- Nothing selected, select first item then accept
return '<C-n><C-y>'
else
-- Something already selected, just accept
return '<C-y>'
end
else
return '<C-y>'
end
end, { expr = true, buffer = event.buf, desc = 'Accept completion' })
end
if client and client.server_capabilities.documentHighlightProvider then
vim.api.nvim_create_autocmd("LspDetach", {
group = vim.api.nvim_create_augroup("LspDetach", { clear = true }),
@ -162,9 +134,14 @@ M.setup = function()
end
end
-- Get capabilities from blink.cmp
local capabilities = require("blink.cmp").get_lsp_capabilities()
-- Setup all servers using the new vim.lsp.config and vim.lsp.enable APIs
for server_name, server in pairs(servers) do
vim.lsp.config(server_name, server or {})
local config = server or {}
config.capabilities = vim.tbl_deep_extend('force', capabilities, config.capabilities or {})
vim.lsp.config(server_name, config)
vim.lsp.enable(server_name)
end
end


.config/nvim/lua/plugins/oil.lua → .config/nvim/lua/plugins/oil_nvim.lua View File


+ 6
- 6
.config/nvim/lua/plugins/treesitter-textobjects.lua View File

@ -38,12 +38,12 @@ M.setup = function()
}
-- Select textobjects
local select = require('nvim-treesitter-textobjects.select')
vim.keymap.set({'n', 'x', 'o'}, 'af', function() select.select_textobject('@function.outer', 'textobjects') end)
vim.keymap.set({'n', 'x', 'o'}, 'if', function() select.select_textobject('@function.inner', 'textobjects') end)
vim.keymap.set({'n', 'x', 'o'}, 'ac', function() select.select_textobject('@conditional.outer', 'textobjects') end)
vim.keymap.set({'n', 'x', 'o'}, 'ic', function() select.select_textobject('@conditional.inner', 'textobjects') end)
vim.keymap.set({'n', 'x', 'o'}, 'al', function() select.select_textobject('@loop.outer', 'textobjects') end)
vim.keymap.set({'n', 'x', 'o'}, 'il', function() select.select_textobject('@loop.inner', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'af', function() select.select_textobject('@function.outer', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'if', function() select.select_textobject('@function.inner', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'ac', function() select.select_textobject('@conditional.outer', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'ic', function() select.select_textobject('@conditional.inner', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'al', function() select.select_textobject('@loop.outer', 'textobjects') end)
vim.keymap.set({'x', 'o'}, 'il', function() select.select_textobject('@loop.inner', 'textobjects') end)
-- Move textobjects
local move = require('nvim-treesitter-textobjects.move')


+ 4
- 1
.config/nvim/lua/plugins/treesitter.lua View File

@ -28,7 +28,9 @@ M.setup = function()
'gitignore',
'php',
'latex',
'blade'
'blade',
'vue',
'go',
})
vim.api.nvim_create_autocmd('FileType', {
@ -36,6 +38,7 @@ M.setup = function()
'php',
'ts',
'vue',
'go',
},
callback = function() vim.treesitter.start() end,
})


+ 16
- 0
.config/nvim/nvim-pack-lock.json View File

@ -4,10 +4,26 @@
"rev": "1900f89dc17c603eec29960f57c00bd9ae696495",
"src": "https://github.com/antoinemadec/FixCursorHold.nvim"
},
"blink.cmp": {
"rev": "10c164bbdf065f9781b6cc2f7d068c016276055b",
"src": "https://github.com/saghen/blink.cmp"
},
"blink.nvim": {
"rev": "d1e7c7c45d45c6b6a25427bf62db4db73b03ff3d",
"src": "https://github.com/saghen/blink.nvim"
},
"conform.nvim": {
"rev": "8314f4c9e205e7f30b62147069729f9a1227d8bf",
"src": "https://github.com/stevearc/conform.nvim"
},
"diffview.nvim": {
"rev": "4516612fe98ff56ae0415a259ff6361a89419b0a",
"src": "https://github.com/sindrets/diffview.nvim"
},
"friendly-snippets": {
"rev": "572f5660cf05f8cd8834e096d7b4c921ba18e175",
"src": "https://github.com/rafamadriz/friendly-snippets"
},
"gitsigns.nvim": {
"rev": "130beacf8a51f00aede9c31064c749136679a321",
"src": "https://github.com/lewis6991/gitsigns.nvim"


+ 0
- 2035
.config/tmux/plugins/catppuccin/tmux/themes/catppuccin_cyberdream_tmux.conf
File diff suppressed because it is too large
View File


Loading…
Cancel
Save