Re: some ideas
On Mon, Dec 11, 2006 at 09:08:20PM -0200, 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). Yet another idea. I'm using many mappinngs like this to not change workinng directory (it seems to me that you want too keep that because of using ./), but inserting the path to file automatically. cmap >fd =expand('%:p:h').'/' (Type >fd at commandline to insert the path of the file beeing edited.) really useful is this mapping, too. After inserting this you don't have to bother about the path at all if there aren't too many subdirectories/files cmap **/* Marc
Re: some ideas
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.
Re: some ideas
On 12/12/06, Aaron Griffin <[EMAIL PROTECTED]> wrote: On 12/11/06, Rodolfo Borges <[EMAIL PROTECTED]> 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). :h autochdir And if you don't like how 'autochdir' works, here's a set of mappings you may want to consider: nnoremap c :cd %:p:h:pwd nnoremap C :lcd %:p:h:pwd nnoremap e :e =expand('%:p:h')/ nnoremap E :e nikolai
Re: some ideas
On 12/11/06, Rodolfo Borges <[EMAIL PROTECTED]> 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). :h autochdir (2) When pasting, arrange spaces and separators automagically: This is a special case that fits your needs, and no one else. Try writing a plugin to do this - it wouldn't be that hard. (3) A mode (to be used by /usr/bin/view) with less-like interface. I currently use :so=999 for easier scrolling. :h less (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. Easy to do, why not do it yourself?
some ideas
(1) When tab-completing on Vim :cmdline, start with the dir of the current file being edited, instead of the $PWD (use ./ for that). (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] (3) A mode (to be used by /usr/bin/view) with less-like interface. I currently use :so=999 for easier scrolling. (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. Best regards, -- Rodolfo Borges