We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free. Anti-spam check. Do not fill this in!==Automatically add abbreviations in a file== If you wish to enter your abbreviations automatically in a file, without the need to open it, then use the following function : <pre> "------------------------------ "mapping to automatically add an "abbreviation fun AddAbbr() normal byw let StringChar = lh#visual#selection() "where lh#visual#selection() is a function you have to download from here : "https://github.com/LucHermitte/lh-vim-lib/blob/master/autoload/lh/visual.vim "and then, to put in your .vim/autoload directory. let val = input("Enter the abbreviation you wish to use for '" . StringChar . "' :") exec "ia" val StringChar silent call SaveAbbr(StringChar, val) endfun fun SaveAbbr(val, abbr) redir >>~/.vim/foo.txt "foo.txt is the file in which you wish to add your abbreviations. For me, it "is ~/.vim/ftplugin/tex.vim echo "iab" a:abbr a:val redir END endfun vmap <S-F8> <ESC>:call AddAbbr()<CR> "Replace S-F8 by any other shortcut you wish </pre> Copy it in your .vimrc file, and read the comments. Basically, you have to download the file located [http://lh-vim.googlecode.com/svn/vim-lib/tags/2.2.1/autoload/lh/visual.vim here] and to copy it in the relevant directory. Then, select a word or an expression in visual mode, and push Shift+F8. Summary: Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA Cancel Editing help (opens in new window) Retrieved from "https://vim.fandom.com/wiki/Using_abbreviations"