eVim - easy Vim - How to make it work on Ubuntu?

565 views
Skip to first unread message

Igor Forca

unread,
Jul 17, 2014, 9:34:54 AM7/17/14
to vim...@googlegroups.com
Hi,
I have been running Vim for several years and I like it a lot. But recently some of servers where migrated from Windows to headles Linux servers (Ubuntu and openSuse) and now we have Windows users who very rarely have to edit some configuration files. To learn Vim text editor is just a waste of there time. You know between two Vim usage they forget most of the commands.

To solve this problem I have researched eVim program (Vim in eVim mode). I started testing on my Windows 7 PC where is my day to day Vim.exe installed.

So starting Vim in eVim mode from command line:
vim -y myfile

Now Vim becomes eVim (you know dummy insert mode all the time and using classic CTRL+action key like in Notepad for Windows). Now I can use:
CTRL+C to copy text
CTRL+X to cut text
CTRL+V to paste text
SHIFT+arrow_keys to select text
CTRL+A to select whole file
CTRL+S to save a file
CTRL+L to get into command mode and type :q to exit eVim
CTRL+O to get into command mode just for one command and then back to insert mode

All this works fine on Vim for Windows, but does not work at all in Vim for Ubuntu and Suse. All Vim's version are 7.4.

Now the question:
I have logged to Ubuntu 14.04 (also on Suse SLES) server and started the "vim -y myfile" command and CTRL+action commands just don't work.

How to make eVim to work on Ubuntu (or Suse)?

P.S. Bonus question: Is there any quicker way to exit eVim beside CTRL+L and :q ?
Thanks

Павлов Николай Александрович

unread,
Jul 17, 2014, 4:44:45 PM7/17/14
to vim...@googlegroups.com, Igor Forca
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On July 17, 2014 5:34:54 PM GMT+03:00, Igor Forca <igo...@gmail.com> wrote:
>Hi,
>I have been running Vim for several years and I like it a lot. But
>recently some of servers where migrated from Windows to headles Linux
>servers (Ubuntu and openSuse) and now we have Windows users who very
>rarely have to edit some configuration files. To learn Vim text editor
>is just a waste of there time. You know between two Vim usage they
>forget most of the commands.
>
>To solve this problem I have researched eVim program (Vim in eVim
>mode). I started testing on my Windows 7 PC where is my day to day
>Vim.exe installed.
>
>So starting Vim in eVim mode from command line:
>vim -y myfile
>
>Now Vim becomes eVim (you know dummy insert mode all the time

>and using
>classic CTRL+action key like in Notepad for Windows).

This part has nothing to do with evim. These mappings are defined in $VIMRUNTIME/mswin.vim which is for some reason sourced by default on windows.

> Now I can use:
>CTRL+C to copy text
>CTRL+X to cut text
>CTRL+V to paste text
>SHIFT+arrow_keys to select text
>CTRL+A to select whole file
>CTRL+S to save a file
>CTRL+L to get into command mode and type :q to exit eVim
>CTRL+O to get into command mode just for one command and then back to
>insert mode
>
>All this works fine on Vim for Windows, but does not work at all in Vim
>for Ubuntu and Suse. All Vim's version are 7.4.
>
>Now the question:
>I have logged to Ubuntu 14.04 (also on Suse SLES) server and started
>the "vim -y myfile" command and CTRL+action commands just don't work.
>
>How to make eVim to work on Ubuntu (or Suse)?
>
>P.S. Bonus question: Is there any quicker way to exit eVim beside
>CTRL+L and :q ?
>Thanks

