# Vim install is messed up



## jbruyet (Mar 30, 2013)

Hey all, I've been having erratic vi behavior in 9.1 so I am trying to install vim (that's the fix in Linux). This is the second vim install I've tried and this install is taking as long as the last one. I thought a vim install would only take about two minutes and I'm up to 47 minutes and counting. Has anyone else tried this? Is it just me or is something messed up with the install? I'm new to FreeBSD so I'm not sure if this is normal behavior. 

Thanks,

Joe B


----------



## kpa (Mar 30, 2013)

The port installs the X11 enabled version of editors/vim that pulls in tons of X11 and GNOME related dependencies. Try editors/vim-lite instead.


----------



## wblock@ (Mar 30, 2013)

What do you mean by "erratic"?


----------



## jbruyet (Mar 30, 2013)

@kpa, I will give that a try. 

@wblock@,

using arrow keys in Insert Mode or Command Mode usually enters a character (not just a, b, c or d) and then a line feed
backspace produces an error message at the bottom of the page -- ^? isn't a vi command
unable to return to Insert Mode

That's all I can think of off the top of my head.  

Thanks guys or gals,

Joe B


----------



## jbruyet (Mar 30, 2013)

@kpa, now _that_ is what I'm talking about. Two minutes and done. Thank you very much for that little tidbit that's going to save me a lot of grief.

Thanks,

Joe B


----------



## wblock@ (Mar 30, 2013)

What is $TERM?  It should be xterm, even in the console.


----------



## jbruyet (Mar 30, 2013)

Well, $TERM gives me more than just xterm:


```
root@FreeNag:/usr/ports/editors/vim-lite # $TERM
xterm: Command not found.
```

Does that tell you anything? FWIW I was able to install Vim-lite in about two minutes but I haven't had a chance to test it yet. Does the "Command not found" error point to something wrong? I'm building this into a Nagios server and I don't want to have to wipe everything and start fresh later on.

Thanks,

Joe B


----------



## kpa (Mar 30, 2013)

You're using the value of TERM as a shell command there. This is the way to echo(1) the value on the command line:

`$ echo $TERM`


----------



## jbruyet (Mar 30, 2013)

Ok, it comes back as xterm.

Vi still isn't working right and now I have a new symptom -- I was in Insert Mode and as I was right-arrowing across a lower-case word I was converting the letters to upper-case letters. I'm going back to Nano; I've had much better luck with it. 

Thanks,

Joe B


----------



## kpa (Mar 30, 2013)

This is my .vimrc, try it if it solves the problems for you:


```
set lcs=tab:>-
set list
set ruler
syn on
set nomodeline
set softtabstop=4
set noautoindent
set tabstop=4
set shiftwidth=4
set expandtab
set backspace=indent,eol,start
```

The defaults for both vi(1) and editors/vim are somewhat unusable if you're more used to other editors like nano.


----------



## wblock@ (Mar 30, 2013)

jbruyet said:
			
		

> Ok, it comes back as xterm.
> 
> Vi still isn't working right and now I have a new symptom -- I was in Insert Mode and as I was right-arrowing across a lower-case word I was converting the letters to upper-case letters.



~ is the convert-to-uppercase command.  This still suggests a problem with terminal settings.  What have you modified?  /etc/ttys, maybe?

editors/nano uses the same terminal emulation as everything else.  The commands are not the same, so it won't have the same problems, but it will still not work right.


----------



## jbruyet (Apr 9, 2013)

Hi @wblock. Sorry about the long delay; this was superseded by other projects at work. I haven't made any changes to any of the files. I am using a program called mRemoteNG to SSH in to all of my servers. I don't know if that would do anything. As to using Nano, I've been using it without any problems. In fact, when I've had problems with vi in my Linux servers I used Nano instead. Up until I learned about the vim install fix for vi. 

Thanks,

Joe B


----------



## wblock@ (Apr 9, 2013)

There may be terminal emulation options in mRemoteNG.  PuTTY has keyboard options that have to be chosen to work correctly with FreeBSD.


----------



## jbruyet (Apr 9, 2013)

