Compare commits

..

No commits in common. "c69a88e20f60efdf4dabd4472b88aaa404cb5982" and "25b36c4c2aa4ac7e6b47cda4feb7300071a55205" have entirely different histories.

19 changed files with 79 additions and 510 deletions

View File

@ -1,3 +1,4 @@
--
-- Initialize Neovim configuration
-- ..............................................

View File

@ -1,19 +0,0 @@
--
-- Icons
--
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 08.11.2024
-- Edited: 08.11.2024
--
-- ==============================================
return {
diagnostics = {
error = "",
warn = "",
hint = "",
info = ""
}
}

View File

@ -1,3 +1,4 @@
--
-- Global custom plugin agnostic keymaps
-- ..............................................
@ -19,29 +20,32 @@ local keymaps = {
desc = "Write buffer to disk"
},
{
mode = { 'n', 'v', 'i' },
mode = { 'n', 'i' },
keys = '<C-z>',
cmd = vim.cmd.undo,
desc = "Undo last edit"
},
{
mode = { 'n', 'v', 'i' },
mode = { 'n', 'i' },
keys = '<C-y>',
cmd = vim.cmd.redo,
desc = "Redo last edit that was undone"
},
--
-- Buffer management
-- Shift line(s) by one shiftwidth
-- ..............................................
{
mode = { 'n', 'i' },
keys = '<C-t>',
cmd = '<cmd>:enew<cr>',
desc = "Edit new, unnamed buffer"
keys = '<S-tab>',
cmd = '<cmd>:<<cr>',
desc = "Shift cursor line left"
},
{
mode = { 'n', 'i' },
keys = '<tab>',
cmd = '<cmd>:><cr>',
desc = "Shift cursor line right"
},
--
-- Shift line(s) by one shiftwidth
-- ..............................................
{
mode = { 'v' },
keys = '<tab>',
@ -55,6 +59,15 @@ local keymaps = {
desc = "Shift selection in visual right"
},
--
-- Buffer management
-- ..............................................
{
mode = { 'n', 'i' },
keys = '<C-t>',
cmd = '<cmd>:enew<cr>',
desc = "Edit new, unnamed buffer"
},
--
-- Window controls
-- ..............................................
{
@ -87,6 +100,7 @@ local keymaps = {
local file_type = vim.api.nvim_buf_get_option(buf, 'filetype')
if buf_type == '' then
-- check if buffer is in ignore
in_ignore = false
for _, v in ipairs(ignore) do
@ -113,18 +127,6 @@ local keymaps = {
end,
desc = "Close buffer"
},
{
mode = { 'i', 'n', 'v' },
keys = '<S-ScrollWheelDown>',
cmd = '<ScrollWheelRight>',
desc = "Scroll rightways"
},
{
mode = { 'i', 'n', 'v' },
keys = '<S-ScrollWheelUp>',
cmd = '<ScrollWheelLeft>',
desc = "Scroll leftways"
},
--
-- Tab (barbar) controls
-- ..............................................
@ -139,14 +141,6 @@ local keymaps = {
keys = '<C-S-tab>',
cmd = vim.cmd('BufferPrevious'),
desc = "Switch to the previous buffer"
},
{
mode = { 'n' },
keys = '<S-f>',
cmd = function()
vim.lsp.buf.format()
end,
desc = "Format buffer with current LSP"
}
}

View File

@ -1,3 +1,4 @@
--
-- Bootstrap and start Lazy.nvim plugins
-- manager.

View File

@ -1,3 +1,4 @@
--
-- Neovim and VIM global configuration
-- and options
@ -39,4 +40,4 @@ opt.smartindent = true
-- disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.inlay_hints_visible = true

View File

@ -1,15 +0,0 @@
--
-- User interface configuration
--
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
border = 'rounded',
winhighlight = 'NormalFloat:DiagnosticError'
}

View File

@ -14,7 +14,7 @@ return {
clickable = true,
-- Set the filetypes which barbar will offset itself for
sidebar_filetypes = {
['neo-tree'] = { event = 'BufWipeout' }
['neo-tree'] = {event = 'BufWipeout'}
}
},
version = '^1.0.0'

View File

@ -1,3 +1,5 @@
--
-- Global custom plugin agnostic keymaps
--

View File

@ -1,36 +0,0 @@
--
-- Improve the default vim.ui interfaces
--
-- Source: https://github.com/stevearc/dressing.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
ui = require 'config.ui'
return {
{
'stevearc/dressing.nvim',
opts = {
input = {
enabled = true,
border = ui.border,
trim_prompt = true,
win_options = {
winhighlight = ui.winhighlight
}
},
select = {
enabled = true,
trim_prompt = true,
win_options = {
winhighlight = ui.winhighlight
}
}
}
}
}

View File

@ -1,20 +0,0 @@
--
-- Super fast git decorations implemented purely in Lua
--
-- Source: https://github.com/lewis6991/gitsigns.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
{
'lewis6991/gitsigns.nvim',
opts = {
auto_attach = true,
}
}
}

View File

@ -1,25 +0,0 @@
--
-- Identation markers
--
-- Source: https://github.com/lukas-reineke/indent-blankline.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 08.11.2024
-- Edited: 08.11.2024
--
-- ==============================================
return {
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {
scope = {
enabled = true
}
}
}
}

View File

