Problem with vim

  • Thread starter Thread starter osp
  • Start date Start date
O

osp

Guest
nakal said:
What I want to know about is your problem with vim that I cannot understand. Please be a more exact here what is happening.

Examples:
  1. in insert mode I write something and decide to delete that - (not escaping insert mode) I press [backspace] - what is happening is that cursor just moves left, characters stays and they disappear only after I press [ESC]
  2. I enter insert mode with and try to move with arrow keys: it starts to make newline with one 'C ' at the beginning - in [ESC] mode arrows keys work properly
    [*]backspacing at the beginning of line stays there - on linux it just erase newline and keep backspacing to the top.


Just a few annoying things I found after a few minutes - really simple editing - this is not a vim behaviour that I am used to on Linux.
 
osp said:
3. example: backspacing at the beginning of line stays there - on Linux it just erase newline and keep backspacing to the top...
Create a ~/.vimrc and put this in there:
Code:
set backspace=indent,eol,start

On most Linux distributions the vim configuration has been heavily modified. On FreeBSD you get the standard, default settings. So you need to tweak it a bit for your environment.
 
Just to be completely sure--you are using editors/vim and not the version of vi that is included with FreeBSD, correct? FreeBSD uses nvi which behaves a little differently than editors/vim.

If so, then as @SirDice said, it's most likely to be a particular Linux distribution's customized version of editors/vim, and you might get different results with different Linux distributions.
 
Last edited by a moderator:
scottro said:
Just to be completely sure--you are using editors/vim and not the version of vi that is included with FreeBSD, correct? FreeBSD uses nvi which behaves a little differently than editors/vim.

If so, then as @SirDice said, it's most likely to be a particular Linux distribution's customized version of editors/vim, and you might get different results with different Linux distributions.

Like I wrote I did pkg install vim, and vim <file>
 
Last edited by a moderator:
SirDice said:
osp said:
3. example: backspacing at the beginning of line stays there - on Linux it just erase newline and keep backspacing to the top...
Create a ~/.vimrc and put this in there:
Code:
set backspace=indent,eol,start

On most Linux distributions the vim configuration has been heavily modified. On FreeBSD you get the standard, default settings. So you need to tweak it a bit for your environment.

OK, I didn't know that, Linux setup is kind of more sensible, but I understand that in FreeBSD is everything vanilla - also good.
 
osp said:
but I understand that in FreeBSD is everything vanilla - also good.
Yes, that's something to keep in mind. A lot of things you install will need to be configured, which is a good thing because it allows you the freedom to modify it and adjust it to your liking. The downside is that you really need to configure everything, sometimes even for the most basic settings.
 
Vim is fundamental for me in text mode, so I am trying to replicate my Linux setup and possibly export it to a single .vimrc, which I could copy to FreeBSD installation.

I find this hints: http://vim.1045645.n5.nabble.com/export-settings-td1180809.html and done this: vim -s /usr/share/vim/vim74/bugreport.vim. This creates a text file bugreport.txt (in attachment) and it should be a file with my complete vim environment. But the output is a little strange to me.

Can someone help me how to edit/reformat that file so it would become a correct vimrc file? It is huge so manually to pinpoint what is relevant and what not would be a pain - does anyone know how to do properly export/import of a vim configuration?
 

Attachments

I use vim and none of the problems originally described happen with me. It sounds like either you're using vi instead of vim, or your terminal is wrong. All I've done is copied the /usr/local/share/vim/vim74/vimrc_example.vim file into ~/.vimrc and aliased vi to vim. I'm also using PuTTY with the xterm terminal settings. Arrow keys in edit mode etc all works normally.
 
xtaz said:
and aliased vi to vim.
That might be the reason. On a lot of Linux distributions vi already points to vim. On FreeBSD they remain separate. In my ~/.cshrc I have:
Code:
if ( -x /usr/local/bin/vim ) then
  alias vi vim
endif
 
xtaz said:
I use vim and none of the problems originally described happen with me. It sounds like either you're using vi instead of vim, or your terminal is wrong. All I've done is copied the /usr/local/share/vim/vim74/vimrc_example.vim file into ~/.vimrc and aliased vi to vim. I'm also using PuTTY with the xterm terminal settings. Arrow keys in edit mode etc all works normally.

I wrote two times already: I did
Code:
pkg install vim
and using
Code:
vim
Code:
# which vi
/usr/bin/vi
# file /usr/bin/vi
....ELF 64bit....
# which vim
/usr/local/bin/vim
# file /usr/local/bin/vim
....ELF 64bit....

P.S. and now I had to use vipw (so I guess true vi) and that was just beyond terrible
 
SirDice said:
xtaz said:
and aliased vi to vim.
That might be the reason. On a lot of Linux distributions vi already points to vim. On FreeBSD they remain separate. In my ~/.cshrc I have:
Code:
if ( -x /usr/local/bin/vim ) then
  alias vi vim
endif

Maybe both of you should test it on fresh install without X - I am using viM
 
You should set the environment variable EDITOR to your favorite editor. vipw will read this environment variable and start accordingly.
 
nakal said:
You should set the environment variable EDITOR to your favorite editor. vipw will read this environment variable and start accordingly.

That was first thing I tried: echo $EDITOR. it was empty, so I guessed that I would have to read manual or ask question, because FreeBSD does again something different. So I battled my way trough default vipw.
 
Back
Top