Compare commits
4 Commits
811b7d9c07
...
b6c4df13e0
| Author | SHA1 | Date | |
|---|---|---|---|
| b6c4df13e0 | |||
| 3ded8e9e0d | |||
| 56136ef0f1 | |||
| e5f95df420 |
1
init.lua
1
init.lua
@@ -6,3 +6,4 @@ require('plugins')
|
|||||||
require('colorscheme')
|
require('colorscheme')
|
||||||
require('lsp')
|
require('lsp')
|
||||||
require('keybindings')
|
require('keybindings')
|
||||||
|
require('diary')
|
||||||
|
|||||||
21
lua/diary.lua
Normal file
21
lua/diary.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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
|
||||||
|
snips.snip_expand(asnippets[2])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("Diary", diary_open, { nargs = '?' })
|
||||||
@@ -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-TermCursor"
|
||||||
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
|
||||||
|
|||||||
@@ -367,36 +367,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",
|
||||||
@@ -416,19 +386,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
|
||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
" Vim Syntax file for CON files
|
" Vim Syntax file for CON files
|
||||||
|
|
||||||
syn match SetLength /^\d\{3\}/ nextgroup=SetKeyword,SetKeywordMarked
|
syn match SetLength /^\d\{3\}/ nextgroup=SetKeyword,SetKeywordMarked,SetKeywordInfoMarked
|
||||||
syn match SetKeyword /\d\{4\}/ contained
|
|
||||||
syn match SetKeywordMarked /310[123]\|5000/ contained nextgroup=SetKeywordMarkedInfo
|
|
||||||
syn match SetKeywordMarkedInfo /..*/ contained
|
|
||||||
|
|
||||||
hi SetLength guifg=grey
|
hi SetLength guifg=grey
|
||||||
|
|
||||||
|
syn match SetKeyword /\d\{4\}/ contained
|
||||||
hi SetKeyword guifg=lightgreen
|
hi SetKeyword guifg=lightgreen
|
||||||
|
|
||||||
|
" Visitations marked completely
|
||||||
|
syn match SetKeywordMarked /310[123]\|5000/ contained nextgroup=SetKeywordMarkedInfo
|
||||||
hi SetKeywordMarked gui=inverse guifg=lightgreen
|
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
|
hi SetKeywordMarkedInfo gui=inverse
|
||||||
|
|
||||||
|
" Mark datasets like patient
|
||||||
syn match SetStart /^0138000/ nextgroup=SetType
|
syn match SetStart /^0138000/ nextgroup=SetType
|
||||||
syn match SetType /con0\|con9\|besa\|adt0\|adt9\|010[1-4]\|rvsa/ contained " 0101
|
syn match SetType /con0\|con9\|besa\|adt0\|adt9\|010[1-4]\|rvsa/ contained " 0101
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user