NVIM: Refactored & Cleaned

Removed some files, added some keybinds & descriptions, added autoinstall lsps, refactored config portion
This commit is contained in:
mattr
2024-10-19 13:27:46 -05:00
parent f863fda1fa
commit 2304b5c75e
13 changed files with 400 additions and 441 deletions

View File

@@ -7,9 +7,7 @@
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',

View File

@@ -1,8 +0,0 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {},
}

View File

@@ -1,9 +0,0 @@
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},
}

View File

@@ -1,55 +0,0 @@
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
},
}

View File

@@ -1,20 +1,40 @@
local servers = {
"rust_analyzer",
"clangd",
"basedpyright",
"lua_ls",
'bashls',
'yamlls',
}
-- local capabilities = base.capabilities
-- local on_attach = base.on_attach
return {
{ "williamboman/mason.nvim" },
{
"williamboman/mason.nvim",
opts = {
ensured_installed = {
"rust_analyzer",
"clangd",
"basedpyright",
"lua_ls"
}
}
"williamboman/mason-lspconfig.nvim",
config = function ()
require('mason-lspconfig').setup({
ensure_installed = servers
})
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
on_attach = on_attach,
capabilities = capabilities
}
end
end,
automatic_installation = true,
},
"williamboman/mason-lspconfig.nvim",
{
"neovim/nvim-lspconfig",
dependencies = {
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},

View File

@@ -6,32 +6,40 @@ vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '<leader>e', ':Neotree reveal action=focus toggle=true<CR>', silent=true }
},
init = function()
if vim.fn.argc(-1) == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
end
end,
opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
},
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '<leader>e', ':Neotree reveal action=focus toggle=true<CR>', silent=true }
},
init = function()
if vim.fn.argc(-1) == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
end
end,
opts = {
filesystem = {
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
hide_by_name = {
'.git',
}
},
never_show = {},
window = {
mappings = {
['\\'] = 'close_window',
},
},
},
},
},
}

View File

@@ -66,8 +66,8 @@ return { -- Autocompletion
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.

View File

@@ -1,5 +1,5 @@
vim.keymap.set('n', '<A-t>', '<CMD>lua require("FTerm").toggle()<CR>')
vim.keymap.set('t', '<A-t>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>')
vim.keymap.set('n', '<A-t>', '<CMD>lua require("FTerm").toggle()<CR>', {desc="Open float terminal"})
vim.keymap.set('t', '<A-t>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', {desc="Close float terminal"})
return {
"numToStr/FTerm.nvim"