Skip to content

Instantly share code, notes, and snippets.

@romainl
romainl / eslint-standard.md
Last active June 5, 2023 00:46
Painless ESLint/Standard integration

Painless ESLint/Standard integration

Our goal, here, is threefold:

  • use Vim's built-in features to their fullest,
  • be a good project citizen even if we don't use $EDITOR_DU_JOUR,
  • have a minimal but beneficial impact on the infrastructure of the project we work on.

Expose a simple interface for linting at the project level

@romainl
romainl / vanilla-linter.md
Last active April 13, 2024 03:30
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active April 15, 2024 22:49
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
@adonis0147
adonis0147 / Vim_install.sh
Last active January 5, 2022 11:48
Compile Vim from source.
#!/bin/bash
sudo dpkg -P vim vim-runtime vim-common vim-tiny
sudo apt-get install libncurses5-dev libperl-dev python-dev ruby-dev mercurial checkinstall lua5.2 liblua5.2-dev
sudo ln -s /usr/include/lua5.2/ /usr/include/lua
proxychains hg clone https://code.google.com/p/vim/
cd vim
./configure --prefix=/opt/vim \