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 -- 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 -- Global custom plugin agnostic keymaps
-- .............................................. -- ..............................................
@ -19,29 +20,32 @@ local keymaps = {
desc = "Write buffer to disk" desc = "Write buffer to disk"
}, },
{ {
mode = { 'n', 'v', 'i' }, mode = { 'n', 'i' },
keys = '<C-z>', keys = '<C-z>',
cmd = vim.cmd.undo, cmd = vim.cmd.undo,
desc = "Undo last edit" desc = "Undo last edit"
}, },
{ {
mode = { 'n', 'v', 'i' }, mode = { 'n', 'i' },
keys = '<C-y>', keys = '<C-y>',
cmd = vim.cmd.redo, cmd = vim.cmd.redo,
desc = "Redo last edit that was undone" desc = "Redo last edit that was undone"
}, },
-- --
-- Buffer management -- Shift line(s) by one shiftwidth
-- .............................................. -- ..............................................
{ {
mode = { 'n', 'i' }, mode = { 'n', 'i' },
keys = '<C-t>', keys = '<S-tab>',
cmd = '<cmd>:enew<cr>', cmd = '<cmd>:<<cr>',
desc = "Edit new, unnamed buffer" 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' }, mode = { 'v' },
keys = '<tab>', keys = '<tab>',
@ -55,6 +59,15 @@ local keymaps = {
desc = "Shift selection in visual right" 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 -- Window controls
-- .............................................. -- ..............................................
{ {
@ -87,6 +100,7 @@ local keymaps = {
local file_type = vim.api.nvim_buf_get_option(buf, 'filetype') local file_type = vim.api.nvim_buf_get_option(buf, 'filetype')
if buf_type == '' then if buf_type == '' then
-- check if buffer is in ignore -- check if buffer is in ignore
in_ignore = false in_ignore = false
for _, v in ipairs(ignore) do for _, v in ipairs(ignore) do
@ -113,18 +127,6 @@ local keymaps = {
end, end,
desc = "Close buffer" 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 -- Tab (barbar) controls
-- .............................................. -- ..............................................
@ -139,14 +141,6 @@ local keymaps = {
keys = '<C-S-tab>', keys = '<C-S-tab>',
cmd = vim.cmd('BufferPrevious'), cmd = vim.cmd('BufferPrevious'),
desc = "Switch to the previous buffer" 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 -- Bootstrap and start Lazy.nvim plugins
-- manager. -- manager.
@ -16,17 +17,17 @@
-- Bootstrap lazy.nvim -- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git" local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" }, { out, "WarningMsg" },
{ "\nPress any key to exit..." }, { "\nPress any key to exit..." },
}, true, {}) }, true, {})
vim.fn.getchar() vim.fn.getchar()
os.exit(1) os.exit(1)
end end
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
@ -49,16 +50,16 @@ require("config.opts")
-- Setup lazy.nvim -- Setup lazy.nvim
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
-- import your plugins -- import your plugins
{ import = "plugins" }, { import = "plugins" },
}, },
-- Configure any other settings here. See the documentation for more details. -- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins. -- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } }, install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates -- automatically check for plugin updates
checker = { enabled = false }, checker = { enabled = false },
rtp = { rtp = {
disabled_plugins = { disabled_plugins = {
"gzip", "gzip",
"matchit", "matchit",

View File

@ -1,3 +1,4 @@
-- --
-- Neovim and VIM global configuration -- Neovim and VIM global configuration
-- and options -- and options
@ -25,11 +26,11 @@ opt.mouse = "a"
opt.shiftwidth = 4 opt.shiftwidth = 4
opt.tabstop = 4 opt.tabstop = 4
opt.showmode = false opt.showmode = false
opt.termguicolors = true -- True color support opt.termguicolors = true -- True color support
opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
opt.wrap = false opt.wrap = false
opt.smoothscroll = true opt.smoothscroll = true
opt.swapfile = false -- disable swapfiles because they are fucking garbage opt.swapfile = false -- disable swapfiles because they are fucking garbage
opt.smartindent = true opt.smartindent = true
-- --
@ -39,4 +40,4 @@ opt.smartindent = true
-- disable netrw -- disable netrw
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 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

@ -2,8 +2,8 @@ return {
{ {
'romgrk/barbar.nvim', 'romgrk/barbar.nvim',
dependencies = { dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
}, },
init = function() init = function()
vim.g.barbar_auto_setup = false vim.g.barbar_auto_setup = false
@ -12,9 +12,9 @@ return {
auto_hide = 1, auto_hide = 1,
tabpages = true, tabpages = true,
clickable = true, clickable = true,
-- Set the filetypes which barbar will offset itself for -- Set the filetypes which barbar will offset itself for
sidebar_filetypes = { sidebar_filetypes = {
['neo-tree'] = { event = 'BufWipeout' } ['neo-tree'] = {event = 'BufWipeout'}
} }
}, },
version = '^1.0.0' version = '^1.0.0'

View File

@ -1,3 +1,5 @@
-- --
-- Global custom plugin agnostic keymaps -- 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 { return {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
lazy = false, lazy = false,
@ -23,29 +9,28 @@ return {
}, },
cmd = "Neotree", cmd = "Neotree",
opts = { opts = {
popup_border_style = ui.border,
source_selector = { source_selector = {
winbar = true, winbar = true,
statusline = false, statusline = false,
sources = { sources = {
{ {
source = "filesystem", source = "filesystem",
display_name = " 󰉓 Files " display_name = " 󰉓 Files "
}, },
{ {
source = "buffers", source = "buffers",
display_name = " 󰈚 Buffers " display_name = " 󰈚 Buffers "
}, },
{ {
source = "document_symbols", source = "document_symbols",
display_name = " 󰊢 Git " display_name = " 󰊢 Git "
}, },
},
}, },
filesystem = { },
filesystem = {
bind_to_cwd = false, bind_to_cwd = false,
follow_current_file = { enabled = true }, follow_current_file = { enabled = true },
use_libuv_file_watcher = true, use_libuv_file_watcher = true,
hijack_netrw_behavior = "open_default", hijack_netrw_behavior = "open_default",
filtered_items = { filtered_items = {
hide_dotfiles = false, hide_dotfiles = false,
@ -57,7 +42,7 @@ return {
} }
}, },
close_if_last_window = false, close_if_last_window = false,
default_component_configs = { default_component_configs = {
container = { container = {
enable_character_fade = true enable_character_fade = true
}, },
@ -67,11 +52,11 @@ return {
with_markers = true, with_markers = true,
indent_marker = "", indent_marker = "",
last_indent_marker = "", last_indent_marker = "",
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "", expander_collapsed = "",
expander_expanded = "", expander_expanded = "",
expander_highlight = "NeoTreeExpander", expander_highlight = "NeoTreeExpander",
} }
} }
} }
} }

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
}
}