Neovim setup

Can it be this easy to make nvim stuff just work? Do I really just need
to pull the files in with Home Manager? It seems so, so long as nvim
knows about gcc :)

There is also a related side of tmux here because it all ties together.
This commit is contained in:
Gene Liverman 2023-12-19 16:32:37 -05:00
parent 5b7bb14cd6
commit dfc94f8c69
27 changed files with 369 additions and 3 deletions

View file

@ -0,0 +1,9 @@
return {
"sudormrfbin/cheatsheet.nvim",
dependencies = {
'nvim-telescope/telescope.nvim',
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
},
config = true,
}

View file

@ -0,0 +1,8 @@
return {
"Mofiqul/dracula.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme "dracula"
end,
}

View file

@ -0,0 +1,19 @@
return {
"nvim-lualine/lualine.nvim",
config = function ()
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'dracula-nvim',
},
sections = {
lualine_a = {
{
'filename',
path = 1,
}
}
}
}
end
}

View file

@ -0,0 +1,14 @@
return {
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls", -- lua
"nil_ls", -- nix
"puppet", -- puppet
"ruff_lsp", -- python
}
})
end
}

View file

@ -0,0 +1,17 @@
return {
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
},
config = function()
require("mason-null-ls").setup({
ensure_installed = {
"prettier", -- HTML, JS, JSON, etc.
"ruff", -- Pyhton
"stylua", -- LUA
},
})
end,
}

View file

@ -0,0 +1 @@
return { "williamboman/mason.nvim", config = true }

View file

@ -0,0 +1,25 @@
return {
"nvim-neo-tree/neo-tree.nvim",
lazy = false,
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function ()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.keymap.set('n', '<C-n>', ':Neotree toggle<CR>', {})
require("neo-tree").setup({
filesystem = {
hijack_netrw_behavior = "open_default"
},
follow_current_file = { enabled = true },
source_selector = {
winbar = true,
statusline = false
}
})
end
}

View file

@ -0,0 +1,23 @@
return {
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.puppet_lint,
null_ls.builtins.diagnostics.rubocop,
null_ls.builtins.diagnostics.ruff,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.puppet_lint,
null_ls.builtins.formatting.rubocop,
null_ls.builtins.formatting.ruff_format,
null_ls.builtins.formatting.stylua,
},
})
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}

View file

@ -0,0 +1,26 @@
return {
"neovim/nvim-lspconfig",
config = function ()
local on_attach = function(_, _)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, {})
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
end
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
on_attach = on_attach,
settings = { Lua = { diagnostics = { globals = {'vim'} } } },
}
lspconfig.nil_ls.setup { on_attach = on_attach }
local puppet_languageserver = vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver")
lspconfig.puppet.setup {
on_attach = on_attach,
cmd = { puppet_languageserver }
}
lspconfig.ruff_lsp.setup { on_attach = on_attach }
end
}

View file

@ -0,0 +1 @@
return { "nvim-tree/nvim-web-devicons", config = true }

View file

@ -0,0 +1,18 @@
return {
"nvim-telescope/telescope-ui-select.nvim",
config = function ()
-- This is your opts table
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
})
}
}
})
-- load_extension, somewhere after setup function:
require("telescope").load_extension("ui-select")
end
}

View file

@ -0,0 +1,13 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
config = function ()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<Space><Space>', builtin.oldfiles, {})
vim.keymap.set('n', '<Space>fg', builtin.live_grep, {})
vim.keymap.set('n', '<Space>fh', builtin.help_tags, {})
end
}

View file

@ -0,0 +1,53 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local config = require('nvim-treesitter.configs')
config.setup {
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
sync_install = false,
ensure_installed = {
"bash",
"css",
"csv",
"diff",
"dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitignore",
"go",
"hcl",
"hocon",
"html",
"javascript",
"json",
"lua",
"make",
"markdown",
"markdown_inline",
"nix",
"passwd",
"promql",
"puppet",
"python",
"regex",
--"pip_requirements",
"ruby",
"sql",
"ssh_config",
"terraform",
"toml",
"tsv",
"typescript",
"udev",
"vim",
"vimdoc",
"xml",
"yaml",
},
}
end
}

View file

@ -0,0 +1,5 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = true,
}

View file

@ -0,0 +1,3 @@
return {
"christoomey/vim-tmux-navigator"
}

View file

@ -0,0 +1 @@
return { "folke/which-key.nvim", config = true }