Compare commits

...

5 Commits

Author SHA1 Message Date
Raoul Branten
bb0a48dafb remove cursor and annoying light bulb 2025-12-23 14:54:16 +01:00
Raoul Branten
c6146055fb var improvements 2025-12-23 14:42:56 +01:00
Raoul Branten
54b45037c1 var improvements 2025-12-23 14:33:18 +01:00
Raoul Branten
3af68c2c76 pre-ai-alter 2025-12-23 14:04:07 +01:00
Raoul Branten
e1c533e1c4 Update lmxfix file command 2025-11-19 13:51:05 +01:00
10 changed files with 388 additions and 38 deletions

142
README.md Normal file
View File

@ -0,0 +1,142 @@
# Neovim Configuration Summary
## Plugin Management
- **Plugin Manager**: `lazy.nvim` (auto-bootstrapped)
- **Leader Key**: `<Space>`
- **Update Checker**: Enabled (silent notifications)
## Core Plugins & Features
### File Navigation & Search
- **Telescope** (v0.1.8): Fuzzy finder for files, buffers, grep, help tags, marks
- **nvim-tree**: File browser
- **Tagbar**: Code structure viewer (properties/methods)
### LSP & Code Intelligence
- **Mason + Mason-LSPConfig**: LSP server management
- **nvim-lspconfig**: LSP client configuration
- **Lspsaga**: Enhanced LSP UI (code actions, definitions, diagnostics, outline)
- **nvim-cmp**: Completion engine with:
- Buffer, path, LSP, cmdline sources
- LuaSnip snippets
### Syntax & Highlighting
- **nvim-treesitter**: Syntax highlighting via language parsers
- **nvim-colorizer**: Color previews (hex codes, etc.)
- **SyntaxAttr**: Display syntax highlighting info
- **Gruvbox**: Colorscheme
### UI Enhancements
- **lualine**: Status bar
- **nvim-scrollbar**: Scrollbar indicator
- **indent-blankline**: Indentation guides
- **rainbow-delimiters**: Color-coded brackets/braces
- **deadcolumn**: Visual indicator near line limit
- **alpha-nvim**: Custom welcome screen
### Git Integration
- **vim-fugitive**: Git wrapper
- **vim-gitgutter**: Git diff indicators in gutter
### Code Quality & Formatting
- **conform.nvim**: Code formatter (configured for Lua with stylua)
- **Trouble.nvim**: Diagnostics viewer
### Marks & Navigation
- **marks.nvim**: Visual marks with gutter indicators
- **vim-indentwise**: Indentation-based navigation
### Other Utilities
- **undotree**: Visual undo history
- **which-key.nvim**: Keybinding help menu
- **toggleterm.nvim**: Floating terminal
- **llama.vim**: Local AI integration (requires llama.cpp with CUDA)
- **mini.nvim**: Mini utilities collection
- **volt/menu**: Context menu system
- **minty**: Color picker
## Key Bindings
### Telescope (`<leader>f`)
- `ff` - Find files
- `fg` - Live grep
- `fb` - Find buffers
- `fc` - Find in current buffer
- `fh` - Help tags
- `fm` - Marks
- `fr` - Resume last search
### LSP (`<leader>l`)
- `lc` - Code actions
- `lo` - Outline
- `lr` - Rename
- `ld` - Go to definition
- `lf` - LSP finder
- `lp` - Preview definition
- `lw` - Workspace diagnostics
- `lb` - Buffer diagnostics
- `lm` - LMS fixer (custom)
### Other Important Bindings
- `<leader>u` - Undo tree
- `<leader>m` - Marks management
- `<leader>t` - Tab navigation
- `<leader>b` - Buffer management
- `<leader>i` - Indentation toggles
- `<leader>n` - Remove search highlight
- `<leader>e` - Show diagnostic
- `<leader><F5>` - Definition in new tab
- `<leader><F8>` - Tagbar toggle
- `<C-k>` - LSP hover
- `<C-]>` - Jump to definition in new tab
- `<Tab>/<S-Tab>` - Tab navigation
- `<C-h/j/k/l>` - Window navigation
- `<C-m>` - Move split to tab
- `<C-t>` - Context menu
## Editor Settings
### Display
- True color support enabled
- Cursor line/column highlighting
- Line numbers
- Color column at 81
- Scroll offset: 5 lines
- Sign column always visible
### Indentation & Formatting
- Expand tabs to spaces
- Tab width: 4 spaces
- Smart indentation
- Show whitespace characters (eol, tabs, trails)
- No text wrapping
### Search
- Case-insensitive (smart case)
- Incremental search
- Highlight search results
- Wildignore case enabled
### Folding
- Method: indent
- Fold level: 99 (mostly open)
- Fold column visible
### Behavior
- Auto-read changed files
- Arrow keys disabled (forces hjkl)
- Mouse disabled
- Shell commands run interactively (`-ic` flag)
## Special Features
1. **PHP Helper**: Custom function for inserting debug backtraces
3. **Custom Aliases**: `Bufdel` command for buffer management
4. **Quick Directory Navigation**: Shortcuts to LMS project directories (`<leader>c`)
## Architecture
- Modular structure: config split into logical files
- Plugin configs in `lua/config/plugin/`
- Main entry point: `init.lua`
- Uses Lua-based configuration throughout
This setup focuses on productivity with LSP integration, AI-assisted completion, and a clean UI.

