Hide (or fold) columns of text in (g)Vim (horizontally)
Question
is there a way to hide columns of a buffer (text file, you know what I mean) while editing it in Vim? e.g. text visible in the buffer before hiding column 2&3:
abbcccccc
accdddddd
And after hiding them:
acccccc
adddddd
(Not to mention I'm working with really huge files (sometimes over 200 gb).)
And yeah, I had found foldcol.vim, but it requires a patch, and I don't have gcc to compile it as a user on a server.
Thanks in advance.
Solution
Cannot be done in stock vim; there is a conceal patch that has not been accepted. The most recent version is only for vim7, and not 7.2 (much less 7.2+patches), so it's probably best considered dead.
OTHER TIPS
Is foldcol.vim maybe what you need? No clue if it works on your huge files though. 200 gb! Impressive in a geeky kind of way. =)
The best version I have seen so far is following:
https://github.com/paulhybryant/foldcol
this github project is based on http://vim.sourceforge.net/scripts/script.php?script_id=1161
however it has some improvements - it actually shows hidden column as '*'
it needs vim-maktaba plugin, so in order to install this in your vim, then do following:
add to your ~/.vimrc file :
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Install vim-maktaba plugin for plugin developers - used in foldcol
Plugin 'google/vim-maktaba'
" Install foldcol - folding columns using <ctrl-v> visual mark, then :VFoldCol
Plugin 'paulhybryant/foldcol'
" All of your Plugins must be added before the following line
call vundle#end() " required
Notice the two plugins added in the vundle.begin -> vundle.end section ; the vim-maktaba and the foldcol
After adding this to your ~/.vimrc file then start vim as administrator or if you are running on ubuntu then write sudo vim
then write :PluginInstall and if needed then write your user and password for your GitHub account - this will give you access to downloading and installing vim plugins from github
example usage in terminal vim started; use <ctrl-v>
and mark column :
it may seem cumbersome, however it is actually just adding two lines to your ~/.vimrc file and running :PluginInstall
enjoy