Changing ignore settings

This commit is contained in:
Dane Sabo 2024-08-23 13:42:41 -04:00
parent fe40917a0c
commit 52ce33d26e
9 changed files with 222 additions and 11 deletions

10
.gitignore vendored
View File

@ -1,10 +0,0 @@
plugin
custom
spell
ftplugin
syntax
coc-settings.json
.luarc.json
lazy-lock.json
after
**/.DS_Store

View File

@ -1 +0,0 @@
!/lua/custom/

32
lazy-lock.json Normal file
View File

@ -0,0 +1,32 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" },
"base46": { "branch": "v2.0", "commit": "36a44bf1c712a42b46479540ee89e296c6c63cdc" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"crates.nvim": { "branch": "main", "commit": "c3fd47391de6999f4c939af89494d08443f71916" },
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"gitsigns.nvim": { "branch": "main", "commit": "c097cb255096f333e14d341082a84f572b394fa2" },
"indent-blankline.nvim": { "branch": "master", "commit": "b7aa0aed55887edfaece23f7b46ab22232fc8741" },
"lazy.nvim": { "branch": "main", "commit": "f918318d21956b0874a65ab35ce3d94d9057aabf" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" },
"nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" },
"nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" },
"nvim-treesitter": { "branch": "master", "commit": "b7339ffb9affdd5c843d4aae1d5f949039294d89" },
"nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" },
"nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"rustaceanvim": { "branch": "master", "commit": "f16c6eacfb7556c69ffc229e220b8555378245f0" },
"telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" },
"ui": { "branch": "v2.0", "commit": "7b3225264af17a9e0aff0b4fd2a0fac90b73db53" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

7
lua/custom/chadrc.lua Normal file
View File

@ -0,0 +1,7 @@
---@type ChadrcConfig
local M = {}
M.ui = { theme = 'doomchad' }
M.plugins = 'custom.plugins'
M.mappings = require "custom.mappings"
return M

View File

@ -0,0 +1,57 @@
local config = require("plugins.configs.lspconfig")
local on_attach = function(client, bufnr)
config.on_attach(client, bufnr)
-- Keybinding to show hover documentation
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>h', '<cmd>lua vim.lsp.buf.hover()<CR>', { noremap = true, silent = true })
-- Keybinding to show diagnostics
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<cmd>lua vim.diagnostic.open_float(nil, { focusable = false, close_events = {"BufLeave", "CursorMoved", "InsertEnter", "FocusLost"}, border = "rounded", source = "always", prefix = " ", scope = "cursor" })<CR>', { noremap = true, silent = true })
-- Keybinding to show signature help
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>s', '<cmd>lua vim.lsp.buf.signature_help()<CR>', { noremap = true, silent = true })
end
local capabilities = config.capabilities
local lspconfig = require("lspconfig")
local servers = {
"pyright",
"ruff_lsp",
}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"python"},
handlers = {
["textDocument/publishDiagnostics"] = function(_, result, ctx, config)
config = config or {}
config.virtual_text = false
vim.lsp.diagnostic.on_publish_diagnostics(_, result, ctx, config)
end,
["textDocument/signatureHelp"] = function() end -- Disable automatic signature help
}
})
end
-- Function to show diagnostics on hover
vim.api.nvim_create_autocmd("CursorHold", {
callback = function()
local opts = {
focusable = false,
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
border = 'rounded',
source = 'always', -- show source in diagnostics popup window
prefix = ' ',
scope = 'cursor',
}
vim.diagnostic.open_float(nil, opts)
end
})
-- Optional: keybinding to manually show diagnostics on hover
vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', { noremap = true, silent = true })

View File

@ -0,0 +1,12 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local options = {
server = {
on_attach = on_attach,
capabilities = capabilities,
}
}
return options

2
lua/custom/init.lua Normal file
View File

@ -0,0 +1,2 @@
vim.g.dap_virtual_text = false

30
lua/custom/mappings.lua Normal file
View File

@ -0,0 +1,30 @@
local M = {}
M.dap = {
plugin = true,
n = {
["<leader>db"] = { "<cmd> DapToggleBreakpoint <CR>" },
["<leader>dus"] = {
function ()
local widgets = require('dap.ui.widgets');
local sidebar = widgets.sidebar(widgets.scopes);
sidebar.open();
end,
"Open debugging sidebar"
}
}
}
M.crates = {
plugin = true,
n = {
["<leader>rcu"] = {
function ()
require('crates').upgrade_all_crates()
end,
"update crates"
}
}
}
return M

82
lua/custom/plugins.lua Normal file
View File

@ -0,0 +1,82 @@
local cmp = require "cmp"
local plugins = {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"rust-analyzer",
},
},
},
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
-- {
-- "simrat39/rust-tools.nvim",
-- ft = "rust",
-- dependencies = "neovim/nvim-lspconfig",
-- opts = function ()
-- return require "custom.configs.rust-tools"
-- end,
-- config = function(_, opts)
-- require('rust-tools').setup(opts)
-- end
-- },
{
'mrcjkb/rustaceanvim',
version = '^4',
ft = {'rust'},
},
{
"mfussenegger/nvim-dap",
init = function()
require("core.utils").load_mappings("dap")
end
},
{
'saecki/crates.nvim',
ft = {"rust", "toml"},
config = function(_, opts)
local crates = require('crates')
crates.setup(opts)
require('cmp').setup.buffer({
sources = { { name = "crates" }}
})
crates.show()
require("core.utils").load_mappings("crates")
end,
},
{
"rust-lang/rust.vim",
ft = "rust",
init = function ()
vim.g.rustfmt_autosave = 1
end
},
{
"theHamsta/nvim-dap-virtual-text",
lazy = false,
config = function(_, opts)
require("nvim-dap-virtual-text").setup()
end
},
{
"hrsh7th/nvim-cmp",
opts = function()
local M = require "plugins.configs.cmp"
M.completion.completeopt = "menu,menuone,noselect"
M.mapping["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = false,
}
table.insert(M.sources, {name = "crates"})
return M
end,
}
}
return plugins