Compare commits
3 Commits
271a18b3a8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd5c73f099 | ||
| 2b47d7a9cd | |||
| 107a257642 |
11
init.lua
11
init.lua
@@ -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/*
|
-- load configurations files from lua/*
|
||||||
require('filetype')
|
require('filetype')
|
||||||
require('options')
|
require('options')
|
||||||
@@ -6,5 +13,7 @@ require('plugins')
|
|||||||
require('colorscheme')
|
require('colorscheme')
|
||||||
require('lsp')
|
require('lsp')
|
||||||
require('keybindings')
|
require('keybindings')
|
||||||
require('diary')
|
|
||||||
require('layout')
|
require('layout')
|
||||||
|
if vim.loop.os_gethostname() == 'ccflow' then
|
||||||
|
require('diary')
|
||||||
|
end
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ local padding = math.floor((logoWidth - greetingWidth) / 2)
|
|||||||
-- Generate spaces for padding
|
-- Generate spaces for padding
|
||||||
local paddedGreeting = string.rep(' ', padding) .. greeting
|
local paddedGreeting = string.rep(' ', padding) .. greeting
|
||||||
|
|
||||||
|
local userName = "You work as '" .. (vim.env.USER or vim.env.USERNAME) .. "'."
|
||||||
local userName = "You work as '" .. vim.env.USER .. "'."
|
|
||||||
|
|
||||||
-- Calculate padding for centering the username
|
-- Calculate padding for centering the username
|
||||||
local userNameWidth = #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
|
local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded .. '\n' .. margin
|
||||||
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
|
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
|
||||||
|
|
||||||
dashboard.section.buttons.val = {
|
local buttons = {
|
||||||
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>'),
|
||||||
|
dashboard.button('t', '[] Todo List', '<cmd>Org agenda t<CR>'),
|
||||||
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
||||||
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
|
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
|
||||||
dashboard.button('q', ' Quit', '<cmd>qa<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
|
-- dashboard.section.footer.val = greeting
|
||||||
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('User', {
|
vim.api.nvim_create_autocmd('User', {
|
||||||
pattern = 'LazyVimStarted',
|
pattern = 'LazyVimStarted',
|
||||||
desc = 'Add Alpha dashboard footer',
|
desc = 'Add Alpha dashboard footer',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local diary_open = function(opts)
|
local diary_open = function(opts)
|
||||||
local date = opts.args ~= '' and opts.args or os.date('%Y-%m-%d')
|
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 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")
|
vim.fn.mkdir(folder, "p")
|
||||||
local file = string.format('%s/diary-%s-%s.adoc', folder, year, month)
|
local file = string.format('%s/diary-%s-%s.adoc', folder, year, month)
|
||||||
print("file is:", file)
|
print("file is:", 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" })
|
vim.keymap.set('n', '<leader>F', ":Fyler kind=split_left<CR>", { desc = "Fyler Files" })
|
||||||
|
|
||||||
-- calendar
|
-- 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" })
|
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" })
|
||||||
|
|
||||||
|
if vim.loop.os_gethostname() == 'ccflow' then
|
||||||
-- Open org file folder in neotree
|
-- 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
|
-- toggle colorscheme between dark and light
|
||||||
vim.keymap.set('n', '<leader>m', function()
|
vim.keymap.set('n', '<leader>m', function()
|
||||||
|
|||||||
10
lua/lsp.lua
10
lua/lsp.lua
@@ -66,7 +66,8 @@ function LSPRangeFormatFunction()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local enable_this_lsp = {}
|
||||||
|
if vim.loop.os_gethostname() == 'ccflow' then
|
||||||
-- VUE and Typescript as of vue-language-server 3.0.x
|
-- VUE and Typescript as of vue-language-server 3.0.x
|
||||||
-- taken from:
|
-- taken from:
|
||||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls
|
-- 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)
|
vim.lsp.config('vtsls', vtsls_config)
|
||||||
|
|
||||||
-- enable this list of lsps
|
-- enable this list of lsps
|
||||||
local enable_this_lsp = {
|
enable_this_lsp = {
|
||||||
'vue_ls',
|
'vue_ls',
|
||||||
'vtsls',
|
'vtsls',
|
||||||
'gopls',
|
'gopls',
|
||||||
@@ -106,6 +107,11 @@ local enable_this_lsp = {
|
|||||||
'basedpyright',
|
'basedpyright',
|
||||||
'wgsl_analyzer',
|
'wgsl_analyzer',
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
-- any lsp which should be enabled in all situations
|
||||||
|
enable_this_lsp = {
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
for l in pairs(enable_this_lsp) do
|
for l in pairs(enable_this_lsp) do
|
||||||
vim.lsp.enable(enable_this_lsp[l])
|
vim.lsp.enable(enable_this_lsp[l])
|
||||||
|
|||||||
@@ -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
|
-- Some general setup taken from some tutorial
|
||||||
|
|||||||
100
lua/plugins.lua
100
lua/plugins.lua
@@ -195,8 +195,8 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
-- org_agenda_files = '~/orgfiles/**/*',
|
-- org_agenda_files = '~/orgfiles/**/*',
|
||||||
-- org_default_notes_file = '~/orgfiles/refile.org',
|
-- org_default_notes_file = '~/orgfiles/refile.org',
|
||||||
org_agenda_files = '~/Documents/Eigene (Briefe etc.)/org/*.org',
|
org_agenda_files = sl_opt.org_agenda_files,
|
||||||
org_default_notes_file = '~/Documents/Eigene (Briefe etc.)/org/refile.org',
|
org_default_notes_file = sl_opt.org_default_notes_file,
|
||||||
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 = {
|
||||||
@@ -234,7 +234,7 @@ require("lazy").setup({
|
|||||||
"chipsenkbeil/org-roam.nvim",
|
"chipsenkbeil/org-roam.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("org-roam").setup({
|
require("org-roam").setup({
|
||||||
directory = "~/Documents/Eigene (Briefe etc.)/org/roam",
|
directory = sl_opt.org_roam_folder,
|
||||||
-- optional
|
-- optional
|
||||||
-- org_files = {
|
-- org_files = {
|
||||||
-- "~/another_org_dir",
|
-- "~/another_org_dir",
|
||||||
@@ -308,16 +308,17 @@ require("lazy").setup({
|
|||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
lazy = false,
|
||||||
local configs = require("nvim-treesitter.configs")
|
-- 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" },
|
-- configs.setup({
|
||||||
sync_install = false,
|
-- ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html", "diff", "go", "rust", "python" },
|
||||||
highlight = { enable = true },
|
-- sync_install = false,
|
||||||
indent = { enable = true },
|
-- highlight = { enable = true },
|
||||||
})
|
-- indent = { enable = true },
|
||||||
end
|
-- })
|
||||||
|
-- end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lualine statusline plugin
|
-- lualine statusline plugin
|
||||||
@@ -507,42 +508,43 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
-- 2026-02-18 nice plugin, but still more irritating than helpful
|
||||||
'sphamba/smear-cursor.nvim',
|
-- {
|
||||||
opts = {
|
-- 'sphamba/smear-cursor.nvim',
|
||||||
-- cursor_color = "#ff4000",
|
-- opts = {
|
||||||
cursor_color = "#8b0000",
|
-- -- cursor_color = "#ff4000",
|
||||||
stiffness = 1,
|
-- cursor_color = "#8b0000",
|
||||||
trailing_stiffness = 1,
|
-- stiffness = 1,
|
||||||
trailing_exponent = 0,
|
-- trailing_stiffness = 1,
|
||||||
matrix_pixel_threshold = 1,
|
-- trailing_exponent = 0,
|
||||||
damping = 0.9,
|
-- matrix_pixel_threshold = 1,
|
||||||
gradient_exponent = 0,
|
-- damping = 0.9,
|
||||||
gamma = 1,
|
-- gradient_exponent = 0,
|
||||||
never_draw_over_target = true, -- if you want to actually see under the cursor
|
-- gamma = 1,
|
||||||
hide_target_hack = true, -- same
|
-- never_draw_over_target = true, -- if you want to actually see under the cursor
|
||||||
legacy_computing_symbols_support = true,
|
-- 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
|
-- -- Only smear cursor when moving at least these distances
|
||||||
min_horizontal_distance_smear = 2,
|
-- -- value of 2 inhibits smear while typing
|
||||||
min_vertical_distance_smear = 2,
|
-- min_horizontal_distance_smear = 2,
|
||||||
|
-- min_vertical_distance_smear = 2,
|
||||||
smear_insert_mode = false,
|
--
|
||||||
|
-- smear_insert_mode = false,
|
||||||
-- particles configuration
|
--
|
||||||
particles_enabled = true,
|
-- -- particles configuration
|
||||||
particle_spread = 1,
|
-- particles_enabled = true,
|
||||||
particles_per_second = 200,
|
-- particle_spread = 1,
|
||||||
particles_per_length = 50,
|
-- particles_per_second = 200,
|
||||||
particle_max_lifetime = 800,
|
-- particles_per_length = 50,
|
||||||
particle_max_initial_velocity = 20,
|
-- particle_max_lifetime = 800,
|
||||||
particle_velocity_from_cursor = 0.5,
|
-- particle_max_initial_velocity = 20,
|
||||||
particle_damping = 0.15,
|
-- particle_velocity_from_cursor = 0.5,
|
||||||
particle_gravity = 50,
|
-- particle_damping = 0.15,
|
||||||
min_distance_emit_particles = 0,
|
-- particle_gravity = 50,
|
||||||
},
|
-- min_distance_emit_particles = 0,
|
||||||
},
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
{
|
{
|
||||||
"A7Lavinraj/fyler.nvim",
|
"A7Lavinraj/fyler.nvim",
|
||||||
|
|||||||
Reference in New Issue
Block a user