Edit Page
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() |
+ | vnoremap ;bc "ey:call CalcBC()<CR> |
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 `> |
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, |
+ | 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 |
+ | "=10+15<enter>p |
− | (where |
+ | (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). |
---- |
---- |
||
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, '*();&><|') |
" 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 |