Vim Tips Wiki
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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 46: Line 46:
   
 
<pre>
 
<pre>
vnoremap ;bc "ey:call CalcBC()<CR>
+
vnoremap ;bc "ey:call CalcBC()&lt;CR&gt;
 
function! CalcBC()
 
function! CalcBC()
 
let has_equal = 0
 
let has_equal = 0
Line 68: Line 68:
 
" append answer or echo
 
" append answer or echo
 
if has_equal == 1
 
if has_equal == 1
normal `>
+
normal `&gt;
 
exec "normal a" . answer
 
exec "normal a" . answer
 
else
 
else
Line 78: Line 78:
 
==Comments==
 
==Comments==
 
Please do not give such things as tips! Make this as a script and put this in the scripts section. Starting from version 6.0 (which is hopefully what most people are using),
 
Please do not give such things as tips! Make this as a script and put this in the scripts section. Starting from version 6.0 (which is hopefully what most people are using),
vim provides the ability to have "plugins". (:he plugin). imho, it's bad practice to keep extending your ~/.vimrc. the rc file should be used for tweaking Vim's settings and such.
+
vim provides the ability to have "plugins". (:he plugin). imho, its bad practice to keep extending your ~/.vimrc. the rc file should be used for tweaking vim's settings and such.
 
it is not a good place to put functions etc. this make the .vimrc very bloated.
 
it is not a good place to put functions etc. this make the .vimrc very bloated.
   
Line 87: Line 87:
 
See also {{help|id=quote=}} about the expression register. E.g., in command mode, type
 
See also {{help|id=quote=}} about the expression register. E.g., in command mode, type
   
"=10+15<enter>p
+
"=10+15&lt;enter&gt;p
   
(where <enter> means press the Enter key) will put 25 into your file at the current cursor position. See {{help|functions}} for the list of functions that Vim supports (no maths functions).
+
(where &lt;enter&gt; means press the Enter key) will put 25 into your file at the current cursor position. See {{help|functions}} for the list of functions that Vim supports (no maths functions).
   
 
----
 
----
Line 98: Line 98:
 
<pre>
 
<pre>
 
" escape chars for shell
 
" escape chars for shell
"not for NT: let @e = escape (@e, '*();&><|')
+
"not for NT: let @e = escape (@e, '*();&amp;&gt;&lt;|')
 
" windows echo must escape the caret with the caret, repeat if piped
 
" windows echo must escape the caret with the caret, repeat if piped
 
" backslashes needed to supress evaluation within vim
 
" backslashes needed to supress evaluation within vim
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)