soywiki 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -199,7 +199,8 @@ When you're on a wiki page and you want to see all the other wiki pages
199
199
  that link in to it, press `,M`. If there is only one page that links in,
200
200
  you'll be taken there automatically.
201
201
 
202
- * `,o` opens the first web hyperlink on or after the cursor
202
+ * `,o` opens the first web hyperlink on or after the cursor in the default external web browser
203
+ * `,O` opens the first web hyperlink on or after the cursor in Vim using `netrw`
203
204
 
204
205
  `,o` opens the next hyperlink on or after the cursor. These are the URLs
205
206
  that begin with http:// or https://. You can also use `ENTER` when the
@@ -212,9 +213,10 @@ adding this to your `~/.vimrc`:
212
213
 
213
214
  let g:SoyWiki#browser_command = "your browser command here"
214
215
 
215
- If your Vim has `netrw`, you can open a hyperlink directly in same Vim
216
- window by putting the cursor at the beginning of a hyperlink and typing
217
- `gf`, or `C-w f` if you want to open the webpage in a split window.
216
+ If your Vim has `netrw` installed, you can open a hyperlink directly in
217
+ same Vim window by putting the cursor on a web hyperlink and typing `,O`
218
+ (capital O). This will open the webpage in a vertical split window,
219
+ using `elinks` or whatever browser you set as your `g:netrw_http_cmd`.
218
220
  See `:help netrw` for more information.
219
221
 
220
222
  Tip: I personally like using `netrw` (configured to use elinks) a lot
data/lib/soywiki.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'string_ext'
2
2
 
3
3
  module Soywiki
4
- VERSION = '0.3.5'
4
+ VERSION = '0.3.6'
5
5
  WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b/
6
6
  HYPERLINK = %r|\bhttps?://[^ >)\n\]]+|
7
7
 
data/lib/soywiki.vim CHANGED
@@ -561,7 +561,8 @@ func! s:global_mappings()
561
561
  noremap <leader>M :call <SID>list_pages_linking_in()<CR>
562
562
  noremap <silent> <leader>o :call <SID>find_next_href_and_open()<cr>
563
563
  nnoremap <silent> q :close<cr>
564
-
564
+ " for netrw vertical split
565
+ nnoremap ,O :exec "silent rightbelow vsplit ". expand("<cWORD>")<cr>
565
566
 
566
567
  command! -bar -nargs=1 -range -complete=file SWAppend :<line1>,<line2>call s:extract(<f-args>, 'append', 0)
567
568
  command! -bar -nargs=1 -range -complete=file SWInsert :<line1>,<line2>call s:extract(<f-args>, 'insert', 0)
@@ -578,7 +579,7 @@ endfunc
578
579
  " this checks if the buffer is a SoyWiki file (from firstline)
579
580
  " and then turns on syntax coloring and mappings as necessary
580
581
  func! s:prep_buffer()
581
- if (s:is_wiki_page())
582
+ if (s:is_wiki_page() && !exists("b:mappings_loaded"))
582
583
  set textwidth=72
583
584
  nnoremap <buffer> <cr> :call <SID>follow_link_under_cursor(0)<cr>
584
585
  nnoremap <buffer> <c-l> :call <SID>follow_link_under_cursor(2)<cr>
@@ -614,6 +615,7 @@ func! s:prep_buffer()
614
615
  au!
615
616
  autocmd BufWritePost <buffer> call s:save_revision()
616
617
  augroup END
618
+ let b:mappings_loaded = 1
617
619
  endif
618
620
  endfunc
619
621
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 5
9
- version: 0.3.5
8
+ - 6
9
+ version: 0.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi