sareyko / neat.vim

A simple VIM plugin to help you pretty print your data.
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Making mapping to be optional #1

Open naquad opened 10 years ago

naquad commented 10 years ago

Hi. I've already got <Leader>n mapped and it would be really awesome if you add a setting for mapping (map/don't map/what to map).

Thanks.

P.S. Maybe it'll be a good default to add theese:


let neat#c#commands      = [':exec "%!astyle --mode=c --style=ansi -pcH" . (&et ? "s" . &sw : "t")']
let neat#cpp#commands    = [':exec "%!astyle --mode=c --style=ansi -pcH" . (&et ? "s" . &sw : "t")']
let neat#java#commands   = [':exec "%!astyle --mode=java --style=ansi -pcH" . (&et ? "s" . &sw : "t")']
let neat#python#commands = [':exec "%!autopep8 /dev/stdin " . (&tw ? "--max-line-length=" . &tw : "")']
let neat#xml#commands    = [':exec "%!tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces " . &sw . " --vertical-space yes --tidy-mark no -wrap " . &tw']
let neat#xhtml#commands  = [':exec "%!tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth']
let neat#html#commands  = [':exec "%!html-beautify -f - -s " . &sw']
let neat#css#commands  = [':exec "%!css-beautify -f - -s " . &sw']
let neat#javascript#commands  = [':exec "%!js-beautify -f - -" . (&et ? "s" . &sw : "t")']
sareyko commented 10 years ago

I like to keep things simple, so I'm probably going to remove the default mappings instead of creating an option to disable/enable them.

Thanks for the filetype commands! I'll add those.

obxhdx commented 9 years ago

Same things here, <Leader>n conflicts with another mapping I'm already used to.