sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
vim ~/.zshrc
CMD + ,
- Text: Change Font size to 14
:w practice.php
will create a new file called practice.php
:e practice.php
edit the practice.php file that was just created
:pwd
show the present working directory
TAB Autocompletion works the same as on the command line.
i
enter insert modeESC
enter normal modeh
left,l
right,j
down,k
upv
enter visual mode to highlight charactersV
enter visual line to highlight entire linesd
delete character (or selection)u
undo:e ~/.vimrc
open the .vimrc file to configure Vim:colorscheme
then tab will cycle through all of the different colorscheme options:so
source &%
current file [:so %
] source the current file.
If editing the .vimrc file inside of Vim, this command will apply all configuration changes.
syntax enable
colorscheme desert
"Make backspace behave like every other editor
set backspace=indent,eol,start
:e ~/.vimrc
:echo $MYVIMRC
displays the path to .vimrc in home directory:tabedit $MYVIMRC
opens .vimrc in a new tab:bd
close tab or buffer<cr>
carriage return:tabc
closes the current tab
,
acts as a namespace to all of your configuration. Can be anything that you want.
<Leader>
alias for backslash (\
) and is default.o
create a new line/
search for textn
will show next occurencegg
goto top of documentV
to select full liney
yank text (alias for copy)p
to paste text at desired spotyy
yank entire line.
redo last commandnohlsearch
turns off search highlightingzz
centers current line on page
"...
"The default leader is \, but a comma is much better
let mapleader = ','
"activates line numbers
set number
"set line spacing (MacVim specific)
set linespace=15
"---------------Search--------------"
set hlsearch
set incsearch
"---------------Mappings--------------"
"Make it easy to edit the Vimrc file
nmap <Leader>ev :tabedit $MYVIMRC<cr>
"add simple highlight removal
nmap <Leader><space> :nohlsearch<cr>
"--------------Auto-Commands------------"
"Automatically source the Vimrc file on save.
augroup autosourcing
autocmd!
autocmd BufWritePost .vimrc source %
augroup END
cd ~/.vim
mkdir colors
cd colors
wget https://raw.githubusercontent.com/gosukiwi/vim-atom-dark/master/colors/atom-dark-vim
:colorscheme atom-dark
" ~/.vimrc
"...
"--------------Visuals--------------
colorscheme atom-dark
set t_CO=256 "forces 256 colors (only use if using terminal Vim)
set guifont=Fira_Code:h17 "Will probably need to be installed
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
"...
Open preferences in MacVim (
CMD + ,
). Uncheck Prefer native full-screen support (requires Mac OS X 10.7).
:sp
split window horizontally:vsp
vertical window split:q
close the active split windowCTRL + w
thenh
j
k
orl
to navigate between the splits.CTRL + ww
to switch between open splits:bp
return to the previous buffer:ls
list all buffers you have open:b3
goto the 3rd buffer, etc. etc.CTRL + w|
causes split to temporarily go full screenCTRL + w=
normalizes the splits
This is the default. We're going to change this.
CTRL + ev
will open the .vimrc file
"--------------Split Management--------------
set splitbelow
set splitright
nmap <C-J> <C-W><C-J>
nmap <C-K> <C-W><C-K>
nmap <C-H> <C-W><C-H>
nmap <C-L> <C-W><C-L>
:e .
browse the current directoryCTRL + ^
return to previous edit point
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Add the following to to the top of your .vimrc file
set nocompatible
so ~/.vim/plugins.vim "links plugin config that will reside in a separate file
" ~/.vim/plugins.vim
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-vinegar'
Plugin 'scrooloose/nerdtree'
call vundle#end()
filetype plugin indent on
:PluginInstall
installs newly added plugins
-
opens the folder that current file resides-
again will go up a level
d
create a directoryD
delete a directory or file%
create a new file
:NERDTreeToggle
opens a sidebar directory tree?
within sidebar will show quickhelp
"Add to Mappings section in .vimrc
"Make NERDTree easier to toggle.
nmap <D-1> :NERDTreeToggle<cr> "D mean Command
It is recommended to install ctags
brew install ctags
" ~/.vim/plugins.vim
"...
Plugin 'ctrlpvim/ctrlp.vim'
-
:CtrlP
orCTRL + p
then start typing to find a file to navigate to -
:CtrlPBufTag
start typing to find variables, functions and class declarations -
:CtrlPMRUFiles
list most recently used files -
CTRL + d
switch between searching through any path or the file name itself -
:bufdo bd!
close everything
" ~/.vimrc
"Add to Mappings section
nmap <c-R> :CtrlPBufTag<cr>
nmap <D-e> :CtrlPMRUFiles<cr>
"--------------Plugins--------------
"CtrlP
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30, results:30'