All Projects → bimlas → vim-eightheader

bimlas / vim-eightheader

Licence: other
Vim plugin: Easily create custom headlines, foldtext, toc, etc

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-eightheader

vim-syntaxMarkerFold
Markers while using syntax fold method
Stars: ✭ 16 (-5.88%)
Mutual labels:  vim-plugin, folding
vim-ormolu
Plugin for formatting Haskell source code
Stars: ✭ 35 (+105.88%)
Mutual labels:  vim-plugin
nvim-toggle-terminal
NeoVim plugin that toggles a terminal buffer in the current window maintaining the same shell instance
Stars: ✭ 54 (+217.65%)
Mutual labels:  vim-plugin
vim-inccomplete
Vim plugin for #include directive completion.
Stars: ✭ 14 (-17.65%)
Mutual labels:  vim-plugin
gentoo-syntax
[MIRROR] Gentoo Ebuild, Eclass, GLEP, ChangeLog and Portage Files syntax highlighting, filetype and indent settings for Vim
Stars: ✭ 22 (+29.41%)
Mutual labels:  vim-plugin
vim-bettergrep
A better way to grep in vim.
Stars: ✭ 15 (-11.76%)
Mutual labels:  vim-plugin
markedpp
Preprocessor for markdown files
Stars: ✭ 21 (+23.53%)
Mutual labels:  table-of-contents
bufstop
Fast and efficient buffer switching for Vim
Stars: ✭ 82 (+382.35%)
Mutual labels:  vim-plugin
mpi
minimal (n)vim plugins - icons (Under 200 LOC)
Stars: ✭ 32 (+88.24%)
Mutual labels:  vim-plugin
YankAssassin.vim
Don't let the cursor move while Yanking in Vim/Neovim
Stars: ✭ 50 (+194.12%)
Mutual labels:  vim-plugin
vim-jqplay
Run jq interactively in Vim
Stars: ✭ 56 (+229.41%)
Mutual labels:  vim-plugin
gh.vim
Vim/Neovim plugin for GitHub
Stars: ✭ 149 (+776.47%)
Mutual labels:  vim-plugin
stan-vim
A Vim plugin for the Stan probabilistic programming language.
Stars: ✭ 41 (+141.18%)
Mutual labels:  vim-plugin
move-less
vim plugin for faster navigation without moving the cursor position (look up/down/middle; scroll up/down/both, fold two distance places permanent together)
Stars: ✭ 36 (+111.76%)
Mutual labels:  vim-plugin
vim-tmuxlike
A vim plugin that mimics the actions of tmux. 像操作Tmux一样操作Vim
Stars: ✭ 20 (+17.65%)
Mutual labels:  vim-plugin
vimwasm-try-plugin
Try Vim plugin on your browser without installing it using vim.wasm!
Stars: ✭ 21 (+23.53%)
Mutual labels:  vim-plugin
vim-nicomment
[Unmaintained] Flow comments on your Vim
Stars: ✭ 16 (-5.88%)
Mutual labels:  vim-plugin
VimConfig
Configuration files for Vi-IMproved.
Stars: ✭ 23 (+35.29%)
Mutual labels:  vim-plugin
tabnine-vim
Vim client for TabNine. https://vimawesome.com/plugin/tabnine-vim
Stars: ✭ 652 (+3735.29%)
Mutual labels:  vim-plugin
vim-js-file-import
Import/require files in javascript and typescript with single button!
Stars: ✭ 130 (+664.71%)
Mutual labels:  vim-plugin

EightHeader

Easily create custom headlines, foldtext, toc, etc.

To use EightHeader just move the cursor to the line which you want to modify (hereinafter line), then call it:

EightHeader( {length}, {align}, {oneline}, {decor}, {marker}, {str} )

{length}   Length of the header.
{align}    Alignment of text.
{oneline}  If false, then underline the {line} with {decor}.
{decor}    Decorator text to fill with.
{marker}   Extra content after decotRightEnd.
{str}      Replace the content of {line} with this.

An example with {oneline} set to true (1) (s:str means the original line, see EightHeaderVars for details):

call EightHeader( 78, 'center', 1, ['l ', 'decor', ' r'], ' m', '\=" ".s:str." "' )

l decordecordecordecordeco TEXT IN THE LINE cordecordecordecordecord r m

... and false (0):

call EightHeader( 78, 'center', 0, ['l ', 'decor', ' r'], ' m', '' )

                            TEXT IN THE LINE                            m
l decordecordecordecordecordecordecordecordecordecordecordecordecordec r

If you don’t like the default 'foldtext' you can customize it by setting to EightHeaderFolds().

For example the closed folds looks like this by default:

+-- 45 lines: Fold level one
+--- 67 lines: Fold level two

If you would like to change it to this kind:

Fold level one................45 lines
  Fold level two..............67 lines

... then you can use this function:

let &foldtext = "EightHeaderFolds( '\\=s:fullwidth-2', 'left', [ repeat( '  ', v:foldlevel - 1 ), '.', '' ], '\\= s:foldlines . \" lines\"', '' )"

An alternative usage for example formating a vimhelp table of contents:

Options;options
Default mappings;maps
  Launch nuclear strike;apocalypse

... to this:

Options........................................................|options|
Default mappings..................................................|maps|
  Launch nuclear strike.....................................|apocalypse|

Visually select the lines, than:

call EightHeader( 78, "left", 1, ".", "\\='|'.matchstr(s:str, ';\\@<=.*').'|'", "\\=matchstr(s:str, '.*;\\@=')" )

Install

Manually:

Download and unzip the subdirectories into '~/.vim'.

Don’t forget to regenerate helptags:

:helptags ~/.vim/doc

... into '~/.vim/bundle' (or to your specific pathogen directory).

Don’t forget to regenerate helptags:

:Helptags

Add these lines to your '.vimrc' after call vundle#rc():

Plugin 'bimlas/vim-eightheader'

Open vim again, then call :PluginInstall

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].