Compare commits

..

9 Commits

Author SHA1 Message Date
87ab333ec9 Added org mode insert <C-CR> to be meta_return 2025-10-23 08:46:39 +02:00
93e281cbb5 Register fzf-lua as ui_select on startup 2025-09-15 10:49:20 +02:00
4bd4d87f5b Dropped AI integration, inline diagnostics, orgmode completion
Keymaps:

- key binding for viewing git log of current file: <space>=l
- blink keybindings simplified, added orgmode as source

Plugins:
- folke todo comments disabled
- dropped all AI integration
- added tiny-inline-diagnostic for easier and(!) wrapped diagnostic
  messages
- added sqlua.ncim plugin to connect to SQL databases
2025-09-08 08:28:03 +02:00
3ac01d9776 Enable more lsp 2025-08-18 08:38:30 +02:00
08784c625a Migrated to vue-language-server 3.0.x 2025-07-21 10:26:11 +02:00
59f4064788 Orgmode mappings <C-M-(left,right)> to promote/demote subtree, diags no multiline 2025-07-21 10:25:28 +02:00
74baebf3f8 Lualine: dropped breadcrumb winbar, was not in use at all
- research turned up no usable plugin or method to display stuff I
  really want or need to know.
2025-07-11 21:34:30 +02:00
3b7c034926 Layout: properly handle cursor position as layout[4] 2025-07-11 10:29:32 +02:00
12152a20db Updated layout to handle cursor positions, too 2025-07-11 10:19:48 +02:00
7 changed files with 166 additions and 283 deletions

13
after/ftplugin/org.lua Normal file
View File

@@ -0,0 +1,13 @@
-- make C-CR in insert mode behave like org_meta_return
-- in normal mode
vim.keymap.set(
"i",
"<C-CR>",
'<cmd>lua require("orgmode").action("org_mappings.meta_return")<CR>', {
silent = true,
buffer = true,
desc = 'ORG: meta return'
}
)

View File

@@ -82,7 +82,6 @@ local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded
dashboard.section.header.val = vim.split(adjustedLogo, '\n') dashboard.section.header.val = vim.split(adjustedLogo, '\n')
dashboard.section.buttons.val = { dashboard.section.buttons.val = {
dashboard.button('o', '󱙺 AI Chat', '<cmd>OGPT<CR>'),
dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'), dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'),
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'), dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'), dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),

View File

@@ -1,84 +1,41 @@
-- an alternative might be: require("lualine").setup {
-- https://github.com/nvim-treesitter/nvim-treesitter-context options = {
local function breadcrumb() icons_enabled = false,
local result = require 'nvim-treesitter'.statusline( theme = 'papercolor_light',
{ component_separators = {},
type_patterns = { section_separators = {},
"class", disabled_filetypes = {
"impl", statusline = {},
"function", winbar = { "neo-tree" },
"method", },
"import", ignore_focus = {},
"for", always_divide_middle = true,
"if", globalstatus = false,
"while", refresh = {
"variable", statusline = 1000,
"comment", tabline = 1000,
}, winbar = 1000,
separator = "" }
} },
) sections = {
if result == "" then lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
result = ' ' lualine_b = { 'branch', 'diff', 'diagnostics' },
elseif result == nil then lualine_c = {},
result = '' lualine_x = { 'encoding', 'fileformat', 'filetype', 'lsp_status' },
end lualine_y = { 'filesize' },
return result lualine_z = { 'progress', 'location' }
end },
inactive_sections = {
require("lualine").setup { lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
options = { lualine_b = {},
icons_enabled = false, lualine_c = {},
theme = 'papercolor_light', -- lualine_x = { 'encoding', 'fileformat', 'filetype' },
component_separators = {}, lualine_x = {},
section_separators = {}, lualine_y = { 'filesize' },
disabled_filetypes = { lualine_z = { 'location' }
statusline = {}, },
winbar = { "neo-tree" }, tabline = {},
}, winbar = {}, -- formerly breadcrumb here
ignore_focus = {}, inactive_winbar = {},
always_divide_middle = true, extensions = {}
globalstatus = false, }
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {},
lualine_x = { 'encoding', 'fileformat', 'filetype', 'lsp_status' },
lualine_y = { 'filesize' },
lualine_z = { 'progress', 'location' }
},
inactive_sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = {},
lualine_c = {},
-- lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_x = {},
lualine_y = { 'filesize' },
lualine_z = { 'location' }
},
tabline = {},
winbar = {
lualine_a = {
{
breadcrumb,
color = { bg = '#2a2a2a', fg = '#cfcfcf' },
},
},
},
inactive_winbar = {
lualine_a = {
{
breadcrumb,
color = { bg = '#101010', fg = '#999999' },
draw_empty = true
}
},
},
extensions = {}
}

