Pour insérer le résultat d'une commande du terminal dans un texte en string dans VIM.
:r!date +\%c
see :help :r!
J'oublie toujours.
ctags -R --extra=f -o tags .
Plein de thèmes pour VIM.
Solution #1
:r! ls
Solution #2
:.!ls
Comment inverser des lignes sous vim ?
:g/^/m0
: start command-line mode.
g means you'll take an action on any lines where a regular expression matches
/ begins the regular expression (could have used any valid delimiter)
^ matches the start of a line (which matches all lines in the buffer)
the second / ends the regular expression; the rest is an Ex command to execute on all matched lines (i.e. all lines in buffer)
m means move (:help :move)
0 is the destination line (beginning of buffer)
PB
Après réinstallation de VIM (version 8) sur un PC Windows (PRO), à chaque ouverture de fichier, VIM me faisait un :
set textwidth=78
malgré un
set textwidth=0
dans mon "_gvimrc"
Solution
Faire un
verbose set tw?
Qui permet de savoir dans quel fichier et à quelle ligne l'écriture de cette valeur s'est effectuée.
Pour moi c'était un
autocmd FileType text setlocal textwidth=78
dans un fichier _vimrc dans le répertoire d'install de VIM. Grrr !
J'ai donc rajouter un :
autocmd FileType text setlocal textwidth=0
dans mon _gvimrc.
Conclusion
Si cela peut aider...
Depuis le temps que je cherchais ceci...
To turn off autoindent when you paste code, there's a special "paste" mode.
Type
:set paste
Then paste your code. Note that the text in the tooltip now says -- INSERT (paste) --.
After you pasted your code, turn off the paste-mode, so that auto-indenting when you type works correctly again.
:set nopaste
However, I always found that cumbersome. That's why I map <F3> such that it can switch between paste and nopaste modes while editing the text! I add this to .vimrc
set pastetoggle=<F3>
Distribution pour vim avec tout plein de plugins utiles.
Via : https://shaar.libox.fr/?ZXm_WA
Je recherche toujours ceci quand je fais des copier-coller depuis Word vers Vim.
En anglais.
Alternatively, you can place your cursor on the unprintable character and hit ga, it will show the decimal/hex/octal code of that character, then you can substitute it with:
:%s/\%xYY/substitute/g
where YY is the hex code of the char, if it's multibyte:
:%s/\%uYYYY/substitute/g
À regarder.
via : http://links.tomcanac.com/?td-Q3Q
Liste de plugin pour VIM.
Pour créer online son propre colorscheme pour VIM.
Python et VIM avec autocompletion.
Astuce pour VIM pour effacer les caractères dont le code ASCII est <127.
How to clear diff in vim
De plung-ins pour le logiciel VIM.
Gérer les sessions avec VIM.
indentation vim pour python
Ne pas oublier dans le vimrc :
filetype plugin indent on
Autoload cscope
Pour faire fonctionner cscope, ne pas oublier la commande suivante :
set csprg=<cscope.exe>
Avec cscope un peut faire un arbre d'appel
vimgdb, un rêve ou réalité ?
A voir
Auto-complétion avec VIM, "omnifunc" fonction.
Complément à VIM pour savoir d'où on vient dans un code.
Pour faire fonctionner cscope, ne pas oublier la commande suivante :
set csprg=<cscope.exe>
Très bon plugin pour VIM pour les couleurs.
Il permet de colorer des mots spécifique par buffer.