Compare commits

..

35 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
3e6c115673 Added keybindings to open org file folder <leader>of, vue_ls handles ts 2025-07-11 09:45:46 +02:00
fd6dd0ba8c Improved keybindings for blink: <Up>, <Down> 2025-07-11 09:45:15 +02:00
ee7157a23a Added commands to save and restore window layouts <leader>ss, sr 2025-07-11 09:44:19 +02:00
3e3d7b8173 Reverted back to lunaperche, better compatibility with raw terminal 2025-07-07 22:15:34 +02:00
19cfaeab49 Disabled mason plugin, added Nightfox colorscheme 2025-07-07 09:08:04 +02:00
5b41b4d781 Gitsigns stage selected lines in visual mode 2025-07-04 13:11:12 +02:00
9faa5209bb Dropped mason (was mixing vue language server up anyways) 2025-07-04 13:05:47 +02:00
36487d273e Added tiny-inline-diagnostic for wrapped lsp diagnostics 2025-07-04 13:05:04 +02:00
5b58207e16 Lualine shows lsp_status, fzf-lua moved up 2025-07-04 12:56:48 +02:00
270222bb57 LSP uses system wide vue-language-server, mason sucks here 2025-07-04 12:05:23 +02:00
75f9692e7d Dropped asciidoc treesitter code 2025-07-03 21:34:48 +02:00
4bb854c54d Fixing termcursor to cursor style in terminals 2025-06-30 08:58:00 +02:00
15e21f333f Replaced nvim-cmp with blink.cmp 2025-06-30 08:57:18 +02:00
1cb0d8ab2a Diary settings, added to alpha splash screen 2025-06-30 08:56:24 +02:00
b6c4df13e0 Dropped support for tidal and sonic pi live coding 2025-06-24 09:20:06 +02:00
3ded8e9e0d Updates to confile syntax highlighting 2025-06-24 09:18:27 +02:00
56136ef0f1 Fixing cursor color on light background by setting guicursor 2025-06-24 09:17:55 +02:00
e5f95df420 Added command :Diary to open the AsciiDoc diary and start a new entry 2025-06-08 12:35:51 +02:00
811b7d9c07 <leader>C for vertical calendar, todo snippet with an extra space 2025-06-08 07:53:05 +02:00
9b9673d159 Moved lengthy setup routines from plugins.lua to config/<pluginname>.lua 2025-06-08 07:52:24 +02:00
6c8b1c87d4 Org Roam added, orgmode now with C-M-Up / -Down to move trees 2025-05-23 22:32:23 +02:00
3d6d0b38f3 Snippets: added datetime, todo and note now end in " - " 2025-05-23 22:31:23 +02:00
bec7627aaa Dropped support for calc + cmp-calc, use qalc instead for explicit calculations 2025-05-23 22:30:48 +02:00
c38ec7f2e4 Keybindings:
- rust overrides K for hover actions and J for joinLines
- <space>F now is dioxus format file
- <space>E now is vim.diagnostic.open_float

Config:

- splash shows OGPT entry
- rustaceanvim now requires version ^6 instead of ^5
- dropped sqls.nvim
2025-05-13 21:16:59 +02:00
9206d3ca43 Migrated lspconfig for ts_ls 2025-05-13 10:53:41 +02:00
f3157898b6 Added syntax highlighting for .CON files 2025-05-04 23:31:37 +02:00
16 changed files with 567 additions and 603 deletions

View File

@@ -1,2 +1,3 @@
-- Options for AsciiDoc files, mainly used in diary situations -- Options for AsciiDoc files, mainly used in diary situations
-- (pun intended)
vim.opt.textwidth = 80 vim.opt.textwidth = 80

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

@@ -29,3 +29,9 @@ vim.keymap.set(
end, end,
{ silent = true, buffer = bufnr, desc = 'RustLSP: show runnables' } { silent = true, buffer = bufnr, desc = 'RustLSP: show runnables' }
) )
-- override signature hover to use RustLsp
vim.keymap.set('n', 'K', ":RustLsp hover actions<cr>", { desc = "RustLSP show signature" })
vim.keymap.set('n', 'J', ":RustLsp joinLines<cr>", { desc = "RustLSP join lines" })

View File

