Skip to content

Commit

Permalink
1718425860
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomashighbaugh committed Jun 15, 2024
1 parent e056e4f commit 1fccc93
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 127 deletions.
10 changes: 5 additions & 5 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" },
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
"kiwi.nvim": { "branch": "master", "commit": "1a625771e3d3d9f50ca28a4501c11842f6c1ec1e" },
"lazy.nvim": { "branch": "main", "commit": "b0ba3f9399bf48c86abaa4db1a40bd0b681d5018" },
"lazy.nvim": { "branch": "main", "commit": "70f2c090d3ffb14f8702d468e05beb240b768881" },
"llm.nvim": { "branch": "main", "commit": "6a90755cfabb56ab99c919b1323e26b5c429f6fb" },
"lsp_signature.nvim": { "branch": "master", "commit": "e92b4e7073345b2a30a56b20db3d541a9aa2771e" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
Expand All @@ -52,11 +52,11 @@
"nvim-jdtls": { "branch": "master", "commit": "a5c6f38f8151d7b4f5b32c005a95022fa66f4c9d" },
"nvim-lightbulb": { "branch": "master", "commit": "02aacd93b9b2367e6dbdd20f43b525f701faf834" },
"nvim-lint": { "branch": "master", "commit": "1a3a8d047bc01f1760ae4a0f5e80f111ea222e67" },
"nvim-lspconfig": { "branch": "master", "commit": "d1ab6b6051976b04948e127b0f302a465b1394d6" },
"nvim-lspconfig": { "branch": "master", "commit": "92166b89ab4b3d60f24e58170cac53b7141fd032" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-scrollbar": { "branch": "main", "commit": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85" },
"nvim-treesitter": { "branch": "master", "commit": "49e4e2b4b62360677568c47b6467f31c809b391c" },
"nvim-treesitter": { "branch": "master", "commit": "3a74b5831058d0daf8952a5b8c556c61b30a3f46" },
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
"nvim-ts-autotag": { "branch": "main", "commit": "6eb4120a1aadef07ac312f1c4bc6456712220007" },
Expand All @@ -71,11 +71,11 @@
"telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" },
"trouble.nvim": { "branch": "main", "commit": "46a19388d3507f4c4bebb9994bf821a79b3bc342" },
"trouble.nvim": { "branch": "main", "commit": "7a9c235806d4d9e2e74889f7e359f183a6d0e20d" },
"venv-selector.nvim": { "branch": "main", "commit": "9b1bfe5aea225853e14358f504c656d4af007035" },
"vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" },
"which-key.nvim": { "branch": "main", "commit": "4b7167f8fb2dba3d01980735e3509e172c024c29" },
"which-key.nvim": { "branch": "main", "commit": "0539da005b98b02cf730c1d9da82b8e8edb1c2d2" },
"windows.nvim": { "branch": "main", "commit": "c7492552b23d0ab30325e90b56066ec51242adc8" }
}
9 changes: 0 additions & 9 deletions lua/core/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
end,
})

vim.api.nvim_create_autocmd({ "TermOpen" }, {
pattern = { "*" },
callback = function()
vim.opt_local["number"] = false
vim.opt_local["signcolumn"] = "no"
vim.opt_local["foldcolumn"] = "0"
end,
})

