Re: Remembering syntax when moving in and out of buffers

2011-09-27 Thread Spiros Bousbouras
On Sep 25, 5:48 pm, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 25/09/11 17:35, Spiros Bousbouras wrote: On Sep 21, 7:38 pm, Benjamin R. Haskellv...@benizi.com wrote: On Wed, 21 Sep 2011, Spiros Bousbouras wrote: On Sep 18, 11:14 pm, Benjamin R. Haskell wrote: I wasn't trying

Re: Remembering syntax when moving in and out of buffers

2011-09-27 Thread Spiros Bousbouras
On Sep 25, 6:09 pm, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 25/09/11 18:48, Tony Mechelynck wrote: On 25/09/11 17:35, Spiros Bousbouras wrote: I also don't like how the functionality for one type of file is split among several directories which will in general also contain

Re: Remembering syntax when moving in and out of buffers

2011-09-27 Thread Spiros Bousbouras
On Sep 25, 8:42 pm, Benjamin R. Haskell v...@benizi.com wrote: On Sun, 25 Sep 2011, Spiros Bousbouras wrote: On Sep 21, 7:38 pm, Benjamin R. Haskell wrote: On Wed, 21 Sep 2011, Spiros Bousbouras wrote: On Sep 18, 11:14 pm, Benjamin R. Haskell wrote: 2. If you disable filetype- and syntax

Re: Remembering syntax when moving in and out of buffers

2011-09-25 Thread Spiros Bousbouras
On Sep 21, 7:38 pm, Benjamin R. Haskell v...@benizi.com wrote: On Wed, 21 Sep 2011, Spiros Bousbouras wrote: On Sep 18, 11:14 pm, Benjamin R. Haskell wrote: Actually I have disabled running the Debian specific stuff in /etc/vim/vimrc so the explanation even for what I describe in my

Re: Setting the bold attribute for Normal text

2011-09-21 Thread Spiros Bousbouras
On Sep 18, 6:48 pm, Spiros Bousbouras spi...@gmail.com wrote: I wasn't trying to mix foreground colours and bold , I only want bold. I guess my last post wasn't clear enough but what I meant was that I start vim with an unnamed buffer not belonging to any specific filetype , I type some

Re: Using :let to view a wildcard of variables

2011-09-21 Thread Spiros Bousbouras
On Sep 18, 9:43 pm, ZyX zyx@gmail.com wrote: In reply to ``Re: Using :let to view a wildcard of variables'' sent 18 September 2011, Sunday by Spiros Bousbouras Why are you using a dictionary ? Why not simply write ... 1. let val=function('tr') 2. let val=0 let val=[] 3. function

Re: Remembering syntax when moving in and out of buffers

2011-09-21 Thread Spiros Bousbouras
On Sep 18, 11:14 pm, Benjamin R. Haskell v...@benizi.com wrote: On Sun, 18 Sep 2011, Spiros Bousbouras wrote: On Sep 18, 5:45 pm, Benjamin R. Haskell wrote: On Sun, 18 Sep 2011, Spiros Bousbouras wrote: The problem is that the filetype is being detected again every time you switch

Re: Remembering syntax when moving in and out of buffers

2011-09-18 Thread Spiros Bousbouras
On Sep 17, 10:25 pm, Benjamin R. Haskell v...@benizi.com wrote: On Sat, 17 Sep 2011, Spiros Bousbouras wrote: If you define a syntax for a buffer , move away and then return is the syntax remembered or do all the syntax commands have to be executed again? Some tests I did indicate it's

Re: Setting the bold attribute for Normal text

2011-09-18 Thread Spiros Bousbouras
On Sep 18, 3:59 pm, Ben Fritz fritzophre...@gmail.com wrote: On Sep 18, 9:40 am, Spiros Bousbouras spi...@gmail.com wrote: I start a buffer not belonging to any specific filetype. I type some random stuff and then do :highlight Normal ctermfg=green I get green letters. But if instead I

Re: Remembering syntax when moving in and out of buffers

2011-09-18 Thread Spiros Bousbouras
On Sep 18, 5:45 pm, Benjamin R. Haskell v...@benizi.com wrote: On Sun, 18 Sep 2011, Spiros Bousbouras wrote: The problem is that the filetype is being detected again every time you switch buffers. Apparently Debian (like most distros) has a bunch of auto-detection on filetypes. With your