-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTyDWnGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvjvoD/96yEVm8qWEjoR0NYch5LP1SwmaX+3w/Yco9JBvDx79mx0zibft+IJE
+tYYJ1vdViBDVXL+A/PZpQZURoAeccAaAeaHN7xa2mlpIbkkq3vOfYAWyOfzIrop
a9tFnKgvrolUWOawuA/NEnDhoU8tg3d8jXaYQCYdDGc723IcD5UQgeMf/xBEtrdR
rN8w/Se3s2PmwP2Jt4+fz1hrAmp5IVo675ly2bSO5f6gW3hWErAKSZAW+WoEy9I6
HlE9o40SzUgZaipEyZ6hGrHaWW6g/erZ2W9vJl4iNO0i+HLtwPnr99XgGKyzDFet
d0prPk/cg56QVnE7VyDzmPNuyrIvKbYf0GmqJQNrLbi2fnniD1A39BvFp88YP5zG
P+gtbpqUu2SKBJOfUjO0h1frI5D4sdfXHpiYSTRe5fThsDHpL/L++uXvda7x+we5
ey8wamxaAhB0z9+czUrrFw4gPPAk7+f1VFSyaeKBvtphym/cbdUD7uWp8W1qFbTM
cevqT9f3ZXxb+no1uq+YjSNv2gjyj46BRrjXx9FiTh4TcBdaFILjUtHQqgJzHPx2
dpBjREU3WIDEc1N4EWdB3PxOiuaMgL5EWZDqDTCYZAOlovwSZ+Z26SG0dGLQOmx5
lwCacYe7/QxWBwqQtauia8gR1stp6SOlASBARKxU1Ag/ZujvfuoKOg==
=8188
-----END PGP SIGNATURE-----

John Little

unread,
Jul 17, 2014, 9:02:14 PM7/17/14
to vim...@googlegroups.com
On Friday, July 18, 2014 1:34:54 AM UTC+12, Igor Forca wrote:

> vim -y myfile
>
> Now Vim becomes eVim (you know dummy insert mode all the time and using classic CTRL+action key like in Notepad for Windows). Now I can use:
> CTRL+C to copy text
> CTRL+X to cut text
> CTRL+V to paste text
> SHIFT+arrow_keys to select text
> CTRL+A to select whole file
> CTRL+S to save a file
> CTRL+L to get into command mode and type :q to exit eVim
> CTRL+O to get into command mode just for one command and then back to insert mode

V>

> All this works fine on Vim for Windows, but does not work at all in Vim for Ubuntu and Suse. All Vim's version are 7.4.

I'm on Kubuntu 13.10. If I start vim with

vim -u NONE -N -y file

all those commands work. But if I just use vim -y some of them don't, so I think my .vimrc and .gvimrc get in the way. I suggest you try moving .vimrc and .gvimrc aside and use empty versions of them initially.

> P.S. Bonus question: Is there any quicker way to exit eVim beside CTRL+L and :q ?

Er, close the window? In KDE that defaults to Alt-F4, just like windows.

Zyx commented:

> This part has nothing to do with evim. These mappings are defined in $VIMRUNTIME/mswin.vim which is for some reason sourced by default on windows.

evim.vim sources mswin.vim, even when not on windows.

Regards, John Little

Павлов Николай Александрович

unread,
Jul 17, 2014, 10:55:37 PM7/17/14
to vim...@googlegroups.com, John Little
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Then one should check for the existence of g:skip_loading_mswin variable.

>
>Regards, John Little

-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTyIyVGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvuk/D/sHgvQragb0kBqboss0JkTUV4nBs00JarriNg8e3Vo9caKGLrsrt3B2
nHh4gxEcB9K4OFDT0azciGLwm7TCvmZIy8Lh3HpbwRG2pk/eyMUvfG58+hrIgt26
VakHAySCQ+/iogX+DP0bb2jWTiWbR2RH+zPwqXs0XMk9zxrIZm6WEaPl1Bn4yyet
aoaWxpHKCqRJYVtrjSeNYNHwt+7Lxv8HJr0K+ECv+ZSEfnJ3Fs4amqbLYA/VTNOI
lIWOLLDKMALYQhclHEHCXchRCdxG9vTZdqQ4oCClNA84dnNGIV6VnkbLNdJjzDDc
lJZErcwHf/fIy5fxU80cD/4v8hBEMnKolZ8ZoCyccuEXBTRmQFezWigzkEWEAXur
FyVvRBmXuzdCxlzVppzFmH9/ihvnYPhRUy1vmSFv2IBM8d/bwlpfX64DYOFj7H/5
8onSm73UlgWOYNvmzaurCVsAIul13UrrC9uYUC6cukOzjqPPgQGfoZQJwZ3qz+54
YdxF7ZtfhHq0QhFA2UcgVKaI0/nhLc3D/B2E9NS1VhW+49sAD1GMKMyzJUq11Y41
bibqpFDRys3Dqup2jVAuHTl/sDMwiQk5hBhcMfEUR/GfhEn3eM4z2lJRG1yWmHm6
TdXeY/K2hXrOuvAcAumc0khmwlzxjT+q9eymFIwZZcDiBnwq+mKHBA==
=XpU6
-----END PGP SIGNATURE-----

