How to get C-x C-f to properly handle $HOME but not expand it into the text?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get C-x C-f to properly handle $HOME but not expand it into the text?

Shlomi Fish-2
Hi all!

With gvim -U NONE -u NONE .jwmrc (which the XML file here
https://github.com/shlomif/shlomif-computer-settings/blob/master/shlomif-settings/jwm/jwm.jwmrc
) pressing Ctrl-x and ctrl-f in insert mode in line 130 causes $HOME to expand
into /home/shlomif in the text, which I wish to avoid, but want the paths to
complete relative to the home dir. How can it be done?

I've searched google, DDG and the vim docs to no avail.

--
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
http://www.shlomifish.org/humour/bits/facts/Emma-Watson/

average_drifter prefers something more lightweight than Windows Notepad. Like
Eclipse.
    — Freenode’s #perl-cats

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190517151511.4f3efead%40telaviv1.shlomifish.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get C-x C-f to properly handle $HOME but not expand it into the text?

Andy Wokula
Am 17.05.2019 um 14:15 schrieb Shlomi Fish:
> Hi all!
>
> With gvim -U NONE -u NONE .jwmrc (which the XML file here
> https://github.com/shlomif/shlomif-computer-settings/blob/master/shlomif-settings/jwm/jwm.jwmrc
> ) pressing Ctrl-x and ctrl-f in insert mode in line 130 causes $HOME to expand
> into /home/shlomif in the text, which I wish to avoid, but want the paths to
> complete relative to the home dir. How can it be done?
>
> I've searched google, DDG and the vim docs to no avail.

I think I've something for you (this is quite old already ...):
     https://gist.github.com/Houl/20881b64aa05d5ecda60914598b3e754

This script temporarily expands an env var like $HOME and later converts it back.

Usage:

* store script in the runtimepath under
       autoload\nwo\mappings\cxf_mod.vim
   (only tested under Windows!)

* add a mapping for i_CTRL-X_CTRL-F in your vimrc:
       imap <expr> <C-X><C-F>  nwo#mappings#cxf_mod#Plug()

--
Andy

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5CDEF11A.1050900%40yahoo.de.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get C-x C-f to properly handle $HOME but not expand it into the text?

Shlomi Fish-2
On Fri, 17 May 2019 19:36:26 +0200
"'Andy Wokula' via vim_use" <[hidden email]> wrote:

> Am 17.05.2019 um 14:15 schrieb Shlomi Fish:
> > Hi all!
> >
> > With gvim -U NONE -u NONE .jwmrc (which the XML file here
> > https://github.com/shlomif/shlomif-computer-settings/blob/master/shlomif-settings/jwm/jwm.jwmrc
> > ) pressing Ctrl-x and ctrl-f in insert mode in line 130 causes $HOME to
> > expand into /home/shlomif in the text, which I wish to avoid, but want the
> > paths to complete relative to the home dir. How can it be done?
> >
> > I've searched google, DDG and the vim docs to no avail.  
>
> I think I've something for you (this is quite old already ...):
>      https://gist.github.com/Houl/20881b64aa05d5ecda60914598b3e754
>
> This script temporarily expands an env var like $HOME and later converts it
> back.
>
> Usage:
>
> * store script in the runtimepath under
>        autoload\nwo\mappings\cxf_mod.vim
>    (only tested under Windows!)
>
> * add a mapping for i_CTRL-X_CTRL-F in your vimrc:
>        imap <expr> <C-X><C-F>  nwo#mappings#cxf_mod#Plug()
>

Thanks, Andy! Can you please make it a github/etc.-plugin-repo similar to
https://github.com/shlomif/vim-extract-variable so it can be used using
vam/vundle/pathogen/etc.?



--
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What does “Zionism” mean? - http://shlom.in/def-zionism

Jack: Hi Sophie!
Sophie: Don’t “Hi, Sophie!” me.
Jack: Don’t “Don’t ‘Hi, Sophie!’ me” me!

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190517211125.5f1be7b0%40telaviv1.shlomifish.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get C-x C-f to properly handle $HOME but not expand it into the text?

Andy Wokula
Am 17.05.2019 um 20:11 schrieb Shlomi Fish:

> On Fri, 17 May 2019 19:36:26 +0200
> "'Andy Wokula' via vim_use" <[hidden email]> wrote:
>
>> Am 17.05.2019 um 14:15 schrieb Shlomi Fish:
>>> Hi all!
>>>
>>> With gvim -U NONE -u NONE .jwmrc (which the XML file here
>>> https://github.com/shlomif/shlomif-computer-settings/blob/master/shlomif-settings/jwm/jwm.jwmrc
>>> ) pressing Ctrl-x and ctrl-f in insert mode in line 130 causes $HOME to
>>> expand into /home/shlomif in the text, which I wish to avoid, but want the
>>> paths to complete relative to the home dir. How can it be done?
>>>
>>> I've searched google, DDG and the vim docs to no avail.
>>
>> I think I've something for you (this is quite old already ...):
>>       https://gist.github.com/Houl/20881b64aa05d5ecda60914598b3e754
>>
>> This script temporarily expands an env var like $HOME and later converts it
>> back.
>>
>> Usage:
>>
>> * store script in the runtimepath under
>>         autoload\nwo\mappings\cxf_mod.vim
>>     (only tested under Windows!)
>>
>> * add a mapping for i_CTRL-X_CTRL-F in your vimrc:
>>         imap <expr> <C-X><C-F>  nwo#mappings#cxf_mod#Plug()
>>
>
> Thanks, Andy! Can you please make it a github/etc.-plugin-repo similar to
> https://github.com/shlomif/vim-extract-variable so it can be used using
> vam/vundle/pathogen/etc.?

https://github.com/Houl/cxf_mod-vim

HTH,
Andy

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5CE2E941.5030104%40yahoo.de.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get C-x C-f to properly handle $HOME but not expand it into the text?

Shlomi Fish-2
On Mon, 20 May 2019 19:52:01 +0200
"'Andy Wokula' via vim_use" <[hidden email]> wrote:

> Am 17.05.2019 um 20:11 schrieb Shlomi Fish:
> > On Fri, 17 May 2019 19:36:26 +0200
> > "'Andy Wokula' via vim_use" <[hidden email]> wrote:
> >  
> >> Am 17.05.2019 um 14:15 schrieb Shlomi Fish:  
> >>> Hi all!
> >>>
> >>> With gvim -U NONE -u NONE .jwmrc (which the XML file here
> >>> https://github.com/shlomif/shlomif-computer-settings/blob/master/shlomif-settings/jwm/jwm.jwmrc
> >>> ) pressing Ctrl-x and ctrl-f in insert mode in line 130 causes $HOME to
> >>> expand into /home/shlomif in the text, which I wish to avoid, but want the
> >>> paths to complete relative to the home dir. How can it be done?
> >>>
> >>> I've searched google, DDG and the vim docs to no avail.  
> >>
> >> I think I've something for you (this is quite old already ...):
> >>       https://gist.github.com/Houl/20881b64aa05d5ecda60914598b3e754
> >>
> >> This script temporarily expands an env var like $HOME and later converts it
> >> back.
> >>
> >> Usage:
> >>
> >> * store script in the runtimepath under
> >>         autoload\nwo\mappings\cxf_mod.vim
> >>     (only tested under Windows!)
> >>
> >> * add a mapping for i_CTRL-X_CTRL-F in your vimrc:
> >>         imap <expr> <C-X><C-F>  nwo#mappings#cxf_mod#Plug()
> >>  
> >
> > Thanks, Andy! Can you please make it a github/etc.-plugin-repo similar to
> > https://github.com/shlomif/vim-extract-variable so it can be used using
> > vam/vundle/pathogen/etc.?  
>
> https://github.com/Houl/cxf_mod-vim
>

Thanks Andy! It works reasonably well. Starred.

        -- Shlomi

> HTH,
> Andy
>



--
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Graphics Apps - http://shlom.in/graphics

Emacs is a nice operating system, but what it lacks, in order to compete with
Linux, is a good text editor.
    — based on http://en.wikiquote.org/wiki/Emacs

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190521034711.28d85dd6%40telaviv1.shlomifish.org.
For more options, visit https://groups.google.com/d/optout.