Re: pulling text to the right?
On Tue, 27 Feb 2007 17:10:40 -0500 Charles E Campbell Jr <[EMAIL PROTECTED]> wrote: > So everything lined up. Of course, when I used my mouse to pick up > your text, it was composed of all spaces. Does your original happen > to have a mixture of tabs and spaces? > > Besides, this text is looking rather like a declaration set. There's > a map specifically supporting that: > \adec seems like the script wasn't loaded propertly. After restarting gvim, both \tsp and \adec worked (the latter one having the best result). great script which I am sure I will get to use alot. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: pulling text to the right?
On Tue, 27 Feb 2007 09:57:55 -0500 Charles E Campbell Jr <[EMAIL PROTECTED]> wrote: > Lev Lvovsky wrote: > > > I'm sure there's a fancy word for this, but is there any way to > > pull text to the right? > > > > suppose I have the following: > > > > COL1 INT, > > COL2 INT, > > COL3 INT, > > > > I'd like to get "COL3" aligned to "COL1" and "COL2", but to do > > that, I need to put the cursor behind "COL3", hit space several > > times, and then align "INT" with the other "INTs". Can I put my > > cursor to the right of "COL3", and pull it over to "INT" on the > > right? > > > It sounds like you're interested in aligning text. For that may I > suggest looking into Align.vim (and AlignMaps.vim, which come > together). To do the alignment, assuming that you're using spaces as > delimiters: > > at the upper right hand corner, type V > move cursor to bottom right hand corner. > type \tsp > > If you're using tabs as delimiters, then use \tab instead of \tsp. I just tested it to see if I could get it to work, but I have some problems. I inserted the following int foo; uint8_t bar; TIME baz; int hello="world; and then followed you instructions (used \tsp), but the result afterwards is: int foo; uint8_t bar; TIME baz; int hello="world; -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tips project
On Fri, 23 Feb 2007 06:32:28 +0200 Ali Polatel <[EMAIL PROTECTED]> wrote: > There is one thing to mention about parsing tips. Are we going to > put the additional comments to the wiki? There are many useful > comments but there are also many useless junk. > It would be _lots_ of work to look at every comment and see if > they're useful or not. > What are your ideas? I think that we should move all comments. it is easier to remove the useless ones later than it is to add a missing comment later on. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: The Seven Habits Of Effective Text Editing 2
On Mon, 19 Feb 2007 23:11:16 +0100 Bram Moolenaar <[EMAIL PROTECTED]> wrote: > > Yongwei Wu wrote: > > > > Bin Chen wrote: > > > > > > > Thanks. I am also looking forward to this talk. But > > > > unfortunately the google video is blocked in some countries, > > > > could some one put the video to the vim official site? and this > > > > can make this video seems more official ^&^. > > > > > > From what countries is the video blocked? Or is it that all of > > > Google video is blocked? > > > > The message I got was: > > > > Thanks for your interest in Google Video. > > > > Currently, the playback feature of Google Video isn't available in > > your country. > > > > We hope to make this feature available more widely in the future, > > and we really appreciate your patience. > > > > I am in China. I am not sure which countries have similar problems. > > Maybe you can get this kind of information, Bram? > > I'll ask if I can get the video in a portable format and put it on the > Vim ftp server. > http://www.schulz.dk/vim/7HabitsForEffectiveT.avi -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tips project
On Fri, 16 Feb 2007 02:37:28 +0100 Bram Moolenaar <[EMAIL PROTECTED]> wrote: > > Hi all, > > Google code has now added support for a wiki. This means open source > projects can have a wiki that's free, fast and reliable > (hopefully :-). > > http://code.google.com/hosting/ > > During my presentation last Tuesday the idea came up (again) to move > the Vim tips to a wiki. The big advantage is that instead of having > to read the notes below the tip to find out about improvements, the > notes can be added in the right place, or even correct mistakes in > the tip. > > I would like to ask for volunteers who want to take the current tips > and notes, write some kind of script to move them to the wiki and set > it up for use. If this works well we can delete the tips from the Vim > website. They are currently closed for updates anyway, thus this is a > good time to try it. > > Using the project name VimTips would be good. Please don't create it > unless you are going to set up the wiki! > I am not sure that I like the idea of the Tips being on a Wiki. I like the fact that I know exactly where to find a particular tip and that chances are it will be there the next time I need it. That the main problem I encounter with wiki pages. Another thing is that we most likely will encounter even more spam than now by moving to a wiki (spambots are getting through, even when you have captcha and user login). just my 5cents -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: vim paste buffer
On Thu, 8 Feb 2007 21:34:12 +0800, "Guillaume Bog" <[EMAIL PROTECTED]> wrote: > Hi everbody, > > I'm new on this list. I use vim in a terminal on ubuntu everyday and > still need some help for efficient use. If the file i'm editing is > longer than one screen and I want to paste it somewhere else (say in a > firefox textarea), I have to go out of vim, cat the file i'm editing, > select it and then paste it (with middle mouse button). I now the > visual mode, and how to highlight all (gg v G). But this operation > doesn't fill the proper buffer. > > I have searched some tips and vim.org but... Any idea? > > Regards, > Guillaume just yank it into the "+ register. This is the same as your clipboard. -- Kim Schulz
Re: CTRL-S functionality to a letter combo like i.e. cs
On Thu, 01 Feb 2007 20:48:52 + "Eric Leenman" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using gvim on windows, which is behaving like windows shortcuts: > For example: > CTRL-S for save > CTRL-X for cut, > ect. > > When using vim on Linux these don't work anymore because of linux > "windows managers". > > Is it possible to put the same functionality of the CTRL-key (and/or > ALT) to a key which is not linux "windows manager " sensitive? > In other words: Is it possible to remap the ctrl key to for example > the letter c? > > So that when you are in insert-mode you can press cs as a replacement > for CTRL-S? > ( > Is this possible without using the Function Keys F1 till F12? > get the vim setup called cream. http://cream.sf.net -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: problems with vim.org/scripts
On Mon, 22 Jan 2007 23:04:14 +0100 Bram Moolenaar <[EMAIL PROTECTED]> wrote: > I broke it and now fixed it. Sorry for the inconvenience! No problem... thanks for the info. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
problems with vim.org/scripts
Hi, I just did a search for "game" in scripts on vim.org, but was returned a site saying: Vim Online Error script: hmmm...strange result_ptr. Did you get here from a vim online link? The link it gave me was: http://www.vim.org/scripts/script_search_results.php?keywords=game&script_type=&order_by=rating&direction=descending&search=search There might be a problem with the site. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Spam in "Tips" in Vim's website
On Wed, 17 Jan 2007 20:46:30 +0100 DervishD <[EMAIL PROTECTED]> wrote: > Hi all :) > > I've noticed that there are still spam in the Tips comments at the > vim website. Bram, do you need help with that? If you want, I can > take a look at the comments and delete any spam I catch. I don't know > how much spare time I'll have, but even with ~1500 tips, it shouldn't > take more than a week or so. > > I've read your post in the Vim page saying that with the help of > moderators, the spam had been eliminated, so probably the spam I've > seen today is new. That's bad :((( > > Raúl Núñez de Arenas Coronado > having RSS feeds of the tips being added makes it easy to catch the spam just after it has been added without having to go to the homepage all the time. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
other function "keywords" than range and dict
hi Is there any other function keywords besids range and dict? I mean the ones you can add after the argument list in a function decleration: function MyFoo(arg1,arg2) keyword echo "foo" endfunction -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
dictionary fun makes gvim crash
Hi I get gvim to crash every time I try the following: let mynumbers = {0:'zero',1:'one',2:'two',3:'three',4:'four', 5:'five',6:'six',7:'seven',8:'eight',9:'nine'} function mynumbers.convert(number) dict return join(map(split(a:number,'\zs'), 'get(self, v:val,"unknown")')) endfunction echo mynumbers.convert(12345) cannot get the same code to crash in the console version of vim. another weird thing is that if I call this function (in console vim) and uses the argument 123123123123 then it returns as if approx. half of the digits are unknown. is it Vim's number<->string conversion mechanism that fails or? $ gvim --version VIM - Vi IMproved 7.0 (2006 May 7, compiled Dec 21 2006 10:24:55) Included patches: 1-178 Compiled by Thierry Vignaud <[EMAIL PROTECTED]> Huge version with GTK2-GNOME GUI. Features included (+) or not (-): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: "/etc/vim/vimrc" user vimrc file: "$HOME/.vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "/etc/vim/gvimrc" user gvimrc file: "$HOME/.gvimrc" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gnome-keyring-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/libxml2 -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib/perl5/5.8.8/i386-linux/CORE -I/usr/include/python2.5 -pthread -I/usr/include -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1 Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux/CORE -L/usr/local/lib -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lgnomeui-2 -lbonoboui-2 -lgnome-keyring -lxml2 -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lbonobo-2 -lgnomevfs-2 -lbonobo-activation -lgconf-2 -lgmodule-2.0 -lORBit-2 -lgthread-2.0 -lgobject-2.0 -lglib-2.0 -lXt -ltermcap -lacl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux/CORE -L/usr/local/lib /usr/lib/perl5/5.8.8/i386-linux/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.8.8/i386-linux/CORE -lperl -lutil -lc -L/usr/lib/python2.5/config -lpython2.5 -lutil -Xlinker -export-dynamic -L/usr/lib -ltcl8.4 -lieee -lm -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: your best vim scripting tip
[snip] Great input Luc! thanks.
Re: your best vim scripting tip
On Mon, 04 Dec 2006 00:40:53 +0100 "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > Kim Schulz wrote: > > Hi, > > It you should give one (or more) tips to a person who was going to > > start creating scripts for vim, then what would it be? > > (besides "know your :help" :-) ) > > > > ideas could be: > > Do's and dont's > > best util script > > often used functions > > ways of optimization > > etc. etc.. > > > > > > In addition to what Yakov and Mikolaj have said, and with which I > fully agree, my main advice would be: Your Mileage Will Vary. > - One person's "most used" script might not even be useful for > another user. > - A keymap, a colorscheme, a syntax script, a utility script or a > vimrc each require fundamentally different approaches. > > One thing Mikolaj mentioned, but which I want to stress: make your > scripts as portable as you can: > - You're on Linux now, but if and when you find yourself facing a Mac > or Windows (or other) machine, you will still want to use Vim the > same way. > - Your scripts should work in both Vim and gvim (if at all possible). > - If ever you find yourself using a Vim version with a limited > featureset, or an older version of Vim, you don't want your vimrc (or > other Vim script) to halt on an error because you set an unsupported > option or use an unsupported command (for that version). > This means that IMHO: > * you should test has(), exists() etc. whenever there is a > possibility that some feature might possibly be absent on some > version of Vim. (Better be safe than sorry.) > * if there are several ways to program a single task, use vim-script > in preference to interfacing with perl, python, etc., unless: >(a) you know that the required interpreter will always be > available whenever you will need that task, and >(b) the "alien" version of the script is faster and cleaner than > the "vim" version, or the task at hand cannot be handled with "pure" > vim-script. > > > Best regards, > Tony. Thanks. it was answers like this I was looking for. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: your best vim scripting tip
On Sun, 3 Dec 2006 11:53:37 +0200 "Yakov Lerner" <[EMAIL PROTECTED]> wrote: > Depends on your task you have at hand. > Once you know the task, you can pick related script(s) > from www.vim.org/scripts and learn from them. sure, but many of the scripts are done by script-programming-beginners an includes tons of bad scripting. What I am asking for i "what would you do different if you should redo one of your first scripts - programming-wise not functionallity! -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: your best vim scripting tip
On Sun, 3 Dec 2006 00:19:26 +0200 "Yakov Lerner" <[EMAIL PROTECTED]> wrote: > On 12/2/06, Kim Schulz <[EMAIL PROTECTED]> wrote: > > It you should give one (or more) tips to a person who was going to > > start creating scripts for vim, then what would it be? > > (besides "know your :help" :-) ) > > This is creepy question, because it's sort of self-contradicting. > Let me explain. On one hand, if you already know everything > that's in :help, then you're vry advanced > scripter, and there's nothing I could add. > > On the other extremity, if you seek advice as *beginner* scripter, > then my best advice would be to read through ':help usr_41'. Three > times. > > Since it contains number of examples, tips, explanations, references, > solutions, and tricks, I could not add anything to it, again. > > > best util script > > often used functions > > ways of optimization > > All these would be for advanced scripter. And then probably found > somewhere on www.vim.org/tips and on www.vim.org/scripts. You are right. It was a bit cryptic this question, but what I was looking for was more those small things that could help a vim script developer become more productive? what has helped you? I know that usr_41 gives a lot of answers but it still only covers the basic stuff and not extra things beyond that. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: C++ refactoring tool
On Fri, 24 Nov 2006 19:58:27 -0600 "Peng Yu" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using vim developing C++ programs exclusively. I'm wondering if > there is good refactoring tool available in vim. > > Thanks, > Peng some of this might help you along: http://www.vim.org/tips/tip.php?tip_id=589 -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
formatexpr examples
Hi, I have been looking for formatexpr examples that show how to write a simple formatting function. Especially how the v:char is supposed to be used since this is not that well described in the docs. Does anyone have such example and can help me? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: vim-based IDE
On Sun, 19 Nov 2006 16:18:40 +0530 "Martin DeMello" <[EMAIL PROTECTED]> wrote: > Seems like a pretty cool project: http://vimmate.rubyforge.org/ > > Also, the README says it was inspired by PIDA > [http://pida.berlios.de/] - a project which, despite actively > searching for something like it, I never managed to discover. I think > there ought to be a section of the vim.org site devoted to such 'vim > ecosystem' projects. I dont really see the WOW things in this project yet. I does not really offer anything that vim with a couple of plugins do. filemanager svncommand shell! etc. I agree with you on the matter of whether to have a section about projects like this on vim.org though. That would be a nice idea both to get a more complete list and to promote such projects more. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: running a function only once over visual selected lines.
On Wed, 15 Nov 2006 22:13:06 +0200 "Yakov Lerner" <[EMAIL PROTECTED]> wrote: [snip] > You need to add keyword range to the function header line like this: > function! Listing2() range Thanks this works perfectly, > This is documented Might be, but I wasn't able to find this when searching the help system. (I found it now and it is only vaguely described with two lines of text). -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
running a function only once over visual selected lines.
Hi I have a function that adds numbers to the begining of lines and I want it to do it to each line in a visual selection (to create numbered lists in my text). There is however the problem that the function is called for each selected line and not once for the entire visual selection. can anyone help me modify it such that it will work on visual selected lines (): function! Listing2() " set line numbers in front of lines let beginning=line("'<") let ending= line("'>") let difsize = ending-beginning let pre = ' ' while (beginning <= ending) if match(ending, '^9*$') == 0 let pre = pre . '0' endif call setline(ending, pre . difsize . "\t" . getline(ending)) let ending=ending-1 let difsize=difsize-1 endwhile endfunction :vmap :call Listing2() I would prefer not to use a global counter. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: vim.org refreshed mockup
On Tue, 7 Nov 2006 19:59:57 +0200 "Panos Laganakos" <[EMAIL PROTECTED]> wrote: > I made a mockup of a refreshed version of vim.org, trying to maintain > as much of the original look as possible: > > http://panos.solhost.org/mockups/vimorg-01.png > > vim tangofied icon by toZth > In general I find it ok, but as some others has mentioned, the light gray used for dates is too close to the color of the background. The logo area should say Vim clearly such that you can actually see what the page is all about. Dont like the icon for the page. It is probably nice for the desktop, but its childish look dont match a fullblown professional editor like Vim. Personally I would love to have the page split up in two parts - general vim information, download, official news, docs - community pages, scripts, tips, forum, less official news. This way we could make the community part grow with new features while still maintaining a professional, easy to overlook, information packed page for those just coming for the download and docs. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
inserting tabs in foldtext
Hi Is there a way to have tab chars in foldtext? I have tried with set foldtext=getline(v:foldstart).'^I^I'.v:foldstart but with no luck. Have also tried with \t and so is this possible and how? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: REQ: gq and swap file stuff?
On Sat, 21 Oct 2006 22:40:32 +0200 "Pero Brbora" <[EMAIL PROTECTED]> wrote: > Hi ... > > When there is no empty lines bellow the long line (at the end of file) > you can't format the line using gq option... > This one I completely agree with. I always start out by adding a lot of empty lines to the bottom of the file before adding contents. this way this annoyance isn't activated as often. Would be super to get rid of this annoyance which I tend consider a bug - even though it probably has its roots in some line-editing ideas from old days. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: locked window
On Thu, 19 Oct 2006 12:15:17 -0700 "Yegappan Lakshmanan" <[EMAIL PROTECTED]> wrote: > You can use the detailed example code under ":help > CursorHold-example". It uses the ":ptag" command and the cursorhold > autocmd to jump to the tag under the cursor in the preview window and > highlight the line. absolutely perfect. this er very close to what I had in mind. Except that I would really like this window to be locked (hence the question which started this thread). -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: locked window
On Thu, 19 Oct 2006 15:18:12 +0200 "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: [snip] > > Instead of calling the program "vim", call it "rview". Then you won't > be able to write anything, nor to use a shell command. Is that safe > enough? Maybe ":help starting.txt" will give you other ideas. except that this is not what I want. I would like to have a preview window that shows the position of decleration whenever I move the cursor on top of a function name, variable etc. It should ofcause use tags to find the right place. Source browsers like Source Insight has a feature like this and I love the way it gives you a superb overview of the code when reading through it. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
locked window
Hi I was wondering if there is a way to lock a window such that the content can only be changed by scripting/commands. Like a preview window or somthing like that. is that possible to make in Vim or should I make a feature request to get it :-) -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Planet Vim
On Thu, 12 Oct 2006 14:45:31 -0500 (CDT) "Tom Purl" <[EMAIL PROTECTED]> wrote: > > Are there enough people out there users/developers that blog about > > Vim? > > I'm sure that you could find a critical mass. > > > If so, it would be great to have a planet vim to aggregate these > > blog posts. > > I don't see why "planet" web sites still exist. I can basically > recreate this functionality using an rss-aggregating web site such as > Bloglines. You can search for Vim-related blogs using their blog > search engine, and then track your favorite Vim-related sites in a > Vim folder. > > I'm not trying to be negative - I just wanted to save you some time if > the functionality that I described is what you require. You are right. I have another idea :-) Lets just mention all vim related blogs in this thread and then people can add them to their rss aggregators themself. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tags - alternative ways to use them
On Fri, 6 Oct 2006 11:48:42 -0700 Max Dyckhoff <[EMAIL PROTECTED]> wrote: > Hari's new plugin LookupFile is a great use of tags, I use it dozens > of times a day! > > http://www.vim.org/scripts/script.php?script_id=1581 ahh lovely. Didn't know that one. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tags - alternative ways to use them
On Fri, 6 Oct 2006 13:32:53 -0500 "Aaron Griffin" <[EMAIL PROTECTED]> wrote: > You could probably use C tags from a header file (with the arguments > turned on) to generate a skeleton .c file just an idea. not a bad idea. Wonder if anyone has done this already. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
tags - alternative ways to use them
Hi, Most of you probably know about using tags, tagfiles and the taglist plugin, but I am courious if anyone has used the tags functionality in interesting alternative ways? maybe in plugins or simple macros - I want to know it all :-) So let me know what neat ideas you have. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: abbreviations + indent + movement commands
On Sat, 23 Sep 2006 17:08:39 +0200 Luc Hermitte <[EMAIL PROTECTED]> wrote: [snip] > > I guess it is in the mark for place of last change, but I just cant > > get iabbrev to execute my movement command (other than using > > ). Is there any way to do this? > > I finally converged to the use of search(), on a placeholder > regex-pattern. This way neither @/ nor the search history are messed > up by irrelevant patterns. I have been playing around with the search() but I couldn't quite get the hang of it. Could you maybe give me an example on how to use it in relation to an abbrev. What I tried was: :iabbrev for( for (!cursor!;<+++>;<+++>){\n<+++>\n}=search('!cursor!',b)c/+>/e but this inserts the linenumber where it finds the placeholder. I would rather like it ro remove the placeholder and move the cursor there. any ideas? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
abbreviations + indent + movement commands
Hi I am playing a bit around with abbreviations, in order to use them for simple pattern templates when I code. like: iabbrev for( for (%%%;%%%;%%%){} problem is that this gives me a wrong indentation of the code such that the } is placed in the same column as where the ( in for( was before changing. like: for (%%%;%%%;%%%){ . } (the . is the eol in that line). How can I get it to obey my indentation rules? Second problem: After the for( is changed to the for (){...} I would like to move the cursor to the first spot just inside the () without having to do this manually. is there a way to go to that place ? I guess it is in the mark for place of last change, but I just cant get iabbrev to execute my movement command (other than using ). Is there any way to do this? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
show matching bracket - the emacs way
Hi Is there any way to get vim to show the line where the matching start bracket is placed (or the line above if line only contains bracket) whenever a closing bracket is pressed. e.g., if( foo == bar ) { bla bla } should show "if( foo == bar ) {" when the } is inserted. Emacs has this feature and I think that it is quite useful when programming, and would love to have it in Vim. I am not looking for showmatch, and dont want to jump to the line - i simply want a preview at the bottom of the script. If this is not possible directly in Vim, I an planning to write a script for this - any ideas are welcome. In gvim I was thinking of using baloonexpr to show it on mouse over also. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: placeholders
On Thu, 21 Sep 2006 23:36:19 +0200 Luc Hermitte <[EMAIL PROTECTED]> wrote: > Hello, > > * On Thu, Sep 21, 2006 at 10:43:54PM +0200, Kim Schulz > <[EMAIL PROTECTED]> wrote: > > I want to add placeholders to some templates I have like > > <+TITLE+> <+DATE+> etc. > > I then want to map a keyboard shortcut to do the following > > 1. find next placeholder > > 2. remove placeholder > > 3. place cursor where placehoder where > > 4. go into insert mode. > > > > I started out on the command, but got kinda stuck. > > :map /<+.\++>:s/<+.\++>//'.i > > > > it almost works, except that it places the cursor at the beginning > > of the line instead of at the place of the placeholder. > > > > any ideas? > > > Why don't you use already existing solutions ? what would I learn from that ? :-) I already have your system installed, but Im trying to learn new Vim stuff by creating a complete personal setup from ground up. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: placeholders
On Thu, 21 Sep 2006 15:57:13 -0500 Tim Chase <[EMAIL PROTECTED]> wrote: > > I want to add placeholders to some templates I have like > > <+TITLE+> <+DATE+> etc. > > I then want to map a keyboard shortcut to do the following > > 1. find next placeholder > > 2. remove placeholder > > 3. place cursor where placehoder where > > 4. go into insert mode. > > > > I started out on the command, but got kinda stuck. > > :map /<+.\++>:s/<+.\++>//'.i > > > > it almost works, except that it places the cursor at the beginning > > of the line instead of at the place of the placeholder. > > Here's my first stab at the matter: > > :nnoremap /<+.\{-1,}+>c/+>/e > > which is > > / find > <+.\{-1,}+> a minimal tag > (do the find) > c change > /+>/e to the "e"nd of the "+>" > (end of the 2nd search) > > The reason for using the minimal operator ("\{-1,}") is to ensure > that there's at least something within (the "1" bit), but that > you don't swallow multiple tags if they occur on the same line. > > Just a few ideas, thanks. works like a charm. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
placeholders
Hi I want to add placeholders to some templates I have like <+TITLE+> <+DATE+> etc. I then want to map a keyboard shortcut to do the following 1. find next placeholder 2. remove placeholder 3. place cursor where placehoder where 4. go into insert mode. I started out on the command, but got kinda stuck. :map /<+.\++>:s/<+.\++>//'.i it almost works, except that it places the cursor at the beginning of the line instead of at the place of the placeholder. any ideas? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: ANN: perforce 4.1 release
On Sun, 3 Sep 2006 10:24:30 -0700 (PDT) Hari Krishna Dara <[EMAIL PROTECTED]> wrote: [snip] thanks for this great plugin. At work I have been forced by my employer to work in Emacs because it has a good perforce integration plugin. With this Vim plugin I finally was allowed to use Vim instead of Emacs. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Vim BOF session
On Sun, 3 Sep 2006 13:21:06 +0200 Mikolaj Machowski <[EMAIL PROTECTED]> wrote: > You point can be split in two: > 1. Intellisense plugin is tied to widget system. It could mean that >popup system had to be written each time for each GUI. Monstrous >effort for writing and maintaining. I dont want MS intellisense, I just want an improved omnicompletion :-) > 2. Info provided by intellisense can be provided by current >implementation of omnicompletion. Problem is efficiency and size of >data. For example inclusion of built-in functions in PHP >omnicompletion caused that phpcomplete.vim has almost 300K. Adding >help would easily explode that file to few M [1]. Parsing of > PHPdoc is also possible but it could take time (phpcomplete is already >sluggish). Well it is posssible in other editors with a reasonable speed (even in Java based editors like IntelliJ Idea), so it must be possible to do natively in vim too. A large modification - probably, but I am sure that will be af great help for many programmers using Vim. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Thank you for Vim7 scripting improvements
On Sun, 03 Sep 2006 14:23:26 +0200 Bram Moolenaar <[EMAIL PROTECTED]> wrote: > > Yakov Lerner wrote: > > > On 9/3/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote: > > > > > > I still miss pre and post increment and decrement operators > > > > (avoids a separate :let command by itself), > > > > > > You mean, as in: > > > > > > :let linenr = a++ > > > > > > I don't know how difficult this is to implement, and if there are > > > any conflicts in the syntax. > > > > And then probably > >:let linenr ++ > > , too ? > > That looks weird. You can do it already with: > > :let linenr += 1 > think of is as in e.g., the C programming language. for (x =0; xhttp://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Vim BOF session
On Sat, 2 Sep 2006 13:00:32 -0700 "Max Dyckhoff" <[EMAIL PROTECTED]> wrote: > > Omnicompletion++: > > --- > > (snip!) > > (and please kill the pink color - it is really ugly) > > I don't really have any other comments, other than you can change the > pink by adding this to your .vimrc: > > hi Pmenu guibg=DarkRed > > I agree, the pink is heinous :) sure, but it is default and what most users see and use. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Vim BOF session
On Sat, 2 Sep 2006 09:37:43 -0700 [EMAIL PROTECTED] wrote: > > Try :help ssop > > in particular, perhaps ZoomWin's internal but temporary setting will > be what you want: > blank,buffers,curdir,folds,help,options,tabpages,winsize It does not seem to remember how the windows are placed inside Vim. I have tried all the sessionoptions but I still have window splits that are set to equal size when I reopen a session even though I saved it with one of the windows being only 1/5 of the window in height. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Vim BOF session
On Fri, 01 Sep 2006 18:55:07 -0400 Robert Hicks <[EMAIL PROTECTED]> wrote: > Bram Moolenaar wrote: > > Greetings, Vim users. > > > > I am hosting a Vim BOF at the upcoming O'Reilly Open Source > > Convention: > > > > Title: Vim 8? > >Date: Tuesday, 19 September 2006 > >Time: 20:30 - 21:30 > >Location: Salon Versailles > > > > Summary: Vim 7 was released May 2006. Does it make sense to make > > another major release and add lots of new features? Or > > should priority be given to fix problems and fine tune > > existing features? > > > > What new features would users really profit from? Talk > > about the pros and cons with the main Vim author. > > > > The conference is held in Brussels, 18 - 21 September. > > > > More information: > > http://conferences.oreillynet.com/cs/euos2006/view/e_sess/9854 > > > I can't be there but... > > "fix problems and fine tune existing features?" > > Yes > I tend to agree. Some of the current features are still slow (think cursorline columnline) and others still lack some userfriendlyness (like omnicompletion). fine tuning these things would be great. there is however a couple of things I would like to see added in vim8: Dialogs: -- Gvim has confirm that can give me a dialog for selecting files etc. but I want this to be implemented as a more generic dialog api. It should be possible to have a "dialog" with the user such that vim can ask a question and the user can answer this. it is not userfriendly enough if it is just shown in the command line area of the editor - we need better looking modal dialog "windows". The output in the bottom of the window that scrolls the entire contents to be able to show multiple lines is simply not userfriendly and "good looking". I think this could be really useful in scripts and especially in relation to e.g., templates. Omnicompletion++: --- Omnicompletion is a great new feature, but I would like to see it become even stronger. The intellisense plugin for gvim on win32 has some of the features I would love to see in the generic omni completion: quickhelp for items in list if available: http://insenvim.sourceforge.net/images/vis_help.jpg parameter help in tooltip: http://insenvim.sourceforge.net/images/vis_tooltip.jpg Some of this might be possible to make with scripts, but it often tend to become slow if not natively implemented. (and please kill the pink color - it is really ugly) Fonts for visualization: - Vim is fixed font which is mostly nice enough. I have hovever lately been working a bit in the editor/code navigator called SourceInsight. It used different fontsizes for marking the parts in the code - e.g. the function name is 2-4pt larger then the rest of the code and the size of the brackets are bigger for each level of them there is (biggest outside, normal innermost). This makes it extreamly easy to recognize where you are in the code while scrolling through i. Sessions: Sessions are great and I use it all the time. It does however have a single problem that irritates me. It does not save information about how the windows, tabs, buffers etc. are placed individually. This makes it really annoying when you, like me, has a window with a file list, a window with debug output, 2-3 open windows in each tab etc. All of this setting up is lost when I close vim and opens it again. Some of these things might already be possible to some extent, but I havent been able to find any info about it - hence it should probably be either better described or more easily available. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: locked indents like emacs
On Thu, 24 Aug 2006 08:45:49 -0500, "Greg Dunn" <[EMAIL PROTECTED]> wrote: > > How about > > :nmap == > > This will allow you to insert tabs while in insert mode, but when in > normal mode it indents the line according to the current indent rules. > > -- Greg great idea. I will test that. -- Kim Schulz
Re: locked indents like emacs
On Thu, 24 Aug 2006 11:32:55 +0200, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > Kim Schulz wrote: >> >> > > That is filetype-dependent indent, since how to indent will be > determined by the syntax of the language of the file being edited: > > :filetype indent on > or (usually better) > :filetype plugin indent on > > If you source the vimrc_example.vim by means of > > :runtime vimrc_example.vim > or > :source $VIMRUNTIME/vimrc_example.vim > > , it includes ":filetype plugin indent on". > > The width of the relative indent is usually defined by the 'shiftwidth' > option. By default, 'shiftwidth' (the width of an indent) and 'tabstop' > (the width of a hard tab) both default to 8, and 'softtabstop' (by how > much the cursor moves when you hit ) defaults to zero (meaning use > the value of 'tabstop'). In general, I don't recommend setting 'tabstop' > to anything other than 8, for compatibility reasons with some other > editors and compilers. > > > Best regards, > Tony This I know, but what I am looking for is a way to lock these syntax indents such that I cannot break the indentation by hitting space og tab repeatently. -- Kim Schulz
Re: locked indents like emacs
On Thu, 24 Aug 2006 10:46:26 +0200, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > Kim Schulz wrote: >> >> Hi is there a way to make indentation in Vim "lock" like in emacs so > that if I press tab in the beginning of a line, then it indents the line > to the correct place. Pressing tab multiple times does not change the > indentation any further - it is locked. > > 'autoindent' will indent the line to the same location as the line the > cursor was on before hitting Enter in Insert mode, o or O in Normal > mode, etc. > > I suppose that you could force a fixed indent of, say, 6 characters > (i.e., always indent to column 7) by using > > :setlocal indentexpr=6 > > To use it in all buffers, use > > :filetype indent off > :set indentexpr=6 What I need is for it to be context sensitive. so if I have if (foo == bar) { // one fixed indent if (bar == baz) { //another fixed indent } } -- Kim Schulz
locked indents like emacs
Hi is there a way to make indentation in Vim "lock" like in emacs so that if I press tab in the beginning of a line, then it indents the line to the correct place. Pressing tab multiple times does not change the indentation any further - it is locked. -- Kim Schulz
Re: gvim fullscreen mode on Gnome ?
On Sat, 19 Aug 2006 12:08:13 +0200 "KLEIN Stéphane" <[EMAIL PROTECTED]> wrote: > Hi, > > is there gvim full screen mode feature on GNU/Linux Gnome... ? In gnome I have f12 mapped to fullscreen of current window. this includes removing the window decoration etc. Only the menu and the toolbar of gvim will be shown but these can be removed via the guioptions in gvim too. the gnome-keybinding-properties program can be used to bind the fullscreen feature to any keybinding you want. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Show/Hide Split Windows
On Thu, 10 Aug 2006 11:43:56 -0700 "Max Dyckhoff" <[EMAIL PROTECTED]> wrote: > He means when using the script that he wrote and which he was > discussing in the same email, which remaps ctrl-w o to do something > else. and it works perfectly :-) Use it a lot here. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: get only basesname from bufname()
On Mon, 7 Aug 2006 15:18:09 -0500 "Bob Hiestand" <[EMAIL PROTECTED]> wrote: > :help fnamemodify() thanks. worked perfectly (just had to figure out that I had used :h instead of :t ) -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
get only basesname from bufname()
hi Is there an easy way to get only the basename (filename) without the path when using bufname()?? I am using it for a guitablabel and have tried with let label = bufname(i-1); let filename = expand("".label.":h") but that does not work. so what is the correct way ? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tab equivalent for bufexists() and bufnr() ?
On Sun, 06 Aug 2006 17:19:17 +0200 "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > Kim Schulz wrote: > > hi > > is there an equivalent to bufexists() and bufnr() but for tabs in > > vim 7? > > > > > > There is no need for an "equivalent". bufexists() and bufnr() will > show that a buffer exists, and give its number, even if it is not > currently loaded in a window; indeed even if it is "unlisted" i.e., > listed by ":ls!" (with bang) but not by ":ls" (without bang). After > ":bdelete" (but not after ":bwipeout") bufexists() is still TRUE for > the just "deleted" buffer. [snip] Ok so basically what I need it for is to get the count of tabs. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: tab equivalent for bufexists() and bufnr() ?
On Sun, 6 Aug 2006 16:42:25 +0200 Kim Schulz <[EMAIL PROTECTED]> wrote: > hi > is there an equivalent to bufexists() and bufnr() but for tabs in vim > 7? > > Besides these two functions I am also looking for an equvivalent to and getbufvar() -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
tab equivalent for bufexists() and bufnr() ?
hi is there an equivalent to bufexists() and bufnr() but for tabs in vim 7? -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
Re: Disable spell for certain filetypes
On Mon, 31 Jul 2006 15:52:01 +0100 C Rose <[EMAIL PROTECTED]> wrote: > Hi > > Is it possible to tell vim 7 to use spell in general, but not for > files with specific filename extensions? > > Thanks in advance maybe somthing like: set spell autocmd BufLoad *.c setlocal nospell -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com
check if guioption is set
hi is there a way to check if a guioption is set. normally I would use somthing like: if guioptions == m :set guioptions-=m:else:set guioptions+=m:endif but since guioptions is a sequence of options and not just a single letter, this wont work. So how do I check if it is set? I was looking for somthing like the ~= in perl but didn't seem to find such a thing. -- Kim Schulz| Private : http://www.schulz.dk [EMAIL PROTECTED] | Business: http://www.devteam.dk +45 5190 4262 | Sparetime: http://www.fundanemt.com