Igor Forca

unread,
Jul 18, 2014, 2:14:26 AM7/18/14
to vim...@googlegroups.com
@ZyX, on my Windows machine I have cleaned-up _vimrc all of this Windows specifics. For test the only command in my _vimrc is: "set nocompatible". I even opened vim and execute command: e $MYVIMRC to see if this file really opens up and takes effect and it does. So no Windows specific shortcuts in _vimrc and all of described WORKS successfully on Vim for Windows. But the same does not on Linux (Ubuntu, Suse).

@John Little, I tried starting "vim -u NONE -y file" but still no success, the only shortcuts working is CTRL+A and CTRL+arrow_keys. The same problem on Ubuntu/Suse. Exactly the same as with only "vim -y myfile".

@John Little, about "bonus question": I can't just close down with ALT+F4, I am using headless = no GUI = terminal only server.


Additional test:
I have now also checked the same on "Ubuntu 14.04 Desktop" and having exactly the same problem with both starting commands (vim -y myfile and vim -u NONE -y myfile), exactly the same problem. I have also added only "set nocompatible" command in .vimrc file.

Павлов Николай Александрович

unread,
Jul 18, 2014, 2:24:44 AM7/18/14
to vim...@googlegroups.com, Igor Forca
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

>--
>--
>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+u...@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

Can you try explicit

source $VIMRUNTIME/mswin.vim

in the vimrc? It should show E484 (in case file was removed from distribution, which is rather strange if true) or just work. Maybe evim.vim was just patched to not source mswin.vim.

Another variant is that you are using tiny version of vim with patched evim.vim (as it will show lots of errors without +eval without patching). Can you post 'vim --version'?
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTyL2XGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvjWyD/4p9r0EM+1DQ9Hb9AloZl8Jh9IU+f8618v+yp437RC265r0icHqgshn
65udKKyqD4Vx9Ay4Rxe46eUnOJuSbqKuhZ6ZYHdxN4vaj7nDWnSiTfr1jN/prID+
cG9gab3rUVX/8tZnT6lgNHkYDdCXhMdRwXN6LW3nA5WYUcqtBCLKMOU7+BBfqM/L
2/0uazezcJjUZQh0+tZS6DIwYgM8p/ZpacwKEuqdGs/gEnGqxdicbYZldAUc79xx
4jWwKF5ZRgXUUPmdwPGhU4RuQhFxYJ+d/72CCLjLcitoVOzrfwzQDYW19HT3LtuP
jy45H7gdn/Sh+B99HCV6+KHxat0cQlQ46uICiDoBFLVwokQ7QBMc/NeHWek8k15E
Bgw/koLuOvNyfHErhimDhAdBsO+rBQkv2/ozmS5WMMFApMGPLORXNK29AKUctnLk
NLajoIDgTQ8wFPdJZ9SQ1CwvbDbvFLhfHPkLK2CthMThiMt0QMgT/5elfiogZIIn
4seyOLEMSHySrCL1jFBICJnRu/8ItYi++9orLVinCytHyETSuRpL7CBQfebef26M
gvqmXA/1ZBbBuk5vslDlemm3RRy4vtBy8jSwA0PZbTnJRSTPmWyBLJvPRboPTySj
y4hGHiF96Gtrfr7JCk42mTBQ86ABTIvBbRmChiJ3SLW8hKOG4cjq9g==
=s9sf
-----END PGP SIGNATURE-----

