Re: Workspace concept ala TextPad

2007-03-02 Thread Eric Leenman



Hi Yegappan


[...]


Remove the ! before the let.

let file_names = input(Enter file name(s): , '', 'file')

- Yegappan


Thanks, it works

Rgds,
Eric

_
Win a Zune™—make MSN® your homepage for your chance to win! 
http://homepage.msn.com/zune?icid=hmetagline




Re: Workspace concept ala TextPad

2007-03-01 Thread Eric Leenman

Hi Yegappan,

I'm trying to do as you said:


In the prompt for adding a file to the workspace, you have to enter
the filename.
If you are using Vim7, you can make the attached change to the workspace
plugin to get filename completion at this prompt. With this change, you can
complete directory and filenames at the prompt.

- Yegappan

***
*** 521,527 
 let file_names = a:args

 if file_names == ''
! let file_names = input(Enter file name(s): )
 if file_names == ''
 return
 endif
--- 521,527 
 let file_names = a:args

 if file_names == ''
! let file_names = input(Enter file name(s): , '', 'file')
 if file_names == ''
 return
 endif



What I did:
I assume you mean line 521, 527.
But when I look at the workspace.vim file the line numbers doesn't line up 
with it.

Therefor I copied the whole function Ws_Add_Files
It is from line number 483--556

 Ws_Add_Files
 Add one or more files to the current group in the workspace
function! s:Ws_Add_Files(args, append)
Get the current group
   let lnum = line('.')
   let cmd = s:Ws_Get_Entry_Idx_By_Line('s:ws_entry_', lnum)
   if cmd == ''
 Add the new files at the end of the workgroup
   let prefix=s:ws_entry
let idx=
   endif

   exe cmd
   if {prefix}{idx}_type == 'group' || {prefix}{idx}_type == 'workspace'
Cursor is on a group name. Add the new file to this group
   let prefix = prefix . idx . '_'
   let idx = 0
   endif

   let file_names = a:args

   if file_names == ''
let file_names = input(Enter file name(s): )
   !let file_names = input(Enter file name(s): , '', 'file')
   if file_names == ''
   return
   endif
   endif

   let len = strlen(file_names)
   let start = 0
   let i = 0

   while start != -1  start  len
Skip whitespace characters
   if file_names[start] =~ '\s'
   let start = matchend(file_names, '\s\+', start)
   endif

   if file_names[start] == '
Single-quoted file name
   let pat = '[^']\\+'
   elseif file_names[start] == ''
Double-quoted file name
   let pat = '[^]\+'
   else
Unquoted filename
   let pat = '.\{-}[^\\]\(\s\|$\)'
   endif

Extract one filename
   let fnames = matchstr(file_names, pat, start)
