Permalink
Browse files

fix #293

Command to keymap for user custmize.
But, paging command would be buffer local command.
Set defautl map(">","<") on setup list buffers(__EVERVIM_LIST__).

���[�U�[�J�X�^�}�C�Y��o����悤�ɃR�}���h����s����B
�������A�ړ��R�}���h�͊�{�I�Ƀo�b�t�@���[�J���̂ق����g���₷�����Ȃ�
�ŁA�o�b�t�@��Z�b�g�A�b�v����ꏊ�Ń}�b�s���O����悤�ɂ����B
  • Loading branch information...
1 parent 183a6e7 commit dd7f5eecb64ed90d7d729969dc9e487ca4a894db @kakkyz81 committed Apr 28, 2012
Showing with 31 additions and 44 deletions.
  1. +26 −41 autoload/evervim.vim
  2. +2 −0 plugin/evervim.vim
  3. +3 −3 plugin/py/evervimmer.py
View
@@ -53,23 +53,6 @@ function! evervim#notesByNotebook() " {{{
set ft=notes
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
- map <silent> <buffer> > :call evervim#notesByNotebookMove('next')<CR>
- map <silent> <buffer> < :call evervim#notesByNotebookMove('prev')<CR>
-endfunction
-"}}}
-
-function! evervim#notesByNotebookMove(way) " {{{
- if &ft != 'notes'
- return
- endif
-
- setlocal modifiable
- if a:way == 'next'
- python Evervimmer.getInstance().notesByNotebookNextpage()
- else
- python Evervimmer.getInstance().notesByNotebookPrevpage()
- endif
- setlocal nomodifiable
endfunction
"}}}
@@ -82,23 +65,6 @@ function! evervim#notesByTag() " {{{
set ft=notesbytag
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
- map <silent> <buffer> > :call evervim#notesByTagMove('next')<CR>
- map <silent> <buffer> < :call evervim#notesByTagMove('prev')<CR>
-endfunction
-"}}}
-
-function! evervim#notesByTagMove(way) " {{{
- if &ft != 'notesbytag'
- return
- endif
-
- setlocal modifiable
- if a:way == 'next'
- python Evervimmer.getInstance().notesByTagNextpage()
- else
- python Evervimmer.getInstance().notesByTagPrevpage()
- endif
- setlocal nomodifiable
endfunction
"}}}
@@ -152,20 +118,37 @@ function! evervim#evervimSearchByQuery(word) " {{{
set ft=notesbyquery
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
- map <silent> <buffer> > :call evervim#searchByQueryMove('next')<CR>
- map <silent> <buffer> < :call evervim#searchByQueryMove('prev')<CR>
endfunction
"}}}
-"
-function! evervim#searchByQueryMove(way) " {{{
- if &ft != 'notesbyquery'
+
+function! evervim#pageNext() " {{{
+ if &ft != 'notes' && &ft != 'notesbytag' && &ft != 'notesbyquery'
return
endif
setlocal modifiable
- if a:way == 'next'
+ if &ft == 'notes'
+ python Evervimmer.getInstance().notesByNotebookNextpage()
+ elseif &ft == 'notesbytag'
+ python Evervimmer.getInstance().notesByTagNextpage()
+ elseif &ft == 'notesbyquery'
python Evervimmer.getInstance().searchByQueryNextpage()
- else
+ endif
+ setlocal nomodifiable
+endfunction
+"}}}
+"
+function! evervim#pagePrev() " {{{
+ if &ft != 'notes' && &ft != 'notesbytag' && &ft != 'notesbyquery'
+ return
+ endif
+
+ setlocal modifiable
+ if &ft == 'notes'
+ python Evervimmer.getInstance().notesByNotebookPrevpage()
+ elseif &ft == 'notesbytag'
+ python Evervimmer.getInstance().notesByTagPrevpage()
+ elseif &ft == 'notesbyquery'
python Evervimmer.getInstance().searchByQueryPrevpage()
endif
setlocal nomodifiable
@@ -248,6 +231,8 @@ function! evervim#listBufSetup() " {{{
setlocal buftype=nofile
setlocal nowrap
setlocal nonumber
+ nmap <silent> <buffer> > :<C-u>EvervimPageNext<CR>
+ nmap <silent> <buffer> < :<C-u>EvervimPagePrev<CR>
endif
endfunction
"}}}
View
@@ -62,6 +62,8 @@ function! s:setCommand() " {{{
command! EvervimCreateNote call evervim#createNoteBuf()
command! EvervimListTags call s:listTags()
command! EvervimReloadPref call s:setPref()
+ command! EvervimPageNext call evervim#pageNext()
+ command! EvervimPagePrev call evervim#pagePrev()
endfunction
"}}}
View
@@ -77,7 +77,7 @@ def notesByNotebook(self, notebook=None): # {{{
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
self.__setBufferList(notetitles,
- " [notebook:%s(%s)] page:%s/%s" % (self.__changeEncodeToBuffer(self.currentNotebook.name) ,
+ " [notebook:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.currentNotebook.name) ,
Evervimmer.maxcount,
Evervimmer.currentpage + 1,
Evervimmer.maxpages + 1
@@ -110,7 +110,7 @@ def notesByTag(self, tag=None): # {{{
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
self.__setBufferList(notetitles,
- " [tag:%s(%s)] page:%s/%s" % (self.__changeEncodeToBuffer(self.currentTag.name) ,
+ " [tag:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.currentTag.name) ,
Evervimmer.maxcount,
Evervimmer.currentpage + 1,
Evervimmer.maxpages + 1
@@ -203,7 +203,7 @@ def searchByQuery(self, query=None): # {{{
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
self.__setBufferList(notetitles,
- " [query:%s(%s)] page:%s/%s" % (self.__changeEncodeToBuffer(self.query) ,
+ " [query:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.query) ,
Evervimmer.maxcount,
Evervimmer.currentpage + 1,
Evervimmer.maxpages + 1

0 comments on commit dd7f5ee

Please sign in to comment.