View File

@@ -71,8 +71,14 @@ vim.keymap.set('n', '<leader>w', workspaces_fzf_picker, { desc = "Workspaces" })
------------------------------------------ ------------------------------------------
local layout = require('layout') local layout = require('layout')
vim.keymap.set('n', '<leader>ss', function() layout.save('default') end, { desc = "Save window layout" }) vim.keymap.set('n', '<leader>ss', function()
vim.keymap.set('n', '<leader>sr', function() layout.restore('default') end, { desc = "Restore window layout" }) layout.save('default')
print("Window layout saved")
end, { desc = "Save window layout" })
vim.keymap.set('n', '<leader>sr', function()
layout.restore('default')
print("Window layout restored")
end, { desc = "Restore window layout" })
------------------------------------------ ------------------------------------------
-- --
@@ -87,7 +93,7 @@ vim.keymap.set('n', '<space>mc', mywords.uhl_all, { desc = "Clear all highlights
------------------------------------------ ------------------------------------------
-- --
-- Some convenience keybindings -- Moving lines up and down
-- --
------------------------------------------ ------------------------------------------

View File

@@ -2,6 +2,9 @@
-- inspired by: -- inspired by:
-- - https://github.com/dedowsdi/.vim/blob/master/autoload/ddd/layout.vim -- - https://github.com/dedowsdi/.vim/blob/master/autoload/ddd/layout.vim
-- - https://vi.stackexchange.com/a/22545/53081 -- - https://vi.stackexchange.com/a/22545/53081
--
-- added cursor position handling
local M = {} local M = {}
local layouts = {} local layouts = {}
local resize_cmds = {} local resize_cmds = {}
@@ -14,7 +17,9 @@ end
function M.add_buf_to_layout(layout) function M.add_buf_to_layout(layout)
if layout[1] == "leaf" then if layout[1] == "leaf" then
table.insert(layout, vim.fn.winbufnr(layout[2])) local win_id = layout[2]
table.insert(layout, vim.fn.winbufnr(win_id))
table.insert(layout, vim.api.nvim_win_get_cursor(win_id))
else else
for _, child_layout in ipairs(layout[2]) do for _, child_layout in ipairs(layout[2]) do
M.add_buf_to_layout(child_layout) M.add_buf_to_layout(child_layout)
@@ -31,18 +36,20 @@ function M.restore(name)
vim.cmd("new") vim.cmd("new")
vim.cmd("wincmd o") vim.cmd("wincmd o")
-- Recursively restore buffers -- Recursively restore buffers and cursor positions
M.apply_layout(layouts[name]) M.apply_layout(layouts[name], name)
-- Resize -- Resize
vim.cmd(resize_cmds[name]) vim.cmd(resize_cmds[name])
end end
function M.apply_layout(layout) function M.apply_layout(layout, name)
if layout[1] == "leaf" then if layout[1] == "leaf" then
-- Load buffer for leaf -- Load buffer for leaf
if vim.fn.bufexists(layout[3]) == 1 then if vim.fn.bufexists(layout[3]) == 1 then
vim.cmd(string.format("b %d", layout[3])) vim.cmd(string.format("b %d", layout[3]))
-- Restore cursor position
vim.api.nvim_win_set_cursor(vim.fn.win_getid(), layout[4])
end end
else else
-- Split cols or rows, split n-1 times -- Split cols or rows, split n-1 times
@@ -56,7 +63,7 @@ function M.apply_layout(layout)
-- Recursive into child windows -- Recursive into child windows
for index, win_id in ipairs(wins) do for index, win_id in ipairs(wins) do
vim.fn.win_gotoid(win_id) vim.fn.win_gotoid(win_id)
M.apply_layout(layout[2][index]) M.apply_layout(layout[2][index], name)
end end
end end
end end

View File

@@ -34,6 +34,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set('n', '<space>]', vim.diagnostic.goto_next, { desc = "Previous diagnostics" }) vim.keymap.set('n', '<space>]', vim.diagnostic.goto_next, { desc = "Previous diagnostics" })
local gitsigns = require('gitsigns') local gitsigns = require('gitsigns')
vim.keymap.set('n', '<space>=l', ":NeogitLogCurrent<CR>", { desc = "Neogit: log for this file" })
vim.keymap.set('n', '<space>==', gitsigns.preview_hunk_inline, { desc = "Git hunk preview" }) vim.keymap.set('n', '<space>==', gitsigns.preview_hunk_inline, { desc = "Git hunk preview" })
vim.keymap.set('n', '<space>=B', gitsigns.blame, { desc = "Git blame file" }) vim.keymap.set('n', '<space>=B', gitsigns.blame, { desc = "Git blame file" })
vim.keymap.set('n', '<space>=D', function() gitsigns.diffthis('~') end, { desc = "Git diff this (~)" }) vim.keymap.set('n', '<space>=D', function() gitsigns.diffthis('~') end, { desc = "Git diff this (~)" })
@@ -65,26 +66,43 @@ function LSPRangeFormatFunction()
}) })
end end
-- Set different settings for different languages' LSP
-- use globally installed vue-language-server (instead of mason provided) -- VUE and Typescript as of vue-language-server 3.0.x
vim.lsp.config('vue_ls', { -- taken from:
-- add filetypes for typescript, javascript and vue -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, local vue_language_server_path = '/home/saschal/.config/yarn/global/node_modules'
init_options = { local vue_plugin = {
vue = { name = '@vue/typescript-plugin',
-- disable hybrid mode, will thus use ts_ls internally location = vue_language_server_path,
hybridMode = false, languages = { 'vue' },
configNamespace = 'typescript',
}
local vtsls_config = {
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
}, },
}, },
}) filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
vim.lsp.config('vtsls', vtsls_config)
-- enable this list of lsps
local enable_this_lsp = { local enable_this_lsp = {
'vue_ls', 'vue_ls',
'vtsls',
'gopls', 'gopls',
'bashls', 'bashls',
'html', 'html',
'lua_ls', 'lua_ls',
'jsonls', -- arch extra: vscode-json-languageserver
'kotlin_lsp', -- arch aur: kotlin-lsp-bin
'lemminx', -- arch aur: lemminx
'clangd',
} }
for l in pairs(enable_this_lsp) do for l in pairs(enable_this_lsp) do