let skip_pat = [' . ']\=\zs.\{-}\ze[' . ' . ']\=$'
   let fnames = matchstr(fnames, skip_pat)

   let start = matchend(file_names, pat, start)

   if fnames != ''
   let fnames = glob(fnames) . \n
   while fnames != ''
   let one_fname = strpart(fnames, 0, stridx(fnames, \n))
   if a:append
   call s:Ws_Add_File(prefix, {prefix}count, one_fname)
   else
   call s:Ws_Add_File(prefix, idx + i, one_fname)
   endif
   let i = i + 1
   let fnames = strpart(fnames, stridx(fnames, \n) + 1)
   endwhile
   endif
   endwhile

   call s:Ws_Refresh()
endfunction


When I do it, and try to add a file, it ends up with:

C:\Windows\system32\cmd.exe /c let file_names = input(Enter file name(s): 
, '', 'file')
'let' is not recognized as an internal or external command, operable program 
or batch file.

shell returned 1
Hit any key to close this window...


What am I doing wrong?

Best regards,
Eric

_
Don’t miss your chance to WIN 10 hours of private jet travel from Microsoft® 
Office Live http://clk.atdmt.com/MRT/go/mcrssaub0540002499mrt/direct/01/




Re: Workspace concept ala TextPad

2007-02-15 Thread Yegappan Lakshmanan

Hi Eric,

On 2/14/07, Eric Leenman [EMAIL PROTECTED] wrote:

Hi Yeggapan,

[...]
You can try using the workspace manager plugin:

http://vim.sourceforge.net/scripts/script.php?script_id=1410
[...]

I got it so far working.
One question.
When I give the command af(AddFile) in the filebuffer, the plugin comes
with
the message give file name (or something like that)
Do you then need to type the complete path (i.e.
C:\Projects\FPGA\VHDL\test.vhdl)
Or can you browse to it ?



In the prompt for adding a file to the workspace, you have to enter
the filename.
If you are using Vim7, you can make the attached change to the workspace
plugin to get filename completion at this prompt. With this change, you can
complete directory and filenames at the prompt.

- Yegappan

***
*** 521,527 
 let file_names = a:args

 if file_names == ''
! let file_names = input(Enter file name(s): )
 if file_names == ''
 return
 endif
--- 521,527 
 let file_names = a:args

 if file_names == ''
! let file_names = input(Enter file name(s): , '', 'file')
 if file_names == ''
 return
 endif


Re: Workspace concept ala TextPad

2007-02-14 Thread Eric Leenman

Hi Yeggapan,

[...]

You can try using the workspace manager plugin:

http://vim.sourceforge.net/scripts/script.php?script_id=1410

[...]

I got it so far working.
One question.
When I give the command af(AddFile) in the filebuffer, the plugin comes 
with

the message give file name (or something like that)
Do you then need to type the complete path (i.e. 
C:\Projects\FPGA\VHDL\test.vhdl)

Or can you browse to it ?

Rgds,
Eric

_
Laugh, share and connect with Windows Live Messenger 
http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=hmtagline




Re: Workspace concept ala TextPad

2007-02-08 Thread A.J.Mechelynck

Jürgen Krämer wrote:

Hi,

A.J.Mechelynck wrote:

Eric Leenman wrote:

I read on the script that I need to follow the 6 points mentioned.

[...]

What I did:
Download the zip file:
And stored
workspace.txt is stored in C:\Program Files\Vim\vimfiles\doc

   

workspace.vim C:\Program Files\Vim\vimfiles\plugin

  

Is this OK?
No. These directories are only for what comes bundled with Vim. You should not 
change anything there, because any upgrade (maybe tomorrow, maybe next year) 
may silently undo whatever changes you had made.


sorry to correct you, Tony, but I think you missed the vimfiles part of
those paths. C:\Program Files\Vim\vimfiles is used for system-wide
configuration files, not for files bundled with Vim.

[...]

Oops. Right. It's C:\Program Files\vim\vim70 (and its contents) that you 
shouldn't touch.


Best regards,
Tony.
--
Confession is good for the soul only in the sense that a tweed coat is
good for dandruff.
-- Peter de Vries



Re: Workspace concept ala TextPad

2007-02-07 Thread Eric Leenman

Hi Yegappan,


From: Yegappan Lakshmanan [EMAIL PROTECTED]
To: Eric Leenman [EMAIL PROTECTED]

[...]

You can try using the workspace manager plugin:
http://vim.sourceforge.net/scripts/script.php?script_id=1410
- Yegappan


I'm a simple VIM user.
That's why I ask many things on this mailing-group, which is very 
responsive.

Many times when I try to install very clever plugins I fail to do so.
Mainly because of the missing-Vim knowledge you guys have.

I decided to try it again and unfortantly failed again to follow the 
instructions.
If it's not too much of your time, could you please explain what I need to 
do following your 6 points.

If not thanks anyway.

I read on the script that I need to follow the 6 points mentioned.

[start of point 1]
1. Download the workspace.zip file and unzip the files to the $HOME/.vim or 
the $HOME/vimfiles or the $VIM/vimfiles directory. This should unzip the 
following two files (the directory structure should be preserved):


 plugin/workspace.vim - main workspace plugin file
 doc/workspace.txt- documentation (help) file

  Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath'
  Vim help pages for more details about installing Vim plugins.
[end of point 1]

What I did:
Download the zip file:
And stored
workspace.txt is stored in C:\Program Files\Vim\vimfiles\doc
workspace.vim C:\Program Files\Vim\vimfiles\plugin

Is this OK?
What is $HOME, how can I check this in VIM?
What is $VIM, how can I check this in VIM?
[start of point 2]
2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or
  $VIM/doc/vimfiles directory, start Vim and run the :helptags .
  command to process the workspace help file.
[end of point 2]

What I did:
I don't understand the first part. What is ment here?
I just started Vim and did typed:  :helptags .
Vim did do something, don't know what.

[start of point 3]
3. If you are running a terminal/console version of Vim and the terminal
   doesn't support changing the window width then set the
   'Ws_Inc_Winwidth' variable to 0 in the .vimrc file.
[end of point 3]

What I did:
I ignored this, as I'm running gvim on windows xp.

[start of point 4]
[end of point 4]

What I did:
As there isn't a point 4 I went to point 5

[start of point 5]
5. Restart Vim.
[end of point 5]

What I did:
I did close gvim and restarted it.


[start of point 6]
6. You can now use the :WsOpen filename command to open a
workspace. You can use the :help workspace command to get
more information about using the workspace plugin.
[end of point 6]

What I did:
I typed :help workspace
Vim replied: E149: Sorry, no help for workspace

Thanks for your time.
Best regards,
Eric Leenman

_
Turn searches into helpful donations. Make your search count. 
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donationFORM=WLMTAG




Re: Workspace concept ala TextPad

2007-02-07 Thread A.J.Mechelynck

Eric Leenman wrote:

Hi Yegappan,


From: Yegappan Lakshmanan [EMAIL PROTECTED]
To: Eric Leenman [EMAIL PROTECTED]

[...]

You can try using the workspace manager plugin:
http://vim.sourceforge.net/scripts/script.php?script_id=1410
- Yegappan


I'm a simple VIM user.
That's why I ask many things on this mailing-group, which is very 
responsive.

Many times when I try to install very clever plugins I fail to do so.
Mainly because of the missing-Vim knowledge you guys have.

I decided to try it again and unfortantly failed again to follow the 
instructions.
If it's not too much of your time, could you please explain what I need 
to do following your 6 points.

If not thanks anyway.

I read on the script that I need to follow the 6 points mentioned.

[start of point 1]
1. Download the workspace.zip file and unzip the files to the $HOME/.vim 
or the $HOME/vimfiles or the $VIM/vimfiles directory. This should unzip 
the following two files (the directory structure should be preserved):


 plugin/workspace.vim - main workspace plugin file
 doc/workspace.txt- documentation (help) file

  Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath'
  Vim help pages for more details about installing Vim plugins.
[end of point 1]

What I did:
Download the zip file:
And stored
workspace.txt is stored in C:\Program Files\Vim\vimfiles\doc
workspace.vim C:\Program Files\Vim\vimfiles\plugin

Is this OK?


No. These directories are only for what comes bundled with Vim. You should not 
change anything there, because any upgrade (maybe tomorrow, maybe next year) 
may silently undo whatever changes you had made.



What is $HOME, how can I check this in VIM?


:echo $HOME

$HOME is your home directory. It's also where your _vimrc (and _gvimrc if you 
use one) ought to be.