View File

@ -20,10 +20,9 @@ wk.add({
{ "<leader>lr", "<cmd>Lspsaga rename<cr>", desc = "Rename", mode ="n"},
{ "<leader>ld", "<cmd>Lspsaga goto_definition<cr>", desc = "Lsp GoTo Definition", mode ="n"},
{ "<leader>lf", "<cmd>Lspsaga finder<cr>", desc = "Lsp Finder", mode ="n"},
{ "<leader>lp", "<cmd>Lspsaga preview_definition<cr>", desc = "Preview Definition", mode ="n"},
{ "<leader>ls", "<cmd>Lspsaga signature_help<cr>", desc = "Signature Help", mode ="n"},
{ "<leader>lp", "<cmd>Lspsaga peek_definition<cr>", desc = "Preview Definition", mode ="n"},
{ "<leader>lw", "<cmd>Lspsaga show_workspace_diagnostics<cr>", desc = "Show Workspace Diagnostics", mode ="n"},
--{ "<leader>lm", "<cmd>tab terminal lmsfixfile %:p:h<cr>", desc = "LMS fixer this file", mode ="n"},
{ "<leader>lb", "<cmd>Lspsaga show_buf_diagnostics<cr>", desc = "Show Buffer Diagnostics", mode ="n"},
{ "<leader>lm", "<cmd>TermExec cmd='lmsfixfile %:p:h' direction='float'<cr>", desc = "LMS fixer this file", mode ="n"},
-- UndoTree
{ "<leader>u", group = "UndoTree" },
@ -40,27 +39,27 @@ wk.add({
{ "<leader>Z", group = "Closing"},
{ "<leader>ZZ", "<cmd>wq!<cr>", desc = "Write en close", mode = "n"},
{ "<leader>ZQ", "<cmd>q!<cr>", desc = "Close without write", mode = "n"},
-- Marks
{ "<leader>m", group = "Marks"},
-- Creating and browsing marks
{ "<leader>m", group = "Create / Jump mark"},
{ "<leader>mx", marks.set, desc = "Set mark [x]", mode = "n"},
{ "<leader>m,", marks.set_next, desc = "Set the next available alphabetical (lowercase) mark", mode = "n"},
{ "<leader>m;", marks.toggle, desc = "Toggle the next available mark at the current line", mode = "n"},
{ "<leader>dmx", marks.delete, desc = "Delete mark x", mode = "n"},
{ "<leader>dm-", marks.delete_line, desc = "Delete all marks on the current line", mode = "n"},
{ "<leader>dm<space>", marks.delete_buf, desc = "Delete all marks in the current buffer", mode = "n"},
{ "<leader>m]", marks.next, desc = "Move to next mark", mode = "n"},
{ "<leader>m[", marks.prev, desc = "Move to previous mark", mode = "n"},
{ "<leader>m:", marks.preview, desc = "Preview mark. This will prompt you for a specific mark to preview; press <cr> to preview the next mark.", mode = "n"},
{ "<leader>m[0-9]", marks.set_bookmark, desc = "Add a bookmark from bookmark group[0-9].", mode = "n"},
{ "<leader>dm[0-9]", marks.delete_bookmark, desc = "Delete all bookmarks from bookmark group[0-9].", mode = "n"},
{ "<leader>m}", marks.next_bookmark, desc = "Move to the next bookmark having the same type as the bookmark under the cursor. Works across buffers.", mode = "n"},
{ "<leader>m{", marks.prev_bookmark, desc = "Move to the previous bookmark having the same type as the bookmark under the cursor. Works across buffers.", mode = "n"},
-- Deleting marks
{ "<leader>s", group = "Delete marks"},
{ "<leader>dmx", marks.delete, desc = "Delete mark x", mode = "n"},
{ "<leader>dm-", marks.delete_line, desc = "Delete all marks on the current line", mode = "n"},
{ "<leader>dm<space>", marks.delete_buf, desc = "Delete all marks in the current buffer", mode = "n"},
{ "<leader>dm=", marks.delete_bookmark, desc = "Delete the bookmark under the cursor.", mode = "n"},
{ "<leader>dm[0-9]", marks.delete_bookmark, desc = "Delete all bookmarks from bookmark group[0-9].", mode = "n"},
-- Git
{ "<leader>h", group = "Git"},
-- Diagnostics
{ "<leader>h", group = "Code Diagnostics"},
-- Diagnostics
-- Tabs
{ "<leader>t", group = "Tabs"},
{ "<leader>tf", "<cmd>tabm 0<cr>", desc = "Move before first tab", mode = "n"},
{ "<leader>tl", "<cmd>tabm<cr>", desc = "Move after last tab", mode = "n"},
@ -78,6 +77,11 @@ wk.add({
{ "<leader>i", group = "Indentation"},
{ "<leader>it", "<cmd>IBLToggle<cr>", desc = "Toggle indentation guides", mode = "n"},
{ "<leader>im", "<cmd>set list!<cr>", desc = "Toggle indentation characters", mode = "n"},
-- Navigation
{ "<leader>c", group = "Quick change directories"},
{ "<leader>cr", "<cmd>cd ~/lms/<cr>", desc = "Change to lms root", mode = "n"},
{ "<leader>cc", "<cmd>cd ~/lms/App/Lms/<cr>", desc = "Change to App/Lms", mode = "n"},
{ "<leader>ct", "<cmd>cd ~/lms/Tests/<cr>", desc = "Change to Tests", mode = "n"},
})
-- prevent using arrow keys or mouse
@ -95,8 +99,8 @@ vim.keymap.set('n', '<c-k>', ':lua vim.lsp.buf.hover()<CR>')
-- tab navigation using <TAB>
vim.keymap.set('n', '<Tab>', ':tabnext<CR>')
vim.keymap.set('n', '<S-Tab>', ':tabprevious<CR>')
vim.keymap.set('n', '<Tab>', ':BufferLineCycleNext<CR>')
vim.keymap.set('n', '<S-Tab>', ':BufferLineCyclePrev<CR>')
-- quick close tab USE <leader>ZQ
--vim.keymap.set('n', '<C-w>', ':tabclose<CR>')

View File

@ -43,6 +43,21 @@ vim.opt.wildignorecase = true
-- running interactive shell commands
vim.opt.shellcmdflag = '-ic'
-- system clipboard
-- this was pretty annoying
--vim.opt.clipboard = 'unnamedplus'
-- folding
vim.opt.foldmethod = 'indent'
vim.opt.foldcolumn = '1'
vim.opt.foldlevel = 99
vim.opt.foldlevelstart = 99
vim.opt.foldenable = true
-- colorscheme
vim.cmd.colorscheme('gruvbox')
vim.opt.background = 'dark'
--vim.opt.foldlevelstart=99
--vim.opt.foldlevel=99
--
--vim.opt.foldmethod = 'expr'
--vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
--vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"

90
lua/config/plugin/cmp.lua Normal file
View File

@ -0,0 +1,90 @@
-- nvim-cmp configuration
local cmp = require('cmp')
local luasnip = require('luasnip')
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
}),
sources = cmp.config.sources({
sources = cmp.config.sources({
{ name = 'nvim_lsp', priority = 1000 },
{ name = 'luasnip', priority = 750 },
}, {
{ name = 'buffer', priority = 500 },
{ name = 'path', priority = 250 },
}),
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
}),
formatting = {
format = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = '[LSP]',
luasnip = '[Snippet]',
buffer = '[Buffer]',
path = '[Path]',
})[entry.source.name]
return vim_item
end,
},
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore)
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore)
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

