calendar.vim icon indicating copy to clipboard operation
calendar.vim copied to clipboard

Calendar Questions

Open rickalex21 opened this issue 3 years ago • 0 comments

Hello, thanks for creating this plugin. It's awesome! How long did it take to create? I have a few questions about it.

  1. User mappings are overridden by default? I have two functions that allow me to resize my windows with repeat.vim. Calendar.vim uses these keys as well as many other keys that I need. So do I have to do this autocommand for all my mappings that are used by calendar.vim ?
function! MoveRight(mycount) abort
	let defaultRepeat=15 
	let size=  a:mycount == 0 ? 1 : a:mycount
	execute "vert resize +"  . size
		call repeat#set("\<Plug>(MoveRight)",size == 1 ? defaultRepeat:size)
endfunction
function! MoveLeft(mycount) abort
	let defaultRepeat=15 
	let size=  a:mycount == 0 ? 1 : a:mycount
	execute "vert resize -"  . size
		call repeat#set("\<Plug>(MoveLeft)",size == 1 ? defaultRepeat:size)
endfunction

nnoremap <silent> <Plug>(MoveRight) :<C-u>call MoveRight(v:count)<CR>
nmap <c-l> <Plug>(MoveRight)
nnoremap <silent> <Plug>(MoveLeft) :<C-u>call MoveLeft(v:count)<CR>
nmap <c-h> <Plug>(MoveLeft)

augroup calendar-mappings
		autocmd!
		autocmd FileType calendar nunmap <buffer> <c-l>
		autocmd FileType calendar nunmap <buffer> <c-h>
		"This is needed to enter the command line q:
		autocmd FileType calendar nunmap <buffer> q
		autocmd FileType calendar nunmap <buffer> <c-g>
		autocmd FileType calendar noremap <buffer> q q
		autocmd FileType calendar nmap <buffer> <c-k> <Plug>(calendar_view_left)
		autocmd FileType calendar nmap <buffer> <c-j> <Plug>(calendar_view_right)
		autocmd FileType calendar nmap <buffer> J <Plug>(calendar_down_large)
		autocmd FileType calendar nmap <buffer> K <Plug>(calendar_up_large)
		nnoremap <c-G> :tabn<cr>
augroup END

Maybe a setting 'g:calendar_override_user_mappings=0'?

  1. Can I edit the ~/.cache/calendar.vim/ files or will that break something in the plugin? I presume my edits would have to be made before calling Calendar. My idea is to import ics events into these json files. It would look something like this:
function! AddEvents() abort
if  'saved_md5sum' !~ 'events_file_md5sum'
"Events file was changed
	call system('Script to read/write events to json files in ~/.cache/calendar.vim.')
endif
execute "normal!  :Calendar -position=topleft  -width=100 \r"
endfunction
command! Cal call AddEvents()

This would replace the call back function from script 52 'calendar_sign' Ideally an ics import feature as mentioned before would be nice in calendar.vim. This is pretty much irrelevant if I decide to stay with google calendar but would like to know for future reference.

  1. What is the difference between agenda and event? It looks like they both add an event when 'i' is entered. Here is my setup.
let g:calendar_views =['year', 'month', 'week', 'day_3', 'day','event', 'agenda']
  1. How do I change the syntax for the current calendar buffer? I read the docs for ownsyntax, I could not figure it out. When attempting to change the background I end up changing all of my window buffers background.

  2. How do you create a task with a note? According to the docs I should add the 'note:' item to it but don't know if it's saving properly as a note because the json file looks different. It saves it as a title and without an entry for 'note' or 'notes'. I think that the notes section is only relevant for google calendar and not the local/.

:Task:Some Task note:This is something that needs to get done.
{"id":"202101301628360005","items":[{"id":"202101311716540004","title":"Some Task note:This is something that needs to get done."}],"title":"Task list"}

According to the docs : Task with note: TASK: [task-title] note: [task-note]

Is there a way to view the note in a task or just enter 'i' and view it in the command line?

  1. Events - How come for the events on google I can't see the details but for the tasks I can? Tasks seem to work fine but I can't add an event with a note or read the notes in an event.

Thanks for everyone's contributions to this project.

rickalex21 avatar Jan 31 '21 23:01 rickalex21