Thanks for all the answers. I now mapped the following:
nmap <A-k> :m+<CR> imap <A-k> <ESC>:m+<CR>a nmap <A-j> :m-2<CR> imap <A-j> <ESC>:m-2<CR>a Somehow, the mapping is not functioning and <A-j> / <A-k> still moves up / down. Is there something I did wrong? When mapping it to another key it is working. Best Regards, Yannik -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of AK Sent: Tuesday, March 13, 2012 5:46 PM To: [email protected] Subject: Re: Move current line up On 03/13/2012 12:39 PM, sc wrote: > On Tue, Mar 13, 2012 at 04:48:43PM +0100, Yannik Sembritzki wrote: >> Hello, > >> is there any pre-defined function which moves the current line up one >> line (e.g. ddkP - (only works if you have got a line above and under >> the line you want to move)), or has anyone already scripted such a function? > > two of my favorite settings in my .vimrc: > > nmap<silent> <F8> :m+<CR> > imap<silent> <F8> <ESC>:m+<CR>a > nmap<silent> <S-F8> :m-2<CR> > imap<silent> <S-F8> <ESC>:m-2<CR>a > nmap<silent> <M-F8> yyp > imap<silent> <M-F8> <ESC>yyp$a > > ok, it's more than two, but down (F8) and up (S-F8) are the two i use > the most > > hth, > > sc > I think alt-k and alt-j are really handy mapping for these commands. -ak -- 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 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