View File

@ -1,4 +1,11 @@
local highlight = {
"RainbowDelimiterRed",
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
@ -7,18 +14,27 @@ local highlight = {
"RainbowViolet",
"RainbowCyan",
}
local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#CC241D" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#D79921" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#458588" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D65D0E" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98971A" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#B16286" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#689D6A" })
vim.api.nvim_set_hl(0, "RainbowDelimiterRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowDelimiterYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowDelimiterBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowDelimiterOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowDelimiterGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowDelimiterViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowDelimiterCyan", { fg = "#56B6C2" })
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
require("ibl").setup { indent = { highlight = highlight } }
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup { scope = { highlight = highlight } }
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)

View File

@ -8,10 +8,11 @@ require("config.plugin.vim-gitgutter")
require("config.plugin.deadcolumn")
require("config.plugin.colorizer")
require("config.plugin.synattr")
require("config.plugin.rainbow-delimiters")
require("config.plugin.marks")
require("config.plugin.vim-indentwise")
require("config.plugin.rainbow-delimiters")
require("config.plugin.indent-blankline")
require("config.plugin.scrollbar")
require("config.plugin.lspsaga")
require("config.plugin.gruvbox")
require("config.plugin.cmp")

View File

@ -1,5 +1 @@
require('lspsaga').setup({
lightbulb = {
enable = false,
},
})
require('lspsaga').config.lightbulb.enabled = false

