Skip to content

Commit

Permalink
chore(update): fix for latest nvim stable and plugin update
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Nehrig <[email protected]>
  • Loading branch information
danielnehrig committed Mar 31, 2024
2 parents dc337d5 + b487d00 commit f4298fe
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 173 deletions.
114 changes: 0 additions & 114 deletions lazy-lock.json

This file was deleted.

36 changes: 16 additions & 20 deletions lua/config/core/autocmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,18 @@ function M.autocmds()
end,
group = au_ft,
})
vim.api.nvim_create_autocmd({ "WinEnter", "BufRead", "BufEnter" }, {
pattern = "alpha",
command = "Alpha",
group = au_ft,
})
-- vim.api.nvim_create_autocmd({ "WinEnter", "BufRead", "BufEnter" }, {
-- pattern = "alpha",
-- command = "Alpha",
-- group = au_ft,
-- })
vim.api.nvim_create_autocmd("FileType", {
pattern = "alpha",
command = "set showtabline=0",
group = au_ft,
})
-- lsp
vim.api.nvim_create_augroup("LspAttach_inlayhints", { clear = true })
-- vim.api.nvim_create_autocmd("LspAttach", {
-- group = "LspAttach_inlayhints",
-- callback = function(args)
-- if not (args.data and args.data.client_id) then
-- return
-- end

-- local bufnr = args.buf
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
-- local present, inlay = pcall(require, "lsp-inlayhints")
-- if present then
-- inlay.on_attach(client, bufnr)
-- end
-- end,
-- })
vim.api.nvim_create_autocmd("LspAttach", {
group = "LspAttach_inlayhints",
callback = function(args)
Expand Down Expand Up @@ -140,6 +125,17 @@ function M.autocmds()
-- end
-- end,
-- })
vim.api.nvim_create_autocmd("WinLeave", {
callback = function()
if vim.bo.ft == "TelescopePrompt" and vim.fn.mode() == "i" then
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<Esc>", true, false, true),
"i",
false
)
end
end,
})
end

return M
12 changes: 12 additions & 0 deletions lua/config/core/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ M.telescope = {
"<Cmd>Telescope file_browser<CR>",
{ desc = "File Browser" },
},
{
"<Leader>fB",
"<Cmd>Telescope file_browser path=%:p:h select_buffer=true<CR>",
{ desc = "File Browser Current Buffer" },
},
{
"<Leader>fs",
"<Cmd>Telescope git_status<CR>",
Expand Down Expand Up @@ -478,6 +483,13 @@ function M.set_lsp_mapping(bufnr)
"<cmd>lua vim.diagnostic.open_float({focusable = false, border = 'single', source = 'if_many' })<CR>",
{ desc = "Diagnostic Float", buffer = bufnr },
},
{
"<leader>ui",
function()
vim.lsp.inlay_hint.enable(bufnr, nil)
end,
{ desc = "Inlay Hint Toggle", buffer = bufnr },
},
},
}

Expand Down
6 changes: 2 additions & 4 deletions lua/config/plugins/configs/cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ function M.init()
cmp.select_next_item()
elseif luasnip and luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif present_neogen then
if neogen.jumpable() then
neogen.jump_next()
end
elseif present_neogen and neogen.jumpable() then
neogen.jump_next()
else
fallback()
end
Expand Down
4 changes: 3 additions & 1 deletion lua/config/plugins/configs/dap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ dap.configurations.rust[1].program = function()
local TOML = require("config.utils.toml")
local cargotoml = vim.fn.readblob(vim.fn.getcwd() .. "/Cargo.toml")
local parsed = TOML.parse(cargotoml)
return build_path_string(
local path = build_path_string(
vim.fn.getcwd() .. "/target/debug/" .. parsed.package.name
)
return path
end

dap.configurations.rust[2] = {
Expand Down Expand Up @@ -282,3 +283,4 @@ if not dapvt_present then
else
dapvt.setup({})
end
require("overseer").patch_dap(true)
10 changes: 5 additions & 5 deletions lua/config/plugins/configs/lspconfig/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ function LSP.on_attach(client, bufnr)
)

require("config.core.mappings").set_lsp_mapping(bufnr)
-- if vim.version().minor > 9 then
-- if client.server_capabilities.inlayHintProvider then
-- vim.lsp.inlay_hint(bufnr, true)
-- end
-- end
if vim.version().minor > 9 then
if client.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint.enable(bufnr, true)
end
end
end

-- LSP Settings
Expand Down
14 changes: 0 additions & 14 deletions lua/config/plugins/configs/telescope/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@ function M.init()
vim.notify("telescope is not installed")
return
end
local action_set = require("telescope.actions.set")
telescope.setup({
pickers = {
find_files = {
hidden = true,
attach_mappings = function(_)
action_set.select:enhance({
post = function()
vim.cmd(":normal! zx")
end,
})
return true
end,
},
},
defaults = {
vimgrep_arguments = {
"rg",
Expand Down
13 changes: 6 additions & 7 deletions lua/config/plugins/configs/treesitter/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ function M.init()
["i;"] = "textsubjects-container-inner",
},
},
-- context_commentstring = {
-- enable = true,
-- -- This plugin provided an autocommand option
-- enable_autocmd = true,
-- },
textobjects = {
lsp_interop = {
enable = true,
Expand Down Expand Up @@ -116,8 +111,12 @@ function M.init()
},
},
})

require("ts_context_commentstring").setup({})
require("ts_context_commentstring").setup({
enable_autocmd = false,
languages = {
typescript = "// %s",
},
})
end

return M
7 changes: 0 additions & 7 deletions lua/config/plugins/modules/navigation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ M.navigation = {
["abecodes/tabout.nvim"] = {
config = function()
require("tabout").setup({
tabkey = "<Tab>",
backwards_tabkey = "<S-Tab>",
act_as_tab = true,
act_as_shift_tab = false,
enable_backwards = true,
completion = true,
tabouts = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
Expand All @@ -55,7 +49,6 @@ M.navigation = {
{ open = "[", close = "]" },
{ open = "{", close = "}" },
},
ignore_beginning = true,
exclude = {},
})
end,
Expand Down
1 change: 0 additions & 1 deletion lua/config/plugins/modules/utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ M.utility = {
},
-- INFO: exec async tasks run jobs etc
["stevearc/overseer.nvim"] = {
commit = "3047ede61cc1308069ad1184c0d447ebee92d749", -- Recommended to to avoid breaking changes
cmd = { "CompilerOpen", "CompilerToggleResults" },
opts = {
-- Tasks are disposed 5 minutes after running to free resources.
Expand Down

0 comments on commit f4298fe

Please sign in to comment.