Tony Mechelynck

unread,
Jul 18, 2014, 4:31:58 AM7/18/14
to vim...@googlegroups.com
On 18/07/14 08:14, Igor Forca wrote:
> @ZyX, on my Windows machine I have cleaned-up _vimrc all of this Windows specifics. For test the only command in my _vimrc is: "set nocompatible". I even opened vim and execute command: e $MYVIMRC to see if this file really opens up and takes effect and it does. So no Windows specific shortcuts in _vimrc and all of described WORKS successfully on Vim for Windows. But the same does not on Linux (Ubuntu, Suse).
>
> @John Little, I tried starting "vim -u NONE -y file" but still no success, the only shortcuts working is CTRL+A and CTRL+arrow_keys. The same problem on Ubuntu/Suse.

In some Linux distributions, including openSUSE but not necessarily
limited to it, if you use the Vim packaged by the distribution (not one
you compile yourself from Bram's sources), it sources a "system vimrc"
even before checking if there is a user vimrc.

To see, if this is the case on your Vim, do

:version

Near the middle of the output, you'll see a number of locations for Vim
configuration scripts. One of them (usually the first one) is called
"system vimrc file". Open that path/file (often, but not necessarily
always, /etc/vimrc) in the same version of Vim. If it opens a blank
window with [New File] in the status message at bottom, then you don't
have a system vimrc for this Vim setup, you can close the window with
":q!" (including the exclamation mark but of course not the quotes).
Otherwise you'll see what the distro has decided to dump on you "for
your own good". Reading that may be quite instructive; it may even
convince you to use an own-compiled version of Bram's Vim (with the
executable at /usr/local/bin/vim, the runtime files as a tree starting
at /usr/local/share/vim/vim73/ and the system vimrc, if any, at
/usr/local/share/vim/vimrc with no dot or underscore in the filename) so
you won't be a victim of do-gooders who act in your name without your
say-so.

You can even have your own-compiled Vim and the distro's Vim both
present on the same system. Since /user/local/bin comes early in the
$PATH, your own Vim takezs precedence, but the other one can still be
invoked with a full path, or under another name from a softlink (e.g.
/bin/vim-suse -> vim). Of course the distro's Vim uses its own system
vimrc and its own runtime files, but your ~/.vimrc and (if any) anything
under your ~/.vim/

> Exactly the same as with only "vim -y myfile".
>
> @John Little, about "bonus question": I can't just close down with ALT+F4, I am using headless = no GUI = terminal only server.

I think I've heard there are headless setups where GUIs are possible.
IIRC it requires "X forwarding" or something.

You can always create a mapping, provided that Vim can get the {lhs},
for example (untested)

:imap <C-F4> <C-O>:qa<CR>

to use Ctrl-F4 to exit Vim. This will still end in error (and not exit)
if you have modified files, unless 'autowriteall' is set and the
modified buffers can be saved.

>
>
> Additional test:
> I have now also checked the same on "Ubuntu 14.04 Desktop" and having exactly the same problem with both starting commands (vim -y myfile and vim -u NONE -y myfile), exactly the same problem. I have also added only "set nocompatible" command in .vimrc file.
>



Best regards,
Tony.
--
There was a young man from Nantucket
Whose cock was so long he could suck it.
He said with a grin,
While wiping his chin,
"If my ear was a cunt, I could fuck it."

Tony Mechelynck

unread,
Jul 18, 2014, 4:35:02 AM7/18/14
to vim...@googlegroups.com
-----------------------------^^ oops! vim74 already

Павлов Николай Александрович