View File

@ -1,15 +1,40 @@
-- This module contains a number of default definitions
local rainbow_delimiters = require 'rainbow-delimiters'
--vim.g.rainbow_delimiters = {
-- strategy = {
-- [''] = rainbow_delimiters.strategy['global'],
-- commonlisp = rainbow_delimiters.strategy['local'],
-- },
-- query = {
-- [''] = 'rainbow-delimiters',
-- lua = 'rainbow-blocks',
-- },
-- --highlight = {
-- -- 'RainbowRed',
-- -- 'RainbowYellow',
-- -- 'RainbowBlue',
-- -- 'RainbowOrange',
-- -- 'RainbowGreen',
-- -- 'RainbowViolet',
-- -- 'RainbowCyan',
-- --},
-- blacklist = {'c', 'cpp'},
--}
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow_delimiters.strategy['global'],
commonlisp = rainbow_delimiters.strategy['local'],
[''] = 'rainbow-delimiters.strategy.global',
vim = 'rainbow-delimiters.strategy.local',
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
},
priority = {
[''] = 110,
lua = 210,
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
@ -19,6 +44,4 @@ vim.g.rainbow_delimiters = {
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
blacklist = {'c', 'cpp'},
}

View File

@ -7,4 +7,16 @@ require 'nvim-treesitter.configs'.setup {
highlight = {
enable = false,
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}

View File

@ -7,6 +7,19 @@ return {
tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
config = function()
require("telescope").load_extension("fzf")
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").load_extension("ui-select")
end,
},
--# treesitter, uses language parsers for highlighting
'nvim-treesitter/nvim-treesitter',
--# lualine, creates nice looking status bar
@ -112,7 +125,13 @@ return {
},
},
},
-- quick commenting
{
'numToStr/Comment.nvim',
opts = {
-- add any options here
}
},
-- Add scrollbar
'petertriho/nvim-scrollbar',
-- Show shortcut keys
@ -171,7 +190,11 @@ return {
{
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({})
require('lspsaga').setup({
lightbulb = {
enable = false,
},
})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
@ -196,6 +219,34 @@ return {
version = "*",
config = true
},
-- Completion framework
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-cmdline",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
require("config.plugin.cmp")
end,
},
-- Improves tabs
{
"akinsho/bufferline.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("bufferline").setup({
options = {
mode = "buffers",
separator_style = "slant",
}
})
end,
},
-- AI
-- {
-- "supermaven-inc/supermaven-nvim",