Re: nested expr in a mapping

2020-02-13 Thread Gary Johnson
On 2020-02-13, M Kelly wrote:
> Hi,
> 
> Is it posible to nest conditionals in a mapping, something like, just for
> demonstration:
> 
> vnoremap  vv (strlen(@y) == 1) ? ':let ...' : '("vcl" =~ 
> getregtype("*"))
> ? 'some foo' : 'some bar' '  some more ...
> 
> Can we do this ?

Yes.  See

:help 41.3
:help expr1
:help :map-
:help matchup.txt " lines 896-900 for some examples

> Do I use ''' (3 single quotes) to embed quotes ?  (and then 5
> for a 2nd level embed ...) ... ?

No.  Expressions are not nested using quotes.  You may use
parentheses if you wish, or just use the precedence rules.

It would be easier to help you if we knew what you had tried, the
actual results, and what you expected.

Regards,
Gary

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20200214042128.GC9366%40phoenix.


Re: nested expr in a mapping

2020-02-13 Thread M Kelly
Hi,

I suppose I can call a function to do this :-)

-m

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/fc4865e6-2357-4a8c-ae7c-c5fe7796b27a%40googlegroups.com.


nested expr in a mapping

2020-02-13 Thread M Kelly
Hi,

Is it posible to nest conditionals in a mapping, something like, just for 
demonstration:

vnoremap  vv (strlen(@y) == 1) ? ':let ...' : '("vcl" =~ 
getregtype("*")) ? 'some foo' : 'some bar' '  some more ...

Can we do this ?  Do I use ''' (3 single quotes) to embed quotes ?  (and 
then 5 for a 2nd level embed ...) ... ?

thx as always,
-m

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/da6436ec-0159-4364-8ab0-90e9b075764d%40googlegroups.com.


Re: Is "vim -C" supposed to override .vimrc?

2020-02-13 Thread 'Ottavio Caruso' via vim_use
On Thu, 13 Feb 2020 at 17:00, Gary Johnson  wrote:
>
> On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> > Hi,
> >
> > this is a snippet or my vimrc:
> >
> > $ cat .vim/vimrc
> > source $VIMRUNTIME/defaults.vim
> > set dir=~/.vim/tmp
> > set expandtab
> > set autoindent
> > iabbrev mydate =strftime("%a %d/%m/%Y")
> > digraph bl 8226 " Insert Bullet with +k bl
> > map  :1m$
> >
> > which sources the default vim system file, which in turn sets
> > "nocompatible", as expected. So far. so good.
> >
> > If I start vim with:
> > $ vim -C somefile
> >
> > I expect this to turn some features off, for example visual mode with
> > mouse clicks, but it doesn't. If I manually set "compatible" from the
> > ex command line, it does turn visual mode off. I assume I could put
> > this is my vimrc, but I don't want to do this all the time. I could
> > probably make an alias to:
> >
> > vim -c "set compatible" somefile
> >
> > However I wonder if this is intended behaviour or not, that is, I
> > expected "vim -C" to override vimrc.
>
> From ":help -C":
>
> -C  Compatible mode.  Sets the 'compatible' option.  You can use
> this to get 'compatible', even though a .vimrc file exists.
> Keep in mind that the command ":set nocompatible" in some
> plugin or startup script overrules this, so you may end up
> with 'nocompatible' anyway.

Thanks. I was looking at the wrong section of the help file.

(For posterity, setting "mouse=r" did what I meant to do).


-- 
Ottavio Caruso

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAEJNuHz1%2BhFhdh9UKqtL%3DPG6O7jd9Vh_zrvvvn5cLq7T-uzBHg%40mail.gmail.com.


Re: Is "vim -C" supposed to override .vimrc?

2020-02-13 Thread Gary Johnson
On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> Hi,
> 
> this is a snippet or my vimrc:
> 
> $ cat .vim/vimrc
> source $VIMRUNTIME/defaults.vim
> set dir=~/.vim/tmp
> set expandtab
> set autoindent
> iabbrev mydate =strftime("%a %d/%m/%Y")
> digraph bl 8226 " Insert Bullet with +k bl
> map  :1m$
> 
> which sources the default vim system file, which in turn sets
> "nocompatible", as expected. So far. so good.
> 
> If I start vim with:
> $ vim -C somefile
> 
> I expect this to turn some features off, for example visual mode with
> mouse clicks, but it doesn't. If I manually set "compatible" from the
> ex command line, it does turn visual mode off. I assume I could put
> this is my vimrc, but I don't want to do this all the time. I could
> probably make an alias to:
> 
> vim -c "set compatible" somefile
> 
> However I wonder if this is intended behaviour or not, that is, I
> expected "vim -C" to override vimrc.

