Compare commits

..

3 Commits

25 changed files with 2146 additions and 2092 deletions

View File

@@ -1,3 +1,10 @@
-- adjust proxy on Windows
if vim.loop.os_environ().OS == 'Windows_NT' then
-- TODO move out of the tree and do not check in
vim.fn.setenv("http_proxy", "http://10.167.16.21:80")
vim.fn.setenv("https_proxy", "http://10.167.16.21:80")
end
-- load configurations files from lua/*
require('filetype')
require('options')
@@ -6,5 +13,7 @@ require('plugins')
require('colorscheme')
require('lsp')
require('keybindings')
require('diary')
require('layout')
if vim.loop.os_gethostname() == 'ccflow' then
require('diary')
end

View File

@@ -64,8 +64,7 @@ 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 .. "'."
local userName = "You work as '" .. (vim.env.USER or vim.env.USERNAME) .. "'."
-- Calculate padding for centering the username
local userNameWidth = #userName
@@ -81,17 +80,25 @@ local margin = string.rep('\n', marginBottom * 5)
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>'),
local buttons = {
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
dashboard.button('t', '[] Todo List', '<cmd>Org agenda t<CR>'),
dashboard.button('u', '󱐥 Update plugins', '<cmd>Lazy update<CR>'),
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
dashboard.button('q', '󰤆 Quit', '<cmd>qa<CR>'),
}
if vim.loop.os_gethostname() == 'ccflow' then
table.insert(buttons, 1,
dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'))
end
dashboard.section.buttons.val = buttons
-- dashboard.section.footer.val = greeting
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
desc = 'Add Alpha dashboard footer',

View File

@@ -1,7 +1,7 @@
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 folder = string.format('~/.diary/asciidoc/%s', year)
local folder = vim.fs.joinpath(vim.env.HOME, string.format('.diary/asciidoc/%s', year))
vim.fn.mkdir(folder, "p")
local file = string.format('%s/diary-%s-%s.adoc', folder, year, month)
print("file is:", file)

View File

@@ -25,14 +25,18 @@ vim.keymap.set('n', '<leader>T', ":Neotree reveal<CR>", { desc = "Neotree Files"
vim.keymap.set('n', '<leader>F', ":Fyler kind=split_left<CR>", { desc = "Fyler Files" })
-- 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 -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)
vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in browser" })
if vim.loop.os_gethostname() == 'ccflow' then
-- 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" })
vim.keymap.set('n', '<leader>of', ':silent :Neotree dir=/home/saschal/Documents/Eigene\\ (Briefe\\ etc.)/org<cr>',
{ desc = "Open org folder" })
end
-- toggle colorscheme between dark and light
vim.keymap.set('n', '<leader>m', function()

View File

@@ -66,7 +66,8 @@ function LSPRangeFormatFunction()
})
end
local enable_this_lsp = {}
if vim.loop.os_gethostname() == 'ccflow' then
-- VUE and Typescript as of vue-language-server 3.0.x
-- taken from:
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls
@@ -92,7 +93,7 @@ local vtsls_config = {
vim.lsp.config('vtsls', vtsls_config)
-- enable this list of lsps
local enable_this_lsp = {
enable_this_lsp = {
'vue_ls',
'vtsls',
'gopls',
@@ -106,6 +107,11 @@ local enable_this_lsp = {
'basedpyright',
'wgsl_analyzer',
}
else
-- any lsp which should be enabled in all situations
enable_this_lsp = {
}
end
for l in pairs(enable_this_lsp) do
vim.lsp.enable(enable_this_lsp[l])

View File

@@ -1,3 +1,29 @@
---------------------------------------------------
--
-- Global settings
--
---------------------------------------------------
-- global
sl_opt = {}
-- this is specific for a machine
if vim.loop.os_gethostname() == 'ccflow' then
sl_opt = {
org_agenda_files = '~/Documents/Eigene (Briefe etc.)/org/*.org',
org_default_notes_file = '~/Documents/Eigene (Briefe etc.)/org/refile.org',
org_roam_folder = '~/Documents/Eigene (Briefe etc.)/org/roam',
}
else
sl_opt = {
org_agenda_files = '~/OneDrive - Stadt Rosenheim/Desktop/orgfiles/*.org',
org_default_notes_file = '~/OneDrive - Stadt Rosenheim/Desktop/orgfiles/refile.org',
org_roam_folder = '~/OneDrive - Stadt Rosenheim/Desktop/orgfiles/roam',
}
end
---------------------------------------------------
--
-- Some general setup taken from some tutorial

View File

@@ -195,8 +195,8 @@ require("lazy").setup({
},
-- 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_agenda_files = sl_opt.org_agenda_files,
org_default_notes_file = sl_opt.org_default_notes_file,
org_todo_keywords = { 'TODO(t)', 'STARTED(s)', 'PLANNED(p)', '|', 'DONE(d)', 'UNPLANNED(u)' },
org_custom_exports = {
f = {
@@ -234,7 +234,7 @@ require("lazy").setup({
"chipsenkbeil/org-roam.nvim",
config = function()
require("org-roam").setup({
directory = "~/Documents/Eigene (Briefe etc.)/org/roam",
directory = sl_opt.org_roam_folder,
-- optional
-- org_files = {
-- "~/another_org_dir",
@@ -308,16 +308,17 @@ require("lazy").setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html", "diff", "go", "rust", "python" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
lazy = false,
-- config = function()
-- local configs = require("nvim-treesitter.configs")
--
-- configs.setup({
-- ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html", "diff", "go", "rust", "python" },
-- sync_install = false,
-- highlight = { enable = true },
-- indent = { enable = true },
-- })
-- end
},
-- lualine statusline plugin
@@ -507,42 +508,43 @@ require("lazy").setup({
},
{
'sphamba/smear-cursor.nvim',
opts = {
-- cursor_color = "#ff4000",
cursor_color = "#8b0000",
stiffness = 1,
trailing_stiffness = 1,
trailing_exponent = 0,
matrix_pixel_threshold = 1,
damping = 0.9,
gradient_exponent = 0,
gamma = 1,
never_draw_over_target = true, -- if you want to actually see under the cursor
hide_target_hack = true, -- same
legacy_computing_symbols_support = true,
-- Only smear cursor when moving at least these distances
-- value of 2 inhibits smear while typing
min_horizontal_distance_smear = 2,
min_vertical_distance_smear = 2,
smear_insert_mode = false,
-- particles configuration
particles_enabled = true,
particle_spread = 1,
particles_per_second = 200,
particles_per_length = 50,
particle_max_lifetime = 800,
particle_max_initial_velocity = 20,
particle_velocity_from_cursor = 0.5,
particle_damping = 0.15,
particle_gravity = 50,
min_distance_emit_particles = 0,
},
},
-- 2026-02-18 nice plugin, but still more irritating than helpful
-- {
-- 'sphamba/smear-cursor.nvim',
-- opts = {
-- -- cursor_color = "#ff4000",
-- cursor_color = "#8b0000",
-- stiffness = 1,
-- trailing_stiffness = 1,
-- trailing_exponent = 0,
-- matrix_pixel_threshold = 1,
-- damping = 0.9,
-- gradient_exponent = 0,
-- gamma = 1,
-- never_draw_over_target = true, -- if you want to actually see under the cursor
-- hide_target_hack = true, -- same
-- legacy_computing_symbols_support = true,
--
-- -- Only smear cursor when moving at least these distances
-- -- value of 2 inhibits smear while typing
-- min_horizontal_distance_smear = 2,
-- min_vertical_distance_smear = 2,
--
-- smear_insert_mode = false,
--
-- -- particles configuration
-- particles_enabled = true,
-- particle_spread = 1,
-- particles_per_second = 200,
-- particles_per_length = 50,
-- particle_max_lifetime = 800,
-- particle_max_initial_velocity = 20,
-- particle_velocity_from_cursor = 0.5,
-- particle_damping = 0.15,
-- particle_gravity = 50,
-- min_distance_emit_particles = 0,
-- },
-- },
{
"A7Lavinraj/fyler.nvim",