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.
ienter insert modeESCenter normal modehleft,lright,jdown,kupventer visual mode to highlight charactersVenter visual line to highlight entire linesddelete character (or selection)uundo:e ~/.vimrcopen the .vimrc file to configure Vim:colorschemethen tab will cycle through all of the different colorscheme options:sosource &%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 $MYVIMRCdisplays the path to .vimrc in home directory:tabedit $MYVIMRCopens .vimrc in a new tab:bdclose tab or buffer<cr>carriage return:tabccloses 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.ocreate a new line/search for textnwill show next occurencegggoto top of documentVto select full lineyyank text (alias for copy)pto paste text at desired spotyyyank entire line.redo last commandnohlsearchturns off search highlightingzzcenters 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 ENDcd ~/.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).
:spsplit window horizontally:vspvertical window split:qclose the active split windowCTRL + wthenhjkorlto navigate between the splits.CTRL + wwto switch between open splits:bpreturn to the previous buffer:lslist all buffers you have open:b3goto 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 + evwill 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:PluginInstallinstalls newly added plugins
-opens the folder that current file resides-again will go up a level
dcreate a directoryDdelete a directory or file%create a new file
:NERDTreeToggleopens 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 CommandIt is recommended to install ctags
brew install ctags
" ~/.vim/plugins.vim
"...
Plugin 'ctrlpvim/ctrlp.vim'-
:CtrlPorCTRL + pthen start typing to find a file to navigate to -
:CtrlPBufTagstart typing to find variables, functions and class declarations -
:CtrlPMRUFileslist most recently used files -
CTRL + dswitch 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'