Re: need some help on writing a script
On Jul 30, 1:04 am, Christian Brabandt cbli...@256bit.org wrote: Hi googler! On Mi, 29 Jul 2009, googler wrote: I'm thinking to solve it this way. 1. I have a list of all the files that are listed on the left window (with their full path name) == is there a way to get such a list? Tricky. I do not use netrw a lot, so there might be easier ways. Dr. Chip may correct me, if I am saying something wrong. I think the directory displayed is always in NETRW_HISTDIR_0. So I would do basically something like this: If the filetype is netrw, Read in the whole buffer into a list. Then filter all rows by lines that start with ^ and at last prepend NETRW_HISTDIR_0 to each row, excep maybe ../ (see help getline(), filter(), help map(), etc.) Hi! Thanks for your suggestions. But I don't see anything called NETRW_HISTDIR_0 in :help. If such a variable is available, that will be very helpful in this case. Does this sound good? Or is there a better approach? Also, how do I qualify the left and right split windows? For example, if I want the name of the file in the right window, the file name is stored in %, but how do I tell vim which window? Not sure. Look at the window and buffer functions (see :h function-list) Also take a look at :h eval.txt. All the stuff for writing scripts is in there. This info will be useful given that I have zero experience in writing vim scripts. Mit freundlichen Grüßen Christian -- Achtung nutzt sich ab wie Liebe. -- Luc de Clapiers Vauvenargues (Reflexionen und Maximen) --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: single and double quotes in a string
On Jul 30, 4:05 pm, J. Manuel Picaza jmpic...@gmail.com wrote: Hello everybody, I am trying to write a function for searching all text marked in a visual block. Also check :help visual-search though what you might be attempting could be different the problem is when in the visual block there is something like: variable=some text's function The block contains both and ' so any attempt to assign the block to a variable fails. I'm not sure how you access the contents of the visual selection.. one way is to yank it. If you are doing that, you can assign the block to a variable by doing: :let var=@ --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: need some help on writing a script
On Jul 31, 12:27 am, KKde khekadestro...@gmail.com wrote: Also, how do I get the name of the buffers and their attributes (like active/hidden, etc)? Which variables are these stored in? you can get the buffers list and their attributes by this way in script exe buffers Thanks, Sarath Where will the output of an exe command go? I need to capture the information and extract the name and attribute of each file/buffer. Will I be able to do that using exe buffers? Thanks. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Changing the title of an open gvim session
On Jul 31, 12:40 am, KKde khekadestro...@gmail.com wrote: Hi Googler You can change the title to whatever you want by using this option :se titlestring= Hi\ Googler This setting is global i.e this title will be applied to all buffers in the current window. Don't worry It can be changed for every buffer using the autocmd for more infromation see :he titlestring Thanks, Sarath Exactly what I was looking for. Thank you. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Shortcut for System.out.println - ViM Java
This can be achieved by using abbreviations in VIM. This is an inbuilt feautre and no need of any external VIM script. see :help abbreviations for more info Thanks, Sarath On Jul 30, 9:41 pm, Rashmi rashmi@gmail.com wrote: Hello all, I'm using ViM version 7.2 to edit Java files. In Java I have to frequently type this code: System.out.println( print something ); Is there a way to create a shortcut so that , the entire line of code System.out.println(); would be typed with just a few keystrokes? For example, something like sout tab , would expand to System.out.println(); I also came across a plugin for ViM called VJDE, I'm trying to find out if this plugin may have this feature to print System.out.println(); with a few keystrokes. I appreciate any help. -Rashmi --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Modeline options no effect, how to debug?
Karthick 写道: On Jul 31, 6:57 am, pansz panshi...@routon.com wrote: I put vim:ts=4 in one of my source file, but when I open the file the ts is still 8 (my global setting is ts=8), I tried all format of modeline and it does not work. Check the value of 'modelines' and value of 'modeline'. If nomodeline is set, modeline processing is not done. Perhaps you can also check :help debug-mode Thanks, the 'modelines' answers my question. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Shortcut for System.out.println - ViM Java
Sarath (KKde), please bottom post on this list. Quote a small (relevant) part of the message you are replying to, and put your text underneath. See the list guidelines: http://groups.google.com/group/vim_use/web/vim-information -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Need SERIOUS Help with .vimrc!
I also do various things with my .vimrc it is a good place to learn. If I get ruined, what I do is I replace the file from a temporary install of VIM. Did u try that? Nuwan On Fri, Jul 31, 2009 at 10:07 AM, KKde khekadestro...@gmail.com wrote: Did you made any changes in .gvimrc file also? On Jul 31, 7:32 am, Kalebmcc kaleb...@gmail.com wrote: Arrgh, I wa tweaking my .vimrc tonight and I ruined it. I can't find what setting is causing this, but instead of just using CTRL+V, CTRL+Z, mouse buttons etc, Vim will print the following text (respectively): ^V, ^Z, left mouse right mouse. I'm puzzled. Also, is there a list of .vimrc options, such as different set parameters, etc? Here is my .vimrc: * Under the Hood * behave mswin Puts Vim into Windows mode. set nocompatible Enables gVim features. set nohidden Once a tab is closed, remove it from the buffer. set novisualbell Turn of screen flash * Backup Control * set nobackup Disables file backups. set nowritebackup Also disables backups. set undolevels=1000 Gives 1000 undos. set wrap! Disable word wrapping set backspace=indent,eol,start Simple backspace. * Spellcheck * set spell Turns on shttp://twitter.com/#search?q=pellchecking. set spl=en spell Use English spell checking. * Searching* set incsearch Enables find-as-you-type. set ignorecase Search ignores case. set hlsearch Highlights search terms. set showmatch Shows matching brackets. * Indentation. * set autoindent Automates indentation to that of previous line. set smartindent Vim will intelligently guess indentation. set nocindent Normal c indenting. set noexpandtab Keeps tab as tab, not spaces. * Gui Options * colorscheme terminal Uses terminal colorscheme. set gfn=ProggyCleanTTSZ:h12:cANSI Sets font to Proggy Clean Slashed Zero. set guioptions=emr e means tab bar is displayed, r for scrollbar set showtabline=2 Tab bar is ALWAYS displayed. set ls=2 Status bar is always displayed. set statusline=%t%h%m%r%=[%b\ 0x%02B]\ \ \ %l,%c%V\ %P Forms a status line. set number Allows line numbers. set nuw=6 Sets line number width to 6. set showcmd Show partial command line. set scrolloff=3 Limits scroll to three lines. set cursorline Highlights line of cursor. * Syntax Highlighting * filetype on filetype plugin on syntax enable syntax on set grepprg=grep\ -nH\ $* Syntax highlighting. * Auto Commands* autocmd BufRead,BufWrite * if ! bin | silent! %s/\s\+$//ge | endif Automatically remove trailing whitespace. * Typo Fixerrs * iab anf and iab adn and iab ans and iab teh the iab thre there -- View this message in context: http://www.nabble.com/Need-SERIOUS-Help-with-.vimrc%21-tp24750175p247... Sent from the Vim - General mailing list archive at Nabble.com. -- Nuuwi Hettiarachchi @ WTC Colombo Sri Lanka... :) --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Need SERIOUS Help with .vimrc!
Nuwan, please bottom post on this list specially if you are going to quote the ENTIRE message you're replying to (more than 150 lines this time).. Quote a small (relevant) part of the message you are replying to, and put your text underneath. See the list guidelines: http://groups.google.com/group/vim_use/web/vim-information -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: single and double quotes in a string
On Jul 31, 8:07 am, Karthick karthick.guru...@gmail.com wrote: On Jul 30, 4:05 pm, J. Manuel Picaza jmpic...@gmail.com wrote: Hello everybody, I am trying to write a function for searching all text marked in a visual block. Also check :help visual-search though what you might be attempting could be different the problem is when in the visual block there is something like: variable=some text's function The block contains both and ' so any attempt to assign the block to a variable fails. I'm not sure how you access the contents of the visual selection.. one way is to yank it. If you are doing that, you can assign the block to a variable by doing: :let var=@ Thanks a lot! Now I can find any kind of text just selecting with the mouse and pressing // (in the line of yy or dd) The code for it is: snoremap // escgvy:let @/=escape(@,'\/$')cr vnoremap // y:let @/=escape(@,'\/$')cr Before asking here (not fully functional) snoremap // ESCgvy:execute ':let @/ = \\V\\c' . substitute (substitute('C-R','\\','','g'),'','\\','g') . ''cr:set hlsearchcr vnoremap // ESCgvy:execute ':let @/ = \\V\\c' . substitute (substitute('C-R','\\','','g'),'','\\','g') . ''cr:set hlsearchcr --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Need SERIOUS Help with .vimrc!
That fixed it! Thank you so much! Mishail wrote: I guess you need to add the following to your .vimrc: source $VIMRUNTIME/mswin.vim -- View this message in context: http://www.nabble.com/Need-SERIOUS-Help-with-.vimrc%21-tp24750175p24752634.html Sent from the Vim - General mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Need SERIOUS Help with .vimrc!
Hi Kalebmmc :) Please bottom post on this list. Quote a small (relevant) part of the message you are replying to, and put your text underneath. See the list guidelines: http://groups.google.com/group/vim_use/web/vim-information -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
way to show the current function name in the status line?
hmm basically, itd be cool if i could continuously show the name of the current function the cursor is within down at the bottom... in emacs, (if it is any help) this is which-function-mode ! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: way to show the current function name in the status line?
Use taglist plugin (http://www.vim.org/scripts/script.php?script_id=273) and add this in your status line: :se statusline=%([%{Tlist_Get_Tagname_By_Line()}]%) 2009/7/31 David Lam david.k.l...@gmail.com: hmm basically, itd be cool if i could continuously show the name of the current function the cursor is within down at the bottom... in emacs, (if it is any help) this is which-function-mode ! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: way to show the current function name in the status line?
Hi Sylvain :) Please bottom post on this list. Quote a small (relevant) part of the message you are replying to, and put your text underneath. See the list guidelines: http://groups.google.com/group/vim_use/web/vim-information -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: searching within already-matched strings
Saluton John :) John Kirkpatrick j...@biochem.ucl.ac.uk dixit: how can i stop already-matched strings being excluded from the search text for regexp matching? e.g. if i have the text aaabbaaa, and i search for \b, the last b of the run of 6 is not matched, as the first 5 have been matched and are therefore excluded from the remaining text to be searched. The problem here is not that the first 5 b's have been matched and then excluded from the remaining text to be searched. The matter here is that the b's *are* a match, and only the first match into a line is found by default. Moreover, only the first match is highlighted before you hit Enter (if incsearch is on). This, unless you mean that in bb you can have b matched two times, one for the first 5 b's and another for the last 5 b's. In that case, yes, already matched text is excluded from further matches. If there are any way of getting what you want, I don't know any, sorry. -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: searching within already-matched strings
Hi, John Kirkpatrick wrote: i'm a bit of a vim novice, so sorry if this is a stupid question. how can i stop already-matched strings being excluded from the search text for regexp matching? e.g. if i have the text aaabbaaa, and i search for \b, the last b of the run of 6 is not matched, as the first 5 have been matched and are therefore excluded from the remaining text to be searched. have a look at :help cpo-c and try :set cpoptions-=c Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin) --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Mapping does not work
Dear vim users, One way or another a mapping I'm trying to implement doesn't work. I'm trying to paste with CTRL-V only in insert mode and keep using CTRL-V for visual in other modes. In my .vimrc I've got: imap C-V +gP The only thing I get when pushing CTRL-V in insert mode is the literal text +gP But not the desired effect: pasting. I tried with inoremap also, but to no avail. What could be wrong? Adriaan. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Mapping does not work
J.A.J. Pater jajpa...@gmail.com [09-07-31 19:10]: Dear vim users, One way or another a mapping I'm trying to implement doesn't work. I'm trying to paste with CTRL-V only in insert mode and keep using CTRL-V for visual in other modes. In my .vimrc I've got: imap C-V +gP The only thing I get when pushing CTRL-V in insert mode is the literal text +gP But not the desired effect: pasting. I tried with inoremap also, but to no avail. What could be wrong? Adriaan. Hi, just a shot in the dark Try imap C-V normal +gP instead. Fingers crossed... Have a nice weekend! mcc -- Please don't send me any Word- or Powerpoint-Attachments unless it's absolutely neccessary. - Send simply Text. See http://www.gnu.org/philosophy/no-word-attachments.html In a world without fences and walls nobody needs gates and windows. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Shortcut for System.out.println - ViM Java
Saluton Rashmi :) Rashmi r...@gmail.com dixit: I used imap as suggested previously, it works well because it also allows positioning the cursor to between the double quotes. You can do that with iabbr, too, but since the iabbr will be triggered mostly using Space (I mean, soutSpace) you will end up with an space between the , which may or may not be what you want. The imap is better in that sense. to a new file created under C:\Program Files\Vim\vimfiles\ftplugin\java.vim the mapping gets set each time ViM is started, so I don't have to set the mapping each time. I got this tip from: http://vim.wikia.com/wiki/VimTip1510 (Keep your vimrc file clean) I don't know about Windows, but in UNIX you can put that in .vim/after/ftplugin/java.vim, just in case you need to. I made a newbie mistake by sending this message twice once to vim_use@googlegroups.com and once to v...@vim.org thinking it might not have reached, so sorry about that. Don't worry about that, it's a normal mistake. On the other hand, please bottom post on this list, quote a small (relevant) part of the message you are replying to, and put your text underneath. See the list guidelines: http://groups.google.com/group/vim_use/web/vim-information Thanks :) -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Mapping does not work
J.A.J. Pater wrote: One way or another a mapping I'm trying to implement doesn't work. I'm trying to paste with CTRL-V only in insert mode and keep using CTRL-V for visual in other modes. In my .vimrc I've got: imap C-V +gP The only thing I get when pushing CTRL-V in insert mode is the literal text +gP But not the desired effect: pasting. I tried with inoremap also, but to no avail. What could be wrong? The imap takes effect during insert mode; it does not, by itself, change modes. In other words, the +gP is acting like keys that you type. Obviously, what you want is what +gP does in normal mode; hence, your imap needs to leave insert mode and enter normal mode. Turns out there's a convenient one-shot insert-mode command for that (ctrl-o): imap c-v c-o+gP Regards, Chip Campbell --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Mapping does not work
meino.cra...@gmx.de schreef: I'm trying to paste with CTRL-V only in insert mode and keep using CTRL-V for visual in other modes. In my .vimrc I've got: imap C-V +gP The only thing I get when pushing CTRL-V in insert mode is the literal text +gP But not the desired effect: pasting. I tried with inoremap also, but to no avail. What could be wrong? Thanks meino, But now I just get the text: normal +gP Trying the command +gP in insert mode gives: gP (not the desired paste effect) Since I'm using gvim selecting +gP via the menu does work! I'm in the dark, so keep shooting, maybe we'll hit something. Adriaan --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Shortcut for System.out.println - ViM Java
On Friday 31 July 2009 12:52:19 Raúl Núñez de Arenas Coronado wrote: You can do that with iabbr, too, but since the iabbr will be triggered mostly using Space (I mean, soutSpace) you will end up with an space between the , which may or may not be what you want. The imap is better in that sense. unless you add the Eatchar function, as documented in :help iabbreviation by adding function! Eatchar(pat) let c = nr2char(getchar(0)) return (c =~ a:pat) ? '' : c endfunction to your .vimrc, and writing your iabbr like this: iabbrev ibt #!/usr/bin/tclshc-r=Eatchar('\s')cr then when you hit the space the string is inserted but not with a trailing space, but if you trigger it with Enter a carriage return is inserted sc --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
error setting up Vim on Mac
I'm trying to set Vim as the default application to open a file on the Mac. I can't, it says You cannot change the item foo.txt to always open in the selected application. The item is either locked or damaged or in a folder you don't have permission to change. (Error -43) I can open the file OK in TextEdit, and I can open Vim OK by itself. I've used Vim for years on the PC but I'm new to the Mac. Using vim 7.0.224, Mac OS 10.5.7. Thanks. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Shortcut for System.out.println - ViM Java
Saluton scott :) scott t...@swbell.net dixit: On Friday 31 July 2009 12:52:19 Raúl Núñez de Arenas Coronado wrote: You can do that with iabbr, too, but since the iabbr will be triggered mostly using Space (I mean, soutSpace) you will end up with an space between the , which may or may not be what you want. The imap is better in that sense. unless you add the Eatchar function, as documented in :help iabbreviation by adding function! Eatchar(pat) let c = nr2char(getchar(0)) return (c =~ a:pat) ? '' : c endfunction Yes! Thanks a lot for the advice, this is something I've always missed in the help for iabbr O:) Very useful, since most of the time I prefer iabbr over imap for certain things. -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Vim Tips wiki
The August edition of the Vim Tips Main Page is now available: http://vim.wikia.com/wiki/Main_Page The featured tip has some useful reminders about using marks (excellent for newcomers). If anyone is wondering about the somewhat strange description of the featured tip on the main page, it's a pitiful joke. Please fix any glitches you notice, or just add a comment at the bottom of a tip to note any problem or improvement (we do not use the talk pages (Discussion) for tips). John --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---