Open gcxfd opened 4 years ago
You might want to create a custom function that writes the file, runs the cli version of this tool(asuming you have one installed) and reloads the file.
Here is my crappy implementation:
if (&ft=='stylus')
function StylusSupremacy()
:w "saves the file
"run the actual command
execute "!(~/.yarn/bin/stylus-supremacy format " . expand('%') . " --replace --options ~/.stylus.json)"
:e "reloads the file
endfunction
command! StylusSupremacy call StylusSupremacy()
map <leader>p :StylusSupremacy<CR>
endif
You might want to update the path to executable and path to config file, but other than that it should do the trick for you. The keybind is \p
assuming you haven't remapped your leader key.
P.S. You should probably put your configs into separate files for each filetype instead of doing if (&ft=='.stylus')
how can i use in vim?