updated config

This commit is contained in:
MasterGordon 2025-12-02 22:30:17 +01:00
parent d516aa3050
commit 547f5dbf18
7 changed files with 116 additions and 31 deletions

View File

@ -185,4 +185,5 @@ require('lazy').setup({
}, },
}) })
local a = '' -- Load custom snippets after plugins are loaded
require('snippets')

View File

@ -1,4 +1,4 @@
# linux_display_server x11 linux_display_server auto
# Font # Font
# font_family family='Berkeley Mono Trial' postscript_name=BerkeleyMonoTrial-Regular # font_family family='Berkeley Mono Trial' postscript_name=BerkeleyMonoTrial-Regular
font_family Input Mono Narrow font_family Input Mono Narrow
@ -6,6 +6,9 @@ font_family Input Mono Narrow
font_size 11 font_size 11
window_border_width 2px window_border_width 2px
wayland_titlebar_color system
hide_window_decorations no
tab_bar_style powerline tab_bar_style powerline
active_tab_foreground #000 active_tab_foreground #000
active_tab_background #eee active_tab_background #eee

View File

@ -1,43 +1,45 @@
{ {
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "21e9fecfc07fb2cd707b6c7c3fa148550a34d053" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" }, "ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, "conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" },
"cspell.nvim": { "branch": "main", "commit": "07d75238648ef99c0c5c05f4cfd83093d0a01dd4" }, "cspell.nvim": { "branch": "main", "commit": "07d75238648ef99c0c5c05f4cfd83093d0a01dd4" },
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" }, "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" }, "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
"grug-far.nvim": { "branch": "main", "commit": "50d9ee2b5a19634670441948e7e4afaa042f1059" }, "grug-far.nvim": { "branch": "main", "commit": "2e991081c0e653e151fc9e659514d7c2fc31d22a" },
"heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" }, "heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
"leetcode.nvim": { "branch": "master", "commit": "10f63d67201f6e988467485e6cf32d08176fcad2" }, "leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" },
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" }, "lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.pairs": { "branch": "main", "commit": "3738ea30ff33e0cbf2983dc67319a5468d25b0a9" }, "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
"neo-tree.nvim": { "branch": "main", "commit": "ed057048a281b418d5318dd5153f9486daa517a3" }, "neo-tree.nvim": { "branch": "main", "commit": "20244beec28b9d79ffb75fe1b1606f4dd8d476fc" },
"neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" }, "neotest": { "branch": "master", "commit": "7166dc36af2760a76479e021e0521e23f62165f1" },
"neotest-bun": { "branch": "main", "commit": "92adf6b939b6ac5202c71f8f078705f6abe30ed9" }, "neotest-bun": { "branch": "main", "commit": "453759015c4c87792a720fa3cc7b643cebe9d4cf" },
"neotest-jest": { "branch": "main", "commit": "1a54cf910571b9ae5216b8570367bcb0310d9f54" }, "neotest-jest": { "branch": "main", "commit": "2f657403aabab7d68eaa2cb9181dc4bb7fdd8a08" },
"none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" }, "none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" }, "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"schemastore.nvim": { "branch": "main", "commit": "3146720ee3a0c6e2446eedd492fb519d16f2e467" }, "roslyn.nvim": { "branch": "main", "commit": "7d8819239c5e2c4a0d8150da1c00fa583f761704" },
"snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" }, "schemastore.nvim": { "branch": "main", "commit": "667eaa5da8f66f1dd97c905a12dd1eb544a2d259" },
"snacks.nvim": { "branch": "main", "commit": "454ba02d69347c0735044f159b95d2495fc79a73" },
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"template-string.nvim": { "branch": "main", "commit": "da5f326b65fb74fd068aa1d8b55461b64c8fb23b" }, "template-string.nvim": { "branch": "main", "commit": "da5f326b65fb74fd068aa1d8b55461b64c8fb23b" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "tokyonight.nvim": { "branch": "main", "commit": "d14614cbfc63b6037bfccd48bb982d2ad2003352" },
"ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" } "ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" }
} }

View File

