Discussion:
line editor keybindings
A***@Biologie.Uni-Osnabrueck.DE
2018-03-13 09:09:24 UTC
Permalink
Hi,

can I switch the editor key bindings to the vi style ?

greetings
Andreas
--
Andreas Müller
Erik Christiansen
2018-03-13 09:50:20 UTC
Permalink
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
this line in ~/.muttrc:

set editor=vim

On a *nix platform, it would be very poor to be unable to use your
favourite editor everywhere.

Erik
Marco Dickert
2018-03-13 10:13:08 UTC
Permalink
Post by Erik Christiansen
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
set editor=vim
You also may want to use a mutt-dedicated vim configuration, like I do:

----
set editor="/usr/bin/vim -c ~/.mutt/vimrc"
----

My ~/.mutt/vimrc looks like this:

----
syntax on
set background=dark
set showcmd
set showmatch
set tabstop=4
set sw=4
set expandtab
set ft=mail
set tw=80
----
--
Marco Dickert
***@misterunknown.de
https://misterunknown.de
Florian Lohoff
2018-03-13 10:23:26 UTC
Permalink
Post by Marco Dickert
Post by Erik Christiansen
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
set editor=vim
----
set editor="/usr/bin/vim -c ~/.mutt/vimrc"
----
As an alternative:

au BufRead,BufNewFile /home/flo/tmp/mutt-* set noai tw=72 ft=mail spell

Obviously you need to change you path for your setup.

Flo
--
Florian Lohoff ***@zz.de
UTF-8 Test: The 🐈 ran after a 🐁, but the 🐁 ran away
Christian Brabandt
2018-03-13 10:35:29 UTC
Permalink
Post by Florian Lohoff
Post by Marco Dickert
Post by Erik Christiansen
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
set editor=vim
----
set editor="/usr/bin/vim -c ~/.mutt/vimrc"
----
au BufRead,BufNewFile /home/flo/tmp/mutt-* set noai tw=72 ft=mail spell
Obviously you need to change you path for your setup.
Even better:

Make sure to have a `:filetype plugin on` in your .vimrc
and then drop all your mutt related settings below
~/.vim/ftplugin/mail.vim
(create non-existent directories).

Then you only need `:set editor=vim` because Vim already recognizes mutt
mails as filetype=mail.

See also here:
https://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html


regards,
Christian
--
MS-DOS must die!
Erik Christiansen
2018-03-13 10:58:55 UTC
Permalink
Post by Marco Dickert
Post by Erik Christiansen
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
set editor=vim
----
set editor="/usr/bin/vim -c ~/.mutt/vimrc"
----
Yes, good point. It can alternatively be handled by a vim autocommand,
e.g.:

au BufNewFile,BufRead ~/Desktop/mutt-* call Set_for_mutt()

function! Set_for_mutt()
setlocal textwidth=72
setlocal formatoptions=qrjt

" Change subthread Subject:
noremap <A-w> ^[gg/^Subject:^MWi [Was: ^OB
"
"Don't quote sig in email replies:
normal :g/^> -- $/,/^$/-1d^M/^$^M^L
endfunction

And for prompting for attachments if they're mentioned in the email,
install CheckAttach.vim & enable it by filetype:

" CheckAttach.vim is a filetype plugin.
filetype plugin on

Note: In ~/.muttrc , there's:

set tmpdir="~/Desktop" # If not in ~/postponed after a crash, look here.

The autocommand's second field needs to match.

Separate .vimrc files slightly smaller, but raise the problem of
maintaining multiple copies, when common lines are edited. When
there's only one, the problem does not arise.

Erik
A***@Biologie.Uni-Osnabrueck.DE
2018-03-13 10:33:20 UTC
Permalink
oh yes, I already have that setting..

but I mean the "littel" line at the bottom of my mutt witch I can
enter with the ':' char

in my bash I switch to that behavior with

set -o vi

some hints ?

- thanks! -


greetings
Andreas
Post by Erik Christiansen
Post by A***@Biologie.Uni-Osnabrueck.DE
can I switch the editor key bindings to the vi style ?
There is better than that - you can use vim as the mutt editor, with
set editor=vim
On a *nix platform, it would be very poor to be unable to use your
favourite editor everywhere.
Erik
--
Andreas Müller - Raum: 35/114b - Tel: 2875
Ben Boeckel
2018-03-13 20:13:46 UTC
Permalink
Post by A***@Biologie.Uni-Osnabrueck.DE
oh yes, I already have that setting..
but I mean the "littel" line at the bottom of my mutt witch I can
enter with the ':' char
in my bash I switch to that behavior with
set -o vi
some hints ?
I don't think there's any way. Even in Vim, to get Vi-like editing on
the command line, you use `C-f` and a small buffer shows up.

--Ben

Continue reading on narkive:
Loading...