You are not logged in.

#1 2010-10-13 13:36:56

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Vim stepdown effect.

This is really bugging me, In one of my previous vimrc's I had middlemouse bound to paste (which wouldnt do the stepdown effect)

I believe it was something along the lines of 'map <MiddleMouse> :set invpaste paste?' But that doesn't seem to work. After a good while googling all I can find is toggles which is not what im after. Any ideas? this is driving me insane!

Offline

#2 2010-10-13 14:18:12

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Vim stepdown effect.

*lol* me too - and _my_ solution is to use 'vi' instead of 'vim' (you may have an 'alias vi=vim' in your .bashrc ...)
'vi' don't have all the bells and whistles of vim - just a god-damned, honest, old-fashioned editor which behaves the way you expect and which can be set up using EXINIT instead of carrying a .vimrc-file around with you ...

Offline

#3 2010-10-13 14:36:55

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

perbh wrote:

*lol* me too - and _my_ solution is to use 'vi' instead of 'vim' (you may have an 'alias vi=vim' in your .bashrc ...)
'vi' don't have all the bells and whistles of vim - just a god-damned, honest, old-fashioned editor which behaves the way you expect and which can be set up using EXINIT instead of carrying a .vimrc-file around with you ...

Hm, I'm not prepared to switch to vi over vim because of this, when I know that there is a fix. (What annoys me most is that I had it, but lost it somehow tweaking my vimrc) =/

Offline

#4 2010-10-13 15:31:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

What is a stepdown effect? Check the paste options, there are a couple of them.

Offline

#5 2010-10-13 15:39:33

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

karol wrote:

What is a stepdown effect? Check the paste options, there are a couple of them.

When pasting some plaintext into vim using mouse3, instead of how the text should appear, like;

1
2
3
4

it comes out as;

1
                2
                                     3
                                                      4

There was a singular bind that fixed it, not something you had to toggle on, then paste, then toggle off. Any ideas?

Offline

#6 2010-10-13 15:46:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

That's what I thought it is :-)
See if this helps http://aymanh.com/a-collection-of-vim-t … g-from-gui

dab-_- wrote:

There was a singular bind that fixed it, not something you had to toggle on, then paste, then toggle off. Any ideas?

If it works, you can put 'set paste' in your .vimrc.

Last edited by karol (2010-10-13 15:48:16)

Offline

#7 2010-10-13 15:54:11

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

karol wrote:

That's what I thought it is :-)
See if this helps http://aymanh.com/a-collection-of-vim-t … g-from-gui

dab-_- wrote:

There was a singular bind that fixed it, not something you had to toggle on, then paste, then toggle off. Any ideas?

If it works, you can put 'set paste' in your .vimrc.

Yeah I came across that article myself, but again that is a toggle, the bind I had just fixed middlemouse to paste properly, argh =/

Offline

#8 2010-10-13 16:01:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

Maybe it's not the 'paste' settings but the 'mouse' settings like 'set mouse=a' (it won't help you, it's just an example) or 'map <MouseMiddle> <esc>"*p' (this may work)?

Last edited by karol (2010-10-13 16:09:51)

Offline

#9 2010-10-13 16:12:08

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

karol wrote:

Maybe it's not the 'paste' settings but the 'mouse' settings like 'set mouse=a' or 'map <MouseMiddle> <esc>"*p'?

Just played with mouse=, no joy there. 'map <MouseMiddle> <esc>"*p' doesn't seem to work either. sad

Offline

#10 2010-10-13 16:21:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

Have you checked the built-in help? It's quite extensive.

Is it a problem to 'set paste' in your .vimrc? What's wrong with that - any side effects?

Last edited by karol (2010-10-13 16:22:44)

Offline

#11 2010-10-13 16:27:23

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

karol wrote:

Have you checked the built-in help? It's quite extensive.

Is it a problem to 'set paste' in your .vimrc? What's wrong with that - any side effects?

Afaik, This turns autoindent etc off, I might be wrong but I think I read it somewhere

Offline

#12 2010-10-13 16:59:45

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Vim stepdown effect.

Interesting, I get the set-down effect in nano, but not in vim.
I have mouse=r as the only setting I can see that may affect it (maybe autoindent rules but it works for your 1234 example above).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#13 2010-10-13 17:03:49

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

skanky wrote:

Interesting, I get the set-down effect in nano, but not in vim.
I have mouse=r as the only setting I can see that may affect it (maybe autoindent rules but it works for your 1234 example above).

Hm, Just tried with mouse=r and STILL no joy. I remember stumbling upon the bind when pimping my vimrc, And now I've lost it I cannot find it ANYWHERE. I've been searching high and low since this morning, really doing my head in!! =/

Offline

#14 2010-10-13 17:03:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

@ skanky
'set mouse=r' triggers the unwanted behavior for me too.

@ dab-_-
Can you paste your .vimrc?

Last edited by karol (2010-10-13 17:04:39)

Offline