What is $VIM, how can I check this in VIM?


:echo $VIM

On your system, I expect $VIM to be the directory C:\Program Files\Vim


[start of point 2]
2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or
  $VIM/doc/vimfiles directory, start Vim and run the :helptags .
  command to process the workspace help file.
[end of point 2]


Now you know (as shown above) where $HOME is. cd to there (in the Dos Box) and 
do
dir
If there is no vimfiles subdir, then you should also do
md vimfiles
Then
cd vimfiles
dir
Is there a doc dubdirectory? If not,
md doc
This is where the helpfile sould go.
Is there (in what Vim calls $HOME/vimfiles) a plugin subdirectory? If not,
md plugin
That's where the .vim should go.
Then,
gvim
:helptags ~/vimfiles/doc
( ~ is an abbreviation for $HOME). After this :helpgrep command has finished 
running (and the cursor has gone back to the edit window and started blinking 
again),

:help workspace.txt
ought to bring you to the first page of help for the workspace plugin.



What I did:
I don't understand the first part. What is ment here?
I just started Vim and did typed:  :helptags .
Vim did do something, don't know what.


No prob. The instructions above should tell you how to do it.



[start of point 3]
3. If you are running a terminal/console version of Vim and the terminal
   doesn't support changing the window width then set the
   'Ws_Inc_Winwidth' variable to 0 in the .vimrc file.
[end of point 3]

What I did:
I ignored this, as I'm running gvim on windows xp.


That's right, it's not for gvim. However, you can provide for it by testing in 
your vimrc (there are versions of vim.exe for Windows, running in console 
mode, and if you want to run them full-screen they won't be resizable. Add


if ! has(gui_running)
let g:Ws_Inc_Winwidth = 0
endif

to your vimrc. This will be ignored by gvim, because in gvim, 
has(gui_running) is nonzero.




[start of point 4]
[end of point 4]

What I did:
As there isn't a point 4 I went to point 5


:-)



[start of point 5]
5. Restart Vim.
[end of point 5]

What I did:
I did close gvim and restarted it.


Right.




[start of point 6]
6. You can now use the :WsOpen filename command to open a
workspace. You can use the :help workspace command to get
more information about using the workspace plugin.
[end of point 6]

What I did:
I typed :help workspace
Vim replied: E149: Sorry, no help for workspace

Thanks for your time.
Best regards,
Eric Leenman


:help workspace.txt (as I showed above) or :help workspace (as shown here) 
ought to show the workspace help, one the tags file has been (re)generated (by 
:helptags) in the directory containing the workspace.txt helpfile.

:help :WsOpen
also ought to show you how to use the :WsOpen command, about which I know 
nothing.



Best regards,
Tony.
--
Yea, though I walk through the valley of the shadow of APL, I shall
fear no evil, for I can string six primitive monadic and dyadic
operators together.
-- Steve Higgins


Re: Workspace concept ala TextPad

2007-02-07 Thread Jürgen Krämer

Hi,