unread,
Jul 18, 2014, 5:24:22 AM7/18/14
to vim...@googlegroups.com, Tony Mechelynck
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On July 18, 2014 12:31:36 PM GMT+03:00, Tony Mechelynck <antoine.m...@gmail.com> wrote:
>On 18/07/14 08:14, Igor Forca wrote:
>> @ZyX, on my Windows machine I have cleaned-up _vimrc all of this
>Windows specifics. For test the only command in my _vimrc is: "set
>nocompatible". I even opened vim and execute command: e $MYVIMRC to see
>if this file really opens up and takes effect and it does. So no
>Windows specific shortcuts in _vimrc and all of described WORKS
>successfully on Vim for Windows. But the same does not on Linux
>(Ubuntu, Suse).
>>
>> @John Little, I tried starting "vim -u NONE -y file" but still no
>success, the only shortcuts working is CTRL+A and CTRL+arrow_keys. The
>same problem on Ubuntu/Suse.
>
>In some Linux distributions, including openSUSE but not necessarily
>limited to it, if you use the Vim packaged by the distribution (not one
>
>you compile yourself from Bram's sources), it sources a "system vimrc"
>even before checking if there is a user vimrc.

According to the documentation it must not read system vimrc with any "-u ...", including "-u NONE". See :h vimrc, the paragraph below table with recommended places for the vimrc.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTyOepGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvoQoD/43Amd94d/jgHQlGyORgDzUDWmj9Frsgd+jopAnkKLH1+fsHHpDstxA
PApdnkmj72cfEZu+TnSQvBzq8w7zki4CR5YCEsUNCXRiFk1xfWzNbEm4aHHFCs6J
Drrcx+sGfQJfl2uOYdFNnoRK3El/JlXDqyPCgqQ2GlOsbiEalDA4DMzU3R9BW8sN
g14wW1+8Wrug0G2zEDYaCAOV7hGIK1aU/is/Ay9PVI8eipZo2a7jywWmhLck6fpe
lpgljN2aRH/Uq6NhLoFm71p6bqHx4EtFm8yEXdW8mMKVHeQ78kVacWNLZ1J3Wl49
7t9XEHxkMf+EfryeoGbQYiJhAqC7LWgEHg3l87EpPn8pI7x2i6LSjwc4EnQ6C9QL
QPm60VbDhbJh/4Ds6Itf1iUKc1nWa9Dq7Gjf7JVi9IIzRmU7yKY9JGhxCNoQJDLn
XCh5UuXqbS4zO+Jcpybeg19vYe4NZiy3BzAkfcoV5Te12BHlPDdIIRcEnA0/p89J
mi853okrz7KFyE3oKLteRWZtVcHGHBM9XCy4cQY0Yc3HcBVAukCqfl598WTYCCq8
BnSdsau4WutZSu18WA8HxH5A9rmUSqKuHeQ/fkoAQcR7re0X4AkW6uIkjZcdd0O3
ROMjak0TJnh+UtYntjNeNO9VFSWs1CLjscvSzmaCV9FMWeFly+sYiA==
=c56B
-----END PGP SIGNATURE-----

Igor Forca

unread,
Jul 18, 2014, 7:28:25 AM7/18/14
to vim...@googlegroups.com
My versions of Vim on Windows 7 and Ubuntu 14.04 bellow. In both cases there are $VIM\vimrc or $VIM/vimrc but shortcuts works fine in Windows and not in Ubuntu. Any other idea what to try out?

ON MY VIM FOR WINDOWS 7:
====================================
C:\>vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:33:40)
MS-Windows 32-bit console version
Compiled by mool@tororo
Big version without GUI. Features included (+) or not (-):
+arabic +ex_extra -mouseshape +tag_binary
+autocmd +extra_search +multi_byte +tag_old_static
-balloon_eval +farsi +multi_lang -tag_any_white
-browse +file_in_path -mzscheme -tcl
++builtin_terms +find_in_path -netbeans_intg -tgetent
+byte_offset +float +path_extra -termresponse
+cindent +folding -perl +textobjects
+clientserver -footer +persistent_undo +title
+clipboard +gettext/dyn -postscript -toolbar
+cmdline_compl -hangul_input +printer +user_commands
+cmdline_hist +iconv/dyn -profile +vertsplit
+cmdline_info +insert_expand -python +virtualedit
+comments +jumplist -python3 +visual
+conceal +keymap +quickfix +visualextra
+cryptv +langmap +reltime +viminfo
+cscope +libcall +rightleft +vreplace
+cursorbind +linebreak -ruby +wildignore
+cursorshape +lispindent +scrollbind +wildmenu
+dialog_con +listcmds +signs +windows
+diff +localmap +smartindent +writebackup
+digraphs -lua -sniff -xfontset
-dnd +menu +startuptime -xim
-ebcdic +mksession +statusline -xterm_save
+emacs_tags +modify_fname -sun_workshop -xpm_w32
+eval +mouse +syntax
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjCi386/ /Ox /GL -DNDEBUG /Zl /MT -DDYNAMIC_ICONV
-DDYNAMIC_GETTEXT -DFEAT_BIG /Fd.\ObjCi386/ /Zi
Linking: link /RELEASE /nologo /subsystem:console /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib
libcmt.lib user32.lib /PDB:vim.pdb -debug
====================================

