:echo @% def/my.txt directory/name of file (relative to the current working directory of /abc)
:echo expand('%:t') my.txt name of file ('tail')
:echo expand('%:p') /abc/def/my.txt full path
:echo expand('%:p:h') /abc/def directory containing file ('head')
:echo expand('%:p:h:t') def First get the full path with :p (/abc/def/my.txt), then get the head of that with :h (/abc/def), then get the tail of that with :t (def)
:echo expand('%:r') def/my name of file less one extension ('root')
:echo expand('%:e') txt name of file's extension ('extension')
-
https://vim.fandom.com/wiki/Get_the_name_of_the_current_filePour enlever des fichiers d'un commit lors d'un rebase interactif : utiliser le keyword 'edit'
Ensuite git reset HEAD^ path/to/file/to/revert
Ensuite git commit --amend
Ensuite git rebase --continue
-
https://superuser.com/questions/229290/how-to-amend-the-last-commit-to-un-add-a-filefallocate -l 10G fake.img
-
https://links.infomee.fr/?IfsqkAComment perdre 30 min
:set backupcopy=yes
When you want to modify a file, you have two options, each with its benefits and drawbacks.
You can overwrite the file in place. This does not use any extra space, and conserves the hard links, permissions and any other attribute beyond the content of the existing file. The major drawback of doing this is that if anything happens while the file is being written (the application crashes, or the power goes out), you end up with a partially written file.
You can write the new version of the file to a new file with a different name, then move it into place. This uses more space and breaks hard links, and if you have write permissions on a file but not on the directory it contains, you can't do it at all. On the flip side, the old version of the file is atomically replaced by the new version, so at every point in time the file name points to a valid, complete version of the file.
http://vimdoc.sourceforge.net/htmldoc/options.html#%27backup%27
-
http://stackoverflow.com/questions/11043534/edit-a-file-in-place-in-vimJe prends de plus en plus le réflexe de "git init" dans certains dossiers un peu chaud qui bougent beaucoup comme des dossiers de configuration..
Et là arrive le moment où je me pose la question : qu'est ce que j'ai touché depuis que j'ai fais mon git ini ? Et voilà la commande magique qui répond à ma question :
git diff --name-only SHA1 SHA2
Après si vous voulez la liste entre le premier et le dernier commit :
git diff --name-only HEAD $(git log --format=%H | tail -1)
-
http://stackoverflow.com/questions/1552340/show-all-changed-files-between-two-git-commitsOutils en ligne de commande pour trouver ce qui occupe de la place, bien pratique
-
http://dev.yorhel.nl/ncdu/manParfois ça sert (la flemme de faire un copier/coller depuis le prompt qui affiche le path courant..)
readlink -e <file>
-
https://links.infomee.fr/?SkmEyAGenial pour s'envoyer des fichiers quand on est sur le meme réseau local sans se faire chier avec les partages de dossier windob qui ne marchent jamais..
-
http://www.msec.it/blog/?page_id=11iSendr propose le même concept que PipeBytes, à savoir établir une connexion directe entre 2 ordinateurs (via le browser) pour transférer de gros fichiers
-
http://www.korben.info/isendr-transfert-securise-de-fichier-sans-logiciel.html