A.J.Mechelynck wrote:
 Eric Leenman wrote:

 I read on the script that I need to follow the 6 points mentioned.

 [start of point 1]
 1. Download the workspace.zip file and unzip the files to the $HOME/.vim 
 or the $HOME/vimfiles or the $VIM/vimfiles directory. This should unzip 
 the following two files (the directory structure should be preserved):

  plugin/workspace.vim - main workspace plugin file
  doc/workspace.txt- documentation (help) file

   Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath'
   Vim help pages for more details about installing Vim plugins.
 [end of point 1]

 What I did:
 Download the zip file:
 And stored
 workspace.txt is stored in C:\Program Files\Vim\vimfiles\doc
   
 workspace.vim C:\Program Files\Vim\vimfiles\plugin
  

 Is this OK?
 
 No. These directories are only for what comes bundled with Vim. You should 
 not 
 change anything there, because any upgrade (maybe tomorrow, maybe next year) 
 may silently undo whatever changes you had made.

sorry to correct you, Tony, but I think you missed the vimfiles part of
those paths. C:\Program Files\Vim\vimfiles is used for system-wide
configuration files, not for files bundled with Vim.

[snip]

 [start of point 2]
 2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or
   $VIM/doc/vimfiles directory, start Vim and run the :helptags .
  
Those directories are swapped -- it should have read $VIM/vimfiles/doc.

   command to process the workspace help file.
 [end of point 2]

An easier way to update the tags file is to just start Vim and enter

  :helptags $HOME/.vim/doc
  :helptags $HOME/vimfiles/doc

or

  :helptags $VIM/vimfiles/doc

In you case -- because C:\Program Files\Vim corresponds to $VIM -- the
third one is the correct one. After that, :help workspace should work.

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)


RE: Workspace concept ala TextPad

2007-02-06 Thread Max Dyckhoff
Sessions should do what you want. You can look at :help session for more 
information, but this is basically what I do:

1. Open the files that you want, in tabs (I typically have three tabs with 
source files, a tab with my todo.otl file, another with some init files and 
another with my .vimrc).
2. Type :mksession ~/work_session.vim

The file work_session.vim now contains the state of vim as it is. You can now 
quit that instance of vim, start up another and do

:source ~/work_session.vim

Or alternatively start vim with an argument:

Vim -S ~/work_session.vim

Presto, your workspace is there! If you want to add or remove files, just 
create a new session file with mksession, or replace the existing one.

I generally always have my vim session open, but whenever I need to reboot (I'm 
on Windows, so that is pretty often), I do a :mksession and then when I get 
back I just :source the file and I'm back where I left off!

Hope that helps,

Max


 -Original Message-
 From: Eric Leenman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 06, 2007 10:37 AM
 To: vim@vim.org
 Subject: Workspace concept ala TextPad

 Hi,

 Is it possible to load a set of files when you start gvim? (Like in
 Textpad,
 for those who know this editor)
 For example:
 I have a project containing 20 files.
 I frequently uses 5 of them to modify and debug them.
 Can you give a command to vim like: Load workspace projectX, which
 then
 load the 5 defined files?
 And when needed add or delete files from this workspace?

 Rgds,
 Eric

 _
 Search for grocery stores. Find gratitude. Turn a simple search into
 something more.
 http://click4thecause.live.com/search/charity/default.aspx?source=hmemt
 agline_gratitudeFORM=WLMTAG



Re: Workspace concept ala TextPad

2007-02-06 Thread Yegappan Lakshmanan

Hi Eric,

On 2/6/07, Eric Leenman [EMAIL PROTECTED] wrote:

Hi,

Is it possible to load a set of files when you start gvim? (Like in Textpad,
for those who know this editor)
For example:
I have a project containing 20 files.
I frequently uses 5 of them to modify and debug them.
Can you give a command to vim like: Load workspace projectX, which then
load the 5 defined files?
And when needed add or delete files from this workspace?



You can try using the workspace manager plugin:

http://vim.sourceforge.net/scripts/script.php?script_id=1410

- Yegappan


Re: Workspace concept ala TextPad

2007-02-06 Thread Tom Purl
 Is it possible to load a set of files when you start gvim? (Like in
 Textpad, for those who know this editor) For example: I have a project
 containing 20 files.  I frequently uses 5 of them to modify and debug
 them.  Can you give a command to vim like: Load workspace projectX,
 which then load the 5 defined files?  And when needed add or delete
 files from this workspace?

Two more options:

Project plugin
--

* http://www.vim.org/scripts/script.php?script_id=69

I don't know how I used to live without this plugin.  It allows you to
create an Eclipse-style layout of a group of files using arbitrary
criteria.

Plain-Old-Buffers
-

You could also just open all of the files in Gvim and then use a tool
like selectbuf (http://www.vim.org/scripts/script.php?script_id=107) to
navigate between them.

HTH!

Tom Purl