"=== === " Set 'nocompatible' to ward off unexpected things that your distro might " have made, as well as sanely reset options when re-sourcing .vimrc set nocompatible set t_Co=256 · "===========COLORS========== colorscheme badwolf········· "colorscheme badwolf········· "colorscheme goodwolf········· "colorscheme distinguished········· "colorscheme vividchalk········· "colorscheme mayansmoke "colorscheme molokai "colorscheme candy "colorscheme wombat " Enable syntax highlighting syntax on "==========PASTING========== nnoremap :set invpaste paste? " Invert the paste mode. imap :set invpaste paste? set pastetoggle= " Turn paste on or off using this keystroke. set showmode " Displays whether paste is turned on or off. "==========SPACES and TABS========== " Display tabs as this amount of spaces. " Sets tab stops to this amount of spaces. set tabstop=2 " Number of spaces a tab key counts for when editing. set softtabstop=2 " Turns tabs into spaces. The tab key will insert spaces instead of tabs. set expandtab " Indentation settings for using 4 spaces instead of tabs. " " Do not change 'tabstop' from its default value of 8 with this setup. " Set the width for autoindents. "set shiftwidth=2 set shiftwidth=2 " Show tabs with a little double arrow and trailing dots, and show whitespace past the end of the line with dots. set listchars=tab:»·,trail:· set list "==========UI Config========== " Display line numbers on the left "set number " Shows the last command entered in the very bottom right. set showcmd " Draws a horizontal highlight on the line the cursor is on. "set cursorline " Attempt to determine the type of a file based on its name and possibly its " contents. Use this to allow intelligent auto-indenting for each filetype, " and for plugins that are filetype specific. " filetype indent on filetype indent plugin on " Better command-line completion. " Vim automatically autocompletes things like filenames when you, for " instance, run :e ~/.vim? Well it will provide a graphical menu of all " the matches you can cycle through if you turn on wildmenu. set wildmenu " Redraw only when we need to. set lazyredraw " When your cursor moves over a parenthesis-like character, the matching one " will be highlighted as well. set showmatch "==========SEARCHING========== " Highlight matches. " Highlight searches (use to temporarily turn off highlighting; see " the mapping of below) set hlsearch " Search as characters are entered. set incsearch " Use case insensitive search, except when using capital letters set ignorecase set smartcase " Turn off search highlight " nnoremap :nohlsearch "=========FOLDING========== " Enable folding "set foldenable· " Show all folds. " This opens most folds by default. " " foldlevelstart is the starting level for opening a new buffer. If it is set " to 0, all folds will be closed. Setting it to 99 would guarentee folds are " always open. So setting it to 10 ensures that only very nested blocks of " code are folded when opening a buffer. " If set to zero,· "set foldlevelstart=10 " Folds can be nested. Setting a max on the number of folds guards against " too many folds. "set foldnestmax=10 " Changed the mapping of pretty frequently, but this is its current command.· " za opens/closes the fold around the current block. " space open/closes folds " nnoremap za " Fold based on indentation. " Other acceptable values are marker, manual, expr, syntax, diff.· " Run :help foldmethod to find out what each of those do. "set foldmethod=indent "==========MOVEMENT========== " Move vertically by visual line. " These two allow us to move around lines visually. So if there's a very long " line that gets visually wrapped to two lines, j won't skip over the "fake" " part of the visual line in favor of the next "real" line. " nnoremap j gj " nnoremap k gk " Overwrite existing movement bindings.· " E and B, which are typically used to move forwards and backwards over visual " words to these purposes. Next I bound the old way to . " " move to beginning/end of line " nnoremap B ^ " nnoremap E $ " " " $/^ doesn't do anything " nnoremap $ " nnoremap ^ " It visually selects the block of characters you added last time you were· " in INSERT mode. " " Highlight last inserted text " nnoremap gV `[v`] "==========LEADER SHORTCUTS========== " Vim doesn't model undo as a simple stack. In Vim it's a tree. This makes " sure you never lose an action in Vim, but also makes it much more difficult " to traverse around that tree. gundo.vim fixes this by displaying that undo " tree in graphical form. Get it and don't look back. Here I've mapped it to " ,u, which I like to think of as "super undo". " " toggle gundo " nnoremap u :GundoToggle " When opening a new line and no filetype-specific indenting is enabled, keep " " the same indent as the line you're currently on. Useful for READMEs, etc. set autoindent " Display the cursor position on the last line of the screen or in the status " " line of a window set ruler "·· " " Always display the status line, even if only one window is displayed set laststatus=2 "··· " " Instead of failing a command because of unsaved changes, instead raise a " " dialogue asking if you wish to save changed files. set confirm "···· " " Use visual bell instead of beeping when doing something wrong set visualbell "····· " " And reset the terminal code for the visual bell. If visualbell is set, " and " " this line is also included, vim will neither flash nor beep. If " visualbell " " is unset, this does nothing. set t_vb= " Set the command window height to 2 lines, to avoid many cases of having to " " "press to continue" "set cmdheight=2 "·· "==========COMMENTS========== " Turn off auto-insert of comment. " " vim also provides a pasting register for you to paste text from the system clipboard.· " You can use \"*p or \"+p depending on your system.· " On a system without X11, such as OSX or Windows, you have to use the * register.· " On an X11 system, like Linux, you can use both. " " http://vim.wikia.com/wiki/Accessing_the_system_clipboard " "augroup auto_comment " au! " au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o "augroup END