Ubuntu won't let me edit or delete .vimrc fileCan't save .bashrc file in VIM (“The swap file ”.bashrc.swp“ already exists!”)Recovery of vim running in screen session after crash of XorgVim change colorscheme and vimrc location fileReflect changes to file that .vimrc sourceshow to use my vimrc file when edit file width sudo commandVI won't let me save my vimrc fileNeed good example of .vimrc fileWhy do I get these .vimrc errors in Ubuntu 14 after upgrade from Ubuntu 13?Why won't Vim source my .vimrc at startup?How to write comment in .vimrc file?Can't find path to ~/.vimrc fileUnmet dependencies installing vim or vim-tiny
Can a character with the War Caster feat call a bolt with Call Lightning instead of making an opportunity attack?
Is there a simple example that empirical evidence is misleading?
Is it legal to have an abortion in another state or abroad?
Why isn't 'chemically-strengthened glass' made with potassium carbonate to begin with?
Why would a rational buyer offer to buy with no conditions precedent?
Do photons bend spacetime or not?
How to deal with a colleague who is being aggressive?
How do I disable login of user?
Is it legal to meet with potential future employers in the UK, whilst visiting from the USA
Dealing with spaghetti codebase, manager asks for things I can't deliver
Is there a context where the expression `a.b::c` makes sense?
Function argument returning void or non-void type
What's difference between "depends on" and "is blocked by" relations between issues in Jira next-gen board?
Is it possible to prohibit all prohibitable schools of magic with a single character?
Are runways booked by airlines to land their planes?
What weight should be given to writers groups critiques?
Job Market: should one hide their (young) age?
Does French have the English "short i" vowel?
Manager questioning my time estimates for a project
On San Andreas Speedruns, why do players blow up the Picador in the mission Ryder?
Why did other houses not demand this?
How to cut a climbing rope?
Drums and punctuation
How to keep consistency across the application architecture as a team grows?
Ubuntu won't let me edit or delete .vimrc file
Can't save .bashrc file in VIM (“The swap file ”.bashrc.swp“ already exists!”)Recovery of vim running in screen session after crash of XorgVim change colorscheme and vimrc location fileReflect changes to file that .vimrc sourceshow to use my vimrc file when edit file width sudo commandVI won't let me save my vimrc fileNeed good example of .vimrc fileWhy do I get these .vimrc errors in Ubuntu 14 after upgrade from Ubuntu 13?Why won't Vim source my .vimrc at startup?How to write comment in .vimrc file?Can't find path to ~/.vimrc fileUnmet dependencies installing vim or vim-tiny
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.
Additionally when I try to edit it from terminal using
sudo vim /etc/vim/vimrc
it says
Found a swap file by name of 'filename'
Apparently it says I edited the same file twice.
command-line vim vimrc
add a comment |
I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.
Additionally when I try to edit it from terminal using
sudo vim /etc/vim/vimrc
it says
Found a swap file by name of 'filename'
Apparently it says I edited the same file twice.
command-line vim vimrc
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
6
Note that.vimrcandvimrcare not the same filename
– wjandrea
May 10 at 17:05
In this case, the solution is to edit a different file. But when you really do needsudoto edit a file, usesudoedit /etc/whateverinstead ofsudo vim /etc/whatever. (You'll need to addexport EDITOR=/usr/bin/vimto~/.bashrc.) You get your own.vimrc, not root's, and you can't run privileged shell commands from within vim.
– AuxTaco
May 10 at 20:06
add a comment |
I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.
Additionally when I try to edit it from terminal using
sudo vim /etc/vim/vimrc
it says
Found a swap file by name of 'filename'
Apparently it says I edited the same file twice.
command-line vim vimrc
I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.
Additionally when I try to edit it from terminal using
sudo vim /etc/vim/vimrc
it says
Found a swap file by name of 'filename'
Apparently it says I edited the same file twice.
command-line vim vimrc
command-line vim vimrc
edited May 10 at 9:59
dessert
27.3k682115
27.3k682115
asked May 10 at 9:57
TistayuTistayu
333
333
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
6
Note that.vimrcandvimrcare not the same filename
– wjandrea
May 10 at 17:05
In this case, the solution is to edit a different file. But when you really do needsudoto edit a file, usesudoedit /etc/whateverinstead ofsudo vim /etc/whatever. (You'll need to addexport EDITOR=/usr/bin/vimto~/.bashrc.) You get your own.vimrc, not root's, and you can't run privileged shell commands from within vim.
– AuxTaco
May 10 at 20:06
add a comment |
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
6
Note that.vimrcandvimrcare not the same filename
– wjandrea
May 10 at 17:05
In this case, the solution is to edit a different file. But when you really do needsudoto edit a file, usesudoedit /etc/whateverinstead ofsudo vim /etc/whatever. (You'll need to addexport EDITOR=/usr/bin/vimto~/.bashrc.) You get your own.vimrc, not root's, and you can't run privileged shell commands from within vim.
– AuxTaco
May 10 at 20:06
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
6
6
Note that
.vimrc and vimrc are not the same filename– wjandrea
May 10 at 17:05
Note that
.vimrc and vimrc are not the same filename– wjandrea
May 10 at 17:05
In this case, the solution is to edit a different file. But when you really do need
sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.– AuxTaco
May 10 at 20:06
In this case, the solution is to edit a different file. But when you really do need
sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.– AuxTaco
May 10 at 20:06
add a comment |
2 Answers
2
active
oldest
votes
User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:
echo 'set mouse=a' >>~/.vimrc
After that, either restart vim or source the file in a running instance with
:source ~/.vimrc
for the change to take effect.
add a comment |
When vim gives you this warning, it also should give you some options at the bottom:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1142064%2fubuntu-wont-let-me-edit-or-delete-vimrc-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:
echo 'set mouse=a' >>~/.vimrc
After that, either restart vim or source the file in a running instance with
:source ~/.vimrc
for the change to take effect.
add a comment |
User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:
echo 'set mouse=a' >>~/.vimrc
After that, either restart vim or source the file in a running instance with
:source ~/.vimrc
for the change to take effect.
add a comment |
User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:
echo 'set mouse=a' >>~/.vimrc
After that, either restart vim or source the file in a running instance with
:source ~/.vimrc
for the change to take effect.
User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:
echo 'set mouse=a' >>~/.vimrc
After that, either restart vim or source the file in a running instance with
:source ~/.vimrc
for the change to take effect.
answered May 10 at 10:02
dessertdessert
27.3k682115
27.3k682115
add a comment |
add a comment |
When vim gives you this warning, it also should give you some options at the bottom:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
add a comment |
When vim gives you this warning, it also should give you some options at the bottom:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
add a comment |
When vim gives you this warning, it also should give you some options at the bottom:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.
When vim gives you this warning, it also should give you some options at the bottom:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.
answered May 10 at 13:45
didwefixitdidwefixit
911
911
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
add a comment |
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.
– Ben
May 11 at 15:10
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1142064%2fubuntu-wont-let-me-edit-or-delete-vimrc-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…
– Lety
May 10 at 9:59
6
Note that
.vimrcandvimrcare not the same filename– wjandrea
May 10 at 17:05
In this case, the solution is to edit a different file. But when you really do need
sudoto edit a file, usesudoedit /etc/whateverinstead ofsudo vim /etc/whatever. (You'll need to addexport EDITOR=/usr/bin/vimto~/.bashrc.) You get your own.vimrc, not root's, and you can't run privileged shell commands from within vim.– AuxTaco
May 10 at 20:06