ON MY UBUNTU 14.04 HEADLESS SERVER
====================================
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:32)
Included patches: 1-52
Modified by pkg-vim-m...@lists.alioth.debian.org
Compiled by buildd@
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand -perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu -ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
====================================

$VIM/vimrc on Ubuntu 14.04
====================================
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
====================================
I have looked at the file /etc/vim/vimrc.local and it does not exists.

Any idea?

Igor Forca

unread,
Jul 18, 2014, 7:43:42 AM7/18/14
to vim...@googlegroups.com
I have looked little bit dipper and it looks like "vim -y myfile" is using evim.vim file: /usr/share/vim/vim74/evim.vim. I have renamed this file and started "vim -y myfile" and Vim gets into ordinary Vim, no "Insert mode" automatically etc. Renaming back the file and starting "vim -y myfile" and I get "Insert mode" automatically. So it looks like this file is read. And inside evim.vim I see sourcing mswin.vim (if I understand from the same path). Bellow are the files content.


/usr/share/vim/vim74/evim.vim on Ubuntu 14.04:
=============================
" Vim script for Evim key bindings
" Maintainer: Bram Moolenaar <Br...@vim.org>
" Last Change: 2006 Mar 29

" Don't use Vi-compatible mode.
set nocompatible

" Use the mswin.vim script for most mappings
source <sfile>:p:h/mswin.vim

" Vim is in Insert mode by default
set insertmode

" Make a buffer hidden when editing another one
set hidden

" Make cursor keys ignore wrapping
inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>

" CTRL-F does Find dialog instead of page forward
noremap <silent> <C-F> :promptfind<CR>
vnoremap <silent> <C-F> y:promptfind <C-R>"<CR>
onoremap <silent> <C-F> <C-C>:promptfind<CR>
inoremap <silent> <C-F> <C-O>:promptfind<CR>
cnoremap <silent> <C-F> <C-C>:promptfind<CR>


set backspace=2 " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set incsearch " do incremental searching
set mouse=a " always use the mouse

" Don't use Ex mode, use Q for formatting
map Q gq

" Switch syntax highlighting on, when the terminal has colors
" Highlight the last used search pattern on the next search command.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
nohlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on

" For all text files set 'textwidth' to 78 characters.
au FileType text setlocal tw=78

endif " has("autocmd")

" vim: set sw=2 :
=============================


/usr/share/vim/vim74/mswin.vim
=============================
" Set options and add mapping such that Vim behaves a lot like MS-Windows
"
" Maintainer: Bram Moolenaar <Br...@vim.org>
" Last change: 2012 Jul 25

" bail out if this isn't wanted (mrsvim.vim uses this).
if exists("g:skip_loading_mswin") && g:skip_loading_mswin
finish
endif

" set the 'cpoptions' to its Vim default
if 1 " only do this when compiled with expression evaluation
let s:save_cpo = &cpoptions
endif
set cpo&vim

" set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
behave mswin

" backspace and cursor keys wrap to previous/next line
set backspace=indent,eol,start whichwrap+=<,>,[,]

" backspace in Visual mode deletes selection
vnoremap <BS> d

" CTRL-X and SHIFT-Del are Cut
vnoremap <C-X> "+x
vnoremap <S-Del> "+x

" CTRL-C and CTRL-Insert are Copy
vnoremap <C-C> "+y
vnoremap <C-Insert> "+y