@@ -1,7 +1,10 @@
-- load configurations files from lua/* -- load configurations files from lua/*
require('filetype')
require('options') require('options')
require('functions') require('functions')
require('plugins') require('plugins')
require('colorscheme') require('colorscheme')
require('lsp') require('lsp')
require('keybindings') require('keybindings')
require('diary')
require('layout')

109
lua/config/alpha-nvim.lua Normal file
View File

@@ -0,0 +1,109 @@
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
_Gopts = {
position = 'center',
hl = 'Type',
wrap = 'overflow',
}
-- DASHBOARD HEADER
local function getGreeting()
local tableTime = os.date '*t'
local datetime = os.date ' %Y-%m-%d-%A  %H:%M:%S '
local hour = tableTime.hour
local greetingsTable = {
[1] = ' Sleep well',
[2] = ' Good morning',
[3] = ' Good afternoon',
[4] = ' Good evening',
[5] = '󰖔 Good night',
}
local greetingIndex = 0
if hour == 23 or hour < 7 then
greetingIndex = 1
elseif hour < 12 then
greetingIndex = 2
elseif hour >= 12 and hour < 18 then
greetingIndex = 3
elseif hour >= 18 and hour < 21 then
greetingIndex = 4
elseif hour >= 21 then
greetingIndex = 5
end
return datetime .. ' ' .. greetingsTable[greetingIndex]
end
local logo = [[

████ ██████ █████ ██
███████████ █████ 
█████████ ███████████████████ ███ ███████████
█████████ ███ █████████████ █████ ██████████████
█████████ ██████████ █████████ █████ █████ ████ █████
███████████ ███ ███ █████████ █████ █████ ████ █████
██████ █████████████████████ ████ █████ █████ ████ ██████
]]
local greeting = getGreeting()
local marginBottom = 0
-- Split logo into lines
local logoWidth = 0
for line in logo:gmatch '[^\n]+' do
logoWidth = math.max(logoWidth, #line / 2)
end
logoWidth = 75 -- code above does not work with utf8 strings in lua 5.1
-- Calculate padding for centering the greeting
local greetingWidth = #greeting - 3
local padding = math.floor((logoWidth - greetingWidth) / 2)
-- Generate spaces for padding
local paddedGreeting = string.rep(' ', padding) .. greeting
local userName = "You work as '" .. vim.env.USER .. "'."
-- Calculate padding for centering the username
local userNameWidth = #userName
local padding = math.floor((logoWidth - userNameWidth) / 2)
-- Generate spaces for padding
local userNamePadded = string.rep(' ', padding) .. userName
-- Add margin lines below the padded greeting
local margin = string.rep('\n', marginBottom * 5)
-- Concatenate logo, padded greeting, and margin
local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded .. '\n' .. margin
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
dashboard.section.buttons.val = {
dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'),
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
dashboard.button('u', '󱐥 Update plugins', '<cmd>Lazy update<CR>'),
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
dashboard.button('q', '󰤆 Quit', '<cmd>qa<CR>'),
}
-- dashboard.section.footer.val = greeting
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
desc = 'Add Alpha dashboard footer',
once = true,
callback = function()
local stats = require('lazy').stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
dashboard.section.footer.val = { ' ', ' ', ' ', ' Loaded ' .. stats.count .. ' plugins  in ' .. ms .. ' ms ' }
dashboard.section.header.opts.hl = 'DashboardFooter'
pcall(vim.cmd.AlphaRedraw)
end,
})
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)

41
lua/config/lualine.lua Normal file
View File

@@ -0,0 +1,41 @@
require("lualine").setup {
options = {
icons_enabled = false,
theme = 'papercolor_light',
component_separators = {},
section_separators = {},
disabled_filetypes = {
statusline = {},
winbar = { "neo-tree" },
},
ignore_focus = {},
always_divide_middle = true,
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 = {}, -- formerly breadcrumb here
inactive_winbar = {},
extensions = {}
}

View File

@@ -1,96 +0,0 @@
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
-- Use <C-b/f> to scroll the docs
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- also scroll docs with page up / down
['<PageUp>'] = cmp.mapping.scroll_docs(-4),
['<PageDown>'] = cmp.mapping.scroll_docs(4),
-- ESC messes with standard ESC mapping, don't use
-- ['<Esc>'] = cmp.mapping.abort(),
['<C-e>'] = cmp.mapping.abort(),
-- Use <CR>(Enter) to confirm selection
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = true }),
-- A super tab
-- sourc: https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip
["<Tab>"] = cmp.mapping(function(fallback)
-- Hint: if the completion menu is visible select next one
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.jumpable(1) then
luasnip.jump(1)
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }), -- i - insert mode; s - select mode
["<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" }),
}),
-- Let's configure the item's appearance
-- source: https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance
formatting = {
-- Set order from left to right
-- kind: single letter indicating the type of completion
-- abbr: abbreviation of "word"; when not empty it is used in the menu instead of "word"
-- menu: extra text for the popup menu, displayed after "word" or "abbr"
fields = { 'abbr', 'menu' },
-- customize the appearance of the completion menu
format = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = '[Lsp]',
luasnip = '[Luasnip]',
buffer = '[File]',
path = '[Path]',
})[entry.source.name]
return vim_item
end,
},
-- Set source precedence
sources = cmp.config.sources({
{ name = 'nvim_lsp' }, -- For nvim-lsp
{ name = 'luasnip' }, -- For luasnip user
{ name = 'buffer' }, -- For buffer word completion
{ name = 'path' }, -- For path completion
{ name = 'orgmode' }, -- for nvim-orgmode
{ name = 'sonicpi' }, -- for sonic-pi integration
{ name = 'calc' }, -- for calulcator
})
})

22
lua/diary.lua Normal file
View File

@@ -0,0 +1,22 @@
local diary_open = function(opts)
local date = opts.args ~= '' and opts.args or os.date('%Y-%m-%d')
local year, month = date:match('(%d%d%d%d)-(%d%d)')
local file = string.format('~/.diary/asciidoc/%s/diary-%s-%s.adoc', year, year, month)
print("file is:", file)
vim.cmd('e ' .. file)
vim.cmd('normal! G')
-- NOTE.2025-06-08 [1] and [2] should be replaced with snippet name, but I
-- don't know how -- neither do grok nor chatgpt ...
local snips = require('luasnip')
local asnippets = snips.get_snippets('asciidoc')
if vim.fn.getfsize(file) == 0 then
snips.snip_expand(asnippets[1])
vim.cmd('normal! G')
end
vim.cmd('normal! 3o') -- insert some newlines before new entry
snips.snip_expand(asnippets[2])
end
vim.api.nvim_create_user_command("Diary", diary_open, { nargs = '?' })

5
lua/filetype.lua Normal file
View File

@@ -0,0 +1,5 @@
vim.filetype.add({
extension = {
CON = 'confile',
},
})

View File

@@ -20,18 +20,22 @@ vim.keymap.set('n', '<leader>g', ":Neogit<CR>", { desc = "Neogit" })
vim.keymap.set('n', '<leader>T', ":Neotree reveal<CR>", { desc = "File Manager" }) vim.keymap.set('n', '<leader>T', ":Neotree reveal<CR>", { desc = "File Manager" })
-- calendar -- calendar
vim.keymap.set('n', '<leader>c', ":Calendar -split=horizontal -position=below -height=12<CR>", { desc = "Show calendar" }) vim.keymap.set('n', '<leader>c', ":Calendar -split=horizontal -position=below -height=12<CR>", { desc = "Show calendar below" })
vim.keymap.set('n', '<leader>C', ":Calendar -view=year -split=vertical -width=27<CR>", { desc = "Show calendar right" })
-- Open current file in browser (chromium) -- Open current file in browser (chromium)
vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in browser" }) vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in browser" })
-- Open org file folder in neotree
vim.keymap.set('n', '<leader>of', ':silent :Neotree dir=/home/saschal/Documents/Eigene\\ (Briefe\\ etc.)/org<cr>', { desc = "Open org folder" })
-- toggle colorscheme between dark and light -- toggle colorscheme between dark and light
vim.keymap.set('n', '<leader>m', function() vim.keymap.set('n', '<leader>m', function()
if vim.opt.background:get() == "dark" then if vim.opt.background:get() == "dark" then
vim.o.background = "light" vim.o.background = "light"
else else
vim.o.background = "dark" vim.o.background = "dark"
end end
end, { desc = "Toggle dark/light mode" }) end, { desc = "Toggle dark/light mode" })
-- --
@@ -60,6 +64,22 @@ local workspaces_fzf_picker = function(opts)
end end
vim.keymap.set('n', '<leader>w', workspaces_fzf_picker, { desc = "Workspaces" }) vim.keymap.set('n', '<leader>w', workspaces_fzf_picker, { desc = "Workspaces" })
------------------------------------------
--
-- Window layout save and restore
--
------------------------------------------
local layout = require('layout')
vim.keymap.set('n', '<leader>ss', function()
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" })
------------------------------------------ ------------------------------------------
-- --
-- Word higlighting -- Word higlighting
@@ -73,7 +93,7 @@ vim.keymap.set('n', '<space>mc', mywords.uhl_all, { desc = "Clear all highlights
------------------------------------------ ------------------------------------------
-- --
-- Some convenience keybindings -- Moving lines up and down
-- --
------------------------------------------ ------------------------------------------

71
lua/layout.lua Normal file
View File

@@ -0,0 +1,71 @@
-- save and restore current window layout
-- inspired by:
-- - https://github.com/dedowsdi/.vim/blob/master/autoload/ddd/layout.vim
-- - https://vi.stackexchange.com/a/22545/53081
--
-- added cursor position handling
local M = {}
local layouts = {}
local resize_cmds = {}
function M.save(name)
layouts[name] = vim.fn.winlayout()
resize_cmds[name] = vim.fn.winrestcmd()
M.add_buf_to_layout(layouts[name])
end
function M.add_buf_to_layout(layout)
if layout[1] == "leaf" then
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
for _, child_layout in ipairs(layout[2]) do
M.add_buf_to_layout(child_layout)
end
end
end
function M.restore(name)
if not layouts[name] then
return
end
-- Create clean window
vim.cmd("new")
vim.cmd("wincmd o")
-- Recursively restore buffers and cursor positions
M.apply_layout(layouts[name], name)
-- Resize
vim.cmd(resize_cmds[name])
end
function M.apply_layout(layout, name)
if layout[1] == "leaf" then
-- Load buffer for leaf
if vim.fn.bufexists(layout[3]) == 1 then
vim.cmd(string.format("b %d", layout[3]))
-- Restore cursor position
vim.api.nvim_win_set_cursor(vim.fn.win_getid(), layout[4])
end
else
-- Split cols or rows, split n-1 times
local split_method = layout[1] == "col" and "rightbelow split" or "rightbelow vsplit"
local wins = { vim.fn.win_getid() }
for i = 2, #layout[2] do
vim.cmd(split_method)
table.insert(wins, vim.fn.win_getid())
end
-- Recursive into child windows
for index, win_id in ipairs(wins) do
vim.fn.win_gotoid(win_id)
M.apply_layout(layout[2][index], name)
end
end
end
return M

View File

@@ -1,4 +1,4 @@
-- attach using autocommand, much better than doing it during mason -- attach using autocommand and setup keybindings
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('sl.lsp', {}), group = vim.api.nvim_create_augroup('sl.lsp', {}),
callback = function(args) callback = function(args)
@@ -16,6 +16,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set("n", "<space>f", function() vim.keymap.set("n", "<space>f", function()
vim.lsp.buf.format({ async = true }) vim.lsp.buf.format({ async = true })
end, { desc = "LSP Format buffer", unpack(bufopts) }) end, { desc = "LSP Format buffer", unpack(bufopts) })
vim.keymap.set("n", '<space>F', ":silent !dx fmt --file %<cr>", { desc = "DX format rsx! regions", unpack(bufopts) })
vim.keymap.set("v", "<space>f", LSPRangeFormatFunction, { desc = "LSP Format region" }) vim.keymap.set("v", "<space>f", LSPRangeFormatFunction, { desc = "LSP Format region" })
-- 2024-09-09 - some ccflow commands for diagnostics, symbols and code actions -- 2024-09-09 - some ccflow commands for diagnostics, symbols and code actions
@@ -26,12 +27,14 @@ vim.api.nvim_create_autocmd('LspAttach', {
local new_config = not vim.diagnostic.config().virtual_lines local new_config = not vim.diagnostic.config().virtual_lines
vim.diagnostic.config({ virtual_lines = new_config }) vim.diagnostic.config({ virtual_lines = new_config })
end, { desc = "Virtual line diagnostics" }) end, { desc = "Virtual line diagnostics" })
vim.keymap.set('n', '<space>E', vim.diagnostic.open_float, { desc = "Popup diagnostics" })
vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" }) vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" })
vim.keymap.set('n', '<space>c', fzf.lsp_code_actions, { desc = "Code Actions" }) vim.keymap.set('n', '<space>c', fzf.lsp_code_actions, { desc = "Code Actions" })
vim.keymap.set('n', '<space>[', vim.diagnostic.goto_prev, { desc = "Previous diagnostics" }) vim.keymap.set('n', '<space>[', vim.diagnostic.goto_prev, { desc = "Previous diagnostics" })
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 (~)" })
@@ -43,6 +46,8 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set('n', '<space>=d', gitsigns.diffthis, { desc = "Git diff this" }) vim.keymap.set('n', '<space>=d', gitsigns.diffthis, { desc = "Git diff this" })
vim.keymap.set('n', '<space>=r', gitsigns.reset_hunk, { desc = "Git reset hunk" }) vim.keymap.set('n', '<space>=r', gitsigns.reset_hunk, { desc = "Git reset hunk" })
vim.keymap.set('n', '<space>=s', gitsigns.stage_hunk, { desc = "Git stage hunk" }) vim.keymap.set('n', '<space>=s', gitsigns.stage_hunk, { desc = "Git stage hunk" })
vim.keymap.set('v', '<space>=s', function() gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end,
{ desc = "Git stage hunk" })
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<C-,>', fzf.lsp_references, { desc = "Find References" }) vim.keymap.set('n', '<C-,>', fzf.lsp_references, { desc = "Find References" })
@@ -50,28 +55,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
end end
}) })
require('mason').setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
require('mason-lspconfig').setup({
-- A list of servers to automatically install if they're not already installed
ensure_installed = {
'lua_ls',
-- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim
'yamlls',
'ts_ls',
'gopls',
'clangd',
},
})
-- lsp format selected range -- lsp format selected range
function LSPRangeFormatFunction() function LSPRangeFormatFunction()
vim.lsp.buf.format({ vim.lsp.buf.format({
@@ -84,60 +67,60 @@ function LSPRangeFormatFunction()
end end
-- Set different settings for different languages' LSP -- VUE and Typescript as of vue-language-server 3.0.x
-- LSP list: https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md -- taken from:
-- How to use setup({}): https://github.com/neovim/nvim-lspconfig/wiki/Understanding-setup-%7B%7D -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls
-- - the settings table is sent to the LSP local vue_language_server_path = '/home/saschal/.config/yarn/global/node_modules'
-- - on_attach: a lua callback function to run after LSP attaches to a given buffer local vue_plugin = {
local lspconfig = require('lspconfig') name = '@vue/typescript-plugin',
location = vue_language_server_path,
-- from :h mason-lspconfig-automatic-server-setup languages = { 'vue' },
require('mason-lspconfig').setup_handlers({ configNamespace = 'typescript',
-- The first entry (without a key) will be the default handler }
-- and will be called for each installed server that doesn't have local vtsls_config = {
-- a dedicated handler.
function(server_name) -- default handler (optional)
if server_name == 'ts_ls' then
-- taken from https://github.com/vuejs/language-tools
-- If you are using mason.nvim, you can get the ts_plugin_path like this
local mason_registry = require('mason-registry')
local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() ..
'/node_modules/@vue/language-server'
lspconfig[server_name].setup {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = vue_language_server_path,
languages = { 'vue' },
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
else
lspconfig[server_name].setup {
}
end
end
})
-- setup sqls support
lspconfig.sqls.setup {
settings = { settings = {
sqls = { vtsls = {
connections = { tsserver = {
-- { globalPlugins = {
-- driver = 'mysql', vue_plugin,
-- dataSourceName = 'root:root@tcp(127.0.0.1:13306)/world',
-- },
{
driver = 'postgresql',
dataSourceName = 'host=127.0.0.1 port=5432 sslmode=disable',
}, },
}, },
}, },
}, },
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
} }
vim.lsp.config('vtsls', vtsls_config)
-- enable this list of lsps
local enable_this_lsp = {
'vue_ls',
'vtsls',
'gopls',
'bashls',
'html',
'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
vim.lsp.enable(enable_this_lsp[l])
end
-- add autoformat to Dioxus projects
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.rs",
callback = function()
local cwd = vim.lsp.buf.list_workspace_folders()
if not (cwd == nil) then
if vim.fn.filereadable(cwd[1] .. "/Dioxus.toml") == 1 then
local command = "dx fmt --file %"
vim.cmd("silent ! " .. command)
-- vim.notify(command)
end
end
end,
})

View File

@@ -20,6 +20,8 @@ vim.opt.expandtab = true -- tabs are spaces, mainly because of python and becaus
vim.opt.number = true -- show absolute number vim.opt.number = true -- show absolute number
vim.opt.relativenumber = false -- add numbers to each line on the left side vim.opt.relativenumber = false -- add numbers to each line on the left side
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
vim.opt.guicursor = "" .. -- cursor highlight group needs to be Cursor to have lunaperche have a proper light cursor
"n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20,t:block-blinkon500-blinkoff500-Cursor"
vim.opt.splitbelow = true -- open new vertical split bottom vim.opt.splitbelow = true -- open new vertical split bottom
vim.opt.splitright = true -- open new horizontal splits right vim.opt.splitright = true -- open new horizontal splits right
vim.opt.termguicolors = true -- enable 24-bit RGB color in the TUI vim.opt.termguicolors = true -- enable 24-bit RGB color in the TUI

View File

@@ -14,19 +14,104 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
-- Auto-completion engine -- Auto-completion engine
{ {
"hrsh7th/nvim-cmp", 'saghen/blink.cmp',
dependencies = { -- optional: provides snippets for the snippet source
"hrsh7th/cmp-nvim-lsp", -- lsp auto-completion dependencies = { 'rafamadriz/friendly-snippets',
"hrsh7th/cmp-buffer", -- buffer auto-completion {
"hrsh7th/cmp-path", -- path auto-completion "L3MON4D3/LuaSnip",
"hrsh7th/cmp-cmdline", -- cmdline auto-completion version = "v2.*"
"saadparwaiz1/cmp_luasnip", -- luasnip auto-completion }
}, },
config = function()
require("config.nvim-cmp") -- use a release tag to download pre-built binaries
end, version = '1.*',
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = {
-- preset = 'enter',
preset = 'default',
-- ['<Up>'] = { 'select_prev', 'fallback' },
-- ['<Down>'] = { 'select_next', 'fallback' },
-- ['<S-Tab>'] = { 'select_prev', 'fallback' },
-- ['<Tab>'] = { 'select_next', 'fallback' },
['<CR>'] = { 'select_and_accept', 'fallback' },
['<C-space>'] = { 'show_and_insert', 'fallback' },
-- ['<C-space>'] = { 'show', 'fallback' },
-- ['<C-n>'] = { 'accept', 'fallback' },
},
signature = { enabled = true },
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = 'mono'
},
-- (Default) Only show the documentation popup when manually triggered
completion = {
documentation = { auto_show = true },
menu = {
-- show more things in the menu
draw = {
columns = {
{ "label", "label_description", gap = 1 },
{ "kind_icon", "kind", gap = 1 },
{ "source_name" },
},
}
},
},
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
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' },
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" }
},
opts_extend = { "sources.default" }
}, },
-- Code snippet engine -- Code snippet engine
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
@@ -40,8 +125,8 @@ require("lazy").setup({
-- --
-- LSP manager and others -- LSP manager and others
-- --
"williamboman/mason.nvim", -- "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", -- "williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
-- Nice plugin to show what LSPs are doing in the background (and others -- Nice plugin to show what LSPs are doing in the background (and others
@@ -63,6 +148,17 @@ require("lazy").setup({
}, },
}, },
-- fzf-lua
{
"ibhagwan/fzf-lua",
-- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require('fzf-lua').register_ui_select()
end
},
-- neogit setup -- neogit setup
{ {
"NeogitOrg/neogit", "NeogitOrg/neogit",
@@ -74,7 +170,11 @@ require("lazy").setup({
-- "nvim-telescope/telescope.nvim", -- optional -- "nvim-telescope/telescope.nvim", -- optional
"ibhagwan/fzf-lua", -- optional "ibhagwan/fzf-lua", -- optional
}, },
config = true config = function()
require('neogit').setup({
sort_branches = "refname"
})
end
}, },
-- org-mode -- org-mode
@@ -85,8 +185,19 @@ require("lazy").setup({
config = function() config = function()
-- Setup orgmode -- Setup orgmode
require('orgmode').setup({ require('orgmode').setup({
org_agenda_files = '~/orgfiles/**/*', -- cf: https://github.com/nvim-orgmode/orgmode/blob/master/docs/configuration.org#mappings
org_default_notes_file = '~/orgfiles/refile.org', mappings = {
org = {
org_move_subtree_up = { '<Leader>oK', '<C-M-Up>' },
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_default_notes_file = '~/orgfiles/refile.org',
org_agenda_files = '~/Documents/Eigene (Briefe etc.)/org/*.org',
org_default_notes_file = '~/Documents/Eigene (Briefe etc.)/org/refile.org',
org_todo_keywords = { 'TODO(t)', 'STARTED(s)', 'PLANNED(p)', '|', 'DONE(d)', 'UNPLANNED(u)' }, org_todo_keywords = { 'TODO(t)', 'STARTED(s)', 'PLANNED(p)', '|', 'DONE(d)', 'UNPLANNED(u)' },
org_custom_exports = { org_custom_exports = {
f = { f = {
@@ -94,7 +205,8 @@ require("lazy").setup({
action = function(exporter) action = function(exporter)
local current_file = vim.api.nvim_buf_get_name(0) local current_file = vim.api.nvim_buf_get_name(0)
local target = vim.fn.fnamemodify(current_file, ':p:r') .. '.html' local target = vim.fn.fnamemodify(current_file, ':p:r') .. '.html'
local command = { 'pandoc', '--filter', 'pandoc-plot', current_file, '--standalone', '--toc', '--number-sections', '--output', target } local command = { 'pandoc', '--filter', 'pandoc-plot', current_file, '--standalone', '--toc',
'--number-sections', '--output', target }
local on_success = function(output) local on_success = function(output)
print('Success!') print('Success!')
vim.api.nvim_echo({ { table.concat(output, '\n') } }, true, {}) vim.api.nvim_echo({ { table.concat(output, '\n') } }, true, {})
@@ -118,22 +230,28 @@ require("lazy").setup({
end, end,
}, },
-- comfortable table editing, esp. used in orgmode -- org-roam - lets try it out (2025-05-20)
{ 'dhruvasagar/vim-table-mode' },
-- fzf-lua
{ {
"ibhagwan/fzf-lua", "chipsenkbeil/org-roam.nvim",
-- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
-- calling `setup` is optional for customization require("org-roam").setup({
local fzf = require("fzf-lua") directory = "~/Documents/Eigene (Briefe etc.)/org/roam",
fzf.setup({ "default-title" }) -- optional
fzf.register_ui_select() -- org_files = {
-- "~/another_org_dir",
-- "~/some/folder/*.org",
-- "~/a/single/org_file.org",
-- }
bindings = {
prefix = "<LocalLeader>r"
}
})
end end
}, },
-- comfortable table editing, esp. used in orgmode
{ 'dhruvasagar/vim-table-mode' },
-- which-key -- which-key
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
@@ -208,90 +326,7 @@ require("lazy").setup({
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' }, dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function() config = function()
-- an alternative might be: require('config.lualine')
-- https://github.com/nvim-treesitter/nvim-treesitter-context
local function breadcrumb()
local result = require 'nvim-treesitter'.statusline(
{
type_patterns = {
"class",
"impl",
"function",
"method",
"import",
"for",
"if",
"while",
"variable",
"comment",
},
separator = ""
}
)
if result == "" then
result = ' '
elseif result == nil then
result = ''
end
return result
end
require("lualine").setup {
options = {
icons_enabled = false,
theme = 'papercolor_light',
component_separators = {},
section_separators = {},
disabled_filetypes = {
statusline = {},
winbar = { "neo-tree" },
},
ignore_focus = {},
always_divide_middle = true,
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' },
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 = {}
}
end end
}, },
@@ -355,11 +390,6 @@ require("lazy").setup({
end end
}, },
-- calulcation in cmp
{
"hrsh7th/cmp-calc",
},
-- calculate using qalc cli, call :QalcAttach or :Qalc -- calculate using qalc cli, call :QalcAttach or :Qalc
{ {
"Apeiros-46B/qalc.nvim", "Apeiros-46B/qalc.nvim",
@@ -372,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
{ {
@@ -392,11 +422,6 @@ require("lazy").setup({
"itchyny/calendar.vim" "itchyny/calendar.vim"
}, },
-- treesitter asciidoc support
-- // NOTE.2025-01-17 seems to be broken
-- { "cpkio/nvim-treesitter-asciidoc" },
-- Greeter to run on NeoVim startup -- Greeter to run on NeoVim startup
{ {
'goolord/alpha-nvim', 'goolord/alpha-nvim',
@@ -404,122 +429,14 @@ require("lazy").setup({
'nvim-tree/nvim-web-devicons', 'nvim-tree/nvim-web-devicons',
}, },
config = function() config = function()
local alpha = require 'alpha' require('config.alpha-nvim')
local dashboard = require 'alpha.themes.dashboard'
_Gopts = {
position = 'center',
hl = 'Type',
wrap = 'overflow',
}
-- DASHBOARD HEADER
local function getGreeting()
local tableTime = os.date '*t'
local datetime = os.date ' %Y-%m-%d-%A  %H:%M:%S '
local hour = tableTime.hour
local greetingsTable = {
[1] = ' Sleep well',
[2] = ' Good morning',
[3] = ' Good afternoon',
[4] = ' Good evening',
[5] = '󰖔 Good night',
}
local greetingIndex = 0
if hour == 23 or hour < 7 then
greetingIndex = 1
elseif hour < 12 then
greetingIndex = 2
elseif hour >= 12 and hour < 18 then
greetingIndex = 3
elseif hour >= 18 and hour < 21 then
greetingIndex = 4
elseif hour >= 21 then
greetingIndex = 5
end
return datetime .. ' ' .. greetingsTable[greetingIndex]
end
local logo = [[

████ ██████ █████ ██
███████████ █████ 
█████████ ███████████████████ ███ ███████████
█████████ ███ █████████████ █████ ██████████████
█████████ ██████████ █████████ █████ █████ ████ █████
███████████ ███ ███ █████████ █████ █████ ████ █████
██████ █████████████████████ ████ █████ █████ ████ ██████
]]
local greeting = getGreeting()
local marginBottom = 0
-- Split logo into lines
local logoWidth = 0
for line in logo:gmatch '[^\n]+' do
logoWidth = math.max(logoWidth, #line / 2)
end
logoWidth = 75 -- code above does not work with utf8 strings in lua 5.1
-- Calculate padding for centering the greeting
local greetingWidth = #greeting - 3
local padding = math.floor((logoWidth - greetingWidth) / 2)
-- Generate spaces for padding
local paddedGreeting = string.rep(' ', padding) .. greeting
local userName = "You work as '" .. vim.env.USER .. "'."
-- Calculate padding for centering the username
local userNameWidth = #userName
local padding = math.floor((logoWidth - userNameWidth) / 2)
-- Generate spaces for padding
local userNamePadded = string.rep(' ', padding) .. userName
-- Add margin lines below the padded greeting
local margin = string.rep('\n', marginBottom * 5)
-- Concatenate logo, padded greeting, and margin
local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded .. '\n' .. margin
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
dashboard.section.buttons.val = {
dashboard.button('h', ' Browse ~', '<cmd>Neotree<CR>'),
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
dashboard.button('u', '󱐥 Update plugins', '<cmd>Lazy update<CR>'),
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
dashboard.button('q', '󰤆 Quit', '<cmd>qa<CR>'),
}
-- dashboard.section.footer.val = greeting
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
desc = 'Add Alpha dashboard footer',
once = true,
callback = function()
local stats = require('lazy').stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
dashboard.section.footer.val = { ' ', ' ', ' ', ' Loaded ' .. stats.count .. ' plugins  in ' .. ms .. ' ms ' }
dashboard.section.header.opts.hl = 'DashboardFooter'
pcall(vim.cmd.AlphaRedraw)
end,
})
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)
end, end,
}, },
-- improved Rust support -- improved Rust support
{ {
'mrcjkb/rustaceanvim', 'mrcjkb/rustaceanvim',
version = '^5', -- Recommended version = '^6', -- Recommended
lazy = false, -- This plugin is already lazy lazy = false, -- This plugin is already lazy
}, },
@@ -531,36 +448,6 @@ require("lazy").setup({
end, end,
}, },
-- Live Coding: sonic-pi music programming
{
'magicmonty/sonicpi.nvim',
config = function()
require('sonicpi').setup({
-- server_dir = '/opt/sonic-pi/app/server',
lsp_diagnostics = true,
mappings = {
{ 'n', '<leader>d', ':SonicPiStartDaemon<CR>', { desc = 'Sonic Pi: start daemon' } },
{ 'n', '<leader>s', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
{ 'i', '<M-s>', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
{ 'n', '<leader>r', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
{ 'i', '<M-r>', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
{ 'n', '<leader>R', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
{ 'i', '<M-R>', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
{ 'v', '<leader>s', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
{ 'v', '<leader>v',
function()
require('sonicpi.remote').run_code(SL_get_visual_selection())
end, { desc = 'Sonic Pi: send visual range' } }
},
single_file = true,
})
end,
dependencies = {
'hrsh7th/nvim-cmp',
'kyazdani42/nvim-web-devicons'
},
},
-- easy term on a shortcut -- easy term on a shortcut
{ {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
@@ -580,18 +467,6 @@ require("lazy").setup({
}, },
}, },
-- Live Coding: tidal cycles support
{
'tidalcycles/vim-tidal',
config = function()
vim.g.tidal_sc_enable = 1
end,
},
-- debugging support, needed for things like rustaceanvim
{
'mfussenegger/nvim-dap'
},
-- show indent markers -- show indent markers
{ {
@@ -602,152 +477,32 @@ require("lazy").setup({
opts = {}, opts = {},
}, },
-- database connectivity
{
"nanotee/sqls.nvim"
},
-- 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,
},
},
},
},
},
-- 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
}) })

View File

@@ -1,13 +1,16 @@
# ccflow local snippets for all modes # ccflow local snippets for all modes
snippet todo "Add a TODO marker" snippet todo "Add a TODO marker"
// TODO.`strftime("%Y-%m-%d")` // TODO.`strftime("%Y-%m-%d -")`
snippet note "Add a NOTE marker" snippet note "Add a NOTE marker"
// NOTE.`strftime("%Y-%m-%d")` // NOTE.`strftime("%Y-%m-%d -")`
snippet date "Insert current date" snippet date "Insert current date"
`strftime("%Y-%m-%d")` `strftime("%Y-%m-%d ")`
snippet datetime "Insert current date and time"
`strftime("%Y-%m-%d %H:%M ")`
snippet lorem "Insert a lorem ipsum paragraph" snippet lorem "Insert a lorem ipsum paragraph"
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

26
syntax/confile.vim Normal file
View File

@@ -0,0 +1,26 @@
" Vim Syntax file for CON files
syn match SetLength /^\d\{3\}/ nextgroup=SetKeyword,SetKeywordMarked,SetKeywordInfoMarked
hi SetLength guifg=grey
syn match SetKeyword /\d\{4\}/ contained
hi SetKeyword guifg=lightgreen
" Visitations marked completely
syn match SetKeywordMarked /310[123]\|5000/ contained nextgroup=SetKeywordMarkedInfo
hi SetKeywordMarked gui=inverse guifg=lightgreen
" Treatments only mark treatment info
syn match SetKeywordInfoMarked /5001/ contained nextgroup=SetKeywordMarkedInfo
hi SetKeywordInfoMarked guifg=lightgreen
" mark keyword value
syn match SetKeywordMarkedInfo /..*/ contained
hi SetKeywordMarkedInfo gui=inverse
" Mark datasets like patient
syn match SetStart /^0138000/ nextgroup=SetType
syn match SetType /con0\|con9\|besa\|adt0\|adt9\|010[1-4]\|rvsa/ contained " 0101
hi SetStart guifg=white guibg=green
hi SetType guifg=white guibg=red