>From ":help -C":

-C  Compatible mode.  Sets the 'compatible' option.  You can use
this to get 'compatible', even though a .vimrc file exists.
Keep in mind that the command ":set nocompatible" in some
plugin or startup script overrules this, so you may end up
with 'nocompatible' anyway.

Regards,
Gary

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20200213170019.GB9366%40phoenix.


Is "vim -C" supposed to override .vimrc?

2020-02-13 Thread 'Ottavio Caruso' via vim_use
Hi,

this is a snippet or my vimrc:

$ cat .vim/vimrc
source $VIMRUNTIME/defaults.vim
set dir=~/.vim/tmp
set expandtab
set autoindent
iabbrev mydate =strftime("%a %d/%m/%Y")
digraph bl 8226 " Insert Bullet with +k bl
map  :1m$

which sources the default vim system file, which in turn sets
"nocompatible", as expected. So far. so good.

If I start vim with:
$ vim -C somefile

I expect this to turn some features off, for example visual mode with
mouse clicks, but it doesn't. If I manually set "compatible" from the
ex command line, it does turn visual mode off. I assume I could put
this is my vimrc, but I don't want to do this all the time. I could
probably make an alias to:

vim -c "set compatible" somefile

However I wonder if this is intended behaviour or not, that is, I
expected "vim -C" to override vimrc.

My settings:
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 13 2019 20:46:00)
Included patches: 1-2200
Modified by m...@netbsd.org
Compiled by oc@e130
Huge version without GUI.  Features included (+) or not (-):
+acl   -farsi -mouse_sysmouse-tag_any_white
+arabic+file_in_path  +mouse_urxvt   -tcl
+autocmd   +find_in_path  +mouse_xterm   +termguicolors
+autochdir +float +multi_byte+terminal
-autoservername+folding   +multi_lang+terminfo
-balloon_eval  -footer-mzscheme  +termresponse
+balloon_eval_term +fork()+netbeans_intg +textobjects
-browse+gettext   +num64 +textprop
-builtin_terms -hangul_input  +packages  +timers
+byte_offset   +iconv +path_extra+title
+channel   +insert_expand -perl  -toolbar
+cindent   +job   +persistent_undo   +user_commands
-clientserver  +jumplist  +postscript+vartabs
-clipboard +keymap+printer   +vertsplit
+cmdline_compl +lambda+profile   +virtualedit
+cmdline_hist  +langmap   -python+visual
+cmdline_info  +libcall   -python3   +visualextra
+comments  +linebreak +quickfix  +viminfo
+conceal   +lispindent+reltime   +vreplace
+cryptv+listcmds  +rightleft +wildignore
+cscope+localmap  -ruby  +wildmenu
+cursorbind-lua   +scrollbind+windows
+cursorshape   +menu  +signs +writebackup
+dialog_con+mksession +smartindent   -X11
+diff  +modify_fname  -sound -xfontset
+digraphs  +mouse +spell -xim
-dnd   -mouseshape+startuptime   -xpm
-ebcdic+mouse_dec +statusline-xsmp
+emacs_tags-mouse_gpm -sun_workshop  -xterm_clipboard
+eval  -mouse_jsbterm +syntax-xterm_save
+ex_extra  +mouse_netterm +tag_binary
+extra_search  +mouse_sgr -tag_old_static
   system vimrc file: "/usr/pkg/etc/vimrc"
 user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
  user exrc file: "$HOME/.exrc"
   defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/pkg/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/include
-I/usr/pkg/include/ncurses  -O2 -I/usr/include
-I/usr/pkg/include/ncurses -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: cc   -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/local/lib
-Wl,--as-needed -o vim   -lm -lnsl  -lncurses -liconv -ldl



-- 
Ottavio Caruso

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAEJNuHy%2BFp%3DNSaduUSBJp8HHmnMj5qVaDX0s5xeFAQ9%3DpMEqXQ%40mail.gmail.com.