View File

@@ -46,13 +46,16 @@ require("lazy").setup({
-- --
-- See :h blink-cmp-config-keymap for defining your own keymap -- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { keymap = {
preset = 'enter', -- preset = 'enter',
['<Up>'] = { 'select_prev', 'fallback' }, preset = 'default',
['<Down>'] = { 'select_next', 'fallback' }, -- ['<Up>'] = { 'select_prev', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' }, -- ['<Down>'] = { 'select_next', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' }, -- ['<S-Tab>'] = { 'select_prev', 'fallback' },
-- ['<Tab>'] = { 'select_next', 'fallback' },
['<CR>'] = { 'select_and_accept', 'fallback' }, ['<CR>'] = { 'select_and_accept', 'fallback' },
['<C-space>'] = { 'show', 'fallback' }, ['<C-space>'] = { 'show_and_insert', 'fallback' },
-- ['<C-space>'] = { 'show', 'fallback' },
-- ['<C-n>'] = { 'accept', 'fallback' },
}, },
signature = { enabled = true }, signature = { enabled = true },
@@ -80,7 +83,19 @@ require("lazy").setup({
-- Default list of enabled providers defined so that you can extend it -- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend` -- elsewhere in your config, without redefining it, due to `opts_extend`
sources = { sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' }, default = { 'lsp', 'path', 'snippets', 'buffer', 'orgmode' },
-- per_filetype = {
-- org = { 'orgmode' }
-- },
providers = {
orgmode = {
name = 'Orgmode',
module = 'orgmode.org.autocompletion.blink',
fallbacks = { 'lsp', 'path', 'snippets', 'buffer' },
-- fallbacks = { 'buffer' },
},
},
}, },
snippets = { preset = 'luasnip' }, snippets = { preset = 'luasnip' },
@@ -138,7 +153,9 @@ require("lazy").setup({
"ibhagwan/fzf-lua", "ibhagwan/fzf-lua",
-- optional for icon support -- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = true, config = function()
require('fzf-lua').register_ui_select()
end
}, },
@@ -168,10 +185,13 @@ require("lazy").setup({
config = function() config = function()
-- Setup orgmode -- Setup orgmode
require('orgmode').setup({ require('orgmode').setup({
-- cf: https://github.com/nvim-orgmode/orgmode/blob/master/docs/configuration.org#mappings
mappings = { mappings = {
org = { org = {
org_move_subtree_up = { '<Leader>oK', '<C-M-Up>' }, org_move_subtree_up = { '<Leader>oK', '<C-M-Up>' },
org_move_subtree_down = { '<Leader>oJ', '<C-M-Down>' }, org_move_subtree_down = { '<Leader>oJ', '<C-M-Down>' },
org_promote_subtree = { '<s', '<C-M-Left>' },
org_demote_subtree = { '>s', '<C-M-Right>' },
} }
}, },
-- org_agenda_files = '~/orgfiles/**/*', -- org_agenda_files = '~/orgfiles/**/*',
@@ -382,15 +402,15 @@ require("lazy").setup({
-- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching -- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching
{ -- {
"folke/todo-comments.nvim", -- "folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, -- dependencies = { "nvim-lua/plenary.nvim" },
opts = { -- opts = {
-- your configuration comes here -- -- your configuration comes here
-- or leave it empty to use the default settings -- -- or leave it empty to use the default settings
-- refer to the configuration section below -- -- refer to the configuration section below
} -- }
}, -- },
-- highlight word under cursor -- highlight word under cursor
{ {
@@ -447,6 +467,7 @@ require("lazy").setup({
}, },
}, },
-- show indent markers -- show indent markers
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
@@ -456,170 +477,32 @@ require("lazy").setup({
opts = {}, opts = {},
}, },
-- ollama and LLM integration
-- improved (wrapping!) diagnostics
{ {
{ "rachartier/tiny-inline-diagnostic.nvim",
"huynle/ogpt.nvim", event = "VeryLazy", -- one of LspAttach, VeryLazy
event = "VeryLazy", priority = 1000, -- needs to be loaded in first
opts = { config = function()
default_provider = "ollama", require('tiny-inline-diagnostic').setup({
edgy = true, -- enable this! options = {
single_window = false, -- set this to true if you want only one OGPT window to appear at a time use_icons_from_diagnostic = true,
providers = { enable_on_insert = true,
ollama = { show_all_diags_on_cursorline = true,
api_host = os.getenv("OLLAMA_API_HOST") or "http://localhost:11434",
api_key = os.getenv("OLLAMA_API_KEY") or "",
model = "llama3.2-vision:sl",
}
} }
}, })
dependencies = { vim.diagnostic.config({ virtual_text = false }) -- Only if needed in your configuration, if you already have native LSP diagnostics
"MunifTanjim/nui.nvim", end
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
},
{
"folke/edgy.nvim",
event = "VeryLazy",
init = function()
vim.opt.laststatus = 3
vim.opt.splitkeep = "screen" -- or "topline" or "screen"
end,
opts = {
exit_when_last = false,
animate = {
enabled = false,
},
wo = {
winbar = true,
winfixwidth = true,
winfixheight = false,
winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
spell = false,
signcolumn = "no",
},
keys = {
-- -- close window
["q"] = function(win)
win:close()
end,
-- close sidebar
["Q"] = function(win)
win.view.edgebar:close()
end,
-- increase width
["<S-Right>"] = function(win)
win:resize("width", 3)
end,
-- decrease width
["<S-Left>"] = function(win)
win:resize("width", -3)
end,
-- increase height
["<S-Up>"] = function(win)
win:resize("height", 3)
end,
-- decrease height
["<S-Down>"] = function(win)
win:resize("height", -3)
end,
},
right = {
{
title = "OGPT Popup",
ft = "ogpt-popup",
size = { width = 0.2 },
wo = {
wrap = true,
},
},
{
title = "OGPT Parameters",
ft = "ogpt-parameters-window",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT Template",
ft = "ogpt-template",
size = { height = 6 },
},
{
title = "OGPT Sessions",
ft = "ogpt-sessions",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT System Input",
ft = "ogpt-system-window",
size = { height = 6 },
},
{
title = "OGPT",
ft = "ogpt-window",
size = { height = 0.5 },
wo = {
wrap = true,
},
},
{
title = "OGPT {{{selection}}}",
ft = "ogpt-selection",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPt {{{instruction}}}",
ft = "ogpt-instruction",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPT Chat",
ft = "ogpt-input",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
},
},
},
-- improved (wrapping!) diagnostics
{
"rachartier/tiny-inline-diagnostic.nvim",
event = "VeryLazy", -- one of LspAttach, VeryLazy
priority = 1000, -- needs to be loaded in first
config = function()
require('tiny-inline-diagnostic').setup({
options = {
use_icons_from_diagnostic = true,
enable_on_insert = true,
show_all_diags_on_cursorline = true,
multilines = {
enabled = true,
always_show = true,
}
}
})
vim.diagnostic.config({ virtual_text = false }) -- Only if needed in your configuration, if you already have native LSP diagnostics
end
},
-- new plugins here
}, },
-- 2025-05-21 not yet clear if this is a good thing or not
{
'xemptuous/sqlua.nvim',
lazy = true,
cmd = 'SQLua',
config = function() require('sqlua').setup() end
},
-- new plugins BEFORE here
}) })