Many updates
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
return {
|
||||
-- which-key... will setup at some point
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
lazy = true,
|
||||
},
|
||||
|
||||
-- statup time tracking
|
||||
{
|
||||
"dstein64/vim-startuptime",
|
||||
cmd = "StartupTime",
|
||||
-- init is called during startup. Configuration for vim plugins typically should be set in an init function
|
||||
init = function()
|
||||
vim.g.startuptime_tries = 10
|
||||
end,
|
||||
},
|
||||
|
||||
-- completions
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
-- load cmp on InsertEnter
|
||||
event = "InsertEnter",
|
||||
-- these dependencies will only be loaded when cmp loads
|
||||
-- dependencies are always lazy-loaded unless specified otherwise
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,meuone,preview,noselect",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4), -- scroll preview forward
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4), -- scroll preview backward
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = false }),
|
||||
['<C-c>'] = cmp.mapping.abort(),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" }, -- lsp completions
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within buffer
|
||||
{ name = "path" }, -- filesystem paths
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- mason
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
local mason = require("mason")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason.setup({})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"zls",
|
||||
"ols",
|
||||
"rnix",
|
||||
},
|
||||
automatic_installation = true, -- auto-install configured servers
|
||||
automatic_enable = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
-- the colorscheme should be available when starting Neovim
|
||||
{
|
||||
"sainnhe/sonokai",
|
||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
-- load the colorscheme here
|
||||
vim.cmd([[colorscheme sonokai]])
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"p00f/alabaster.nvim",
|
||||
name = "alabaster",
|
||||
},
|
||||
|
||||
-- Other colorschemes
|
||||
{
|
||||
"karoliskoncevicius/sacredforest-vim",
|
||||
lazy = false,
|
||||
name = "sacredforest"
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = true,
|
||||
name = "tokyonight",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
local map = require("liamm.core.keymap").nnoremap
|
||||
-- return {
|
||||
-- "theprimeagen/harpoon",
|
||||
-- branch = "harpoon2",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- },
|
||||
-- lazy = false,
|
||||
-- config = function()
|
||||
-- local harpoon = require("harpoon")
|
||||
--
|
||||
-- ---@diagnostic disable-next-line: missing-parameter
|
||||
-- harpoon:setup()
|
||||
-- map("<leader>a", function() harpoon:list():append() end)
|
||||
-- map("<leader>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
-- map("<c-h>", function() harpoon:list():select(1) end)
|
||||
-- map("<c-h>", function() harpoon:list():select(2) end)
|
||||
-- map("<c-h>", function() harpoon:list():select(3) end)
|
||||
-- map("<c-h>", function() harpoon:list():select(4) end)
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
---@diagnostic disable-next-line: missing-parameter
|
||||
harpoon:setup()
|
||||
map("<leader>a", function() harpoon:list():add() end)
|
||||
map("<c-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
map("<c-h>", function() harpoon:list():select(1) end)
|
||||
map("<c-j>", function() harpoon:list():select(2) end)
|
||||
map("<c-k>", function() harpoon:list():select(3) end)
|
||||
map("<c-l>", function() harpoon:list():select(4) end)
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
local map = require("liamm.core.keymap").nnoremap
|
||||
local vmap = require("liamm.core.keymap").vnoremap
|
||||
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
local on_attach = function(client, bufnr)
|
||||
opts.buffer = bufnr
|
||||
|
||||
opts.desc = "Show LSP References"
|
||||
map("gR", "<cmd>Telescope lsp_references<CR>", opts)
|
||||
|
||||
opts.desc = "Go To Declaration"
|
||||
map("gD", vim.lsp.buf.declaration, opts)
|
||||
|
||||
opts.desc = "Show LSP Definition"
|
||||
map("gd", "<cmd>Telescope lsp_definitions<CR>", opts)
|
||||
|
||||
opts.desc = "Show LSP Type Definitions"
|
||||
map("gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
|
||||
|
||||
opts.desc = "Show LSP Implementations"
|
||||
map("gi", "<cmd>Telescope lsp_implementations<CR>", opts)
|
||||
|
||||
opts.desc = "See Available Code Actions"
|
||||
map("<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vmap("<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
|
||||
opts.desc = "Smart Rename"
|
||||
map("<leader>rn", vim.lsp.buf.rename, opts)
|
||||
|
||||
opts.desc = "Show Buffer Diagnostics"
|
||||
map("<leader>vD", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
|
||||
|
||||
opts.desc = "Show Line Diagnostics"
|
||||
map("<leader>vd", vim.diagnostic.open_float, opts)
|
||||
|
||||
opts.desc = "Go To Prev Diagnostic"
|
||||
map("[d", "<cmd>vim.diagnostic.jump({ count = 1, float = true })<CR>", opts)
|
||||
|
||||
opts.desc = "Go To Next Diagnostic"
|
||||
map("]d", "<cmd>vim.diagnostic.jump({ count = -1, float = true })<CR>", opts)
|
||||
|
||||
opts.desc = "Show Documentation For Cursor Hover"
|
||||
map("K", vim.lsp.buf.hover, opts)
|
||||
|
||||
opts.desc = "Show Documentation For Cursor Hover"
|
||||
map("<leader>rs", "<cmd>LspRestart<CR>", opts)
|
||||
end
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
local signs = {
|
||||
Error = ' ',
|
||||
Warn = ' ',
|
||||
Info = ' ',
|
||||
Hint = 'H',
|
||||
}
|
||||
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
lspconfig["zls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig["rnix"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostic = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig["ols"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
single_file_support = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
lualine = require("lualine")
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '|', right = '|'},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 75,
|
||||
tabline = 10000,
|
||||
winbar = 10000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
--sources = 'nvim_diagnostic'
|
||||
sources = { 'nvim_diagnostic' },
|
||||
|
||||
-- Displays diagnostics for the defined severity types
|
||||
sections = { 'error', 'warn', 'info', 'hint' },
|
||||
diagnostics_color = {
|
||||
-- Same values as the general color option can be used here.
|
||||
error = 'DiagnosticError', -- Changes diagnostics' error color.
|
||||
warn = 'DiagnosticWarn', -- Changes diagnostics' warn color.
|
||||
info = 'DiagnosticInfo', -- Changes diagnostics' info color.
|
||||
hint = 'DiagnosticHint', -- Changes diagnostics' hint color.
|
||||
},
|
||||
symbols = {
|
||||
error = ' ',
|
||||
warn = ' ',
|
||||
info = ' ',
|
||||
hint = 'H'
|
||||
},
|
||||
colored = true, -- Displays diagnostics status in color if set to true.
|
||||
update_in_insert = false, -- Update diagnostics in insert mode.
|
||||
always_visible = false, -- Show diagnostics even if there are none.
|
||||
},
|
||||
},
|
||||
lualine_x = {'encoding', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
input = { enabled = true },
|
||||
picer = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
sroll = { enabled = true },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release"
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = smart_case,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>ff", "<cmd>Telescope find_files<CR>", desc = "Find files in cwd" },
|
||||
{ "<leader>fg", "<cmd>Telescope git_files<CR>", desc = "Find git file cwd" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<CR>", desc = "Find recent files in cwd" },
|
||||
{ "<leader>fs", "<cmd>Telescope live_grep<CR>", desc = "Find string in cwd" },
|
||||
{ "<leader>fc", "<cmd>Telescope grep_string<CR>", desc = "Find string under cursor in cwd" },
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user