Questions tagged [vim]

Vim is an open-source text editor with a steep learning curve that leads to high efficiency in many tasks related to text edition. If you wish to start with vim, try to run “vimtutor”, which will teach you basic commands.

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Visit the home page of vim or visit the Official Vim Tips Wiki.

95 questions
50
votes
6 answers

How to make a global ~/.vimrc?

Right now, I make everyone do ~/.vimrc and put their settings there. How can I make a global, default .vimrc for new users?
Alex
  • 8,111
  • 24
  • 71
  • 99
38
votes
16 answers

How to bring .vimrc around when I SSH?

My work tends to involves using SSH to connect to various machines, and then using vim to edit files on those machines. The problem is that I have to constantly copy my .vimrc file around. It's very annoying to open vim and not have any settings. Is…
Apreche
  • 1,405
  • 4
  • 17
  • 20
32
votes
1 answer

How to tell if I'm in MacVim in .vimrc

In my .vimrc, I want to check if I'm in MacVim vs. regular vim so I can optionally set some MacVim-specific settings, which should not be applied to regular vim. How do I do this?
Andy White
  • 1,161
  • 1
  • 14
  • 19
29
votes
4 answers

vim re-edit as root

I often open a file in vim, make some changes and when it's time to save the file is read-only.. (owned by another user). I'm looking for tips on how I could re-open the file as root and keep my changes without first saving it to a temporary file…
rkthkr
  • 8,503
  • 26
  • 38
24
votes
5 answers

How to set vim filetype when editing nginx config files

When I open vim for a file like /etc/nginx/sites-available/default, syntax highlighting works fine. But then if I create my own file /etc/nginx/sites-available/myapp, vim does not highlight its syntax. I have to do :setf conf every time. Is there…
HappyDeveloper
  • 654
  • 2
  • 6
  • 13
23
votes
5 answers

Windows Powershell Vim Keybindings

Is there a way to get vim keybindings in powershell as you would in bash or zsh with a command like set -o vi
Bryan Ward
  • 395
  • 1
  • 3
  • 10
21
votes
10 answers

Suggestions for entries in a sysadmins .vimrc

At the very least I always uncomment "syntax on" in /etc/vim/vimrc
Gareth
  • 8,413
  • 13
  • 43
  • 44
19
votes
12 answers

What language for starting on Linux?

I am about to begin a 4-year information security degree at Purdue. The degree does not call for any programming courses. So the only time I will be able to take one is the occasional elective. So most of my learning will be on my own. At the start…
JD Davis
  • 191
  • 3
19
votes
2 answers

How do I keep 10 lines visible when scrolling up to EOF with CRTL-F?

I am used to using vi, not vim. What I find annoying in vim is that when you are scrolling with CTRL-F and reach EOF, vim scrolls down to the very last line and put this line on the top of your screen, and you can't see the lines above. You must…
Gaston
  • 193
  • 1
  • 5
16
votes
4 answers

Vim - Trigger action\script on save\write?

This might be better for super user, but I figure as a tool of the trade it might be a better topic for here. I find often when editing in vim that I exit out, run some script that I am testing, and then go back into vim (yes I realize I can use…
Joshua Enfield
  • 3,404
  • 8
  • 41
  • 58
13
votes
4 answers

Save file after forgetting to open as root / sudo vi

Possible Duplicate: vim re-edit as root I could have sworn I saw this question asked. But after looking though every search result for "vi" I'm stumped/lazy. I've opened a file, made an edit and now I realize it's read only and I've opened it as…
MathewC
  • 6,877
  • 9
  • 38
  • 53
13
votes
1 answer

Configure vim for text selection with shift and copy/paste via ctrl+c, ctrl+v?

Many machines i need to work with have basic NIX installation with vim as text editor. But vim's way to select text is kind of unusual to me :). Is it any easy way to re-configure vim so it will use shift in order to select text and ctrl+c / ctrl+v…
grigoryvp
  • 3,415
  • 11
  • 38
  • 58
11
votes
2 answers

How to tell Vim to extend the background color to the whole screen?

I have an issue with the Vim color schemes: The background color does not fill the whole screen. For example, in the "blue" color scheme the whole screen should turn blue. Instead, the blue background only extends to the end of each line. Is this a…
chiborg
  • 1,043
  • 2
  • 13
  • 26
10
votes
5 answers

How to enable color in Vim over SSH?

I have two remote servers: Server 1: Linux 2.6.18-238.12.1.el5PAE i686 / VIM - Vi IMproved - version 7.0.237 Server 2: Linux 2.6.18-338.19.1.el5.lve0.8.36 x86_64 / VIM - Vi IMproved version 7.0.237 When I ssh into Server 2 and use vim to edit a php…
cwd
  • 2,693
  • 9
  • 32
  • 47
8
votes
2 answers

When using vim with screen the keys ctrl + right and ctrl + left don't work

In the last days i became very addicted of using the combination terminator (in full screen) + screen + vim. But i'm having problems with the ctrl + right and ctrl + left key mappings, they are erasing text instead of jumping words. I already…
Dimas Kotvan
  • 241
  • 3
  • 7
1
2 3 4 5 6 7