@ -1,47 +0,0 @@
--
-- Mini plugin library
--
-- Source: https://github.com/lewis6991/gitsigns.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
{
'echasnovski/mini.animate',
version = false
},
{
'echasnovski/mini.comment',
version = false,
opts = {
mappings = {
comment_line = '#',
comment_visual = '#'
}
}
},
{
'echasnovski/mini.move',
version = false,
opts = {
mappings = {
-- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
left = nil,
right = nil,
down = '<C-down>',
up = '<C-up>',
-- Move current line in Normal mode
line_left = '<S-tab>',
line_right = '<tab>',
line_down = '<C-down>',
line_up = '<C-up>',
}
}
}
}

View File

@ -1,17 +1,3 @@
--
-- Pretty file tree with various sources
--
-- Source: https://github.com/nvim-neo-tree/neo-tree.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 01.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
ui = require 'config.ui'
return {
"nvim-neo-tree/neo-tree.nvim",
lazy = false,
@ -23,7 +9,6 @@ return {
},
cmd = "Neotree",
opts = {
popup_border_style = ui.border,
source_selector = {
winbar = true,
statusline = false,

View File

@ -1,125 +0,0 @@
--
-- Start config for builtin Neovim language server protocol client
--
-- Source: https://github.com/RRethy/vim-illuminate
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 08.11.2024
-- Edited: 08.11.2024
--
-- ==============================================
local ui = require 'config.ui'
local icons = require 'config.icons'
return {
{
'neovim/nvim-lspconfig',
dependencies = {
"williamboman/mason.nvim",
{
"williamboman/mason-lspconfig.nvim",
config = function()
end
},
},
opts = {
inlay_hints = {
enabled = true,
},
diagnostics = {
update_in_insert = false,
underline = true,
severity_sort = false,
float = {
border = ui.border,
source = 'always',
},
virtual_text = {
spacing = 4,
source = "if_many",
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
prefix = "icons"
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = icons.diagnostics.error,
[vim.diagnostic.severity.WARN] = icons.diagnostics.warn,
[vim.diagnostic.severity.HINT] = icons.diagnostics.hint,
[vim.diagnostic.severity.INFO] = icons.diagnostics.info
}
}
}
},
config = function(_, opts)
require("mason").setup()
local handlers = {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({
on_attach = function(client, bufnr)
-- optionally enable inlay hints
-- Source: https://www.reddit.com/r/neovim/comments/14em0f8/how_to_use_the_new_lsp_inlay_hints/
-- ..............................................
if client.server_capabilities.inlayHintProvider and opts.inlay_hints.enabled then
vim.lsp.inlay_hint.enable(true, { bufnr })
end
end
})
end,
}
require("mason-lspconfig").setup({ handlers = handlers })
-- Setup diagnostic signs
--
-- Source: https://www.lazyvim.org/plugins/lsp#mason-lspconfignvim
-- ..............................................
-- diagnostics signs
if type(opts.diagnostics.signs) ~= "boolean" then
for severity, icon in pairs(opts.diagnostics.signs.text) do
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end
end
-- diagnostic sign as prefix for virtual text
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "" or function(diagnostic)
for d, icon in pairs(icons.diagnostics) do
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
return icon
end
end
end
end
-- Setup diagnostic user interface
--
-- Source: https://vonheikemen.github.io/devlog/tools/setup-nvim-lspconfig-plus-nvim-cmp
-- ..............................................
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover,
{
border = ui.border
})
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{
border = ui.border
})
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
end
}
}

View File

@ -1,25 +0,0 @@
--
-- Prettier user interface for VIM notifications.
--
-- Source: https://github.com/rcarriga/nvim-notify
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 01.11.2024
-- Edited: 01.11.2024
--
-- ==============================================
return {
{
'rcarriga/nvim-notify',
lazy = false,
opts = {
render = "wrapped-compact"
},
-- Source: https://www.lazyvim.org/plugins/ui#nvim-notify
init = function()
vim.notify = require('notify')
end
}
}

View File

@ -1,40 +0,0 @@
--
-- Tree sitter syntax highlightning
--
-- Source: https://github.com/nvim-treesitter/nvim-treesitter
-- https://www.lazyvim.org/plugins/treesitter
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
{
'nvim-treesitter/nvim-treesitter',
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
-- Luckily, the only things that those plugins need are the custom queries, which we make available
-- during startup.
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end,
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
opts = {
auto_install = true,
highlight = {
enable = true
},
indent = {
enable = true
}
}
}
}

View File

@ -1,20 +0,0 @@
--
-- Super fast git decorations implemented purely in Lua
--
-- Source: https://github.com/lewis6991/satellite.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
{
'lewis6991/satellite.nvim',
opts = {
current_only = false
}
}
}

View File

@ -1,20 +0,0 @@
--
-- Dim all non active scopes using tree sitter
--
-- Source: https://github.com/folke/twilight.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 07.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
return {
{
"folke/twilight.nvim",
opts = {
}
}
}

View File

@ -1,23 +0,0 @@
--
-- Mark all occurances of the word under the current cursor
--
-- Source: https://github.com/RRethy/vim-illuminate
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 08.11.2024
-- Edited: 08.11.2024
--
-- ==============================================
return {
{
'RRethy/vim-illuminate',
opts = {
case_insensitive_regex = false,
},
config = function(opts)
require('illuminate').configure(opts)
end
}
}