@ -1,6 +1,9 @@
return { return {
'saghen/blink.cmp', 'saghen/blink.cmp',
dependencies = { 'rafamadriz/friendly-snippets' }, dependencies = {
'rafamadriz/friendly-snippets',
'L3MON4D3/LuaSnip',
},
version = '1.*', version = '1.*',
build = 'cargo build --release', build = 'cargo build --release',
@ -23,6 +26,10 @@ return {
}, },
}, },
snippets = {
preset = 'luasnip',
},
-- Default list of enabled providers defined so that you can extend it -- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend` -- elsewhere in your config, without redefining it, due to `opts_extend`
sources = { sources = {

View File

@ -29,7 +29,7 @@ return {
json = { 'prettierd', 'prettier', stop_after_first = true }, json = { 'prettierd', 'prettier', stop_after_first = true },
jsonc = { 'prettierd', 'prettier', stop_after_first = true }, jsonc = { 'prettierd', 'prettier', stop_after_first = true },
markdown = { 'prettierd', 'prettier', stop_after_first = true }, markdown = { 'prettierd', 'prettier', stop_after_first = true },
cs = { 'astyle' }, cs = { 'csharpierd' },
php = { 'php_cs_fixer' }, php = { 'php_cs_fixer' },
go = { 'gofmt' }, go = { 'gofmt' },
}, },
@ -38,7 +38,7 @@ return {
lsp_format = 'fallback', lsp_format = 'fallback',
}, },
-- Set up format-on-save -- Set up format-on-save
format_on_save = { timeout_ms = 500 }, format_on_save = { timeout_ms = 3000 },
-- Customize formatters -- Customize formatters
formatters = { formatters = {
shfmt = { shfmt = {
@ -47,6 +47,11 @@ return {
astyle = { astyle = {
prepend_args = { '--style=java', '--max-code-length=80', '--squeeze-ws' }, prepend_args = { '--style=java', '--max-code-length=80', '--squeeze-ws' },
}, },
csharpierd = {
command = 'csharpierd',
args = { '$RELATIVE_FILEPATH' },
stdin = true,
},
}, },
}, },
init = function() init = function()

View File

@ -129,11 +129,11 @@ return {
yamlls = {}, yamlls = {},
eslint = {}, eslint = {},
tailwindcss = {}, tailwindcss = {},
vtsls = { -- vtsls = {
settings = { -- settings = {
vtsls = { autoUseWorkspaceTsdk = true }, -- vtsls = { autoUseWorkspaceTsdk = true },
}, -- },
}, -- },
jsonls = { jsonls = {
settings = { settings = {
json = { json = {
@ -145,6 +145,7 @@ return {
gopls = {}, gopls = {},
rust_analyzer = {}, rust_analyzer = {},
roslyn = {}, roslyn = {},
tsgo = {},
} }
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {

66
lua/snippets.lua Normal file
View File

@ -0,0 +1,66 @@
local ls = require('luasnip')
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
-- Function to find the project root by looking for .csproj file
local function find_project_root(filepath)
local dir = vim.fn.fnamemodify(filepath, ':h')
while dir ~= '/' do
local files = vim.fn.glob(dir .. '/*.csproj', false, true)
if #files > 0 then
return dir
end
dir = vim.fn.fnamemodify(dir, ':h')
end
return nil
end
-- Function to get namespace from file path
local function get_namespace()
local filepath = vim.fn.expand('%:p')
local project_root = find_project_root(filepath)
if not project_root then
return 'YourNamespace'
end
local relative_path = filepath:sub(#project_root + 2) -- +2 to remove leading /
local dir_path = vim.fn.fnamemodify(relative_path, ':h')
if dir_path == '.' or dir_path == '' then
-- File is in project root
local project_name = vim.fn.fnamemodify(vim.fn.glob(project_root .. '/*.csproj'), ':t:r')
return project_name
end
-- Convert directory path to namespace (replace / with .)
local namespace = dir_path:gsub('/', '.')
-- Get project name and prepend it
local project_name = vim.fn.fnamemodify(vim.fn.glob(project_root .. '/*.csproj'), ':t:r')
if project_name and project_name ~= '' then
return project_name .. '.' .. namespace
end
return namespace
end
-- Function to get class name from filename
local function get_classname()
return vim.fn.expand('%:t:r')
end
-- C# class snippet
ls.add_snippets('cs', {
s('csc', {
t('namespace '),
f(function() return get_namespace() end),
t({ ';', '', 'public class ' }),
f(function() return get_classname() end),
t({ '', '{', '\t' }),
i(0),
t({ '', '}' }),
}),
})