1
Déplacer le curseur
H
: en haut de l’écran
M
: au milieu de l’écran
L
: en bas de l’écran
Jest and built-in Vim features
Set up a sandbox
$ cd /tmp
$ mkdir jest-and-vim
$ cd $_
$ npm init -y
$ npm install --save-dev jest
#!/bin/sh | |
usage() { | |
cat <<\EOF | |
usage: git jump <mode> [<args>] | |
Jump to interesting elements in an editor. | |
The <mode> parameter is one of: | |
diff: elements are diff hunks. Arguments are given to diff. |
Don't use Vim
Don't do the crime, if you can't do the time.
-- Anthony Vincenzo "Tony" Baretta
Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.
Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.
:DiffOrig but smarter
This is an enhanced version of the snippet provided under :help diff-original-file
.
Where the original :DiffOrig
only shows differences between the buffer in memory and the file on disk, :Diff
can be used in two ways:
-
against the file on disk, like the original, with:
:Diff
Off the beaten path
&path
used for?
What is Vim uses :help 'path'
to define the root directories from where to search non-recursively for files.
It is used for:
gf
,gF
,<C-w>f
,<C-w>F
,<C-w>gf
,<C-w>gF
,:find
,:sfind
,:tabfind
,
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
" Print the sum of the lines covered by visual selection or motion | |
function! Sum(type, ...) | |
let sel_save = &selection | |
let &selection = "inclusive" | |
let reg_save = @@ | |
*t'> | |
'[,']!awk '{ sum += $0 } END { print sum }' | |
let &selection = sel_save |