@wblock@, there _is_ a PuTTY configuration option and that option opens PuTTY for making the changes. I changed the "The Function keys and keypad" option from ESC[n~ to VT100+ and that seemed to make things work a little better but we're still not there -- I tried to backspace over some characters and that made them upper-case, then doing a capital I moved the cursor to home on that line. Any suggestions for more tweaks? 

Also, I was looking for my .vimrc file and can't find anything. @kpa, are you still out there? Where do I find my .vimrc file? 

Thanks,

Joe B


----------



## cpm@ (Apr 9, 2013)

jbruyet said:
			
		

> Also, I was looking for my .vimrc file and can't find anything. Kpa, are you still out there? Where do I find my .vimrc file?
> 
> Thanks,
> 
> Joe B



Read vim(1)() man page.


----------



## wblock@ (Apr 10, 2013)

jbruyet said:
			
		

> wblock, there IS a PuTTY configuration option and that option opens PuTTY for making the changes. I changed the "The Function keys and keypad" option from ESC[n~ to VT100+



If this is PuTTY, just a second...

Set Backspace to Control-H.
Set Home and End keys to Standard.
Set Function Keys and keypad to Linux.

In your .cshrc, set

```
bindkey "\e[1~" beginning-of-line
bindkey "\e[3~" delete-char
```



> and that seemed to make things work a little better but we're still not there -- I tried to backspace over some characters and that made them upper-case, then doing a capital I moved the cursor to home on that line.



That capital I is working as intended.


----------



## lalebarde (Apr 10, 2013)

Back to vim install, original issue here, I have the same problem with vim-lite. If I use ports, I get (first, I installed gettext via ports) :

```
root@EL001:/usr/ports/editors/vim-lite # make install clean
=> 7.3.008 doesn't seem to exist in /usr/ports/distfiles/vim.
=> Attempting to fetch http://artfiles.org/vim.org/patches/7.3/7.3.008
7.3.008                                       100% of   11 kB  127 kBps
=> 7.3.009 doesn't seem to exist in /usr/ports/distfiles/vim.
=> Attempting to fetch http://artfiles.org/vim.org/patches/7.3/7.3.009
7.3.009                                       100% of 3197  B  482 kBps
.....
=> 7.3.052 doesn't seem to exist in /usr/ports/distfiles/vim.
=> Attempting to fetch http://artfiles.org/vim.org/patches/7.3/7.3.052
7.3.052                                       100% of   10 kB  122 kBps
=> 7.3.053 doesn't seem to exist in /usr/ports/distfiles/vim.
=> Attempting to fetch http://artfiles.org/vim.org/patches/7.3/7.3.053
^Cfetch: transfer interrupted
```

If I use pkg_add, I get:

```
root@EL001:/mnt/support/tarballs # pkg_add vim-lite-7.3.669.tbz
pkg_add: warning: package 'vim-lite-7.3.669' requires 'libiconv-1.14', but 'libiconv-1.14_1' is installed
pkg_add: warning: package 'vim-lite-7.3.669' requires 'gettext-0.18.1.1', but 'gettext-0.18.1.1_1' is installed
```

I read a lot of posts dating 2009 with a big mess related to the 7.2.041% patch, including a solution with a Makefile patch, but nothing that works for me with 7.3

Last, I am on a fresh install of FreeBSD 9.1 on a server, and I am a FreeBSD newbie. I want vim to help in the install process because it is conveniant for me - then I will uninstall it.

Any clue please?


----------



## kpa (Apr 10, 2013)

editors/vim has lots and lots of patches that need to be fetched, let the port compilation continue long enough and it should fetch them all.


----------



## lalebarde (Apr 10, 2013)

Thanks @kpa. This is a crazy situation, but I have re-run it. Gracefully, I have to go outside this afternoon. I hope it will have succeeded in the time between!
.....
6 hours after on a dual core, it works !!! Just creasy for a footprint of only 90 Mb. Thanks again.


----------



## jbruyet (Apr 12, 2013)

@kpa, I can't find a .vimrc file. I looked in the locations listed in the man pages but nothing there. I tried using locate but that didn't help either; it just did a carriage return.

@wblock, I made the PuTTY tweaks. The only .cshrc file I had was dot.cshrc so I made the two additions there. I'll try it this way and see if I notice a difference. 

Thanks,

Joe B


----------



## jbruyet (Apr 12, 2013)

@wblock, those tweaks didn't help. I was just working on a .cfg file (Nagios) and the right-arrow key deleted the line I was working on.

Everybody have a great weekend,

Joe B


----------



## cpm@ (Apr 13, 2013)

jbruyet said:
			
		

> kpa, I can't find a .vimrc file. I looked in the locations listed in the man pages but nothing there. I tried using locate but that didn't help either; it just did a carriage return.



Creates ~/.vimrc and customize it with @kpa's configuration. You can see a list of options that can be preset by entering the following command [CMD=]:set all[/CMD] 

For more information on what a particular option just type [CMD=]:help option_name[/CMD]


----------



## kpa (Apr 13, 2013)

Yes, if ~/.vimrc does not exist you create it yourself.


----------



## jbruyet (Apr 16, 2013)

Ok, I created the .vimrc file and filled it with @kpa's values (post #10) but no joy. I found another site that recommended the following settings so vi would operate in FreeBSD just like it works in Linux. It didn't work either:


```
set nocompatible
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set incsearch
set virtualedit=all
set bs=2
```

These are the only entries in .vimrc and I was wondering -- are there other default entries in my .vimrc file that I'm overlooking? I Googled FreeBSD .vimrc template but nothing of any value showed up. 

Thus far Nano has worked trouble-free for me every time I've used it, if that tells anyone anything. 

Thanks,

Joe B


----------



## jozze (Apr 17, 2013)

Editors vi and vim are the same as in Linux. I used Slackware before (and I still do) and it's the same here. The difference is, most of the times under Linux, it's already preconfigured for you (depends on the distro). Here you have to do it yourself.

Luckily for you, vim ships with a sample configuration file, which has all those nice things you're used to already. I dunno in which directory it is, but you can search for it:


```
# find / | grep vim | grep sample
```

At startup vim for a configuration in two possible files: /etc/vimrc and in ~/.vimrc. If the file doesn't exist, it uses the ugly defaults.

In order to use that sleek and sweet config you're probably used to, move that file to the /etc folder. The filename is without the dot.

If you wanna have some user specific settings, you put them in the ~/.vimrc. Example of ~/.vimrc is this:


```
set number
set enc=utf-8
```

As for the long compilation time of the normal vim ... It all depends on your config. If you addded support for some languages you're not sure you'll need, then you should probably uncheck that option.

Erratic vi behavior is the same thing. The configuration is empty, and it's using the ugly default settings.


----------



## jozze (Apr 17, 2013)

One more thing: just copying the file vimrc.sample to /etc won't do it. You also have to rename it to vimrc (for obvious reasons).

When I was talking about the compilation time and config, I meant your config flags you set with 'make' before building.

Hope this helps


----------



## jozze (Apr 17, 2013)

Oh sorry, I didn't access to my desktop before so I just checked now from my configuration: it's not /etc/vimrc where your system wide vim config is, but it's /usr/local/share/vim/vimrc, and "sample" is in fact /usr/local/share/vim/vim73/vimrc_example.vim. Sorry if I made any confusion before.


----------



## jbruyet (May 16, 2013)

Hey @jozze, thanks for the info. I'll try it tomorrow. Also, sorry for the long delay -- I just returned to work after rotator cuff surgery. 

Thanks,

Joe B


----------



## jozze (May 17, 2013)

No problem  Before you were complaining about the long compilation time, so I maybe you can cut of the compile time config flags a little bit. Here's how mine look like:


```
# cd /usr/ports/editors/vim && make showconfig
===> The following configuration options are avalilable for vim 7.3.669_1:
     CSCOPE=off: cscope support
     EXUBERANT_CTAGS=off: Use exctags instead of ctags
     LUA=on: Lua scripting language support
     NLS=on: Native Language Support
     PERL=off: Perl scripting language support
     PYTHON=on: Python bindings or support
     RUBY=off: Ruby bindings or support
     TCL=off: Tcl scripting language support
     X11=off: X11 (graphics) support
     XTERM_SAVE=on: Restore xterm screen after exit
====> Options available for the radio UI: you can only select none or one of them
     ATHENA=off: Athena GUI toolkit
     GTK2=off: GTK+ 2 GUI toolkit support
     GNOME=off: GNOME desktop environment support
     MOTIF=off: Motif widget library support
===> Use 'make config' to modify these settings
```

It will still take long to download all the patches (all 669 of them are downloaded separately, that's why), but it will compile fast.

Happy coding, and I wish you a swift recovery!

Cheers,

JoÅ¾e


----------



## Avyd (May 29, 2013)

jozze said:
			
		

> No problem  Before you were complaining about the long compilation time, so I maybe you can cut of the compile time config flags a little bit. Here's how mine look like



I have had similar problems and for me installing vim without X11 worked.

`make WITHOUT_X11=yes install clean`


----------



## ShelLuser (May 30, 2013)

I figured I could easily do without vim but now that I'm busy using multiple text files and comparing their contents (I know about cmp, that's not the point) I finally gave in.

Just wanting to share that I also don't think the compile time is an issue of editors/vim vs. editors/vim-lite but merely of configuring the whole thing (`# make config`). Since I don't use X11 on my server I made sure to only enable the CSCOPE and PERL options and in the end I think the fetching of all the distribution patches actually took longer than the actual compile process.


----------

