Rodolfo Borges wrote:
(1)
When tab-completing on Vim :cmdline, start with the dir of the current
file being edited, instead of the $PWD (use ./ for that).

No prefix on a text filename means the current dir, also in sh and COMMAND.COM (principle of least surprise). But you can have the current dir be always the dir of the current file, as follows:

- Method I:     :set autochdir
- Method II:    :autocmd BufRead,BufNewFile,BufFilePost *
                        \ lcd %:p:h



(2)
When pasting, arrange spaces and separators automagically:
Exemple:
('[x]' means the cursor is over char 'x', the brackets are not part of the text)

red, [b]lue, green
dW
red, [g]reen
$
red, gree[n]
p
red, green, blu[e]

This works for comma-separated options and for Lists. For strings with any separator it would be possible to write a function in vimscript and assign it to a mapping. (You may want to tackle it as an exercise.)



(3)
A mode (to be used by /usr/bin/view) with less-like interface.
I currently use :so=999 for easier scrolling.

I think there's a script somewhere which transforms Vim into a less-like pager. Also a manpage reader frontend. Have you searched vim-online now that its scripts section has come back?



(4)
About that generic syntax highlighting that uses just # for comments,
and " ' for strings:
Don't hightlight the # unless on the first column, and don't
hightlight strings at all.

With strings highlighting, I know if I forget to close a string by mistake. But this is the best "first example" to use for writing your own syntax script: simple enough to give even a beginner a good chance of success, and you formulated it so you'll be motivated. Go ahead.



Best regards,


Best regards,
Tony.

Reply via email to