Re: Using :let to view a wildcard of variables

2011-09-18 Thread Spiros Bousbouras
On Sep 18, 10:25 am, ZyX zyx@gmail.com wrote: In reply to ``Using :let to view a wildcard of variables'' sent 17 September 2011, Saturday by David Fishburn Will display all variables currently defined in Vim. One thing I have always wanted to do is: :let my_prefix.* let d={}

Re: Setting the bold attribute for Normal text

2011-09-18 Thread Spiros Bousbouras
On Sep 18, 8:44 pm, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 18/09/11 16:40, Spiros Bousbouras wrote: I start a buffer not belonging to any specific filetype. I type some random stuff and then do :highlight Normal ctermfg=green I get green letters. But if instead I do

Remembering syntax when moving in and out of buffers

2011-09-17 Thread Spiros Bousbouras
If you define a syntax for a buffer , move away and then return is the syntax remembered or do all the syntax commands have to be executed again? Some tests I did indicate it's the latter. Specifically (with simplifications) my .vimrc (on Linux) has autocmd BufReadPost,BufNewFile *.myfile

Re: Abbreviations and key mappings

2011-09-12 Thread Spiros Bousbouras
On Sep 11, 9:58 am, ZyX zyx@gmail.com wrote: If you use eval(''.escape(maparg(...), '\').'') instead of substitute() it will be more reliable and you still won't have to use :imap. Great. I was wondering whether there is a way to go from things like 'NL' to the actual character

Re: Abbreviations and key mappings

2011-09-12 Thread Spiros Bousbouras
On Sep 12, 4:09 pm, Ben Fritz fritzophre...@gmail.com wrote: On Sep 11, 1:16 am, Spiros Bousbouras spi...@gmail.com wrote: :iabbrev CUC NLcucumber :inoremap C-y CUCspace But when I press Ctrl-y I get 'CUC ' i.e. the CUC does not get expanded. I tried :inoremap C-y CUCEsc

Re: yank inner word

2011-09-12 Thread Spiros Bousbouras
On Sep 12, 3:40 pm, Ben Fritz fritzophre...@gmail.com wrote: Yikes! Text-objects are way more useful without using visual mode, Ok , I'm convinced text objects are wonderful. Is there a way to get the line range covered by a text object to be used in user defined commands ? I can see that you

Abbreviations and key mappings

2011-09-11 Thread Spiros Bousbouras
:iabbrev CUC NLcucumber :inoremap C-y CUCspace But when I press Ctrl-y I get 'CUC ' i.e. the CUC does not get expanded. I tried :inoremap C-y CUCEsc and :inoremap C-y CUCC-] but no dice. Then I tried :inoremap C-y CUCESCBgd$aC-r=maparg(@g , i , 1)CR which does expand the abbreviation but it

Re: yank inner word

2011-09-11 Thread Spiros Bousbouras
On Sep 11, 4:22 am, Javier Rojas wrote: :help iw most, if not all core Vim operations let you use a motion or region; you can use any motion with, e.g., the (y)ank operation. Thanks. I don't believe I had ever come across the iw motion command before. -- You received this message from the

Re: Abbreviations and key mappings

2011-09-11 Thread Spiros Bousbouras
On Sep 11, 8:42 am, ZyX zyx@gmail.com wrote: Reply to message Abbreviations and key mappings, sent 10:16:13 11 September 2011, Sunday by Spiros Bousbouras: :iabbrev CUC NLcucumber :inoremap C-y CUCspace But when I press Ctrl-y I get 'CUC ' i.e. the CUC does not get expanded. I

Re: Abbreviations and key mappings

2011-09-11 Thread Spiros Bousbouras
On Sep 11, 9:08 am, Spiros Bousbouras wrote: I presented a simplified version of what I want. I actually have several abbreviations and I want C-y to work with all of them. For example :iabbrev CUC NLcucumber :iabbrev TOM NLtomato CUCC-y where 'C-y' means pressing Ctrl-y , must insert

Re: gvim or vim in console...

2011-09-11 Thread Spiros Bousbouras
On Sep 11, 5:39 am, Kevin Tough ke...@toughlife.org wrote: I am just starting to learn vim. I use Fedora and would like to know whether most programmers use vim from the console or do they/you use gvim. I use both. I have a gvim window constantly open with several tabs of files I edit often

Re: yank inner word

2011-09-11 Thread Spiros Bousbouras
On Sep 11, 12:54 pm, Tim Chase v...@tim.thechases.com wrote: On 09/11/11 01:28, Spiros Bousbouras wrote: On Sep 11, 4:22 am, Javier Rojas wrote: :help iw Thanks. I don't believe I had ever come across the iw motion command before. Please do take the time to follow Tony's suggestion

yank inner word

2011-09-10 Thread Spiros Bousbouras
In file usr_24.txt under the vim documentation directory we read that yiw is for yank-inner-word. Where is this yank inner word functionality documented and how is it different from yw ? I tried every help search I could think might be relevant but nowhere is yiw defined. -- You received this

Re: Puzzling error message after a throw

2011-05-17 Thread Spiros Bousbouras
On May 17, 12:36 am, Étienne Faure tinou...@gmail.com wrote: On Mon, May 16, 2011 at 23:51, Spiros Bousbouras spi...@gmail.com wrote: function! Foo() throw 0 endfunction if 1 call Foo() endif When I execute the above script I get E605: Exception not caught: 0

Puzzling error message after a throw

2011-05-16 Thread Spiros Bousbouras
function! Foo() throw 0 endfunction if 1 call Foo() endif When I execute the above script I get E605: Exception not caught: 0 [...] line6: E171: Missing :endif Is the error about the endif a bug ? In a complicated script it could send someone on a wild goose chase when

Re: Inserting output of Ex command into buffer

2011-04-13 Thread Spiros Bousbouras
On Apr 10, 11:39 pm, Spiros Bousbouras spi...@gmail.com wrote: On Apr 9, 6:29 pm, Tim Chase v...@tim.thechases.com wrote: On 04/09/2011 12:11 PM, Spiros Bousbouras wrote: How can you insert the output of an Ex command into the buffer at the place where the cursor is ? Say for example

Re: Inserting output of Ex command into buffer

2011-04-13 Thread Spiros Bousbouras
On Apr 13, 3:53 pm, Tim Chase v...@tim.thechases.com wrote: While this works for expressions (the followup question about echo 25*47), it doesn't satisfy the OP's request for arbitrary Ex commands. Assuming the commands to be executed don't include redirs and there's not a redir already in

Re: Inserting output of Ex command into buffer

2011-04-13 Thread Spiros Bousbouras
On Apr 13, 5:08 pm, Spiros Bousbouras spi...@gmail.com wrote: On Apr 13, 3:53 pm, Tim Chase v...@tim.thechases.com wrote: While this works for expressions (the followup question about echo 25*47), it doesn't satisfy the OP's request for arbitrary Ex commands. Assuming the commands

Re: Inserting output of Ex command into buffer

2011-04-12 Thread Spiros Bousbouras
On Apr 10, 7:47 pm, Tim Chase v...@tim.thechases.com wrote: On 04/10/2011 05:39 PM, Spiros Bousbouras wrote: On Apr 9, 6:29 pm, Tim Chase v...@tim.thechases.com wrote: On 04/09/2011 12:11 PM, Spiros Bousbouras wrote: How can you insert the output of an Ex command into the buffer

Re: Inserting output of Ex command into buffer

2011-04-10 Thread Spiros Bousbouras
On Apr 9, 6:29 pm, Tim Chase v...@tim.thechases.com wrote: On 04/09/2011 12:11 PM, Spiros Bousbouras wrote: How can you insert the output of an Ex command into the buffer at the place where the cursor is ? Say for example in the 1st line here I want to insert right after you the output

Inserting output of Ex command into buffer

2011-04-09 Thread Spiros Bousbouras
How can you insert the output of an Ex command into the buffer at the place where the cursor is ? Say for example in the 1st line here I want to insert right after you the output of :chdir .So I place the cursor after you and then do what ? -- You received this message from the vim_use

Backwards searches and the ? operator

2011-04-03 Thread Spiros Bousbouras
I've just had some very frustrating minutes trying to figure out why searching with a pattern which I felt should work wasn't actually working. After trying this and that I decided eventually to look up \? in the help file and saw that it's not supposed to work with backwards searches. Does anyone

Re: Backwards searches and the ? operator

2011-04-03 Thread Spiros Bousbouras
On Apr 3, 7:02 pm, Tim Chase v...@tim.thechases.com wrote: On 04/03/2011 12:46 PM, Spiros Bousbouras wrote: I've just had some very frustrating minutes trying to figure out why searching with a pattern which I felt should work wasn't actually working. After trying this and that I decided

Setting alternate file name

2011-04-01 Thread Spiros Bousbouras
Is there a way to set the alternate file name by setting some variable or calling a function ? Or is the only way to actually switch to 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

Problems using value returned by external command

2011-04-01 Thread Spiros Bousbouras
The following on GNU/Linux with vim version 7.1 prompt cat myscript #!/bin/sh echo 1 prompt cat myscript.vim function! Check() let l:r = system(./myscript) if l:r == 1 echo Good else echo Length of l:r is strlen(l:r) echoerr l:r is l:r endif endfunction I

Re: Problems using value returned by external command

2011-04-01 Thread Spiros Bousbouras
On Apr 2, 4:52 am, Ben Schmidt mail_ben_schm...@yahoo.com.au wrote: On 2/04/11 12:57 PM, Spiros Bousbouras wrote: The following on GNU/Linux with vim version 7.1 prompt  cat myscript #!/bin/sh echo 1 prompt  cat myscript.vim function! Check()      let l:r = system(./myscript

vim leaves zombies behind , part 2

2011-03-24 Thread Spiros Bousbouras
This is a continuation of https://groups.google.com/group/vim_use/browse_thread/thread/1312b6962f9f0431 I have now switched to Debian GNU/Linux and my vim version is 7.1 If I do :!! some_executable the executable becomes a zombie after it terminates and remains a zombie until I exit vim. The

Syntax for function arguments

2009-04-02 Thread Spiros Bousbouras
function Foo(arg1 , arg2) echo Hello world ! endfunction When I try to source the above I get E475: Invalid argument: Foo(arg1 , arg2) If I change the first line to function Foo(arg1, arg2) it works fine. (If you can't see the difference between the two scroll below for the answer) So I was

Replacing a character in a string

2009-04-02 Thread Spiros Bousbouras
let s = 'qwerty' Let's say I want to replace the first character by Q. I thought the following would work let s[0] = 'Q' but it gives E689: Can only index a List or Dictionary So what is the simplest way to achieve such a task ? I know there is the substitute function but I wouldn't want to

Re: Replacing a character in a string

2009-04-02 Thread Spiros Bousbouras
On 2 Apr, 17:14, Maxim Kim haba...@gmail.com wrote: On 2 апр, 19:34, Spiros Bousbouras spi...@gmail.com wrote: let s = 'qwerty' Let's say I want to replace the first character by Q. I thought the following would work let s[0] = 'Q' but it gives E689: Can only index a List

Re: Creating a new undo block

2009-04-02 Thread Spiros Bousbouras
On 2 Apr, 13:35, Tobia Conforto tobia.confo...@gmail.com wrote: Spiros Bousbouras wrote: Anyone knows if it's possible to achieve the same effect from within a script ? Maybe you could try ending insert mode and entering it again? See :stopinsert and :startinsert Or you could send the c

Finding the length of a buffer in a script

2009-04-02 Thread Spiros Bousbouras
How can you find from within a script how many lines the current buffer has ? One solution is len(getbufline(bufname('%') , 1 , '$')) but this seems wasteful. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit

Re: Finding the length of a buffer in a script

2009-04-02 Thread Spiros Bousbouras
On 3 Apr, 00:02, John Beckett johnb.beck...@gmail.com wrote: Spiros Bousbouras wrote: How can you find from within a script how many lines the current buffer has ? :echo line('$') Great , thanks. --~--~-~--~~~---~--~~ You received this message from

Creating a new undo block

2009-04-01 Thread Spiros Bousbouras
function! Add_line() call append(0 , This is a new line) endfunction imap F1 ESC:call Add_line()CR The above script gets executed and now I am in Insert mode. I type a few characters and then press F1. As expected This is a new line is added at the top of the buffer. Now if I press 'u' it

Re: avoid losing undo capability when switching buffers?

2009-04-01 Thread Spiros Bousbouras
On 1 Apr, 16:56, Tim Chase v...@tim.thechases.com wrote: Reckoner wrote: when I have buffers open and I switch between them, I have noticed that I lose the ability to undo changes in these buffers. In other words, doing 'u' does not undo changes if that buffer has been switched out of