How do you make vimwiki automatically conceal [[ and ]] for links not under the cursor?

892 views
Skip to first unread message

Juan Alonso

unread,
Aug 23, 2012, 12:16:48 AM8/23/12
to vim...@googlegroups.com
Hi,

I use vimwiki 2.0 with vim 7.3 in 2 different computers: Ubuntu and OS X 10.8. For some reason when I have my cursor on "line 2" my vimwiki links appear as:

--- start wiki page ---
[[link]]
line 2
--- end wiki page ---

In OS X wiki but they appear as:

--- start wiki page ---
link
line 2
--- end wiki page ---

In Ubuntu. I prefer the Ubuntu version but I can't find which option turns it on or what's the difference between both .vimrc (they are identical). I have tried minimal .vimrc files in both systems but I still can't get vimwiki to hide the [[ ]].

Does anyone know how to turn that feature on manually?

Thanks

Eric Weir

unread,
Aug 23, 2012, 7:20:53 PM8/23/12
to vim...@googlegroups.com
I have the same versions of vimwiki and vim and OS X 10.6.8. When I have my cursor on or within double enclosing brackets the brackets are highlighted. I assumed this is the default and that there is no option. 

The result you report with OS X strikes me as strange. Unless it's explicitly identified as a link, e.g., by being included in a list of links, how can you tell a link is a link if the brackets don't display?

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA 

"What does it mean...that the world is so beautiful?" 

- Mary Oliver 






steen

unread,
Aug 23, 2012, 8:12:56 PM8/23/12
to vim...@googlegroups.com
I'm pretty sure I know where this is coming from, as I have a simliar
issue. There are various compile-time options with vim, at least one
of which seems to affect this. These are generally things like support
for Ruby and Python, support for mouse activity, that sort of thing. I
haven't been able to narrow down which options are causing this (there
are a lot of them), but on my OSX machine, I get hiding brackets on
the version of vim that comes from macvim (either in the gui or in the
console), but not in the default OSX console version. I strongly
suspect that there are compile-time option differences between OSX and
Ubuntu, though I have no Ubuntu machine on which to test this theory.

To see a list of compile-time options for vim, do "vim --version".
Below, I include the output of my two different versions, in case
anyone more knowledgeable than I about this can use this data to help
narrow down the problem.

-- Steen

~ [ which vim
] 5:09 PM
/usr/bin/vim
~ [ vim --version
] 5:09 PM
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 31 2011 19:27:29)
Compiled by ro...@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile -python
-python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H
-arch i386 -arch x86_64 -g
-Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

~ [ /Applications/MacVim.app/Contents/MacOS/Vim --version
] 5:10 PM
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 2 2012 17:38:47)
MacOS X (unix) version
Included patches: 1-390
Compiled by Bjorn Winckler <bjorn.w...@gmail.com>
Huge version with MacVim GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +fork() +fullscreen
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm
+mouse_netterm -mouse_sysmouse +mouse_xterm +mouse_urxvt +multi_byte
+multi_lang -mzscheme +netbeans_intg +odbeditor +path_extra +perl
+persistent_undo +postscript +printer +profile +python -python3 +quickfix
+reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff
+startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white
-tcl +terminfo +termresponse +textobjects +title +toolbar
+transparency +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows
+writebackup -X11 -xfontset +xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM
-Wall -Wno-unknown-pragmas -
pipe -DMACOS_X_UNIX -no-cpp-precomp -g -O2 -arch i386
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1

Linking: gcc -L. -L. -arch i386 -L/usr/local/lib -o Vim
-framework Cocoa -framewo
rk Carbon -lncurses -liconv -framework Cocoa
-fstack-protector -L/usr/local/lib -L/S
ystem/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm
-lutil -lc -framework Pytho
n -framework Ruby
~ [

Juan Alonso

unread,
Aug 26, 2012, 9:07:50 PM8/26/12
to vim...@googlegroups.com
Hi Eric,

On Thu, Aug 23, 2012 at 4:20 PM, Eric Weir <eew...@bellsouth.net> wrote:
> I have the same versions of vimwiki and vim and OS X 10.6.8. When I have my
> cursor on or within double enclosing brackets the brackets are highlighted.
> I assumed this is the default and that there is no option.

I guess you are referring to matchparens option. What I meant is different.

> The result you report with OS X strikes me as strange. Unless it's
> explicitly identified as a link, e.g., by being included in a list of links,
> how can you tell a link is a link if the brackets don't display?

Links are colored in a different way and, for me, editing pages just
looks cleaner with that option.

--
Juan

Juan Alonso

unread,
Aug 26, 2012, 9:10:42 PM8/26/12
to vim...@googlegroups.com
Thanks Steen, that was it. With macvim it does work as you described to me.

I looked at a diff between both options (osx's default and macvim's
default) and it looks like you need +conceal to get the concealing
effect on. In retrospective it sounds obvious, hehe. I guess something
like this would benefit from appearing on the installation
instructions to benefit people who know of the feature and for people
who might not be aware of the people.
--
Juan
Reply all
Reply to author
Forward
0 new messages