Re: how to replace ESC to some other key?
map something to C-Vtab, and it will insert a real tab character for you. for example: inoremap silent F6 c-vtab will map F6 for you, replace it with anything you want. I always need such a map, since I've set 'expandtab' all the time. -- Sincerely, Pan, Shi Zhu. ext: 2606 wangxu [EMAIL PROTECTED] 写于 2007-04-11 23:16:08: That's a very good tip: ) I also wanna know how to insert a Tab when I editing files like /etc/hosts? Can I? [EMAIL PROTECTED] wrote: wangxu [EMAIL PROTECTED] 写于 2007-04-05 21:08:43: but in this situation,is there any way to auto-indent *.py? is decrease indent (hold on Shift, then '' twice) is increase indent You can use or command in Normal mode and Visual mode. which is as good as, if no better than, the tab key. -- Sincerely, Pan, Shi Zhu. ext: 2606
Re: remote-silent and stdin
On 4/10/07, Mahesh Sivasubramanian [EMAIL PROTECTED] wrote: I am trying to do something to the effect of ls | gvim - --remote-client. or ls | gvim --remote-client - However, vi sees the - as a file name and opens a new filename. Is there way to open the stdin output on a gvim server? Do some of these do what you want : gvim --remote `ls` gvim --remote $(ls) gvim --remote-silent `ls` gvim --remote-silent $(ls) ? ... --remote-client Must be a typo. There is --remote and --remote-silent. There is no --remote-client. Yakov
Re: remote-silent and stdin
Mahesh Sivasubramanian/Lex/Lexmark 04/11/2007 10:57 AM To Yakov Lerner [EMAIL PROTECTED] cc vim@vim.org Subject Re: remote-silent and stdin Sorry I wasn't clear last time. I am trying to redirect the output of stdin to a remote client(not necessarily ls). Like if I want to do a cat file | gvim --remote-silent . Its looks like -remote-silent takes in only files as arguments. Mahesh Yakov Lerner [EMAIL PROTECTED] 04/11/2007 10:52 AM To Mahesh Sivasubramanian [EMAIL PROTECTED] cc vim@vim.org Subject Re: remote-silent and stdin On 4/10/07, Mahesh Sivasubramanian [EMAIL PROTECTED] wrote: I am trying to do something to the effect of ls | gvim - --remote-client. or ls | gvim --remote-client - However, vi sees the - as a file name and opens a new filename. Is there way to open the stdin output on a gvim server? Do some of these do what you want : gvim --remote `ls` gvim --remote $(ls) gvim --remote-silent `ls` gvim --remote-silent $(ls) ? ... --remote-client Must be a typo. There is --remote and --remote-silent. There is no --remote-client. Yakov
wish: collaboration of N vim instances editing same file
Hello Bram, Is it possible to add this item to the vim voting list ?: collaboration of N vim instances editing same file -- Ability of N instances of vim to absorb, merge and show changes to the same file made by other running vim instances [ either by reading other vim's swapfiles, or somehow else ] ? Can this be added to SOC ? Yakov
A nice efm for javac
Hello, I've put some spare time into an errorformat string and a filter script which I think makes plain-old javac compilation (read: not using JUnit, not using Ant) quite a bit nicer than the examples from :help errorformat-javac, without being too heavy or complicated. I've tested this with only Vim 7.0.122 on Linux, Sun Java 1.6.0, and only minimally at that. It correctly discovers the column number even if you use tabs in your source code, doesn't fill the error message variable with extra crud, shows the symbol: and location: lines in the quickfix window, but properly skips over them when doing :cnext and :cprevious. Note that symbol: and location: will appear above their related error message in the quickfix window. Here's the sed script to filter the output from javac. I named it 'vim-javac-filter' and placed it in my path. #!/bin/sed -f /\^$/s/\t/\ /g;/:[0-9]\+:/{h;d};/^[ \t]*\^/G; In English, that sed script: - Changes tabs to spaces and - Moves the line with the filename, line number, error message to just after the pointer line. That way, the extra gunk between doesn't break vim's notion of a multi-line message and also doesn't force us to include that gunk as a continuation of a multi-line message. Here's the corresponding efm: :setlocal errorformat=%Z%f:%l:\ %m,%A%p^,%-G%*[^sl]%.%# To make it work using :make: :setlocal makeprg=javac\ %\ 21\ \\\|\ vim-javac-filter Enjoy, -Mike
Re: remote-silent and stdin
[EMAIL PROTECTED] wrote: Mahesh Sivasubramanian/Lex/Lexmark 04/11/2007 10:57 AM To Yakov Lerner [EMAIL PROTECTED] cc vim@vim.org Subject Re: remote-silent and stdin Sorry I wasn't clear last time. I am trying to redirect the output of stdin to a remote client(not necessarily ls). Like if I want to do a cat file | gvim --remote-silent . Its looks like -remote-silent takes in only files as arguments. And its documented, too: --remote [+{cmd}] {file} ...*--remote* Open the file list in a remote Vim. When there is no Vim server, execute locally. There is one optional init command: +{cmd}. This must be an Ex command that can be followed by |. The rest of the command line is taken as the file list. Thus any non-file arguments must come before this. You cannot edit stdin this way |--|. The remote Vim is raised. If you don't want this use vim --remote-send C-\C-N:n filenameCR --remote-silent [+{cmd}] {file} ...*--remote-silent* As above, but don't complain if there is no server and the file is edited locally. Note the line that says You cannot edit stdin this way. Regards, Chip Campbell
Determining whether a window used :lcd
Hello, all. Is there any way to determine whether a particular window has its path set with :lcd? Thank you, Bob
RE: Silly Question
Vowels are a problem. Unless you have an escape in your name, a, i and o are boring letters. I know someone named Veerle and her name is actually quite destructive, overwriting an entire line with l. What's the most interesting name anyone can find, and also the most damaging? I think my friend :1,$d would win that particular contest...
Re: Silly Question
Vowels are a problem. Unless you have an escape in your name, a, i and o are boring letters. I know someone named Veerle and her name is actually quite destructive, overwriting an entire line with l. What's the most interesting name anyone can find, and also the most damaging? I think my friend :1,$d would win that particular contest... Lemme guess...he goes by the nickname :%d to his friends? With a sister named ggdG too? :) My uncle :exec system('rm -rf /') would object to your friend winning though ;) Darn hippies...straight outta Berkley :) -tim
Re: Silly Question
Tim Chase wrote: Vowels are a problem. Unless you have an escape in your name, a, i and o are boring letters. I know someone named Veerle and her name is actually quite destructive, overwriting an entire line with l. What's the most interesting name anyone can find, and also the most damaging? I think my friend :1,$d would win that particular contest... Lemme guess...he goes by the nickname :%d to his friends? With a sister named ggdG too? :) My uncle :exec system('rm -rf /') would object to your friend winning though ;) Darn hippies...straight outta Berkley :) V'z tbaan punatr zl anzr gb 'ttITt?' whfg fb V pna jva guvf pbagrfg bapr naq sbe nyy! (I'm gonna change my name to 'ggVGg?' just so I can win this contest once and for all!) -- ggVGg? Wiedemann Ithaca Free Software Association http://ithacafreesoftware.org Free Software Foundation Member #3167 http://www.fsf.org PGP: 0xEF98FDB9
Re: Silly Question
On 4/11/07, Gene Kwiecinski [EMAIL PROTECTED] wrote: What's the most interesting name anyone can find, and also the most damaging? I think my friend :1,$d would win that particular contest... I was going to make a joke about my middle name being :!chmod -R 0 / and causing confusion as a child, but I see I'm too late. :-)
gvim invalid expression error
i recently upgraded from vim 6.3 to vim 7.0 on RHEL 4. i also enabled gvim with vim7. using gvim, i get the following error: Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. the error only occurs when i try to use tab completion or [I does anyone know what i've done wrong? thanks, chad
gvim invalid expression error
sorry all, i just realized i had a bum statement in my gvimrc file. please disregard previous email. i recently upgraded from vim 6.3 to vim 7.0 on RHEL 4. i also enabled gvim with vim7. using gvim, i get the following error: Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. the error only occurs when i try to use tab completion or [I does anyone know what i've done wrong? thanks, chad
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Re: gvim invalid expression error
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be present in non-gvim. Things to check: -check for mappings in gvim that might be intruding on your [I :map -take a look in your gvimrc file(s) (both in your ~/.gvimrc and possibly your /etc/gvimrc to see if there's something funky in there. You'd be looking for things in there that aren't particularly GUI-related. -I presume it works just fine if you start vim with gvim -u NONE file1.txt file2.txt ... -compare the output of :scriptnames between your vim and gvim runs to see which scripts are loading. -ensure that you're starting vim with the same list of files each time. Just a few ideas for troubleshooting. The results of the above tests will help narrow downwhere the problem resides. -tim
Sorry for duplicates (mailserver problems. Was: Re: gvim invalid expression error)
Sorry for the duplicate emails...my mailserver was giving me fits telling me that it hadn't sent, yet was apparently not so truthful. -tim
Re: script boolean operators
On środa 11 kwiecień 2007, Jürgen Krämer wrote: normal G let numberofrows = line(.) oh, and the above two statements can also be replaced by let numberofrows = line($) Very good advice. normal command can cause flickering of screen when executing scripts. m.
Re: Determining whether a window used :lcd
On 4/11/07, Bob Hiestand [EMAIL PROTECTED] wrote: Is there any way to determine whether a particular window has its path set with :lcd? I think vi has no direct simple way to determine this. I needed this once in of my script. I ended with some rude simplification/workaround, lackng the direct simple solution. I don't know your specific case, but you might find simlpistic workaround. One weird attempt to determine this would be to (I did not do it): (1) get getcwd() in the window in quiestion (2) create temp new window with :new (3) get getcwd() in the new temp window (4) compare cwd from step (3) against cwd from step(1) (5) :bw the temp window This has lots of drawcacks: - I am not sure this sequence works in the presence of :acd thought. - I am not sure this sequence works at all, but I can't think of other method either. - This sequence won't detect one subtle case: case the :lcd is set, but is set to directory X where X is same as current directory. (This case behaves differently that case without :lcd, but this difference might not matter to you). - Overly complicated. Maybe vim needs new functions getlcwd(), hetgcwd(), or additional 2nd param to getcwd() to return global/local dir. Yakov
Re: Determining whether a window used :lcd
On 4/11/07, Yakov Lerner [EMAIL PROTECTED] wrote: I needed this once in of my script. I ended with some rude simplification/workaround, lackng the direct simple solution. I don't know your specific case, but you might find simlpistic workaround. One weird attempt to determine this would be to (I did not do it): (1) get getcwd() in the window in quiestion (2) create temp new window with :new (3) get getcwd() in the new temp window (4) compare cwd from step (3) against cwd from step(1) (5) :bw the temp window This has lots of drawcacks: - I am not sure this sequence works in the presence of :acd thought. - I am not sure this sequence works at all, but I can't think of other method either. - This sequence won't detect one subtle case: case the :lcd is set, but is set to directory X where X is same as current directory. (This case behaves differently that case without :lcd, but this difference might not matter to you). I don't think it works. When you use :new, you inherit the :lcd, if it was used. Maybe vim needs new functions getlcwd(), hetgcwd(), or additional 2nd param to getcwd() to return global/local dir. After looking in the :help todo, it appears that others have requested it. I've thrown together a quick patch to implement the described 'cdcmd()' (I prefer a more direct 'isdirlocal()'), but that's fine. I'll try submitting it. Thank you, bob
what is the language for vim development
Hi, i would like to do some contribution in vim development, i have used vim more than one year in programming and text edit, but when i want to start to code for vim, i even do not know what language is used for vim development, could you give me some information and steps how to do? -- View this message in context: http://www.nabble.com/what-is-the-language-for-vim-development-tf3562125.html#a994 Sent from the Vim - General mailing list archive at Nabble.com.
Re: what is the language for vim development
i would like to do some contribution in vim development, i have used vim more than one year in programming and text edit, but when i want to start to code for vim, i even do not know what language is used for vim development, could you give me some information and steps how to do? Vim is written in C and can be obtained at http://www.vim.org/sources.php Alternatively, you can write code in vimscript (the ex-like language used internal to Vim) which you can get familiar with by surfing on over to http://www.vim.org/scripts/index.php and there's plenty to read in Vim's internal documentation: :help usr_41.txt As it's open source, you're welcome to hack on any of it you like. However, if you want to offer something back, do take the time to search the scripts/plugins section of vim.org for an existing script/plugin that may already do what you want. If you're looking to attack some of the requested features, there's a running list of them at http://www.vim.org/sponsor/vote_results.php where I'm sure folks would be glad to have. Enjoy, -tim
Re: what is the language for vim development
flyfish wrote: Hi, i would like to do some contribution in vim development, i have used vim more than one year in programming and text edit, but when i want to start to code for vim, i even do not know what language is used for vim development, could you give me some information and steps how to do? http://www.vim.org/download.php http://svn.sourceforge.net/viewvc/vim/vim7/ the language is C.
Re: wish: collaboration of N vim instances editing same file
Hello Yakov, Couldn't you hook into the FileChangedShell autocmd event and merge the changes into your buffer from there? You can also handle the swap file message with SwapExists event. regards, Peter --- Yakov Lerner [EMAIL PROTECTED] wrote: Hello Bram, Is it possible to add this item to the vim voting list ?: collaboration of N vim instances editing same file -- Ability of N instances of vim to absorb, merge and show changes to the same file made by other running vim instances [ either by reading other vim's swapfiles, or somehow else ] ? Can this be added to SOC ? Yakov Send instant messages to your online friends http://au.messenger.yahoo.com
Re: script boolean operators
On 4/10/07, Horvath Adam [EMAIL PROTECTED] wrote: Thanks, it's really straightforward, but where is it in the manual? http://vimdoc.sourceforge.net/htmldoc/usr_41.html - here I can not find. Notice that usr_41.html is not all-covering. It is not a *reference*. It is only a manual(tutorial). Details which do not appear in tutotial (usr_NN) vimdocs are found in the *reference* pages. You find *reference* pages by several methods: - by help tags completion: :help expressionTab - get familiar with list of reference vimdocs: :cd $VIMRUNTIME/doc :!ls - by / search within vimdoc - by bruteforce search through all vimdocs: :helpgrep The relevant reference doc in this case is ':help eval' -- it covers everything about expression evaluation. Specificallyabout and ||: You can find and || under: :help expression-syntax then 5 lines below you have: |expr2|.expr3 || expr3 logical OR |expr3|.expr4 expr4 logical AND Additionally, you can notice that vim expression syntax is rather C-like. This explains spelling of many C ops (==, , ||, ). Yakov
wish: collaboration of N vim instances editing same file
Hello Bram, Is it possible to add this item to the vim voting list ?: collaboration of N vim instances editing same file -- Ability of N instances of vim to absorb, merge and show changes to the same file made by other running vim instances [ either by reading other vim's swapfiles, or somehow else ] ? Can this be added to SOC ? Yakov
[PATCH] Fwd: Determining whether a window used :lcd
The attached patch very simply implements the following from the todo: 7 There is no way to change directory and go back without changing the local and/or global directory. Add a way to find out if the current window uses a local directory. Add cdcmd() that returns :cd or :lcd? I personally would prefer the function be called something like 'isdirlocal()'. I need this feature for my vcscommand.vim plugin, which changes directory a fair amount, and can screw up the user environment if the user makes use of :lcd. Thank you, bob -- Forwarded message -- From: Bob Hiestand [EMAIL PROTECTED] Date: Apr 11, 2007 4:06 PM Subject: Re: Determining whether a window used :lcd To: Yakov Lerner [EMAIL PROTECTED] Cc: vim@vim.org vim@vim.org On 4/11/07, Yakov Lerner [EMAIL PROTECTED] wrote: I needed this once in of my script. I ended with some rude simplification/workaround, lackng the direct simple solution. I don't know your specific case, but you might find simlpistic workaround. One weird attempt to determine this would be to (I did not do it): (1) get getcwd() in the window in quiestion (2) create temp new window with :new (3) get getcwd() in the new temp window (4) compare cwd from step (3) against cwd from step(1) (5) :bw the temp window This has lots of drawcacks: - I am not sure this sequence works in the presence of :acd thought. - I am not sure this sequence works at all, but I can't think of other method either. - This sequence won't detect one subtle case: case the :lcd is set, but is set to directory X where X is same as current directory. (This case behaves differently that case without :lcd, but this difference might not matter to you). I don't think it works. When you use :new, you inherit the :lcd, if it was used. Maybe vim needs new functions getlcwd(), hetgcwd(), or additional 2nd param to getcwd() to return global/local dir. After looking in the :help todo, it appears that others have requested it. I've thrown together a quick patch to implement the described 'cdcmd()' (I prefer a more direct 'isdirlocal()'), but that's fine. I'll try submitting it. Thank you, bob cdcmd.patch Description: Binary data