Advanced vimrc? question

2013-09-10 Thread Gabor Urban
Hi
I have a problem which is not a top priority issue, but quite annoying for
me.

I use different indention depth with different types of sources. It is
rather time consuming to set it manually. Is there a possibility to defined
these values to file extensions?

Thanks for any ideas,

Gabor
-- 
Urbán Gábor

Linux is like a wigwam: no Gates, no Windows and an Apache inside.

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Highlighting() breaks quickfix

2013-09-10 Thread Matěj Cepl
Hi,

I like and use Highlighting() from
http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches

 Smart Enter for highlighting
let g:highlighting = 0
function! Highlighting()
  if g:highlighting == 1  @/ =~ '^\\'.expand('cword').'\\$'
let g:highlighting = 0
return :silent nohlsearch\CR
  endif
  let @/ = '\'.expand('cword').'\'
  let g:highlighting = 1
  return :silent set hlsearch\CR
endfunction
nnoremap silent expr CR Highlighting()

 remove highlighting
:nnoremap silent Space :nohlsearchBar:echoCR

Unfortunately, it breaks quickfix; after pressing CR in the quickfix
window, nothing happens.

I have tried to counter this problem by adding

  if buftype == quickfix
  return 'execute normal! CR'
  endif

to the start of the function, but then I get an error message
complaining that the quickfix window is not modifiable. So, I guess

normal! CR

is not the proper thing to say in the quickfix window. What is? How can
I make this function not break quickfix?

Thank you for any suggestions,

Matěj Cepl
-- 
http://www.ceplovi.cz/matej/, Jabber: mc...@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC

They that can give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review
   of Pennsylvania, 1759.





signature.asc
Description: OpenPGP digital signature


Re: Highlighting() breaks quickfix

2013-09-10 Thread Ben Fritz
On Tuesday, September 10, 2013 2:35:29 AM UTC-5, Matěj Cepl wrote:
 
 normal! CR
 
 
 
 is not the proper thing to say in the quickfix window. What is? How can
 

That's not the proper syntax anywhere. This means to do 4 keystrokes in normal 
mode:

 - indent left
C - change to end of line
R - insert text R followed by 

You probably wanted 'normal! ^M' (where ^M is a literal carriage return 
character, obtained by typing CTRL+V followed by enter in insert mode), or 
'execute normal! \CR' to use the special key syntax within a string.

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Advanced vimrc? question

2013-09-10 Thread David Fishburn
...
 I use different indention depth with different types of sources. It

  is rather time consuming to set it manually. Is there a possibility
  to defined these values to file extensions?
 
  Have you tried autocmds? eg
  autocmd FileType python setlocal shiftwidth=4
  autocmd FileType ruby setlocal shiftwidth=2

 It's probably cleaner to add a vim file in your indent directory
 (python.vim, ruby.vim, etc.) and let filetype detection load it
 automatically.


That would imply you are re-writing the indent scripts.

This is typically where you would use the _after_ directories.

For windows:
vimfiles\after

Linux:
.vim/after

In my case, I didn't like the indent settings for PHP and XML, so I created:

after/indent/php.vim
after/indent/xml.vim

These both had 1 line in them:
setlocal shiftwidth=2

That way, each time you set the filetype, after everything runs as usual,
the after directory fires and allows me to automatically change the
shiftwidth (for xml above) to 2, from whatever it was.

HTH,
David

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Advanced vimrc? question

2013-09-10 Thread David Fishburn
...In my case, I didn't like the indent settings for PHP and XML, so I
created:


 after/indent/php.vim
 after/indent/xml.vim


Oops, I meant:
after/ftplugin/php.vim
after/ftplugin/xml.vim

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


RE: Advanced vimrc? question

2013-09-10 Thread John Beckett
Gabor Urban wrote:
 I use different indention depth with different types of
 sources. It is rather time consuming to set it manually.
 Is there a possibility to defined these values to file
 extensions?

See Different settings for different file types:
http://vim.wikia.com/wiki/Indenting_source_code

John


-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Delete lines matching expression?

2013-09-10 Thread Chris Lott
 For example, replace all lines containing test to nottest:
 :%s/test/nottest/c
  Instead, is there some way to delete all lines containing test, with
 confirmation?

Not sure about the confirmation step. This kind of things works for
the deleting of lines matching a pattern test:

:%g/test/d

c
--
Chris Lott ch...@chrislott.org

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Delete lines matching expression?

2013-09-10 Thread Ven Tadipatri
Is there a command similar to :%s that would delete lines?
For example, replace all lines containing test to nottest:
:%s/test/nottest/c
 Instead, is there some way to delete all lines containing test, with
confirmation?
:%(something else)/test/c

Thanks,
Ven

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


editing zone files but errors on RP records

2013-09-10 Thread Nnaemeka David
While editing some dns zone data files, I found that vim reports errors in some 
RP (Responsible person) type records. I wonder why it should be doing so and 
not report errors for any other type. By the way, syntax is on. 

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Delete lines matching expression?