#15 2010-10-13 17:18:05

dab-_-
Member
Registered: 2010-10-05
Posts: 43

Re: Vim stepdown effect.

karol wrote:

@ skanky
'set mouse=r' triggers the unwanted behavior for me too.

@ dab-_-
Can you paste your .vimrc?

Sure;

" perldo {$/='';if($_!~ /my/){$_='';print $_}}
set autoread                    " auto read when file is changed
set nobackup                    " I have git...
set nowb
set noswapfile
set magic                       " magic RE
set mat=2                       "
set cmdheight=1
set nocp                        " no-compatible mode
set t_Co=256                    " use 256 colors
set vb                          " visual bell
set undolevels=512              " undo
set history=50                  " q:
set ruler                       " cursor position
set shortmess=aIoO              " short msg, no intro
set showmode                    " show current mode
set noequalalways               " no need to always keep windows same size
set splitbelow                  " splitted window under current one
set laststatus=2                " status line, always
set maxfuncdepth=1000           " depth for subs
set wildchar=<Tab>              " tab for autocompletion
set wildmode=longest,list       " bash-style completion
set incsearch                   " show partial matches
set hlsearch                    " hilight patterns
set ignorecase                  " ignore case when searching
set smartcase                   " ... unless there is capitals in the pattern
set tabstop=2                   " tabstop
set expandtab                   " spaces, not tabs
set shiftwidth=2
set smarttab                    " outdent by one level using bkspc
set showmatch                   " show matching brackets etc
set autoindent
set smartindent
set showmode
set nowrap                      " dont wrap long lines
set number                      " line numbering
set scrolloff=3                 " number of lines to keep above cursor
set wildmode=list:longest,full  " bash style completioness
set guioptions-=m               " just in case we happened to..
set guioptions=-T               " ..be using gvim
set cursorline                  " hilight line where cursor is
set cot+=menuone                " show preview of function prototype
filetype plugin indent on       " def filetype settings. Mail gets textwidth 72
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
map <F3> :NERDTreeToggle<CR>
map <space> /
map <c-space> ?
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map @ I#
map <F7> :-1r !xclip -o -sel clip<CR>
noremap <Left>  <NOP>
noremap <Right> <NOP>
noremap <Up>    <NOP>
noremap <Down>  <NOP>
inoremap <Left> <NOP>
inoremap <Up>   <NOP>
inoremap <Down> <NOP>
nnoremap <F5> :set invpaste<CR>:set paste?<CR>
augroup vimrc_autocmds
  autocmd BufRead * highlight OverLength ctermbg=236 guibg=#592929
  autocmd BufRead * match OverLength /\%74v.*/
augroup END
colorscheme wombat256mod
syntax on
au BufRead,BufNewFile *.markdown set ft=md
au BufRead,BufNewFile *.md set ft=md
au FileType pl,pm,t set filetype=perl
let perl_include_pod=1            " no idea but seems nice
let perl_extended_vars = 1        " syntax hl for 'complicated' stuff
hi CursorLine term=none cterm=none
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%)
set showcmd     " Show partial command in status line
set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)\ [%08O:%02B]
set list
set listchars=tab:\-\ ,trail:-

Offline

#16 2010-10-13 17:29:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

Disabling autoindent and smartindent fixes it ;P

Offline

#17 2010-10-13 19:38:21

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Vim stepdown effect.

karol wrote:

@ skanky
'set mouse=r' triggers the unwanted behavior for me too.

@ dab-_-
Can you paste your .vimrc?

If I have mouse=a I can't paste with the middle button.
If I have mouse=r I can paste with middle button.

In both cases, I do *not* get the behaviour when I paste text in. Only in nano.

Re autoindent this is what I have:

if has("autocmd")
....
  filetype plugin indent on
....
 else
  set autoindent        " always set autoindenting on
endif " has("autocmd")

"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#18 2010-10-13 19:50:00

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: Vim stepdown effect.

With paste set autoindent will not work. You have to get used to the set:paste && set:nopaste workflow. Copying/pasting within vim for a few lines does not have this problem. And anyway, for large stuff where I foresee a lot of copying and pasting I use a graphical editor. Nano should not have this problem at all. This has nothing to with the mouse, you can reproduce it with keyboard paste commands. If there's a binding that emulates this, I haven't heard of it.

Last edited by schivmeister (2010-10-13 19:54:59)


I need real, proper pen and paper for this.

Offline

#19 2010-10-13 19:59:59

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Vim stepdown effect.

Just checked, Nano does exhibit it, and it's caused by "set autoindent" there, too.

So the bind referred to was one that probably did "set:paste <do paste> set:nopatse"?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#20 2010-10-13 20:05:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Vim stepdown effect.

@ schivmeister
That's right, Shift+Insert behaves the same way.

@ skanky
http://vim.wikia.com/wiki/Toggle_auto-i … code_paste + ':help pastetoggle' in vim.

Offline

Board footer

Powered by FluxBB