Skip to content

Instantly share code, notes, and snippets.

@hotoo
Created July 22, 2010 04:23
Show Gist options
  • Select an option

  • Save hotoo/485565 to your computer and use it in GitHub Desktop.

Select an option

Save hotoo/485565 to your computer and use it in GitHub Desktop.
--- C:/Documents and Settings/wb-tianliang/My Documents/下载/calendar.vim Thu Jul 22 12:22:37 2010
+++ D:/Vim/vimfiles/plugin/calendar.vim Thu Jul 22 12:21:37 2010
@@ -1191,7 +1191,21 @@
let vbufnr = bufnr('__Calendar')
" load the file
- exe "sp " . sfile
+ if winnr('#') == 0
+ if a:dir == "V"
+ exe "vsplit " . sfile
+ else
+ exe "split " . sfile
+ endif
+ else
+ wincmd p
+ if !&hidden && &modified
+ exe "new " . sfile
+ else
+ exe "edit " . sfile
+ endif
+ endif
+
setlocal ft=calendar
let dir = getbufvar(vbufnr, "CalendarDir")
let vyear = getbufvar(vbufnr, "CalendarYear")
@hotoo
Copy link
Author

hotoo commented Jul 22, 2010

让日记在最近未修改的窗口中打开,
而不是在狭窄的 calendar 窗口上方打开。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment