mirror of
https://github.com/amix/vimrc
synced 2025-07-07 08:45:00 +08:00
rename vim_plugins_src to vim_plugin_candinates_src and used as an plugin candinate dir
This commit is contained in:
82
vim_plugin_candinates_src/VimOrganizer_v0313/INSTALL.txt
Normal file
82
vim_plugin_candinates_src/VimOrganizer_v0313/INSTALL.txt
Normal file
@ -0,0 +1,82 @@
|
||||
Installation instructions for VimOrganizer v. 0.30, November 2011
|
||||
=================================================================
|
||||
|
||||
1. Install VimOrganizer files as you would any other ftplugin, with downloaded
|
||||
files going in their respective directories under your .vim (Linux/Mac)
|
||||
or vimfiles (Windows) directory.
|
||||
|
||||
2. Run helptags on the help file in the /doc directory, vimorg.txt,
|
||||
so hep items can be accessed using the Vim help system.
|
||||
|
||||
3. Make sure your vimrc has these lines:
|
||||
-------------------------------------
|
||||
filetype plugin indent on
|
||||
|
||||
[...and then somewhere below that:]
|
||||
|
||||
au! BufRead,BufWrite,BufWritePost,BufNewFile *.org
|
||||
au BufEnter *.org call org#SetOrgFileType()
|
||||
------------------------------------
|
||||
|
||||
If you use VimOrganizer much you will also want to configure variables
|
||||
and/or functions in your vimrc. A sample vimrc has been included
|
||||
in the download.
|
||||
|
||||
ALSO, you will want to install the plugins listed below. VimOrganizer
|
||||
will work without them, but some functionality will be unavailable:
|
||||
|
||||
4. Make sure you have Calendar.vim installed.
|
||||
(Calendar.vim comes included in the /plugin/ directory as part of
|
||||
the Vim runtime in some Vim installs, otherwise available at:
|
||||
http://www.vim.org/scripts/script.php?script_id=52)
|
||||
|
||||
Second, here are two plugins that you will want to download to
|
||||
take advantage of Org-mode-like narrowing and link features that have been built
|
||||
into VimOrganizer:
|
||||
|
||||
5. Christian Brabandt's NarrowRegion plugin. Find and install it from here:
|
||||
http://www.vim.org/scripts/script.php?script_id=3075
|
||||
6. The Utl "Universal Text Linking" plugin. Find and install it from here:
|
||||
http://www.vim.org/scripts/script.php?script_id=293
|
||||
|
||||
If you are running on Windows another plugin will be useful:
|
||||
|
||||
7. If you're running on Windows then you may want to get Peter Rodding's
|
||||
shell.vim plugin. It's not necessary, but if you have installed
|
||||
it VimOrganizer will use it to ensure that you don't see
|
||||
the annoying Windows command prompt window pop up when VimOrganizer
|
||||
calls out to Emacs/Org-mode.
|
||||
http://www.vim.org/scripts/script.php?script_id=3123
|
||||
|
||||
8. FINALLY, install Emacs. Not necessary for basic outlining, agenda
|
||||
searches, and other basic stuff, but it is necessary to do exports
|
||||
to html and PDF (which you will definitely want) as well as other
|
||||
advanced stuff. Don't be afraid, install is simply and configuration
|
||||
is not hard. Find Emacs here:
|
||||
http://www.gnu.org/software/emacs/
|
||||
|
||||
Vimorg uses a variable, g:org_command_for_emacsclient, to hold the
|
||||
command that will start the emacsclient on your system. If you are
|
||||
not on Linux or OSX you will need to set this explicitly in your
|
||||
vimrc file.
|
||||
|
||||
Also, please note that emacsclient works slightly differently on
|
||||
Windows and Linux/OSX systems. You must manually start
|
||||
Emacs on Linux/OSX or calls to emacsclient will not work. Please see
|
||||
:h vimorg-emacs-setup
|
||||
|
||||
For Emacs you should also install a hook function in the .emacs file,
|
||||
which will automatically make minor conversions when you export and/or
|
||||
open a VimOrganizer .org file in Emacs. You can find the text for that
|
||||
function in the VimOrganizer help file:
|
||||
:h vimorg-orgmode-conversion
|
||||
|
||||
If you're scared of Emacs, don't worry. You don't ever need to edit
|
||||
a document using Emacs. The most you will need to do is open up
|
||||
the .emacs configuration file (in Vim) to make some configuration
|
||||
changes, and that is required only if you're doing more advanced stuff.
|
||||
Having said, that, if there are problems it can sometimes be easiest to
|
||||
open Emacs and diagnose an issue there. Still, you don't ever need
|
||||
to edit a document in Emacs, just think of Emacs as your "application
|
||||
server".
|
||||
|
@ -0,0 +1,113 @@
|
||||
* VimOrganizer CheatSheet
|
||||
** Outline Navigation
|
||||
TAB cycle visibilty of single headline/subtree
|
||||
|
||||
Shift-TAB cycle visibility of entire outline
|
||||
|
||||
,1 show level 1 heads only
|
||||
|
||||
,2 show up to level 2 headings
|
||||
|
||||
...
|
||||
|
||||
,,3 show up to level 3 heads for current heading only
|
||||
|
||||
,,5 show up to level 5 heads for current heading only
|
||||
. . .
|
||||
** Basic Outline Editing
|
||||
Name your file with a '.org' extension and then just start adding
|
||||
headings with asterisk to indicate heading level. NOTE: asterisks must
|
||||
be in the leftmost column and must be separate from heading text by a
|
||||
space. This document is an example showing headings, subheadings,
|
||||
and text underneath each.
|
||||
*** Adding new headlines
|
||||
**** Enter, shift+Enter
|
||||
add another headline of same level
|
||||
<enter> works only in normal mode
|
||||
**** Ctrl+Enter
|
||||
add another headline of lower-level
|
||||
**** Ctrl+Shift+Enter
|
||||
add another headline of higher-level
|
||||
** Time Stamps/Date-time prompt
|
||||
The following commands may be issued anywhere within a headline and will
|
||||
enter or edit the corresponding date for the headline. One date of
|
||||
each type may be defined per headline (i.e, 'deadline', 'scheduled',
|
||||
'closed', and 'regular'. You can enter more dates anywhere you want, but
|
||||
this editing mechanism is currently restricted to dealing with only these
|
||||
"primary" dates.
|
||||
|
||||
enter DEADLINE date for headline ,dd
|
||||
enter SCHEDULED date for headline ,ds
|
||||
enter CLOSED date for headline ,dc
|
||||
enter regular date TIMESTAMP (i.e., no indicator) for headline
|
||||
,dt
|
||||
enter timestamp into text ,dg
|
||||
|
||||
The command-line prompt and calendar that appear when you enter a ,d<x>
|
||||
command operate nearly the same as the date-time prompt in Emacs'
|
||||
Org-mode. A few options are not yet implemented (e.g., the 'w'eek
|
||||
options), but most should work just the same. For excellent documentation
|
||||
on Org-mode's date-time prompt see:
|
||||
:http://orgmode.org/manual/The-date_002ftime-prompt.html#The-date_002ftime-prompt
|
||||
** Agenda Dashboard
|
||||
Type ,ag to bring up the Agenda Dashboard, which allows you to launch
|
||||
some searches.
|
||||
** Set Agenda Files
|
||||
Agenda files are held in a list: g:agenda_files. You can enter values for
|
||||
g:agenda_files in your vimrc, e.g.,
|
||||
|
||||
:let g:agenda_files = ['myfile.org','c:/path/myfile.org']
|
||||
|
||||
You can also use Vimscript to assign multiple files at a time to
|
||||
g:agenda_files. For example, putting the line below in your vimrc would
|
||||
put all .org files in the org_files directory into g:agenda_files:
|
||||
|
||||
:let g:agenda_files = split(glob("~\desktop\org_files\*.org"),"\n")
|
||||
|
||||
User Interface for runtime editing of g:agenda_files:
|
||||
|
||||
There is a also a bare-bones agenda-editing mechanism that works like this:
|
||||
(1) Put your .org working directories in list g:agenda_dirs. Mine is in my
|
||||
vimrc and looks like this:
|
||||
|
||||
:let g:agenda_dirs=["c:/users/herbert/documents/my\ dropbox","c:/users/herbert/desktop/org_Files"]
|
||||
|
||||
(2) Then to edit your agenda files issue this command
|
||||
|
||||
:call EditAgendaFiles()
|
||||
|
||||
This will open a new tab and show your current agenda files along with a list
|
||||
of all org files in your agenda dirs. Simply copy or move lines from the
|
||||
agenda dirs list to the top and when done press :W (that's a capital 'W').
|
||||
Order of agenda files is sometimes important, e.g., it is used when ordering
|
||||
some agenda results.
|
||||
|
||||
** Tags
|
||||
Tags for a file are defined using the SetupTags(<tag-setup-string>) function. There is an
|
||||
example in the project's vimrc file. General structure of the
|
||||
tag-setup-string is: (1) tags followed by the single-key access in parens,
|
||||
(2) brackets (i.e., {} ) around sets of tags that are mutually exclusive.
|
||||
For now you must place the single-key-access parens with character after the
|
||||
tag, no letter is automatically assigned. The tags set up by SetupTags() are
|
||||
used in the menu accessed by ,et .
|
||||
|
||||
edit tags -- ,et
|
||||
view items with tag in agenda -- double-click tag,
|
||||
|
||||
(Note: The 'RunSearch' searches below can all be entered now
|
||||
by accessing Agenda Dashboard (,ag) and pressing 'm')
|
||||
view entries having both tag1 and tag2:
|
||||
:call RunSearch('+tag1+tag2')
|
||||
view entries having tag1 but not tag2:
|
||||
:call RunSearch('+tag1-tag2')
|
||||
view entries having tag1 or tag2:
|
||||
:call RunSearch('+tag1|tag2')
|
||||
view entries having tag1 that are also TODO:
|
||||
:call RunSearch('+TODO+tag1')
|
||||
view entries having tag1 that are also DONE:
|
||||
:call RunSearch('+DONE+tag1')
|
||||
view entries having tag1 that have any todo:
|
||||
:call RunSearch('+ANY_TODO+tag1')
|
||||
|
||||
|
||||
|
175
vim_plugin_candinates_src/VimOrganizer_v0313/_vimrc
Normal file
175
vim_plugin_candinates_src/VimOrganizer_v0313/_vimrc
Normal file
@ -0,0 +1,175 @@
|
||||
" This is an example vimrc that should work for testing purposes.
|
||||
" Integrate the VimOrganizer specific sections into your own
|
||||
" vimrc if you wish to use VimOrganizer on a regular basis. . .
|
||||
|
||||
"===================================================================
|
||||
" THE NECESSARY STUFF"
|
||||
" THe three lines below are necessary for VimOrganizer to work right
|
||||
" =================================================================
|
||||
filetype plugin indent on
|
||||
" and then put these lines in vimrc somewhere after the line above
|
||||
au! BufRead,BufWrite,BufWritePost,BufNewFile *.org
|
||||
au BufEnter *.org call org#SetOrgFileType()
|
||||
|
||||
"==============================================================
|
||||
" THE UNNECESSARY STUFF"
|
||||
"=============================================================
|
||||
" Everything below here is a customization. None are needed.
|
||||
"============================================================
|
||||
|
||||
" vars below are used to define default Todo list and
|
||||
" default Tag list. Both of these can also be defined
|
||||
" on a document-specific basis by config lines in a file.
|
||||
" See :h vimorg-todo-metadata and/or :h vimorg-tag-metadata
|
||||
" 'TODO | DONE' is the default,so not really necessary to define it at all
|
||||
let g:org_todo_setup='TODO | DONE'
|
||||
" OR, e.g.,:
|
||||
"let g:org_todo_setup='TODO NEXT STARTED | DONE CANCELED'
|
||||
|
||||
" include a tags setup string if you want:
|
||||
let g:org_tags_alist='{@home(h) @work(w) @tennisclub(t)} {easy(e) hard(d)} {computer(c) phone(p)}'
|
||||
"
|
||||
" g:org_agenda_dirs specify directories that, along with
|
||||
" their subtrees, are searched for list of .org files when
|
||||
" accessing EditAgendaFiles(). Specify your own here, otherwise
|
||||
" default will be for g:org_agenda_dirs to hold single
|
||||
" directory which is directory of the first .org file opened
|
||||
" in current Vim instance:
|
||||
" Below is line I use in my Windows install:
|
||||
" NOTE: case sensitive even on windows.
|
||||
let g:org_agenda_select_dirs=["~/desktop/org_files"]
|
||||
let g:agenda_files = split(glob("~/desktop/org_files/org-mod*.org"),"\n")
|
||||
|
||||
" ---------------------
|
||||
" Emacs setup
|
||||
" --------------------
|
||||
" To use Emacs you will need to define the client. On
|
||||
" Linux/OSX this is typically simple, just:
|
||||
"let g:org_command_for_emacsclient = 'emacsclient'
|
||||
"
|
||||
"On Windows it is more complicated, and probably involves creating
|
||||
" a 'soft link' to the emacsclient executable (which is 'emacsclientw')
|
||||
" See :h vimorg-emacs-setup
|
||||
"let g:org_command_for_emacsclient = 'c:\users\herbert\emacsclientw.exe'
|
||||
|
||||
" ---------------------
|
||||
" Custom Agenda Searches
|
||||
" --------------------
|
||||
" the assignment to g:org_custom_searches below defines searches that a
|
||||
" a user can then easily access from the Org menu or the Agenda Dashboard.
|
||||
" (Still need to add help on how to define them, assignment below
|
||||
" is hopefully illustrative for now. . . . )
|
||||
let g:org_custom_searches = [
|
||||
\ { 'name':"Next week's agenda", 'type':'agenda',
|
||||
\ 'agenda_date':'+1w','agenda_duration':'w'}
|
||||
\, { 'name':"Next week's TODOS", 'type':'agenda',
|
||||
\ 'agenda_date':'+1w','agenda_duration':'w','spec':'+UNFINISHED_TODOS'}
|
||||
\, { 'name':'Home tags', 'type':'heading_list', 'spec':'+HOME'}
|
||||
\, { 'name':'Home tags', 'type':'sparse_tree', 'spec':'+HOME'}
|
||||
\ ]
|
||||
|
||||
" --------------------------------
|
||||
" Custom colors
|
||||
" --------------------------------"
|
||||
" OrgCustomColors() allows a user to set highlighting for particular items
|
||||
function! OrgCustomColors()
|
||||
" various text item "highlightings" are below
|
||||
" these are the defaults. Uncomment and change a line if you
|
||||
" want different highlighting for the element
|
||||
"
|
||||
" below are defaults for any TODOS you define. TODOS that
|
||||
" come before the | in a definition will use 'NOTDONETODO'
|
||||
" and those that come after are DONETODO
|
||||
"hi! DONETODO guifg=green ctermfg=green
|
||||
"hi! NOTDONETODO guifg=red ctermfg=lightred
|
||||
|
||||
" heading level highlighting is done in pairs, one for the
|
||||
" heading when unfoled and one for folded. Default is to make
|
||||
" them the same except for the folded version being bold:
|
||||
" assign OL1 pair for level 1, OL2 pair for level 2, etc.
|
||||
"hi! OL1 guifg=somecolor guibg=somecolor
|
||||
"hi! OL1Folded guifg=somecolor guibg=somecolor gui=bold
|
||||
|
||||
|
||||
" tags are lines below headings that have :colon:separated:tags:
|
||||
"hi! Org_Tag guifg=lightgreen ctermfg=blue
|
||||
|
||||
" lines that begin with '#+' in column 0 are config lines
|
||||
"hi! Org_Config_Line guifg=darkgray ctermfg=magenta
|
||||
|
||||
"drawers are :PROPERTIES: and :LOGBOOK: lines and their associated
|
||||
" :END: lines
|
||||
"hi! Org_Drawer guifg=pink ctermfg=magenta
|
||||
"hi! Org_Drawer_Folded guifg=pink ctermfg=magenta gui=bold cterm=bold
|
||||
|
||||
" this applies to value names in :PROPERTIES: blocks
|
||||
"hi! Org_Property_Value guifg=pink ctermfg=magenta
|
||||
|
||||
" three lines below apply to different kinds of blocks
|
||||
"hi! Org_Block guifg=#555555 ctermfg=magenta
|
||||
"hi! Org_Src_Block guifg=#555555 ctermfg=magenta
|
||||
"hi! Org_Table guifg=#888888 guibg=#333333 ctermfg=magenta
|
||||
|
||||
" dates are date specs between angle brackets (<>) or square brackets ([])
|
||||
"hi! Org_Date guifg=magenta ctermfg=magenta gui=underline cterm=underline
|
||||
|
||||
" Org_Star is used to "hide" initial asterisks in a heading
|
||||
"hi! Org_Star guifg=#444444 ctermfg=darkgray
|
||||
|
||||
"hi! Props guifg=#ffa0a0 ctermfg=gray
|
||||
|
||||
" bold, itals, underline, and code are highlights applied
|
||||
" to character formatting
|
||||
"hi! Org_Code guifg=darkgray gui=bold ctermfg=14
|
||||
"hi! Org_Itals gui=italic guifg=#aaaaaa ctermfg=lightgray
|
||||
"hi! Org_Bold gui=bold guifg=#aaaaaa ctermfg=lightgray
|
||||
"hi! Org_Underline gui=underline guifg=#aaaaaa ctermfg=lightgray
|
||||
"hi! Org_Lnumber guifg=#999999 ctermfg=gray
|
||||
|
||||
" these lines apply to links: [[link]], and [[link][link desc]]
|
||||
"if has("conceal")
|
||||
" hi! default linkends guifg=blue ctermfg=blue
|
||||
"endif
|
||||
"hi! Org_Full_Link guifg=cyan gui=underline ctermfg=lightblue cterm=underline
|
||||
"hi! Org_Half_Link guifg=cyan gui=underline ctermfg=lightblue cterm=underline
|
||||
|
||||
" applies to the Heading line that can be displayed in column view
|
||||
"highlight OrgColumnHeadings guibg=#444444 guifg=#aaaaaa gui=underline
|
||||
|
||||
" Use g:org_todo_custom_highlights to set up highlighting for individual
|
||||
" TODO items. Without this all todos that designate an uninished state
|
||||
" will be highlighted using NOTDONETODO highlight (see above)
|
||||
" and all todos that designate a finished state will be highlighted using
|
||||
" the DONETODO highlight (see above).
|
||||
let g:org_todo_custom_highlights =
|
||||
\ { 'NEXT': { 'guifg':'#888888', 'guibg':'#222222',
|
||||
\ 'ctermfg':'gray', 'ctermbg':'darkgray'},
|
||||
\ 'WAITING': { 'guifg':'#aa3388',
|
||||
\ 'ctermfg':'red' } }
|
||||
|
||||
endfunction
|
||||
|
||||
" below are two examples of Org-mode "hook" functions
|
||||
" These present opportunities for end-user customization
|
||||
" of how VimOrganizer works. For more info see the
|
||||
" documentation for hooks in Emacs' Org-mode documentation:
|
||||
" http://orgmode.org/worg/org-configs/org-hooks.php#sec-1_40
|
||||
"
|
||||
" These two hooks are currently the only ones enabled in
|
||||
" the VimOrganizer codebase, but they are easy to add so if
|
||||
" there's a particular hook you want go ahead and request it
|
||||
" or look for where these hooks are implemented in
|
||||
" /ftplugin/org.vim and use them as example for placing your
|
||||
" own hooks in VimOrganizer:
|
||||
function! Org_property_changed_functions(line,key, val)
|
||||
"call confirm("prop changed: ".a:line."--key:".a:key." val:".a:val)
|
||||
endfunction
|
||||
function! Org_after_todo_state_change_hook(line,state1, state2)
|
||||
"call confirm("changed: ".a:line."--key:".a:state1." val:".a:state2)
|
||||
"call OrgConfirmDrawer("LOGBOOK")
|
||||
"let str = ": - State: " . org#Pad(a:state2,10) . " from: " . Pad(a:state1,10) .
|
||||
" \ ' [' . org#Timestamp() . ']'
|
||||
"call append(line("."), repeat(' ',len(matchstr(getline(line(".")),'^\s*'))) . str)
|
||||
endfunction
|
||||
|
||||
|
@ -0,0 +1,172 @@
|
||||
" calutil.vim: some calendar utilities
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" with modifications by Herbert Sitz for VimOrganizer
|
||||
" Date: Oct 08, 2008
|
||||
" Version: 3b ASTRO-ONLY
|
||||
" ---------------------------------------------------------------------
|
||||
if exists("loaded_calutil")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_calutil= "v3b"
|
||||
if v:version < 700
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of calutil needs vim 7.0"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
|
||||
function! calutil#dayname(date)
|
||||
return calutil#DayOfWeek(split(a:date,'-')[0],split(a:date,'-')[1],split(a:date,'-')[2],2)
|
||||
endfunction
|
||||
function! calutil#dow(date)
|
||||
return calutil#DayOfWeek(split(a:date,'-')[0],split(a:date,'-')[1],split(a:date,'-')[2],1)
|
||||
endfunction
|
||||
|
||||
function! calutil#jul(date)
|
||||
return calutil#Cal2Jul(split(a:date,'-')[0],split(a:date,'-')[1],split(a:date,'-')[2])
|
||||
endfunction
|
||||
|
||||
function! calutil#cal(julian)
|
||||
return calutil#Jul2Cal(a:julian)
|
||||
endfunction
|
||||
" ---------------------------------------------------------------------
|
||||
" DayOfWeek: {{{1
|
||||
" Usage : call calutil#DayOfWeek(y,m,d,[0|1|2])
|
||||
" g:CalUtilDayOfWeek: if 0-> integer (default)
|
||||
" 1-> 3-letter English abbreviation for name of day
|
||||
" 2-> English name of day
|
||||
" Returns
|
||||
" g:CalUtilDayOfWeek
|
||||
" ---------
|
||||
" 1 : 0 1 2 3 4 5 6
|
||||
" 2 : Mon Tue Wed Thu Fri Sat Sun
|
||||
" 3 : Monday Tuesday Wednesday Thursday Friday Saturday Sunday
|
||||
fun! calutil#DayOfWeek(y,m,d,...)
|
||||
if a:0 > 0
|
||||
let g:CalUtilDayOfWeek= a:1
|
||||
endif
|
||||
|
||||
let z = calutil#Cal2Jul(a:y,a:m,a:d)
|
||||
if z >= 0
|
||||
let z= z%7
|
||||
else
|
||||
let z= 7 - (-z%7)
|
||||
endif
|
||||
|
||||
if exists("g:CalUtilDayOfWeek")
|
||||
if g:CalUtilDayOfWeek == 2
|
||||
let dow0="Mon"
|
||||
let dow1="Tue"
|
||||
let dow2="Wed"
|
||||
let dow3="Thu"
|
||||
let dow4="Fri"
|
||||
let dow5="Sat"
|
||||
let dow6="Sun"
|
||||
return dow{z}
|
||||
elseif g:CalUtilDayOfWeek == 3
|
||||
let dow0="Monday"
|
||||
let dow1="Tuesday"
|
||||
let dow2="Wednesday"
|
||||
let dow3="Thursday"
|
||||
let dow4="Friday"
|
||||
let dow5="Saturday"
|
||||
let dow6="Sunday"
|
||||
return dow{z}
|
||||
endif
|
||||
endif
|
||||
return z
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" calutil#Cal2Jul: convert a (after 9/14/1752) Gregorian calendar date to Julian day {{{1
|
||||
" (on,before " ) Julian calendar date to Julian day
|
||||
" (proleptic)
|
||||
fun! calutil#Cal2Jul(y,m,d)
|
||||
let year = a:y
|
||||
let month= a:m
|
||||
let day = a:d
|
||||
|
||||
" there is no year zero
|
||||
if year == 0
|
||||
let year= -1
|
||||
elseif year < 0
|
||||
let year= year + 1
|
||||
endif
|
||||
|
||||
let julday= day - 32075 +
|
||||
\ 1461*(year + 4800 + (month - 14)/12)/4 +
|
||||
\ 367*(month - 2 - ((month - 14)/12)*12)/12 -
|
||||
\ 3*((year + 4900 + (month - 14)/12)/100)/4
|
||||
|
||||
" 2361221 == Sep 2, 1752, which was followed immediately by
|
||||
" Sep 14, 1752 (in England). Various countries
|
||||
" adopted the Gregorian calendar at different times.
|
||||
if julday <= 2361221
|
||||
let a = (14-month)/12
|
||||
let y = year + 4800 - a
|
||||
let m = month + 12*a - 3
|
||||
let julday = day + (153*m + 2)/5 + y*365 + y/4 - 32083
|
||||
endif
|
||||
return julday
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" calutil#Jul2Cal: convert a Julian day to a date: {{{1
|
||||
" Default year/month/day
|
||||
" julday,1 julday,"ymd" year/month/day
|
||||
" julday,2 julday,"mdy" month/day/year
|
||||
" julday,3 julday,"dmy" day/month/year
|
||||
fun! calutil#Jul2Cal(julday,...)
|
||||
let julday= a:julday
|
||||
|
||||
if julday <= 2361221
|
||||
" Proleptic Julian Calendar:
|
||||
" 2361210 == Sep 2, 1752, which was followed immediately by Sep 14, 1752
|
||||
" in England
|
||||
let c = julday + 32082
|
||||
let d = (4*c + 3)/1461
|
||||
let e = c - (1461*d)/4
|
||||
let m = (5*e + 2)/153
|
||||
let day = e - (153*m + 2)/5 + 1
|
||||
let month = m + 3 - 12*(m/10)
|
||||
let year = d - 4800 + m/10
|
||||
if year <= 0
|
||||
" proleptic Julian Calendar: there *is* no year 0!
|
||||
let year= year - 1
|
||||
endif
|
||||
|
||||
else
|
||||
" Gregorian calendar
|
||||
let t1 = julday + 68569
|
||||
let t2 = 4*t1/146097
|
||||
let t1 = t1 - (146097*t2 + 3)/4
|
||||
let yr = 4000*(t1 + 1)/1461001
|
||||
let t1 = t1 - (1461*yr/4 - 31)
|
||||
let mo = 80*t1/2447
|
||||
let day = (t1 - 2447*mo/80)
|
||||
let t1 = mo/11
|
||||
let month = (mo + 2 - 12*t1)
|
||||
let year = (100*(t2 - 49) + yr + t1)
|
||||
endif
|
||||
|
||||
let month = (month<10) ? '0' . month : month
|
||||
let day = (day < 10) ? '0' . day : day
|
||||
|
||||
if a:0 > 0
|
||||
if a:1 == 1 || a:1 =~ "ymd"
|
||||
return year."-".month."/".day
|
||||
elseif a:1 == 2 || a:1 =~ "mdy"
|
||||
return month."-".day."/".year
|
||||
elseif a:1 == 3 || a:1 =~ "dmy"
|
||||
return day."-".month."/".year
|
||||
else
|
||||
return year."-".month."/".day
|
||||
endif
|
||||
else
|
||||
return year."-".month."-".day
|
||||
endif
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vim: ts=4 fdm=marker
|
||||
|
@ -0,0 +1,77 @@
|
||||
" org.vim - VimOrganizer plugin for Vim
|
||||
" -------------------------------------------------------------
|
||||
" Version: 0.30
|
||||
" Maintainer: Herbert Sitz <hesitz@gmail.com>
|
||||
" Last Change: 2011 Nov 02
|
||||
"
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3342
|
||||
" Github page: http://github.com/hsitz/VimOrganizer
|
||||
" Copyright: (c) 2010, 2011 by Herbert Sitz
|
||||
" The VIM LICENSE applies to all files in the
|
||||
" VimOrganizer plugin.
|
||||
" (See the Vim copyright except read "VimOrganizer"
|
||||
" in places where that copyright refers to "Vim".)
|
||||
" http://vimdoc.sourceforge.net/htmldoc/uganda.html#license
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk *** ***
|
||||
|
||||
if exists("g:org_autoload_funcs")
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:org_autoload_funcs=1
|
||||
|
||||
function! org#SetOrgFileType()
|
||||
"if expand("%:e") == 'org'
|
||||
if &filetype != 'org'
|
||||
execute "set filetype=org"
|
||||
|
||||
" if !exists('g:org_todo_setup')
|
||||
" let g:org_todo_setup = 'TODO | DONE'
|
||||
" endif
|
||||
" if !exists('g:org_tag_setup')
|
||||
" let g:org_tag_setup = '{home(h) work(w)}'
|
||||
" endif
|
||||
"
|
||||
" call OrgProcessConfigLines()
|
||||
" exec "syntax match DONETODO '" . b:v.todoDoneMatch . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6"
|
||||
" exec "syntax match NOTDONETODO '" . b:v.todoNotDoneMatch . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6"
|
||||
|
||||
endif
|
||||
"endif
|
||||
endfunction
|
||||
|
||||
function! org#Pad(s,amt)
|
||||
return a:s . repeat(' ',a:amt - len(a:s))
|
||||
endfunction
|
||||
|
||||
function! org#Timestamp()
|
||||
return strftime("%Y-%m-%d %a %H:%M")
|
||||
endfunction
|
||||
|
||||
function! org#GetGroupHighlight(group)
|
||||
" this code was copied and modified from code posted on StackOverflow
|
||||
" http://stackoverflow.com/questions/1331213/how-to-modify-existing-highlight-group-in-vim
|
||||
" Redirect the output of the "hi" command into a variable
|
||||
" and find the highlighting
|
||||
redir => GroupDetails
|
||||
exe "silent hi " . a:group
|
||||
redir END
|
||||
|
||||
" Resolve linked groups to find the root highlighting scheme
|
||||
while GroupDetails =~ "links to"
|
||||
let index = stridx(GroupDetails, "links to") + len("links to")
|
||||
let LinkedGroup = strpart(GroupDetails, index + 1)
|
||||
redir => GroupDetails
|
||||
exe "silent hi " . LinkedGroup
|
||||
redir END
|
||||
endwhile
|
||||
|
||||
" Extract the highlighting details (the bit after "xxx")
|
||||
let MatchGroups = matchlist(GroupDetails, '\<xxx\>\s\+\(.*\)')
|
||||
let ExistingHighlight = MatchGroups[1]
|
||||
|
||||
return ExistingHighlight
|
||||
|
||||
endfunction
|
||||
|
@ -0,0 +1,525 @@
|
||||
" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79
|
||||
" Vimwiki autoload plugin file
|
||||
" Desc: Tables
|
||||
" | Easily | manageable | text | tables | ! |
|
||||
" |--------+------------+-------+--------+---------|
|
||||
" | Have | fun! | Drink | tea | Period. |
|
||||
"
|
||||
" Author: Maxim Kim <habamax@gmail.com>
|
||||
" Home: http://code.google.com/p/vimwiki/
|
||||
|
||||
" Load only once {{{
|
||||
if exists("g:loaded_vimwiki_tbl_auto") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_vimwiki_tbl_auto = 1
|
||||
"}}}
|
||||
|
||||
let s:textwidth = &tw
|
||||
|
||||
" Misc functions {{{
|
||||
function! s:wide_len(str) "{{{
|
||||
" vim73 has new function that gives correct string width.
|
||||
if exists("*strdisplaywidth")
|
||||
return strdisplaywidth(a:str)
|
||||
endif
|
||||
|
||||
" get str display width in vim ver < 7.2
|
||||
if !g:vimwiki_CJK_length
|
||||
let ret = strlen(substitute(a:str, '.', 'x', 'g'))
|
||||
else
|
||||
let savemodified = &modified
|
||||
let save_cursor = getpos('.')
|
||||
exe "norm! o\<esc>"
|
||||
call setline(line("."), a:str)
|
||||
let ret = virtcol("$") - 1
|
||||
d
|
||||
call setpos('.', save_cursor)
|
||||
let &modified = savemodified
|
||||
endif
|
||||
return ret
|
||||
endfunction "}}}
|
||||
|
||||
function! s:is_table(line) "{{{
|
||||
return a:line =~ '^\s*\%(|[^|]\+\)\+|\s*$' || s:is_separator(a:line)
|
||||
endfunction "}}}
|
||||
|
||||
function! s:is_separator(line) "{{{
|
||||
return a:line =~ '^\s*[|+]\s*--[-|+]\+'
|
||||
endfunction "}}}
|
||||
|
||||
function! s:is_last_column(lnum, cnum) "{{{
|
||||
return strpart(getline(a:lnum), a:cnum - 1) =~ '^[^|]*|\s*$'
|
||||
endfunction "}}}
|
||||
|
||||
function! s:is_first_column(lnum, cnum) "{{{
|
||||
let line = strpart(getline(a:lnum), 0, a:cnum - 1)
|
||||
return line =~ '^\s*|[^|]*$' || line =~ '^\s*$'
|
||||
endfunction "}}}
|
||||
|
||||
function! s:count_separators_up(lnum) "{{{
|
||||
let lnum = a:lnum - 1
|
||||
while lnum > 1
|
||||
if !s:is_separator(getline(lnum))
|
||||
break
|
||||
endif
|
||||
let lnum -= 1
|
||||
endwhile
|
||||
|
||||
return (a:lnum-lnum)
|
||||
endfunction "}}}
|
||||
|
||||
function! s:count_separators_down(lnum) "{{{
|
||||
let lnum = a:lnum + 1
|
||||
while lnum < line('$')
|
||||
if !s:is_separator(getline(lnum))
|
||||
break
|
||||
endif
|
||||
let lnum += 1
|
||||
endwhile
|
||||
|
||||
return (lnum-a:lnum)
|
||||
endfunction "}}}
|
||||
|
||||
function! s:create_empty_row(cols) "{{{
|
||||
let first_cell = "| |"
|
||||
let cell = " |"
|
||||
let row = first_cell
|
||||
|
||||
for c in range(a:cols - 1)
|
||||
let row .= cell
|
||||
endfor
|
||||
|
||||
return row
|
||||
endfunction "}}}
|
||||
|
||||
function! s:create_row_sep(cols) "{{{
|
||||
let first_cell = "|---+"
|
||||
let cell = "---+"
|
||||
let last_cell = "---|"
|
||||
|
||||
if a:cols < 2
|
||||
return "|---|"
|
||||
endif
|
||||
|
||||
let row = first_cell
|
||||
|
||||
for c in range(a:cols - 2)
|
||||
let row .= cell
|
||||
endfor
|
||||
|
||||
let row .= last_cell
|
||||
|
||||
return row
|
||||
endfunction "}}}
|
||||
|
||||
function! s:get_values(line) "{{{
|
||||
return split(a:line, '\s*|\s*', 1)[1:-2]
|
||||
endfunction "}}}
|
||||
|
||||
function! s:col_count(lnum) "{{{
|
||||
let line = getline(a:lnum)
|
||||
if !s:is_separator(line)
|
||||
return len(split(line, '\s*|\s*', 1)[1:-2])
|
||||
else
|
||||
return len(split(line, '-+-', 1))
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! s:get_indent(lnum) "{{{
|
||||
if !s:is_table(getline(a:lnum))
|
||||
return
|
||||
endif
|
||||
|
||||
let indent = 0
|
||||
|
||||
let lnum = a:lnum - 1
|
||||
while lnum > 1
|
||||
let line = getline(lnum)
|
||||
if !s:is_table(line)
|
||||
let indent = indent(lnum+1)
|
||||
break
|
||||
endif
|
||||
let lnum -= 1
|
||||
endwhile
|
||||
|
||||
return indent
|
||||
endfunction " }}}
|
||||
|
||||
function! s:get_rows(lnum) "{{{
|
||||
if !s:is_table(getline(a:lnum))
|
||||
return
|
||||
endif
|
||||
|
||||
let upper_rows = []
|
||||
let lower_rows = []
|
||||
|
||||
let lnum = a:lnum - 1
|
||||
while lnum > 1
|
||||
let line = getline(lnum)
|
||||
if s:is_table(line)
|
||||
call add(upper_rows, [lnum, line])
|
||||
else
|
||||
break
|
||||
endif
|
||||
let lnum -= 1
|
||||
endwhile
|
||||
call reverse(upper_rows)
|
||||
|
||||
let lnum = a:lnum
|
||||
while lnum <= line('$')
|
||||
let line = getline(lnum)
|
||||
if s:is_table(line)
|
||||
call add(lower_rows, [lnum, line])
|
||||
else
|
||||
break
|
||||
endif
|
||||
let lnum += 1
|
||||
endwhile
|
||||
|
||||
return upper_rows + lower_rows
|
||||
endfunction "}}}
|
||||
|
||||
function! s:get_cell_max_lens(lnum) "{{{
|
||||
let max_lens = {}
|
||||
for [lnum, row] in s:get_rows(a:lnum)
|
||||
if s:is_separator(row)
|
||||
continue
|
||||
endif
|
||||
let cells = s:get_values(row)
|
||||
for idx in range(len(cells))
|
||||
let value = cells[idx]
|
||||
if has_key(max_lens, idx)
|
||||
let max_lens[idx] = max([s:wide_len(value), max_lens[idx]])
|
||||
else
|
||||
let max_lens[idx] = s:wide_len(value)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
return max_lens
|
||||
endfunction "}}}
|
||||
|
||||
function! s:get_aligned_rows(lnum, col1, col2) "{{{
|
||||
let max_lens = s:get_cell_max_lens(a:lnum)
|
||||
let rows = []
|
||||
for [lnum, row] in s:get_rows(a:lnum)
|
||||
if s:is_separator(row)
|
||||
let new_row = s:fmt_sep(max_lens, a:col1, a:col2)
|
||||
else
|
||||
let new_row = s:fmt_row(row, max_lens, a:col1, a:col2)
|
||||
endif
|
||||
call add(rows, [lnum, new_row])
|
||||
endfor
|
||||
return rows
|
||||
endfunction "}}}
|
||||
|
||||
" Number of the current column. Starts from 0.
|
||||
function! s:cur_column() "{{{
|
||||
let line = getline('.')
|
||||
if !s:is_table(line)
|
||||
return -1
|
||||
endif
|
||||
if s:is_separator(line)
|
||||
let sep = '[+|]'
|
||||
else
|
||||
let sep = '|'
|
||||
endif
|
||||
|
||||
let curs_pos = col('.')
|
||||
let mpos = match(line, '|', 0)
|
||||
let col = -1
|
||||
while mpos < curs_pos && mpos != -1
|
||||
let mpos = match(line, sep, mpos+1)
|
||||
if mpos != -1
|
||||
let col += 1
|
||||
endif
|
||||
endwhile
|
||||
return col
|
||||
endfunction "}}}
|
||||
|
||||
" }}}
|
||||
|
||||
" Format functions {{{
|
||||
function! s:fmt_cell(cell, max_len) "{{{
|
||||
let cell = ' '.a:cell.' '
|
||||
|
||||
let diff = a:max_len - s:wide_len(a:cell)
|
||||
if diff == 0 && empty(a:cell)
|
||||
let diff = 1
|
||||
endif
|
||||
|
||||
let cell .= repeat(' ', diff)
|
||||
return cell
|
||||
endfunction "}}}
|
||||
|
||||
function! s:fmt_row(line, max_lens, col1, col2) "{{{
|
||||
let new_line = '|'
|
||||
let cells = s:get_values(a:line)
|
||||
for idx in range(len(cells))
|
||||
if idx == a:col1
|
||||
let idx = a:col2
|
||||
elseif idx == a:col2
|
||||
let idx = a:col1
|
||||
endif
|
||||
let value = cells[idx]
|
||||
let new_line .= s:fmt_cell(value, a:max_lens[idx]).'|'
|
||||
endfor
|
||||
|
||||
let idx = len(cells)
|
||||
while idx < len(a:max_lens)
|
||||
let new_line .= s:fmt_cell('', a:max_lens[idx]).'|'
|
||||
let idx += 1
|
||||
endwhile
|
||||
return new_line
|
||||
endfunction "}}}
|
||||
|
||||
function! s:fmt_cell_sep(max_len) "{{{
|
||||
if a:max_len == 0
|
||||
return repeat('-', 3)
|
||||
else
|
||||
return repeat('-', a:max_len+2)
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! s:fmt_sep(max_lens, col1, col2) "{{{
|
||||
let sep = '|'
|
||||
for idx in range(len(a:max_lens))
|
||||
if idx == a:col1
|
||||
let idx = a:col2
|
||||
elseif idx == a:col2
|
||||
let idx = a:col1
|
||||
endif
|
||||
let sep .= s:fmt_cell_sep(a:max_lens[idx]).'+'
|
||||
endfor
|
||||
let sep = substitute(sep, '+$', '|', '')
|
||||
return sep
|
||||
endfunction "}}}
|
||||
"}}}
|
||||
|
||||
" Keyboard functions "{{{
|
||||
function! s:kbd_create_new_row(cols, goto_first) "{{{
|
||||
let cmd = "\<ESC>o".s:create_empty_row(a:cols)
|
||||
let cmd .= "\<ESC>:call org#tbl#format(line('.'))\<CR>"
|
||||
if a:goto_first
|
||||
let cmd .= "\<ESC>0:call search('|', 'c', line('.'))\<CR>la"
|
||||
else
|
||||
let cmd .= "0".(col('.')-1)."lT|a"
|
||||
endif
|
||||
return cmd
|
||||
endfunction "}}}
|
||||
|
||||
function! s:kbd_goto_next_row() "{{{
|
||||
let cmd = "\<ESC>jt|T|a"
|
||||
return cmd
|
||||
endfunction "}}}
|
||||
|
||||
function! s:kbd_goto_prev_row() "{{{
|
||||
let cmd = "\<ESC>jt|T|a"
|
||||
return cmd
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#next_col(last)
|
||||
return s:kbd_goto_next_col(a:last)
|
||||
endfunction
|
||||
function! s:kbd_goto_next_col(last) "{{{
|
||||
if a:last
|
||||
let seps = s:count_separators_down(line('.'))
|
||||
if mode() == 'n'
|
||||
let cmd = seps . "j0:call search('|', 'c', line('.'))\<CR>l"
|
||||
else
|
||||
let cmd = "\<ESC>".seps."j0:call search('|', 'c', line('.'))\<CR>la"
|
||||
endif
|
||||
else
|
||||
if mode() == 'n'
|
||||
let cmd = ":call search('|', 'c', line('.'))\<CR>l"
|
||||
else
|
||||
let cmd = "\<ESC>:call search('|', 'c', line('.'))\<CR>la"
|
||||
endif
|
||||
endif
|
||||
return cmd
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#prev_col(first)
|
||||
return s:kbd_goto_prev_col(a:first)
|
||||
endfunction
|
||||
function! s:kbd_goto_prev_col(first) "{{{
|
||||
if a:first
|
||||
let seps = s:count_separators_up(line('.'))
|
||||
let cmd = "\<ESC>".seps."k$:call search('|', 'b', line('.'))\<CR>la"
|
||||
else
|
||||
let cmd = "\<ESC>2F|la"
|
||||
endif
|
||||
return cmd
|
||||
endfunction "}}}
|
||||
|
||||
"}}}
|
||||
|
||||
" Global functions {{{
|
||||
function! org#tbl#kbd_cr() "{{{
|
||||
let lnum = line('.')
|
||||
if !s:is_table(getline(lnum))
|
||||
return "\<CR>"
|
||||
endif
|
||||
|
||||
if s:is_separator(getline(lnum+1)) || !s:is_table(getline(lnum+1))
|
||||
let cols = len(s:get_values(getline(lnum)))
|
||||
return s:kbd_create_new_row(cols, 0)
|
||||
else
|
||||
return s:kbd_goto_next_row()
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#kbd_tab() "{{{
|
||||
let lnum = line('.')
|
||||
if !s:is_table(getline(lnum))
|
||||
return "\<Tab>"
|
||||
endif
|
||||
|
||||
let last = s:is_last_column(lnum, col('.'))
|
||||
if last && !s:is_table(getline(lnum+1))
|
||||
let cols = len(s:get_values(getline(lnum)))
|
||||
return s:kbd_create_new_row(cols, 1)
|
||||
endif
|
||||
return s:kbd_goto_next_col(last)
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#kbd_shift_tab() "{{{
|
||||
let lnum = line('.')
|
||||
if !s:is_table(getline(lnum))
|
||||
return "\<S-Tab>"
|
||||
endif
|
||||
|
||||
let first = s:is_first_column(lnum, col('.'))
|
||||
if first && !s:is_table(getline(lnum-1))
|
||||
return ""
|
||||
endif
|
||||
return s:kbd_goto_prev_col(first)
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#format(lnum, ...) "{{{
|
||||
let line = getline(a:lnum)
|
||||
if !s:is_table(line)
|
||||
return
|
||||
endif
|
||||
|
||||
if a:0 == 2
|
||||
let col1 = a:1
|
||||
let col2 = a:2
|
||||
else
|
||||
let col1 = 0
|
||||
let col2 = 0
|
||||
endif
|
||||
|
||||
let indent = s:get_indent(a:lnum)
|
||||
|
||||
for [lnum, row] in s:get_aligned_rows(a:lnum, col1, col2)
|
||||
let row = repeat(' ', indent).row
|
||||
call setline(lnum, row)
|
||||
endfor
|
||||
|
||||
let &tw = s:textwidth
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#create(...) "{{{
|
||||
if a:0 > 1
|
||||
let cols = a:1
|
||||
let rows = a:2
|
||||
elseif a:0 == 1
|
||||
let cols = a:1
|
||||
let rows = 2
|
||||
elseif a:0 == 0
|
||||
let cols = 5
|
||||
let rows = 2
|
||||
endif
|
||||
|
||||
if cols < 1
|
||||
let cols = 5
|
||||
endif
|
||||
|
||||
if rows < 1
|
||||
let rows = 2
|
||||
endif
|
||||
|
||||
let lines = []
|
||||
let row = s:create_empty_row(cols)
|
||||
|
||||
call add(lines, row)
|
||||
if rows > 1
|
||||
call add(lines, s:create_row_sep(cols))
|
||||
endif
|
||||
|
||||
for r in range(rows - 1)
|
||||
call add(lines, row)
|
||||
endfor
|
||||
|
||||
call append(line('.'), lines)
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#align_or_cmd(cmd) "{{{
|
||||
if s:is_table(getline('.'))
|
||||
call org#tbl#format(line('.'))
|
||||
else
|
||||
exe 'normal! '.a:cmd
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#reset_tw(lnum) "{{{
|
||||
let line = getline(a:lnum)
|
||||
if !s:is_table(line)
|
||||
return
|
||||
endif
|
||||
|
||||
let s:textwidth = &tw
|
||||
let &tw = 0
|
||||
endfunction "}}}
|
||||
|
||||
" TODO: move_column_left and move_column_right are good candidates to be
|
||||
" refactored.
|
||||
function! org#tbl#move_column_left() "{{{
|
||||
if !s:is_table(getline('.'))
|
||||
return
|
||||
endif
|
||||
|
||||
let cur_col = s:cur_column()
|
||||
if cur_col == -1
|
||||
return
|
||||
endif
|
||||
|
||||
if cur_col > 0
|
||||
call org#tbl#format(line('.'), cur_col-1, cur_col)
|
||||
call cursor(line('.'), 1)
|
||||
if !s:is_separator(getline('.'))
|
||||
call search('\%(|[^|]\+\)\{'.(cur_col-1).'}| .', 'eW')
|
||||
else
|
||||
call search('|\%([^+]\++\)\{'.(cur_col-1).'}--', 'eW')
|
||||
endif
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#move_column_right() "{{{
|
||||
if !s:is_table(getline('.'))
|
||||
return
|
||||
endif
|
||||
|
||||
let cur_col = s:cur_column()
|
||||
if cur_col == -1
|
||||
return
|
||||
endif
|
||||
|
||||
if cur_col < s:col_count(line('.'))-1
|
||||
call org#tbl#format(line('.'), cur_col, cur_col+1)
|
||||
call cursor(line('.'), 1)
|
||||
if !s:is_separator(getline('.'))
|
||||
call search('\%(|[^|]\+\)\{'.(cur_col+1).'}| .', 'eW')
|
||||
else
|
||||
call search('|\%([^+]\++\)\{'.(cur_col+1).'}--', 'eW')
|
||||
endif
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! org#tbl#get_rows(lnum) "{{{
|
||||
return s:get_rows(a:lnum)
|
||||
endfunction "}}}
|
||||
|
||||
"}}}
|
||||
|
@ -0,0 +1,15 @@
|
||||
The vim73 patch in this directory does two things:
|
||||
|
||||
1. Enables level-dependent fold highlighting in Vim73.
|
||||
2. Enables separate TODO highlighting in folded headings
|
||||
in VimOrganizer, so TODO's stand out even when a
|
||||
heading is folded.
|
||||
|
||||
The vim72 patch is old and only does (1) above.
|
||||
|
||||
If someone is using a version of Windows and wants to avoid
|
||||
recompiling process you can contact me and I will send you an
|
||||
executable you should be able to use on your system.
|
||||
|
||||
Herbert Sitz
|
||||
hesitz@gmail.com
|
@ -0,0 +1,79 @@
|
||||
=== (+2,-1) src/eval.c ===
|
||||
@@ -355,6 +355,7 @@
|
||||
{VV_NAME("operator", VAR_STRING), VV_RO},
|
||||
{VV_NAME("searchforward", VAR_NUMBER), 0},
|
||||
{VV_NAME("oldfiles", VAR_LIST), 0},
|
||||
+ {VV_NAME("foldhighlight", VAR_NUMBER), 0},
|
||||
};
|
||||
|
||||
/* shorthand */
|
||||
=== (+18,-9) src/screen.c ===
|
||||
@@ -2179,9 +2179,17 @@
|
||||
# define RL_MEMSET(p, v, l) for (ri = 0; ri < l; ++ri) \
|
||||
ScreenAttrs[off + (p) + ri] = v
|
||||
#endif
|
||||
+ /*
|
||||
+ * 4. Compose the folded-line string with 'foldtext', if set.
|
||||
+ */
|
||||
+ text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
|
||||
+
|
||||
+ txtcol = col; /* remember where text starts */
|
||||
|
||||
/* Set all attributes of the 'number' column and the text */
|
||||
- RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col);
|
||||
+ //RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col);
|
||||
+ RL_MEMSET(col, hl_attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)), W_WIDTH(wp) - col);
|
||||
+
|
||||
|
||||
#ifdef FEAT_SIGNS
|
||||
/* If signs are being displayed, add two spaces. */
|
||||
@@ -2196,10 +2204,11 @@
|
||||
if (wp->w_p_rl)
|
||||
/* the line number isn't reversed */
|
||||
copy_text_attr(off + W_WIDTH(wp) - len - col,
|
||||
- (char_u *)" ", len, hl_attr(HLF_FL));
|
||||
+ (char_u *)" ", len, hl_attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
+
|
||||
else
|
||||
# endif
|
||||
- copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_FL));
|
||||
+ copy_text_attr(off + col, (char_u *)" ", len, hl_attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
col += len;
|
||||
}
|
||||
}
|
||||
@@ -2222,10 +2231,10 @@
|
||||
if (wp->w_p_rl)
|
||||
/* the line number isn't reversed */
|
||||
copy_text_attr(off + W_WIDTH(wp) - len - col, buf, len,
|
||||
- hl_attr(HLF_FL));
|
||||
+ hl_attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
else
|
||||
#endif
|
||||
- copy_text_attr(off + col, buf, len, hl_attr(HLF_FL));
|
||||
+ copy_text_attr(off + col, buf, len, hl_attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
col += len;
|
||||
}
|
||||
}
|
||||
@@ -2233,9 +2242,9 @@
|
||||
/*
|
||||
* 4. Compose the folded-line string with 'foldtext', if set.
|
||||
*/
|
||||
- text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
|
||||
-
|
||||
- txtcol = col; /* remember where text starts */
|
||||
+ //text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
|
||||
+// moved up above to heappen earlier h.s.
|
||||
+ // txtcol = col; /* remember where text starts */
|
||||
|
||||
/*
|
||||
* 5. move the text to current_ScreenLine. Fill up with "fill_fold".
|
||||
=== (+3,-2) src/vim.h ===
|
||||
@@ -1767,7 +1767,8 @@
|
||||
#define VV_OP 52
|
||||
#define VV_SEARCHFORWARD 53
|
||||
#define VV_OLDFILES 54
|
||||
-#define VV_LEN 55 /* number of v: vars */
|
||||
+#define VV_FOLDHIGHLIGHT 55
|
||||
+#define VV_LEN 56 /* number of v: vars */
|
||||
|
||||
#ifdef FEAT_CLIPBOARD
|
@ -0,0 +1,113 @@
|
||||
diff -u ./src/eval.c ./patched_src/eval.c
|
||||
--- ./src/eval.c 2010-08-09 13:12:14.000000000 -0700
|
||||
+++ ./patched_src/eval.c 2011-08-24 12:45:30.990183200 -0700
|
||||
@@ -362,6 +362,8 @@
|
||||
{VV_NAME("operator", VAR_STRING), VV_RO},
|
||||
{VV_NAME("searchforward", VAR_NUMBER), 0},
|
||||
{VV_NAME("oldfiles", VAR_LIST), 0},
|
||||
+ {VV_NAME("foldhighlight", VAR_NUMBER), 0},
|
||||
+ {VV_NAME("todohighlight", VAR_NUMBER), 0},
|
||||
};
|
||||
|
||||
/* shorthand */
|
||||
diff -u ./src/screen.c ./patched_src/screen.c
|
||||
--- ./src/screen.c 2010-08-13 06:21:27.000000000 -0700
|
||||
+++ ./patched_src/screen.c 2011-10-15 04:01:17.947926300 -0700
|
||||
@@ -2214,6 +2214,8 @@
|
||||
* 4. Compose the text
|
||||
* 5. Add the text
|
||||
* 6. set highlighting for the Visual area an other text
|
||||
+ * NOTE: in patch for VimOrganizer step 4, composing text
|
||||
+ * is moved up to happen as part of step 2.
|
||||
*/
|
||||
col = 0;
|
||||
|
||||
@@ -2271,10 +2273,16 @@
|
||||
# define RL_MEMSET(p, v, l) for (ri = 0; ri < l; ++ri) \
|
||||
ScreenAttrs[off + (p) + ri] = v
|
||||
#endif
|
||||
+ /*
|
||||
+ * 4. Compose the folded-line string with 'foldtext', if set.
|
||||
+ */
|
||||
+ text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
|
||||
+
|
||||
+ txtcol = col; /* remember where text starts */
|
||||
+
|
||||
+ /* Set all attributes of the 'number' column and the text */
|
||||
+ RL_MEMSET(col, syn_id2attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)), W_WIDTH(wp) - col);
|
||||
|
||||
- /* Set all attributes of the 'number' or 'relativenumber' column and the
|
||||
- * text */
|
||||
- RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col);
|
||||
|
||||
#ifdef FEAT_SIGNS
|
||||
/* If signs are being displayed, add two spaces. */
|
||||
@@ -2289,10 +2297,11 @@
|
||||
if (wp->w_p_rl)
|
||||
/* the line number isn't reversed */
|
||||
copy_text_attr(off + W_WIDTH(wp) - len - col,
|
||||
- (char_u *)" ", len, hl_attr(HLF_FL));
|
||||
+ (char_u *)" ", len, hl_attr(HLF_SC));
|
||||
else
|
||||
# endif
|
||||
- copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_FL));
|
||||
+ copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_SC));
|
||||
+
|
||||
col += len;
|
||||
}
|
||||
}
|
||||
@@ -2324,20 +2333,35 @@
|
||||
if (wp->w_p_rl)
|
||||
/* the line number isn't reversed */
|
||||
copy_text_attr(off + W_WIDTH(wp) - len - col, buf, len,
|
||||
- hl_attr(HLF_FL));
|
||||
+ hl_attr(HLF_N));
|
||||
+ //syn_id2attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
+
|
||||
else
|
||||
#endif
|
||||
- copy_text_attr(off + col, buf, len, hl_attr(HLF_FL));
|
||||
+ copy_text_attr(off + col, buf, len, hl_attr(HLF_N));
|
||||
+ //copy_text_attr(off + col, buf, len, syn_id2attr(get_vim_var_nr(VV_FOLDHIGHLIGHT)));
|
||||
+
|
||||
col += len;
|
||||
}
|
||||
}
|
||||
|
||||
+ /* now set attributes for vimorganizer todo word in headline, if any */
|
||||
+ /* v:todohighlight is set in user's OrgFoldText() function. . . */
|
||||
+ if (get_vim_var_nr(VV_TODOHIGHLIGHT) > 0 )
|
||||
+ {
|
||||
+ int start=0, end;
|
||||
+
|
||||
+ while( *(text + start) == ' ' )
|
||||
+ start++;
|
||||
+ end = start;
|
||||
+ while( *(text + end) != ' ' )
|
||||
+ end++;
|
||||
+ RL_MEMSET(start+col, syn_id2attr(get_vim_var_nr(VV_TODOHIGHLIGHT)), end - start);
|
||||
+ }
|
||||
/*
|
||||
* 4. Compose the folded-line string with 'foldtext', if set.
|
||||
*/
|
||||
- text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
|
||||
-
|
||||
- txtcol = col; /* remember where text starts */
|
||||
+ // moved up above to happen earlier h.s.
|
||||
|
||||
/*
|
||||
* 5. move the text to current_ScreenLine. Fill up with "fill_fold".
|
||||
diff -u ./src/vim.h ./patched_src/vim.h
|
||||
--- ./src/vim.h 2010-07-29 11:46:39.000000000 -0700
|
||||
+++ ./patched_src/vim.h 2011-08-11 14:22:52.525545700 -0700
|
||||
@@ -1842,7 +1842,9 @@
|
||||
#define VV_OP 52
|
||||
#define VV_SEARCHFORWARD 53
|
||||
#define VV_OLDFILES 54
|
||||
-#define VV_LEN 55 /* number of v: vars */
|
||||
+#define VV_FOLDHIGHLIGHT 55
|
||||
+#define VV_TODOHIGHLIGHT 56
|
||||
+#define VV_LEN 57 /* number of v: vars */
|
||||
|
||||
#ifdef FEAT_CLIPBOARD
|
||||
|
1482
vim_plugin_candinates_src/VimOrganizer_v0313/doc/vimorg.txt
Normal file
1482
vim_plugin_candinates_src/VimOrganizer_v0313/doc/vimorg.txt
Normal file
File diff suppressed because it is too large
Load Diff
7462
vim_plugin_candinates_src/VimOrganizer_v0313/ftplugin/org.vim
Normal file
7462
vim_plugin_candinates_src/VimOrganizer_v0313/ftplugin/org.vim
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
||||
" org.vim - VimOrganizer plugin for Vim
|
||||
" -------------------------------------------------------------
|
||||
" Version: 0.30
|
||||
" Maintainer: Herbert Sitz <hesitz@gmail.com>
|
||||
" Last Change: 2011 Nov 02
|
||||
"
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3342
|
||||
" Github page: http://github.com/hsitz/VimOrganizer
|
||||
" Copyright: (c) 2010, 2011 by Herbert Sitz
|
||||
" The VIM LICENSE applies to all files in the
|
||||
" VimOrganizer plugin.
|
||||
" (See the Vim copyright except read "VimOrganizer"
|
||||
" in places where that copyright refers to "Vim".)
|
||||
" http://vimdoc.sourceforge.net/htmldoc/uganda.html#license
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk *** ***
|
||||
|
||||
nnoremap <silent> <buffer> <localleader>ag :call OrgAgendaDashboard()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>et :call OrgTagsEdit()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>ci :call OrgClockIn()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>co :call OrgClockOut()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>d :call OrgDateDashboard()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>t :call OrgTodoDashboard()<cr>
|
||||
"nnoremap <silent> <buffer> q :sign unplace * | quit<cr>
|
||||
nnoremap <silent> <buffer> q :call OrgQuitAgenda()<cr>
|
||||
function! OrgQuitAgenda()
|
||||
sign unplace *
|
||||
bw
|
||||
call clearmatches()
|
||||
let b:v.chosen_agenda_heading = 0
|
||||
if bufnr('ColHeadBuffer') > -1
|
||||
"main window has column headings window that
|
||||
"is now showing a blank buffer line, push back up . . .
|
||||
resize 100
|
||||
endif
|
||||
"quit
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> <buffer> <c-tab> :wincmd k<cr>
|
@ -0,0 +1,176 @@
|
||||
" org.vim - VimOrganizer plugin for Vim
|
||||
" -------------------------------------------------------------
|
||||
" Version: 0.30
|
||||
" Maintainer: Herbert Sitz <hesitz@gmail.com>
|
||||
" Last Change: 2011 Nov 02
|
||||
"
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3342
|
||||
" Github page: http://github.com/hsitz/VimOrganizer
|
||||
" Copyright: (c) 2010, 2011 by Herbert Sitz
|
||||
" The VIM LICENSE applies to all files in the
|
||||
" VimOrganizer plugin.
|
||||
" (See the Vim copyright except read "VimOrganizer"
|
||||
" in places where that copyright refers to "Vim".)
|
||||
" http://vimdoc.sourceforge.net/htmldoc/uganda.html#license
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk *** ***
|
||||
"
|
||||
"Section Mappings and Endstuff
|
||||
" below block of 10 or 15 maps are ones collected
|
||||
" from body of doc that weren't getting assigned for docs
|
||||
" oepened after initial org filetype doc
|
||||
nnoremap <silent> <buffer> <tab> :call OrgCycle()<cr>
|
||||
nnoremap <silent> <buffer> <s-tab> :call OrgGlobalCycle()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>ci :call OrgClockIn(line("."))<cr>
|
||||
nnoremap <silent> <buffer> <localleader>co :call OrgClockOut()<cr>
|
||||
"cnoremap <space> <C-\>e(<SID>OrgDateEdit())<CR>
|
||||
" dl is for the date on the current line
|
||||
noremap <buffer> <localleader>x :call OrgExportDashboard()<cr>
|
||||
noremap <buffer> <localleader>d :call OrgDateDashboard()<cr>
|
||||
noremap <buffer> <localleader>b :call OrgTableDashboard()<cr>
|
||||
"noremap <silent> <buffer> <localleader>dg :call OrgGenericDateEdit()<cr>
|
||||
"noremap <silent> <buffer> <localleader>dt :call OrgDateEdit('TIMESTAMP')<cr>
|
||||
"noremap <silent> <buffer> <localleader>dd :call OrgDateEdit('DEADLINE')<cr>
|
||||
"noremap <silent> <buffer> <localleader>dc :call OrgDateEdit('CLOSED')<cr>
|
||||
"noremap <silent> <buffer> <localleader>ds :call OrgDateEdit('SCHEDULED')<cr>
|
||||
noremap <silent> <buffer> <localleader>a* :call OrgRunAgenda(strftime("%Y-%m-%d"),'w,'')<cr>
|
||||
noremap <silent> <buffer> <localleader>aa :call OrgRunAgenda(strftime("%Y-%m-%d"),'w,'+ANY_TODO')<cr>
|
||||
noremap <silent> <buffer> <localleader>at :call OrgRunAgenda(strftime("%Y-%m-%d"),'w,'+UNFINISHED_TODOS')<cr>
|
||||
noremap <silent> <buffer> <localleader>ad :call OrgRunAgenda(strftime("%Y-%m-%d"),'w,'+FINISHED_TODOS')<cr>
|
||||
noremap <silent> <buffer> <localleader>ag :call OrgAgendaDashboard()<cr>
|
||||
noremap <silent> <buffer> <localleader>ac :call OrgCustomSearchMenu()<cr>
|
||||
"command! -nargs=0 Agenda :call OrgAgendaDashboard()
|
||||
nnoremap <silent> <buffer> <s-up> :call OrgDateInc(1)<CR>
|
||||
nnoremap <silent> <buffer> <s-down> :call OrgDateInc(-1)<CR>
|
||||
nnoremap <silent> <buffer> <2-LeftMouse> :call OrgMouseDate()<CR>
|
||||
nnoremap <localleader>pl :call s:MyPopup()<cr>
|
||||
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
|
||||
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
|
||||
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
||||
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
||||
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
|
||||
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
|
||||
"map <silent> <localleader>b :call ShowBottomCal()<cr>
|
||||
|
||||
nnoremap <silent> <buffer> <localleader>et :call OrgTagsEdit()<cr>
|
||||
|
||||
" clear search matching
|
||||
nnoremap <silent> <buffer> <localleader>cs :let @/=''<cr>
|
||||
|
||||
noremap <buffer> <localleader>r :call OrgRefileDashboard()<cr>
|
||||
"noremap <silent> <buffer> <localleader>rh :call OrgRefile(line('.'))<cr>
|
||||
"noremap <silent> <buffer> <localleader>rj :call OrgJumpToRefilePoint()<cr>
|
||||
"noremap <silent> <buffer> <localleader>rx :call OrgJumpToRefilePointPersistent()<cr>
|
||||
"noremap <silent> <buffer> <localleader>rs :call OrgSetRefilePoint()<cr>
|
||||
"noremap <silent> <buffer> <localleader>rp :call OrgRefileToPermPoint(line('.'))<cr>
|
||||
noremap <silent> <buffer> <localleader>v :silent call OrgEval()<cr>
|
||||
|
||||
noremap <buffer> <C-K> <C-]>
|
||||
noremap <buffer> <C-N> <C-T>
|
||||
noremap <silent> <buffer> <localleader>0 :call OrgExpandWithoutText(99999)<CR>
|
||||
noremap <silent> <buffer> <localleader>9 :call OrgExpandWithoutText(9)<CR>
|
||||
noremap <silent> <buffer> <localleader>8 :call OrgExpandWithoutText(8)<CR>
|
||||
noremap <silent> <buffer> <localleader>7 :call OrgExpandWithoutText(7)<CR>
|
||||
noremap <silent> <buffer> <localleader>6 :call OrgExpandWithoutText(6)<CR>
|
||||
noremap <silent> <buffer> <localleader>5 :call OrgExpandWithoutText(5)<CR>
|
||||
noremap <silent> <buffer> <localleader>4 :call OrgExpandWithoutText(4)<CR>
|
||||
noremap <silent> <buffer> <localleader>3 :call OrgExpandWithoutText(3)<CR>
|
||||
noremap <silent> <buffer> <localleader>2 :call OrgExpandWithoutText(2)<CR>
|
||||
noremap <silent> <buffer> <localleader>1 :call OrgExpandWithoutText(1)<CR>
|
||||
noremap <silent> <buffer> <localleader><space> :call OrgExpandWithoutText(1)<CR>
|
||||
"noremap <silent> <buffer> <localleader>/ :let @/='exec call OrgExpandWithoutText(1)<CR>
|
||||
"noremap <silent> <buffer> <localleader>/ :let @a='/^\*\{1,' . &foldlevel . '\} .*'|call LevSearch()<cr>
|
||||
nnoremap <buffer> <expr> <localleader>/ '/^\*\{1,' . &foldlevel . '\} .*'
|
||||
nnoremap <buffer> <expr> <localleader>? '?^\*\{1,' . &foldlevel . '\} .*'
|
||||
|
||||
" set reasonable max limit of 12 for '0' command below, because it iterates
|
||||
" each for each level, just assume 12 is max. . .
|
||||
noremap <silent> <buffer> <localleader>,0 :call OrgShowSubs(12,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,9 :call OrgShowSubs(9,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,8 :call OrgShowSubs(8,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,7 :call OrgShowSubs(7,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,6 :call OrgShowSubs(6,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,5 :call OrgShowSubs(5,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,4 :call OrgShowSubs(4,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,3 :call OrgShowSubs(3,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,2 :call OrgShowSubs(2,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,1 :call OrgShowSubs(1,0)<CR>
|
||||
noremap <silent> <buffer> <localleader>,; :call OrgShowSubs(1,0)<CR>
|
||||
|
||||
|
||||
"nnoremap <silent> <buffer> <localleader>no :call NarrowOutline(line('.'))<cr>
|
||||
"nnoremap <silent> <buffer> <localleader>ns :call NarrowOutline(line('.'))<cr>
|
||||
"nnoremap <silent> <buffer> <localleader>nc :call NarrowCodeBlock(line('.'))<cr>
|
||||
nnoremap <silent> <buffer> <localleader>na :call NarrowCodeBlock(line('.'))<cr>
|
||||
nnoremap <silent> <buffer> <localleader>m :call OrgColumnsDashboard()<cr>
|
||||
" ----------------------------------------
|
||||
" table commands
|
||||
au InsertEnter *.org :call org#tbl#reset_tw(line("."))
|
||||
au InsertLeave *.org :call org#tbl#format(line("."))
|
||||
command! -buffer -nargs=* OrgTable call org#tbl#create(<f-args>)
|
||||
"nnoremap <silent> <buffer> <localleader>bc :call org#tbl#create()<cr>
|
||||
command! -buffer OrgTableAlignQ call org#tbl#align_or_cmd('gqq')
|
||||
command! -buffer OrgTableAlignW call org#tbl#align_or_cmd('gww')
|
||||
command! -buffer OrgTableMoveColumnLeft call org#tbl#move_column_left()
|
||||
"nnoremap <silent> <buffer> <localleader>bl :call org#tbl#move_column_left()<cr>
|
||||
command! -buffer OrgTableMoveColumnRight call org#tbl#move_column_right()
|
||||
"nnoremap <silent> <buffer> <localleader>br :call org#tbl#move_column_right()<cr>
|
||||
|
||||
" table function mappings
|
||||
inoremap <buffer> <expr> <CR> org#tbl#kbd_cr()
|
||||
inoremap <expr> <buffer> <Tab> org#tbl#kbd_tab()
|
||||
inoremap <expr> <buffer> <S-Tab> org#tbl#kbd_shift_tab()
|
||||
nnoremap <buffer> gqq :OrgTableAlignQ<CR>
|
||||
nnoremap <buffer> gww :OrgTableAlignW<CR>
|
||||
"nnoremap <silent><buffer> <A-Left> <Plug>OrgTableMoveColumnLeft
|
||||
nnoremap <silent><script><buffer>
|
||||
\ <Plug>OrgTableMoveColumnLeft :OrgTableMoveColumnLeft<CR>
|
||||
"nnoremap <silent><buffer> <A-Right> <Plug>OrgTableMoveColumnRight
|
||||
nnoremap <silent><script><buffer>
|
||||
\ <Plug>OrgTableMoveColumnRight :OrgTableMoveColumnRight<CR>
|
||||
" -------------------------------------
|
||||
|
||||
imap <silent> <buffer> <s-c-CR> <c-r>=OrgNewHead('levelup',1)<CR>
|
||||
imap <silent> <buffer> <c-CR> <c-r>=OrgNewHead('leveldown',1)<CR>
|
||||
imap <silent> <buffer> <s-CR> <c-r>=OrgNewHead('same',1)<CR>
|
||||
nnoremap <silent> <buffer> <s-c-CR> :call OrgNewHead('levelup')<CR>
|
||||
nnoremap <silent> <buffer> <c-CR> :call OrgNewHead('leveldown')<CR>
|
||||
nnoremap <silent> <buffer> <CR> :call OrgEnterFunc()<CR>
|
||||
nnoremap <silent> <buffer> <c-left> :call OrgShowLess(line("."))<CR>
|
||||
nnoremap <silent> <buffer> <c-right> :call OrgShowMore(line("."))<CR>
|
||||
nnoremap <silent> <buffer> <c-a-left> :call OrgMoveLevel(line("."),'left')<CR>
|
||||
nnoremap <silent> <buffer> <c-a-right> :call OrgMoveLevel(line("."),'right')<CR>
|
||||
nnoremap <silent> <buffer> <c-a-up> :<C-U>call OrgMoveLevel(line("."),'up',v:count1)<CR>
|
||||
nnoremap <silent> <buffer> <c-a-down> :<C-U>call OrgMoveLevel(line("."),'down',v:count1)<CR>
|
||||
nnoremap <silent> <buffer> <a-end> :call OrgNavigateLevels("end")<CR>
|
||||
nnoremap <silent> <buffer> <a-home> :call OrgNavigateLevels("home")<CR>
|
||||
nnoremap <silent> <buffer> <a-up> :call OrgNavigateLevels("up")<CR>
|
||||
nnoremap <silent> <buffer> <a-down> :call OrgNavigateLevels("down")<CR>
|
||||
nnoremap <silent> <buffer> <a-left> :call OrgNavigateLevels("left")<CR>
|
||||
nnoremap <silent> <buffer> <a-right> :call OrgNavigateLevels("right")<CR>
|
||||
nnoremap <silent> <buffer> <localleader>le :call EditLink()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>lf :call FollowLink(OrgGetLink())<cr>
|
||||
nnoremap <silent> <buffer> <localleader>ln :/]]<cr>
|
||||
nnoremap <silent> <buffer> <localleader>lp :?]]<cr>
|
||||
nnoremap <silent> <buffer> <localleader>lc :set conceallevel=3\|set concealcursor=nc<cr>
|
||||
nnoremap <silent> <buffer> <localleader>la :set conceallevel=3\|set concealcursor=c<cr>
|
||||
nnoremap <silent> <buffer> <localleader>lx :set conceallevel=0<cr>
|
||||
"nnoremap <silent> <buffer> <localleader>,e :call OrgSingleHeadingText("expand")<CR>
|
||||
"nnoremap <silent> <buffer> <localleader>,E :call OrgBodyTextOperation(1,line("$"),"expand")<CR>
|
||||
"nnoremap <silent> <buffer> <localleader>,C :call OrgBodyTextOperation(1,line("$"),"collapse")<CR>
|
||||
"nnoremap <silent> <buffer> <localleader>,c :call OrgSingleHeadingText("collapse")<CR>
|
||||
nnoremap <silent> <buffer> zc :call OrgDoSingleFold(line("."))<CR>
|
||||
|
||||
" below are alternate mappings for terminals, which
|
||||
" don't support some of the above key combinations
|
||||
nnoremap <silent> <buffer> ,<tab> :call OrgGlobalCycle()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>zu :call OrgNavigateLevels("up")<CR>
|
||||
nnoremap <silent> <buffer> <localleader>zd :call OrgNavigateLevels("down")<CR>
|
||||
nnoremap <silent> <buffer> <localleader>zl :call OrgNavigateLevels("left")<CR>
|
||||
nnoremap <silent> <buffer> <localleader>zr :call OrgNavigateLevels("right")<CR>
|
||||
nnoremap <silent> <buffer> <localleader>zL :call OrgMoveLevel(line("."),'left')<CR>
|
||||
nnoremap <silent> <buffer> <localleader>zR :call OrgMoveLevel(line("."),'right')<CR>
|
||||
nnoremap <silent> <buffer> <localleader>k :<c-u>call OrgMoveLevel(line("."),'up',v:count1)<CR>
|
||||
nnoremap <silent> <buffer> <localleader>j :<c-u>call OrgMoveLevel(line("."),'down',v:count1)<CR>
|
||||
nnoremap <silent> <buffer> <localleader>np :call OrgNewHead('levelup')<CR>
|
||||
nnoremap <silent> <buffer> <localleader>ns :call OrgNewHead('leveldown')<CR>
|
262
vim_plugin_candinates_src/VimOrganizer_v0313/indent/org.vim
Normal file
262
vim_plugin_candinates_src/VimOrganizer_v0313/indent/org.vim
Normal file
@ -0,0 +1,262 @@
|
||||
" org.vim - VimOrganizer plugin for Vim
|
||||
" -------------------------------------------------------------
|
||||
" Version: 0.30
|
||||
" Maintainer: Herbert Sitz <hesitz@gmail.com>
|
||||
" Last Change: 2011 Nov 02
|
||||
"
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3342
|
||||
" Github page: http://github.com/hsitz/VimOrganizer
|
||||
" Copyright: (c) 2010, 2011 by Herbert Sitz
|
||||
" The VIM LICENSE applies to all files in the
|
||||
" VimOrganizer plugin.
|
||||
" (See the Vim copyright except read "VimOrganizer"
|
||||
" in places where that copyright refers to "Vim".)
|
||||
" http://vimdoc.sourceforge.net/htmldoc/uganda.html#license
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk *** ***
|
||||
|
||||
" set indent of text lines beyond heading's left column
|
||||
" 0 -- have text lines flush with their heading's left col
|
||||
if !exists("g:org_indent_from_head")
|
||||
let g:org_indent_from_head = 0
|
||||
|
||||
endif
|
||||
|
||||
if exists("b:did_indent") | finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
|
||||
setlocal indentexpr=GetOrgIndent()
|
||||
setlocal nolisp
|
||||
setlocal nosmartindent
|
||||
setlocal autoindent
|
||||
"setlocal indentkeys+=},=\\item,=\\bibitem
|
||||
|
||||
|
||||
" Only define the function once
|
||||
"if exists("GetOrgIndent") | finish
|
||||
"endif
|
||||
|
||||
|
||||
|
||||
function! GetOrgIndent(...)
|
||||
" Find a non-blank line above the current line.
|
||||
"let lnum = prevnonblank(v:lnum - 1)
|
||||
let lnum = PrevNonBlank(v:lnum - 1)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0 | return 0
|
||||
endif
|
||||
|
||||
let curline = getline(v:lnum) " current line
|
||||
"let lminusone = getline(v:lnum-1)
|
||||
"if b:v.last_lnum > 0) && (curline !~ '^\s*$')
|
||||
" let lnum = b:v.last_lnum
|
||||
" let b:v.last_lnum = 0
|
||||
" endif
|
||||
let ind = indent(lnum)
|
||||
|
||||
if b:v.suppress_list_indent == 1
|
||||
let prevline = getline(lnum) " previous line
|
||||
else
|
||||
let prevline = getline(prevnonblank(v:lnum-1))
|
||||
endif
|
||||
|
||||
if (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
let b:v.suppress_list_indent = 0
|
||||
let b:v.org_list_offset=0
|
||||
endif
|
||||
|
||||
if (curline =~ '^\*\+ ')
|
||||
let ind = 0
|
||||
" below lines are failsafes, hopefully redundant
|
||||
let b:v.suppress_list_indent=0
|
||||
let b:v.suppress_indent=0
|
||||
elseif curline =~ '#+begin_'
|
||||
let b:v.suppress_indent=1
|
||||
let ind = 0
|
||||
elseif curline =~ '#+end_'
|
||||
let b:v.suppress_indent=0
|
||||
let ind = 0
|
||||
elseif curline =~ '^#+'
|
||||
let ind = 0
|
||||
"elseif (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
" \ && (len(synstack(v:lnum-1,1))>0)
|
||||
" \ && (synIDattr(synstack(v:lnum-1,1)[0],'name') == 'orgList')
|
||||
" let b:v.suppress_list_indent = 0
|
||||
elseif b:v.suppress_indent == 1
|
||||
return indent(curline)
|
||||
elseif b:v.suppress_list_indent == 1
|
||||
return len(matchstr(curline,'^\s*')) + b:v.org_list_offset
|
||||
elseif (curline =~ '^\s*\(\d\+[.):]\|[-+] \)')
|
||||
let before_ind = len(matchstr(curline,'^\s*'))
|
||||
"let ind= ind
|
||||
let b:v.org_list_offset = ind - before_ind
|
||||
let b:v.suppress_list_indent = 1
|
||||
elseif (curline =~'^\s*\d\+[).:]\s\+\S') || (curline =~'^\s*[-+\*]\s\+\S')
|
||||
" if len(curline)>0
|
||||
let ind = indent(curline)
|
||||
" endif
|
||||
elseif prevline =~ '^\*\+ '
|
||||
let ind = len(matchstr(prevline,'^\*\+ ')) + g:org_indent_from_head
|
||||
elseif prevline =~ '^\s*\d\+[).\]:]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs\d\+[).\]:]\s\+\ze\S'))
|
||||
elseif prevline =~ '^\s*[-+\*]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs[-+\*]\s\+\ze\S'))
|
||||
elseif (len(synstack(v:lnum,1))>0) && (synIDattr(synstack(v:lnum,1)[0],'name') == 'orgList')
|
||||
let ind = len(matchstr(getline(v:lnum-1),'^\s*'))
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
function! PrevNonBlank(line)
|
||||
let line = prevnonblank(a:line)
|
||||
|
||||
if (len(synstack(line,1))>0) && (synIDattr(synstack(line,1)[0],'name') == 'orgLisp')
|
||||
execute line + 1
|
||||
let line = search('^#+begin_src','nb')-1
|
||||
elseif (len(synstack(line-1,1))>0) && (synIDattr(synstack(line-1,1)[0],'name') == 'orgList')
|
||||
execute line - 1
|
||||
let line = search('^\s*$','nb')-1
|
||||
|
||||
endif
|
||||
return prevnonblank(line)
|
||||
endfunction
|
||||
|
||||
function! GetTestIndent2(lnum)
|
||||
" Find a non-blank line above the current line.
|
||||
"let lnum = prevnonblank(a:lnum - 1)
|
||||
let lnum = PrevNonBlank(a:lnum - 1)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0 | return 0
|
||||
endif
|
||||
|
||||
let curline = getline(a:lnum) " current line
|
||||
"let lminusone = getline(a:lnum-1)
|
||||
"if b:v.last_lnum > 0) && (curline !~ '^\s*$')
|
||||
" let lnum = b:v.last_lnum
|
||||
" let b:v.last_lnum = 0
|
||||
" endif
|
||||
let ind = indent(lnum)
|
||||
|
||||
if b:v.suppress_list_indent == 1
|
||||
let prevline = getline(lnum) " previous line
|
||||
else
|
||||
let prevline = getline(prevnonblank(a:lnum-1))
|
||||
endif
|
||||
|
||||
if (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
let b:v.suppress_list_indent = 0
|
||||
let b:v.org_list_offset=0
|
||||
endif
|
||||
|
||||
if (curline =~ '^\*\+ ')
|
||||
let ind = 0
|
||||
" below lines are failsafes, hopefully redundant
|
||||
let b:v.suppress_list_indent=0
|
||||
let b:v.suppress_indent=0
|
||||
elseif curline =~ '#+begin_'
|
||||
let b:v.suppress_indent=1
|
||||
let ind = 0
|
||||
elseif curline =~ '#+end_'
|
||||
let b:v.suppress_indent=0
|
||||
let ind = 0
|
||||
"elseif (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
" \ && (len(synstack(a:lnum-1,1))>0)
|
||||
" \ && (synIDattr(synstack(a:lnum-1,1)[0],'name') == 'orgList')
|
||||
" let b:v.suppress_list_indent = 0
|
||||
elseif b:v.suppress_indent == 1
|
||||
return indent(curline)
|
||||
elseif b:v.suppress_list_indent == 1
|
||||
return len(matchstr(curline,'^\s*')) + b:v.org_list_offset
|
||||
elseif (curline =~ '^\s*\(\d\+[.):]\|[-+] \)')
|
||||
let before_ind = len(matchstr(curline,'^\s*'))
|
||||
"let ind= ind
|
||||
let b:v.org_list_offset = ind - before_ind
|
||||
let b:v.suppress_list_indent = 1
|
||||
elseif (curline =~'^\s*\d\+[).:]\s\+\S') || (curline =~'^\s*[-+\*]\s\+\S')
|
||||
" if len(curline)>0
|
||||
let ind = indent(curline)
|
||||
" endif
|
||||
elseif prevline =~ '^\*\+ '
|
||||
let ind = len(matchstr(prevline,'^\*\+ ')) + g:org_indent_from_head
|
||||
elseif prevline =~ '^\s*\d\+[).\]:]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs\d\+[).\]:]\s\+\ze\S'))
|
||||
elseif prevline =~ '^\s*[-+\*]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs[-+\*]\s\+\ze\S'))
|
||||
elseif (len(synstack(a:lnum,1))>0) && (synIDattr(synstack(a:lnum,1)[0],'name') == 'orgList')
|
||||
let ind = len(matchstr(getline(a:lnum-1),'^\s*'))
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
function! GetTestIndent(lnum)
|
||||
" Find a non-blank line above the current line.
|
||||
"let lnum = prevnonblank(a:lnum - 1)
|
||||
let lnum = PrevNonBlank(a:lnum - 1)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0 | return 0
|
||||
endif
|
||||
|
||||
let curline = getline(a:lnum) " current line
|
||||
"let lminusone = getline(a:lnum-1)
|
||||
"if b:v.last_lnum > 0) && (curline !~ '^\s*$')
|
||||
" let lnum = b:v.last_lnum
|
||||
" let b:v.last_lnum = 0
|
||||
" endif
|
||||
let ind = indent(lnum)
|
||||
if b:v.suppress_list_indent == 1
|
||||
let prevline = getline(lnum) " previous line
|
||||
else
|
||||
let prevline = getline(prevnonblank(v:lnum-1))
|
||||
endif
|
||||
|
||||
if (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
let b:v.suppress_list_indent = 0
|
||||
let b:v.org_list_offset=0
|
||||
endif
|
||||
|
||||
if (curline =~ '^\*\+ ')
|
||||
let ind = 0
|
||||
" below lines are failsafes, hopefully redundant
|
||||
let b:v.suppress_list_indent=0
|
||||
let b:v.suppress_indent=0
|
||||
elseif curline =~ '#+begin_'
|
||||
let b:v.suppress_indent=1
|
||||
let ind = 0
|
||||
elseif curline =~ '#+end_'
|
||||
let b:v.suppress_indent=0
|
||||
let ind = 0
|
||||
"elseif (curline =~ '^\s*$') && (b:v.suppress_list_indent == 1)
|
||||
" \ && (len(synstack(a:lnum-1,1))>0)
|
||||
" \ && (synIDattr(synstack(a:lnum-1,1)[0],'name') == 'orgList')
|
||||
" let b:v.suppress_list_indent = 0
|
||||
elseif b:v.suppress_indent == 1
|
||||
return indent(curline)
|
||||
elseif b:v.suppress_list_indent == 1
|
||||
return len(matchstr(curline,'^\s*')) + b:v.org_list_offset
|
||||
elseif (curline =~ '^\s*\(\d\+[.):]\|[-+] \)')
|
||||
let before_ind = len(matchstr(curline,'^\s*'))
|
||||
"let ind= ind
|
||||
let b:v.org_list_offset = ind - before_ind
|
||||
let b:v.suppress_list_indent = 1
|
||||
elseif (curline =~'^\s*\d\+[).:]\s\+\S') || (curline =~'^\s*[-+\*]\s\+\S')
|
||||
" if len(curline)>0
|
||||
let ind = indent(curline)
|
||||
" endif
|
||||
elseif prevline =~ '^\*\+ '
|
||||
let ind = len(matchstr(prevline,'^\*\+ ')) + g:org_indent_from_head
|
||||
elseif prevline =~ '^\s*\d\+[).\]:]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs\d\+[).\]:]\s\+\ze\S'))
|
||||
elseif prevline =~ '^\s*[-+\*]\s\+\S'
|
||||
let ind = ind + len(matchstr(prevline,'^\s*\zs[-+\*]\s\+\ze\S'))
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
130
vim_plugin_candinates_src/VimOrganizer_v0313/intro.txt
Normal file
130
vim_plugin_candinates_src/VimOrganizer_v0313/intro.txt
Normal file
@ -0,0 +1,130 @@
|
||||
VimOrganizer version 0.30, November 2, 2011. Requires Vim version that
|
||||
is compiled with support for folding and tabs. Conceal will
|
||||
be taken advantage of if working with Vim73 supporting conceal.
|
||||
(Also, I STRONGLY suggest that you apply a patch to Vim so that
|
||||
folded headings can have level-dependent highlighting,
|
||||
patch for Vim73 is in contrib directory of the download. If you're on
|
||||
Windows contact me and I should be able to provide you with an
|
||||
executable. If I hadn't been able to make Vim do this I would have
|
||||
bitten the bullet and moved to Emacs, as much as I hate editing in Emacs.)
|
||||
|
||||
VimOrganizer is a Vim filetype plugin that attempts to clone Emacs' Org-mode.
|
||||
It is currently (November 2011) in an alpha-stage, both in terms of (1) the
|
||||
breadth and depth of Org-mode features it clones and (2) the stability of its
|
||||
operation. It is nevertheless very usable.
|
||||
|
||||
Some of the ADDITIONS AND IMPROVEMENTS since previous (December 2010) version:
|
||||
-- Adjusts to any colorscheme
|
||||
-- Org menu in gvim.
|
||||
-- "Dashboards" to assist with Date entry, Columns, Tables,
|
||||
Agenda searches, and exporting.
|
||||
-- VimOrganizer help file to install in Vim.
|
||||
-- Better compatibility with Org-mode files. Open, edit, and save same
|
||||
files in Org-mode and/or VimOrganizer with (some) of the functionality and
|
||||
configuration-specific options of Org-mode supported in VimOrganizer.
|
||||
-- Support for Org-mode style links (as well as use of 'Conceal' in Vim73
|
||||
to hide link brackets and
|
||||
descriptions)
|
||||
-- Easy to use Org-like column mode, including column headings,
|
||||
inherited columns, support for Org column blocks, and ability to
|
||||
specify a list of custom column specs to apply in any buffer.
|
||||
-- Org-like narrowing of code blocks and subtrees
|
||||
-- Support for Org-like specifications of TODOS, tags, dates,
|
||||
including support for Org-compatible config lines in a file.
|
||||
-- Support for Org-like CATEGORIES, both in specification and in
|
||||
their inherited behavior.
|
||||
-- Search specification in Agenda searches is now nearly identical
|
||||
to specification of searches in Org-mode.
|
||||
-- User can specify list of commonly used custom agenda searches.
|
||||
-- Clockin, clockout, and (when a running Emacs server is available,
|
||||
clocktable block creation and updates.
|
||||
-- Org-like "refiling"
|
||||
-- Easy creation and editing of tables, as well as (when a running Emacs
|
||||
server is available) manipulation and evaluation of tables, including
|
||||
all spreadsheet functionality in Org-mode.
|
||||
-- "Live" block evaluation (when a running Emacs server is available)
|
||||
-- Support for nearly all the export types and export options
|
||||
available in Org-mode (when running Emacs server is available)
|
||||
-- Call out to an Emacs server to do "tangling" (literate programming).
|
||||
-- Many bug fixes and small improvements
|
||||
|
||||
Org-mode, and thus VimOrganizer, is a text-editor plugin/application that can
|
||||
be used for (1) keeping notes, (2) maintaining TODO lists, (3) planning
|
||||
projects, and/or (4) authoring and publishing documents, including support for
|
||||
literate programming and "reproducible research". Like Org-mode, VimOrganizer
|
||||
does this by implementing a flexible plain-text system with a lightly
|
||||
structured document format. Org-mode has been in constant development for
|
||||
seven or eight years, and continues to be developed. Work on VimOrganizer is
|
||||
likewise ongoing, but VimOrganizer is at present a smaller and less ambitious
|
||||
project than Org-mode.
|
||||
|
||||
File formats and basic workflows for VimOrganizer and Org-mode are very
|
||||
similar (files auto-convert as part of loading process) and VimOrganizer
|
||||
actually calls out to an Emacs' Org-mode server to
|
||||
implement important features, e.g., exporting to pdf format for printing.
|
||||
|
||||
Thus, to make full use of VimOrganizer you will want to have an Emacs'
|
||||
server running alongside. In most cases this requires little knowledge of
|
||||
Emacs other than how to start it up and add a few lines to the '.emacs' file,
|
||||
Emacs' counterpart to Vim's '.vimrc'. (You can even edit the .emacs file in
|
||||
Vim.) VimOrganizer is focused on leveraging Org-mode by accessing it via
|
||||
an Emacs server, and re-implementing in Vim only what is necessary and makes
|
||||
sense.
|
||||
|
||||
VimOrganizer also lets Vim users access Org-babel, a subproject of
|
||||
Org-mode that allows execution of source-code blocks in org-format
|
||||
documents. Uses for Org-babel range from writing technical research papers to
|
||||
simply using a VimOrganizer document as a "language-scratchpad". Over
|
||||
twenty languages are supported, including C, R, Lisp, Python, Perl, Ruby,
|
||||
and others. VimOrganizer calls out to a running Emacs server for Org-babel
|
||||
processing; functionality and speed are essentially the same as
|
||||
when editing with Org-mode in Emacs.
|
||||
|
||||
VimOrganizer has a first draft of a Vim help file, but the best first step in
|
||||
learning about VimOrganizer is to learn about Emacs' Org-mode. VimOrganizer
|
||||
uses the same basic concepts but implements them within the context of Vim
|
||||
(and with a reduced feature set). Org-mode's main documentation and
|
||||
support newsgroup are found here:
|
||||
Org-mode Main Manual: http://orgmode.org/manual/index.html
|
||||
Org-mode Compact Guide: http://orgmode.org/guide/index.html
|
||||
Org-mode support: http://news.gmane.org/gmane.emacs.orgmode
|
||||
Org-babel information: http://orgmode.org/worg/org-contrib/babel/
|
||||
|
||||
VimOrganizer help can be found here:
|
||||
https://github.com/hsitz/VimOrganizer/blob/master/doc/vimorg.txt
|
||||
|
||||
==========================
|
||||
INSTALLATION INSTRUCTIONS
|
||||
===========================
|
||||
https://github.com/hsitz/VimOrganizer/blob/master/INSTALL.txt
|
||||
|
||||
|
||||
QUESTIONS, COMMENTS, SUGGESTIONS
|
||||
================================
|
||||
Questions, comments, and suggestions regarding VimOrganizer are always
|
||||
appreciated. The preferred place for those is in the VimOrganizer newsgroup
|
||||
here:
|
||||
http://groups.google.com/group/vimorganizer/topics
|
||||
|
||||
VimOrganizer project files are maintained at github and the version
|
||||
there may be more recent than the files at vim.org:
|
||||
https://github.com/hsitz/VimOrganizer
|
||||
|
||||
----------------------------------------------------------------
|
||||
NOTE: some code from other Vim plugins has been incorporated into the
|
||||
VimOrganizer script files. Do NOT download these plugins to use them
|
||||
with VimOrganizer; since VimOrganizer does not call out to them in any way:
|
||||
|
||||
1. Charles Campbell's great calendar utilities
|
||||
2. Table editing routines from Maxim Kim's excellent vimwiki plugin.
|
||||
These are really quite nice (seem to be inspired by Org-mode's
|
||||
own table-editing stuff) and deserve to be offered as a separate
|
||||
plugin of their own, not dependent on any larger project. (If
|
||||
VimOrganizer is not quite the sort of plugin you're looking for then
|
||||
vimwiki may be.)
|
||||
----------------------------------------------------------------
|
||||
|
||||
VimOrganizer page at vim.org:
|
||||
http://www.vim.org/scripts/script.php?script_id=3342
|
||||
|
||||
|
102
vim_plugin_candinates_src/VimOrganizer_v0313/syntax/org.vim
Normal file
102
vim_plugin_candinates_src/VimOrganizer_v0313/syntax/org.vim
Normal file
@ -0,0 +1,102 @@
|
||||
" org.vim - VimOrganizer plugin for Vim
|
||||
" -------------------------------------------------------------
|
||||
" Version: 0.30
|
||||
" Maintainer: Herbert Sitz <hesitz@gmail.com>
|
||||
" Last Change: 2011 Nov 02
|
||||
"
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3342
|
||||
" Github page: http://github.com/hsitz/VimOrganizer
|
||||
" Copyright: (c) 2010, 2011 by Herbert Sitz
|
||||
" The VIM LICENSE applies to all files in the
|
||||
" VimOrganizer plugin.
|
||||
" (See the Vim copyright except read "VimOrganizer"
|
||||
" in places where that copyright refers to "Vim".)
|
||||
" http://vimdoc.sourceforge.net/htmldoc/uganda.html#license
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk *** ***
|
||||
|
||||
" THIS FUNC is only for variable stars per level, currently
|
||||
" not exposed to users
|
||||
function! s:SynStars(perlevel)
|
||||
let b:levelstars = a:perlevel
|
||||
exe 'syntax match OL1 +^\(*\)\{1}\s.*+ contains=stars'
|
||||
exe 'syntax match OL2 +^\(*\)\{'.( 1 + 1*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL3 +^\(*\)\{'.(1 + 2*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL4 +^\(*\)\{'.(1 + 3*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL5 +^\(*\)\{'.(1 + 4*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL6 +^\(*\)\{'.(1 + 5*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL7 +^\(*\)\{'.(1 + 6*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL8 +^\(*\)\{'.(1 + 7*a:perlevel).'}\s.*+ contains=stars'
|
||||
exe 'syntax match OL9 +^\(*\)\{'.(1 + 8*a:perlevel).'}\s.*+ contains=stars'
|
||||
endfunction
|
||||
command! ChangeSyn call <SID>SynStars(b:levelstars)
|
||||
|
||||
|
||||
syntax match Org_Property_Value +^\s*:\S*:\ze.*+
|
||||
|
||||
syntax match Org_Tag +\s*:\S*:$+
|
||||
syntax match Org_Drawer +^\s*:\(PROPERTIES\|LOGBOOK\|END\):\ze.*+
|
||||
syntax match Org_Date +[<[]\d\d\d\d-\d\d-\d\d.\{-1,}[\]>]+
|
||||
syntax match Org_Star +\*\+\*+me=e-1 contained
|
||||
syntax match Org_Table +^\s*|.\+|\s*$+
|
||||
"syntax match NEXT '\* \zsNEXT' containedin=OL1,OL2,OL3,OL4,OL5,OL6
|
||||
"syntax match CANCELED '\* \zsCANCELED' containedin=OL1,OL2,OL3,OL4,OL5,OL6
|
||||
"syntax match TODO '\* \zsTODO' containedin=OL1,OL2,OL3,OL4,OL5,OL6
|
||||
"syntax match STARTED '\* \zsSTARTED' containedin=OL1,OL2,OL3,OL4,OL5,OL6
|
||||
"syntax match DONE '\* \zsDONE' containedin=OL1,OL2,OL3,OL4,OL5,OL6
|
||||
|
||||
syntax match Org_Config_Line '^#+.*' containedin=Org_Block,Org_Src_Block
|
||||
syntax region Org_Block start='\c^#+begin.*$' end='\c^#+end.*' keepend contains=Org_Config_Line
|
||||
syntax region Org_Src_Block start='\c^#+begin_src.*$' end='\c^#+end.*' keepend contains=Org_Config_Line
|
||||
|
||||
syntax match OL1 +^\(*\)\{1}\s.*+ contains=stars
|
||||
syntax match OL2 +^\(*\)\{2}\s.*+ contains=stars
|
||||
syntax match OL3 +^\(*\)\{3}\s.*+ contains=stars
|
||||
syntax match OL4 +^\(*\)\{4}\s.*+ contains=stars
|
||||
syntax match OL5 +^\(*\)\{5}\s.*+ contains=stars
|
||||
syntax match OL6 +^\(*\)\{6}\s.*+ contains=stars
|
||||
syntax match OL7 +^\(*\)\{7}\s.*+ contains=stars
|
||||
syntax match OL8 +^\(*\)\{8}\s.*+ contains=stars
|
||||
syntax match OL9 +^\(*\)\{9}\s.*+ contains=stars
|
||||
|
||||
" character highlights
|
||||
syn match Org_Code '=\S.\{-}\S='
|
||||
syn match Org_Itals '\(\_^\|\W\)/\zs\S[^/]\{-}\S\ze/\_W'
|
||||
syn match Org_Bold '\(\_^\|\W\)\*\zs\S[^*]\{-}\S\ze\*\_W'
|
||||
syn match Org_Underline '\(\_^\|\W\)_\zs\S[^_]\{-}\S\ze_\_W'
|
||||
syn match Org_Lnumber '^\t*\(\d\.\)*\s\s' contained
|
||||
|
||||
if has("conceal")
|
||||
syn region Org_Half_Link concealends matchgroup=linkends start='\[\[' end=']]' contains=FullLink
|
||||
syn region Org_Full_Link concealends matchgroup=linkends start='\[\[\(.\{-1,}\)]\[' end=']]'
|
||||
endif
|
||||
"exec "syntax match DONETODO '" . b:v.todoDoneMatch . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6"
|
||||
"exec "syntax match NOTDONETODO '" . b:v.todoNotDoneMatch . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6"
|
||||
|
||||
" ***********************************************
|
||||
" section below is example for having subregions
|
||||
" of code in an .org file that use syntax highlighting
|
||||
" for the language in the code block itself
|
||||
" not regular Org syntax highlighting.
|
||||
" See Emacs' Org documentation for some details:
|
||||
" http://orgmode.org/manual/Working-With-Source-Code.html#Working-With-Source-Code
|
||||
" Notice that much of the functionality of
|
||||
" source code blocks is for when they are exported or 'tangled'.
|
||||
" VimOrganizer calls out to an Emacs server for exports (and,
|
||||
" -- soon to come -- for tangling) so the functionality described
|
||||
" in the Emacs Org-mode docs already exists for VimOrganizer.
|
||||
"
|
||||
" The example below is for Lisp, other languages could be added
|
||||
" using same priciple. In addition to using context-sensitive
|
||||
" syntax highlighting for code blocks, VimOrganizer will
|
||||
" eventually use context-sensitive language indent-rules. . .
|
||||
" ************************************************"
|
||||
let b:current_syntax=''
|
||||
unlet b:current_syntax
|
||||
syntax include @Lispcode $VIMRUNTIME/syntax/lisp.vim
|
||||
syntax region orgLisp start='^#+begin_src/semacs-lisp' end='^#+end_src$' contains=@Lispcode
|
||||
let b:current_syntax = 'combined'
|
||||
hi orgLisp gui=bold
|
||||
|
||||
|
||||
" vim600: set foldmethod=marker foldlevel=0:
|
Reference in New Issue
Block a user