" CTRL-V and SHIFT-Insert are Paste
map <C-V> "+gP
map <S-Insert> "+gP

cmap <C-V> <C-R>+
cmap <S-Insert> <C-R>+

" Pasting blockwise and linewise selections is not possible in Insert and
" Visual mode without the +virtualedit feature. They are pasted as if they
" were characterwise instead.
" Uses the paste.vim autoload script.
" Use CTRL-G u to have CTRL-Z only undo the paste.

exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']

imap <S-Insert> <C-V>
vmap <S-Insert> <C-V>

" Use CTRL-Q to do what CTRL-V used to do
noremap <C-Q> <C-V>

" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>

" For CTRL-V to work autoselect must be off.
" On Unix we have two selections, autoselect can be used.
if !has("unix")
set guioptions-=a
endif

" CTRL-Z is Undo; not in cmdline though
noremap <C-Z> u
inoremap <C-Z> <C-O>u

" CTRL-Y is Redo (although not repeat); not in cmdline though
noremap <C-Y> <C-R>
inoremap <C-Y> <C-O><C-R>

" Alt-Space is System menu
if has("gui")
noremap <M-Space> :simalt ~<CR>
inoremap <M-Space> <C-O>:simalt ~<CR>
cnoremap <M-Space> <C-C>:simalt ~<CR>
endif

" CTRL-A is Select all
noremap <C-A> gggH<C-O>G
inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
cnoremap <C-A> <C-C>gggH<C-O>G
onoremap <C-A> <C-C>gggH<C-O>G
snoremap <C-A> <C-C>gggH<C-O>G
xnoremap <C-A> <C-C>ggVG

" CTRL-Tab is Next window
noremap <C-Tab> <C-W>w
inoremap <C-Tab> <C-O><C-W>w
cnoremap <C-Tab> <C-C><C-W>w
onoremap <C-Tab> <C-C><C-W>w

" CTRL-F4 is Close window
noremap <C-F4> <C-W>c
inoremap <C-F4> <C-O><C-W>c
cnoremap <C-F4> <C-C><C-W>c
onoremap <C-F4> <C-C><C-W>c

" restore 'cpoptions'
set cpo&
if 1
let &cpoptions = s:save_cpo
unlet s:save_cpo
endif
=============================

Any additional idea?

John Little

unread,
Jul 18, 2014, 7:48:23 AM7/18/14
to vim...@googlegroups.com
On Friday, July 18, 2014 6:14:26 PM UTC+12, Igor Forca wrote:
> @John Little, about "bonus question": I can't just close down with ALT+F4, I am using headless = no GUI = terminal only server.

Sorry, vim -y starts the GUI on my system, despite having no "g", so I thought it would for you, too.

If I start vim with vim -y -v -u NONE -N, I see some of your trouble; I can't start a selection with <shift-left> and <shift-right>, but shift up, down, end, and home work, as does cut, copy (albeit silently) and paste. Investigating why <shift-left> and <shift-right> don't work, by using <ctrl-q> before typing them, I find that vim is being passed nothing. This is in konsole, the KDE terminal emulator, so I fired up xterm, and <shift-left> and <shift-right> work there. (After using stty to get a ctrl-q back (stty start ^@ stop ^@) I see vim getting ^[[1;2C and ^[[1;2D.)

The point behind the above (somewhat tediously detailed) is that your problems may stem from the key presses not being passed to vim by whatever it's running in. You might tell us that, and how your users connect to the servers.

You can check for this trouble by pressing <ctrl-q>; if you get a "^" with the cursor on it, then use a key press you're having trouble with, like <shift-left>. If nothing appears, vim is not getting it, or if something does appear, you have a terminal capability problem, see :help termcap, and consult the documentation for what vim is running in. <ctrl-q> might not work without some set up at the user end, like I had to with xterm.

A better approach altogether might be to use netrw, and run vim locally to the user. Can work brilliantly, particularly if the servers are "distant".

HTH, and regards, John Little

Reply all
Reply to author
Forward
0 new messages