Skip to contentSkip to conversation

qemu: add .exrc

PATCH In review Michael S. Tsirkin 2 participants 4 messages Jul 19, 2012 – Jul 31, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qemu: add .exrc

I've been using this to get correct indenting with vim in qemu for a while, but it's a bit easier if we put the settings in the central place.
Note that
1. you still need to enable 'exrc' and 'secure' options in your vimrc for these settings to take effect.
2. you can create a .vimrc file if 'exrc' is on but there's need to bypass this configuration.

---

Changes from v1:
added some comments explaining usage

 .exrc | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 .exrc
.exrc new file +7 -0
new file mode 100644
index 0000000..37755ed
@@ -0,0 +1,7 @@
+"VIM settings to match QEMU coding style.  They are activated by adding the
+"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
+"set secure
+"set exrc
+set expandtab
+set shiftwidth=4
+set smarttab
Signature · 1 line
MST
#1 lore raw
Quoted 10 lines · Michael S. Tsirkin

I've been using this to get correct indenting with vim in qemu for a while, but it's a bit easier if we put the settings in the central place.
Note that
1. you still need to enable 'exrc' and 'secure' options in your vimrc for these settings to take effect.
2. you can create a .vimrc file if 'exrc' is on but there's need to bypass this configuration.

So two -1 and one +1, given +1 seems to be the only one from a vim user I'm inclined to go ahead with this one as others aren't likely to be negatively affected...

Quoted 24 lines

---

Changes from v1:
added some comments explaining usage

 .exrc | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 .exrc
.exrc new file +7 -0
new file mode 100644
index 0000000..37755ed
@@ -0,0 +1,7 @@
+"VIM settings to match QEMU coding style.  They are activated by adding the
+"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
+"set secure
+"set exrc
+set expandtab
+set shiftwidth=4
+set smarttab
Signature · 1 line
MST
#2 lore raw
Quoted 25 lines · Michael S. Tsirkin
Quoted 10 lines · Michael S. Tsirkin

I've been using this to get correct indenting with vim in qemu for a while, but it's a bit easier if we put the settings in the central place.
Note that
1. you still need to enable 'exrc' and 'secure' options in your vimrc for these settings to take effect.
2. you can create a .vimrc file if 'exrc' is on but there's need to bypass this configuration.

So two -1 and one +1, given +1 seems to be the only one from a vim user I'm inclined to go ahead with this one as others aren't likely to be negatively affected...

Quoted 9 lines

---

Changes from v1:
added some comments explaining usage

 .exrc | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 .exrc
Quoted 10 lines

.exrc line 4

Quoted 10 lines
.exrc new file +4 -0
new file mode 100644
index 0000000..37755ed
@@ -0,0 +1,7 @@
+"VIM settings to match QEMU coding style.  They are activated by adding the
+"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
+"set secure
+"set exrc

Doesn't this make VIM to read commands from all files edited, not just files of QEMU? Aren't there security implications from this recommendation?

Quoted 6 lines
Quoted 5 lines
.exrc new file +3 -1
+set expandtab
+set shiftwidth=4
+set smarttab
--

MST

#3 lore raw
Quoted 26 lines · Blue Swirl
Quoted 25 lines · Michael S. Tsirkin
Quoted 10 lines · Michael S. Tsirkin

I've been using this to get correct indenting with vim in qemu for a while, but it's a bit easier if we put the settings in the central place.
Note that
1. you still need to enable 'exrc' and 'secure' options in your vimrc for these settings to take effect.
2. you can create a .vimrc file if 'exrc' is on but there's need to bypass this configuration.

So two -1 and one +1, given +1 seems to be the only one from a vim user I'm inclined to go ahead with this one as others aren't likely to be negatively affected...

Quoted 9 lines

---

Changes from v1:
added some comments explaining usage

 .exrc | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 .exrc
Quoted 14 lines
Quoted 10 lines

.exrc line 4

Quoted 10 lines
.exrc new file +4 -0
new file mode 100644
index 0000000..37755ed
@@ -0,0 +1,7 @@
+"VIM settings to match QEMU coding style.  They are activated by adding the
+"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
+"set secure
+"set exrc

Doesn't this make VIM to read commands from all files edited, not just files of QEMU? Aren't there security implications from this recommendation?

That is why you need to set "secure" option.
Another way is to manually source this file,
I will add this explanation.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
.exrc new file +3 -1
+set expandtab
+set shiftwidth=4
+set smarttab
--

MST