My personal .vimrc preferences and collection of settings. Basically i tried to make a collection that does not need any plugins besides from the features already delivered with VI improved (Vim) so i can use this on almost every server without installing anything.
ATTENTION: This help contains normal VIM commands and newly added stuff added whith custom .vimrc in a wild mix.
usually it should be Placed here:
Description | File |
---|---|
user vimrc file | $HOME/.vimrc |
2nd user vimrc file | ~/.vim/vimrc |
You can use :version
in command mode to show what files he is checking.
system vimrc file: "/usr/local/etc/vim/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/etc/vim"
f-b for $VIMRUNTIME: "/usr/local/share/vim/vim81"
Command/Schortcurt | Result |
---|---|
CTRL+ w followed by h | split horizontally |
CTRL + w followed by v | split vertically |
CTRL+ w followed by < or > | resize horizontally |
CTRL+ w followed by + or - | resize vertically |
CTRL + w followed by w | to toggle between open windows and |
CTRL + w followed by h/j/k/l CTRL + w followed by Left/Down/Up/Right arrow |
move to the left/bottom/top/right window accordingly |
:q | close it |
Command | Result |
---|---|
:tabnew | new tab |
,t | new tab with explorer |
,T | remove complete tab with multiple windows |
gt CTRL + PgUp |
go next tab |
gT CTRL + PgDn |
go previous tab |
{i}gt | got to tab number {i} |
Command | Result |
---|---|
"+y | copy to clipboard |
"*y | copy to middle mouse button |
"+p | paste from clipboard |
"*p | paste from middle mouse button |
As mentioned below there are systems whithout a clippboard. Thats the reason why i did not add this permanantly to my vimrc.
set clipboard=unnamedplus
" or
set clipboard=unnamed
Depending on what clipboard you want to use.
If you wants to know if your VIM supports cipboard:
vim --version | grep clip
The clipboard sytem on linux/Unix machines is handled by the Xserver, So if your Server has no X11 System you have to rely on the copy and paste capability of your terminal application. Always remember that if you hold CTRL and select whith your mouse you get into blocksekection mode.(sometimes it's CRTL+ALT)
In Putty (Windows to Linux), you can highlight the text in the tty by holding the left mouse button down, then clicking the right mouse button (without lifting the left button). Then you can paste it anywhere you want.
Several links concerning PHP and VIM