-- ─────────────────────────────────────────────────────────────────
-- fix comment on new line
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
Expand Down
168 changes: 76 additions & 92 deletions lua/features/lsp/lang/python.lua
Original file line number Diff line number Diff line change
@@ -1,93 +1,85 @@
--return {
-- {
-- "williamboman/mason.nvim",
-- opts = function(_, opts)
-- table.insert(opts.ensure_installed, "black")
-- end,
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = function(_, opts)
-- if type(opts.ensure_installed) == "table" then
-- vim.list_extend(opts.ensure_installed, { "ninja", "python", "rst", "toml" })
-- end
-- end,
-- },
--
-- {
-- "neovim/nvim-lspconfig",
-- opts = {
-- servers = {
-- pyright = {
-- keys = {
-- { "<leader>lo", "<cmd>PyrightOrganizeImports<CR>", desc = "Organize Imports" },
-- },
-- -- disable hint of pyright
-- capabilities = (function()
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
-- capabilities.textDocument.publishDiagnostics.tagSupport.valueSet = { 2 }
-- return capabilities
-- end)(),
-- settings = {
-- python = {
-- analysis = {
-- indexing = true,
-- typeCheckingMode = "basic",
-- diagnosticMode = "openFilesOnly",
-- autoImportCompletions = true,
-- autoSearchPaths = true,
-- inlayHints = {
-- variableTypes = true,
-- functionReturnTypes = true,
-- },
-- useLibraryCodeForTypes = true,
-- diagnosticSeverityOverrides = {
-- reportGeneralTypeIssues = "none",
-- reportOptionalMemberAccess = "none",
-- reportOptionalSubscript = "none",
-- reportPrivateImportUsage = "none",
-- },
-- },
-- },
-- },
-- },
-- },
-- attach_handlers = {
-- pyright = function(client, _)
-- local sc = client.server_capabilities
-- sc.renameProvider = false -- rope is ok
-- sc.hoverProvider = false -- pylsp includes also docstrings
-- sc.signatureHelpProvider = false -- pyright typing of signature is weird
-- sc.definitionProvider = true -- pyright does not follow imports correctly
-- sc.referencesProvider = true -- pylsp does it
-- sc.completionProvider = {
-- resolveProvider = true,
-- triggerCharacters = { "." },
-- }
-- end,
-- },
-- },
-- },
--
-- {
-- "stevearc/conform.nvim",
-- opts = {
-- formatters_by_ft = {
-- ["python"] = { "black" },
-- },
-- },
-- },
--}
return {
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = function(_, opts)
-- if type(opts.ensure_installed) == "table" then
-- vim.list_extend(opts.ensure_installed, { "ninja", "python", "rst", "toml" })
-- end
-- end,
-- },
--
-- {
-- "neovim/nvim-lspconfig",
-- opts = {
-- servers = {
-- pyright = {
-- keys = {
-- { "<leader>lo", "<cmd>PyrightOrganizeImports<CR>", desc = "Organize Imports" },
-- },
-- -- disable hint of pyright
-- capabilities = (function()
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
-- capabilities.textDocument.publishDiagnostics.tagSupport.valueSet = { 2 }
-- return capabilities
-- end)(),
-- settings = {
-- python = {
-- analysis = {
-- indexing = true,
-- typeCheckingMode = "basic",
-- diagnosticMode = "openFilesOnly",
-- autoImportCompletions = true,
-- autoSearchPaths = true,
-- inlayHints = {
-- variableTypes = true,
-- functionReturnTypes = true,
-- },
-- useLibraryCodeForTypes = true,
-- diagnosticSeverityOverrides = {
-- reportGeneralTypeIssues = "none",
-- reportOptionalMemberAccess = "none",
-- reportOptionalSubscript = "none",
-- reportPrivateImportUsage = "none",
-- },
-- },
-- },
-- },
-- },
-- },
-- attach_handlers = {
-- pyright = function(client, _)
-- local sc = client.server_capabilities
-- sc.renameProvider = false -- rope is ok
-- sc.hoverProvider = false -- pylsp includes also docstrings
-- sc.signatureHelpProvider = false -- pyright typing of signature is weird
-- sc.definitionProvider = true -- pyright does not follow imports correctly
-- sc.referencesProvider = true -- pylsp does it
-- sc.completionProvider = {
-- resolveProvider = true,
-- triggerCharacters = { "." },
-- }
-- end,
-- },
-- },
-- },
--
-- {
-- "stevearc/conform.nvim",
-- opts = {
-- formatters_by_ft = {
-- ["python"] = { "black" },
-- },
-- },
-- },
--}
-- Add `pyright` to mason
{
"williamboman/mason.nvim",
opts = function(_, opts)
-- vim.list_extend(opts.ensure_installed, { "pyright", "black", "ruff-lsp", "ruff" })
vim.list_extend(opts.ensure_installed, {
"black",
"ruff",
"pyright",
})
end,
},
Expand Down Expand Up @@ -156,11 +148,6 @@ return {
{ "<leader>lo", "<cmd>PyrightOrganizeImports<CR>", desc = "Organize Imports" },
},
},
ruff_lsp = {
-- handlers = {
-- ["textDocument/publishDiagnostics"] = function() end,
-- },
},
jedi_language_server = {},
},
setup = {
Expand Down Expand Up @@ -190,7 +177,7 @@ return {
optional = true,
opts = {
formatters_by_ft = {
["python"] = { { "black", "ruff" } },
["python"] = { { "black" } },
},
},
},
Expand All @@ -202,10 +189,7 @@ return {
local nls = require("null-ls")
opts.sources = vim.list_extend(opts.sources, {
-- Order of formatters matters. They are used in order of appearance.
nls.builtins.formatting.ruff,
nls.builtins.formatting.black,

nls.builtins.diagnostics.ruff,
})
end,
},
Expand Down
10 changes: 5 additions & 5 deletions lua/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ return {
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
preview_config = {
border = Utils.telescope.borderchars("thick", "tl-t-tr-r-br-b-bl-l"), -- [ top top top - right - bottom bottom bottom - left ]
border = Utils.ui.borderchars("thick", "tl-t-tr-r-br-b-bl-l"), -- [ top top top - right - bottom bottom bottom - left ]
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
Expand Down Expand Up @@ -350,22 +350,22 @@ return {
prompt_prefix = "",
selection_caret = "",
entry_prefix = " ",
borderchars = is_telescope_bg_clear and Utils.telescope.borderchars("rounded")
borderchars = is_telescope_bg_clear and Utils.ui.borderchars("rounded")
or {
prompt = Utils.telescope.borderchars("thick", nil, {
prompt = Utils.ui.borderchars("thick", nil, {
top = "",
top_left = "",
left = "",
right = " ",
top_right = " ",
bottom_right = " ",
}),
results = Utils.telescope.borderchars(
results = Utils.ui.borderchars(
"thick",
nil,
{ top = "", top_left = "", right = " ", top_right = " ", bottom_right = " " }
),
preview = Utils.telescope.borderchars("thick", nil, { top = "", top_left = "", top_right = "" }),
preview = Utils.ui.borderchars("thick", nil, { top = "", top_left = "", top_right = "" }),
},
dynamic_preview_title = true,
hl_result_eol = true,
Expand Down
6 changes: 0 additions & 6 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ return {
"yaml",
},
}),
formatting.markdown_toc, -- use `<!-- toc -->` before headers in your markdown file.`
completion.luasnip,
completion.tags,
formatting.rubyfmt,
Expand All @@ -251,7 +250,6 @@ return {
diagnostics.deadnix,
diagnostics.statix,
diagnostics.todo_comments,
diagnostics.tsc,
diagnostics.zsh,
formatting.terraform_fmt,
formatting.black,
Expand All @@ -260,14 +258,10 @@ return {
code_actions.ts_node_action,
formatting.goimports,
formatting.gofumpt,
code_actions.shellcheck,
code_actions.refactoring.with({
filetypes = { "go", "javascript", "lua", "python", "typescript" },
}),
formatting.alejandra,
formatting.fixjson,
formatting.trim_newlines,
formatting.trim_whitespace,
code_actions.gitsigns,
formatting.shfmt,
formatting.leptosfmt,
Expand Down
10 changes: 0 additions & 10 deletions lua/utils/init.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
local Profile = require("profile")

---@class Util
---@field root utils.root
---@field telescope utils.telescope
---@field theme utils.theme
---@field plugin utils.plugin
---@field lualine utils.lualine
---@field cmd utils.cmd
---@field lsp utils.lsp
---@field string utils.string
---@field table utils.table
local M = {}

setmetatable(M, {
Expand Down
13 changes: 13 additions & 0 deletions lua/utils/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@ function M.on_attach(on_attach)
})
end

function M.on_support_methods(method, fn)
return vim.api.nvim_create_autocmd("User", {
pattern = "LspSupportsMethod",
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
local buffer = args.data.buffer ---@type number
if client and method == args.data.method then
return fn(client, buffer)
end
end,
})
end

return M
Loading

0 comments on commit 1fccc93

Please sign in to comment.