2013-09-10 Thread Tim Chase
On 2013-09-10 07:21, Chris Lott wrote:
  For example, replace all lines containing test to nottest:
  :%s/test/nottest/c
   Instead, is there some way to delete all lines containing test,
  with confirmation?
 
 Not sure about the confirmation step. This kind of things works for
 the deleting of lines matching a pattern test:
 
 :%g/test/d

If you do need confirmation, you can do

  :%s/.*test.*\n//\c

If you don't need confirmation, Chris gave the standard solution,
except that the % is optional since :g defaults to the whole file.

For the record, the :g command can be inverted to delete every line
that *doesn't* match test by using

  :v/test/d

-tim




-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: appending more text to a macro definition

2013-09-10 Thread Ben Fritz
On Tuesday, September 10, 2013 12:02:45 PM UTC-5, Nnaemeka David wrote:
 How do I append more text to a recorded macro?

I assume you're talking about recording macros with the 'q' command in normal 
mode, for example:

qqAhello!Escq to record a macro in register 'q' that puts hello! at the end 
of a line.

To append more commands to the same macro, just record into the same register, 
but use a capital letter. This is documented at :help q

Continuing our example,

qQi worldEscq

will modify the macro in 'q' to instead write hello world! at the end of the 
line.

 the macro contains only one line but when the text is appended, or commands, 
 the macro will extend to three lines. 

You've lost me now, however. How did you append text to the macro, if not using 
the capital letter as I detail above? What do you mean by lines in the 
recorded macro?

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Which version of Ruby should I use with Vim 7.4?

2013-09-10 Thread Oskar Kvist
Hi!

I'm having trouble getting Ruby to work (need it for the LustyJuggler plugin) 
with Vim 7.4. If I look in the gvim.exe file, it references 
msvcrt-ruby192.dll, but even the latest ruby 1.9.3 has msvcrt-ruby191.dll in 
it. I tried renaming that to msvcrt-ruby192.dll but it didn't work (results in 
a LoadError: Incompatible library version), not renaming the dll does not 
work either, has('ruby') == 0 then.

I'm searched for answers to this question, but to my surprise I could not find 
anything.

I'm on Windows by the way, maybe that has something to do with it.

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: editing zone files but errors on RP records

2013-09-10 Thread Charles Campbell

Nnaemeka David wrote:

While editing some dns zone data files, I found that vim reports errors in some 
RP (Responsible person) type records. I wonder why it should be doing so and 
not report errors for any other type. By the way, syntax is on.

I advice bring this up with bindzone's maintainer (dns merely includes 
bindzone).  You'll find his email in the bindzone syntax file.


Regards,
C Campbell

--
--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups vim_use group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Which version of Ruby should I use with Vim 7.4?

2013-09-10 Thread Tony Mechelynck

On 11/09/13 00:14, Oskar Kvist wrote:

Hi!

I'm having trouble getting Ruby to work (need it for the LustyJuggler plugin) with Vim 7.4. If I 
look in the gvim.exe file, it references msvcrt-ruby192.dll, but even the latest ruby 
1.9.3 has msvcrt-ruby191.dll in it. I tried renaming that to msvcrt-ruby192.dll but it didn't work 
(results in a LoadError: Incompatible library version), not renaming the dll does not 
work either, has('ruby') == 0 then.

I'm searched for answers to this question, but to my surprise I could not find 
anything.

I'm on Windows by the way, maybe that has something to do with it.



Vim without Cream has, alas, not yet got beyond 7.3.829; it hasn't 
changed since 20 February. If you want to use it anyway, you need Ruby 
1.9.1.


I'm surprised that your Ruby 1.9.3 has a ruby191.dll with it. If your 
gvim version needs a msvcrt-ruby192.dll, I would expect it to have been 
compiled for Ruby 1.9.2. You can check that by starting it and checking 
the bottom half of the output of the :version command: you'll probably 
see there a number of Ruby-related compiler and linker defines.


If you compile Vim yourself (on any OS), you can compile it for (almost) 
any Ruby version, but you need to make sure that there is no mismatch 
between your Ruby version and what Vim expects. On Linux this would be 
simply a matter of having the right development packages installed 
(and configure would mostly do the right thing), but on Windows you have 
to tell the make program which Ruby version you have installed; how to 
do that may vary according to which compiler (and makefile) you are 
using. Check the text of your src/make_{something}.mak (where 
{something} varies according to your compiler): you ought to be able to 
find there which make command-line switch (or environment variable) you 
need to set, and to what, as a function of your installed Ruby package. 
Usually there is a default value, which may or may not be the version 
installed on your system.



Best regards,
Tony.
--
Gentlemen of the jury, said the defense attorney, now beginning
to warm to his summation, the real question here before you is, shall this
beautiful young woman be forced to languish away her loveliest years in a
dark prison cell?  Or shall she be set free to return to her cozy little
apartment at 4134 Mountain Ave. -- there to spend her lonely, loveless hours
in her boudoir, lying beside her little Princess phone, 962-7873?

--
--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups vim_use group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


appending more text to a macro definition

2013-09-10 Thread Nnaemeka David
How do I append more text to a recorded macro?
the macro contains only one line but when the text is appended, or commands, 
the macro will extend to three lines. 
thanks

-- 
-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_use group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.