set listShows invisible characters.set listcharsWhat invisibile characters should be set to, see:h listcharsfor complete list.
mapcreates a key map that works in normal, visual, select and operator pending modesmap!creates a key map that works in insert and command-line mode.
:nmap - Display normal mode maps
:imap - Display insert mode maps
:vmap - Display visual and select mode maps
:smap - Display select mode maps
:xmap - Display visual mode maps
:cmap - Display command-line mode maps
:omap - Display operator pending mode maps
noremapis added when you don't want a mapping to be recursive e.g. map z to v, but not to what v is then mapped to. http://stackoverflow.com/a/3776182.<bar>should be used in place of|when used in map commands to distinguish it from a pipe
" Indenting in visual mode keeps the visual highlight.
vnoremap < <gv
vnoremap > >gv
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
" Jump to start and end of line using the home row keys.
nnoremap H ^
nnoremap L $
" Fix the filetype for .md files.
augroup MarkDownType
autocmd!
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
augroup end
" Quick escape from insert mode.
inoremap jj <ESC>When you see something like let g:some_variable = x you're setting the value of a global variable.
To see all global variables let g:.
From :help internal-variables
(nothing) In a function: local to a function; otherwise: global
buffer-variable b: Local to the current buffer.
window-variable w: Local to the current window.
tabpage-variable t: Local to the current tab page.
global-variable g: Global.
local-variable l: Local to a function.
script-variable s: Local to a :source'ed Vim script.
function-argument a: Function argument (only inside a function).
vim-variable v: Global, predefined by Vim.
Why let vs. set?
:set is for setting options, :let for assigning a value to a variable.
:edit .to open a netrw buffer:e .same as above
From within the netrw interface
<enter>edit a file / enter a directoryPedit file in most recent tab (or current tab if only one)-go up a directory%create an empty filedcreate a directoryDdelete the selected itemRrename the selected itemscycle through different sort options
- You can use visual highlighting to paste over text with
p :regsee all register contents:reg "0see contents of register 0<C-r>"in insert mode, paste the contents of the default register<C-r>0in insert mode, paste the contents of register 0"+ppaste from the system copy / paste buffer (if multi-line, don't have toset pastefirstput +paste contents of system copy / paste buffer"+is the system clipboard"*is the "mouse highlight" clipboard"0holds last yank"1holds last delete / change- So, you can use
"0to paste yanked text after deleting / changing text ppaste after the cursorPpaste before the cursor"Ayappend text to registerA
(or)move backward or forward by "sentences"{or}move backward or forward by "paragraphs"g$move to visual end of wrapped lineg0move to visual beginning of wrapped line%go to matching (), [], {} etc
:g/^$/ddelete all blank linesgqgqformat / wrap the current line:e %:h<TAB>edit files in same directory as current file
Tabularize /<pattern>Run the tabular plugin (does some smart multi-line matchingTab /<pattern>Same as above<,'>Tab /=Run tabularize on the selected text, targeting equal signs