This example puts the Table of Contents in the Sidebar. The sidebar is locked in place as you scroll up and down. Just paste the following in your page.

<nav class="toc-fixed" markdown="1">
* TOC
{:toc}
</nav>

And create assets/main.scss with the following content.

---
---

@import "minima";

div.wrapper {max-width:960px;margin-left:5%;}
div.post-content > p {width:65%;max-width:640;}
nav.toc-fixed {position:fixed;top:50px;left:60%;max-width:320px}
nav.toc-fixed ul {list-style:none;padding-left:0;margin-left:0;}
table {width:65%;max-width:640;}

Examples

Check out Sidebar, Sidebar2 and Sidebar Fixed for more examples.

Jekyll Serve

You can view this repo locally with the following command (I’m assuming you’ve already installed jekyll and cloned this repo.

jekyll serve --trace

You may get an error similar to the following:

/usr/lib/ruby/2.7.0/bundler/runtime.rb:312:in `check_for_activated_spec!': You 
have already activated rouge 3.20.0, but your Gemfile requires rouge 3.19.0. 
Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

This means the gem.lock file is out of date. To fix run the following command. You may have to iterate multiple times if more than one gem is out of date.

bundle update rouge

Please send me a pull request with your fix.

Lorem Ipsum

You can ignore the following documentation. I’m using the Lued Text Editor documentation as Lorem Ipsum.


Key bindings are defined in lued/lua_src/bindings/lued_bindings.lua. This is fairly straight-forward, easily understandable Lua code. You are encouraged to modify the bindings to suite your style. You don’t Lua knowledge to figure out what to do.

Basic Control Key Commands

Ctrl+@Called when resuming from Ctrl+Z (fg at shell prompt). Not directly used by you.
Ctrl+QQuit or Exit. Similar to Sublime Ctrl-Q.
Ctrl+WClose window or tab. Similar to Sublime Ctrl-W.
Ctrl+EMove to End of Line. Similar to Sublime <End>.
Ctrl+RMove right defined number (4) of char
Ctrl+TSelect file tab menu
Ctrl+YRedo (undo undo). Similar to Sublime Ctrl+Y
Ctrl+USpare
Ctrl+ITerminal interprets as `Tab` key
Ctrl+OOpen File. Similar to Word Ctrl+O
Ctrl+POpen File from partial name. Similar to Sublime Ctrl+P
Ctrl+AMove to Start of Line. Similar to Sublime <Home>.
Ctrl+SSave File. Similar to Sublime Ctrl+S.
Ctrl+DSelect Word under cursor. Similar to Sublime Ctrl+D
Ctrl+FFind. Similar to Sublime Ctrl+F. If text is selected the find selected text (Similar to Sublime Ctrl+F3).
Ctrl+GGoto Line Number. Similar to Sublime Ctrl+G
Ctrl+HFind and Replace. Similar to Sublime Ctrl+H.
Ctrl+JDo Not Use. Same as Enter Key
Ctrl+KSpare
Ctrl+LSelect entire line. Similar to Sublime Ctrl+L
Ctrl+ZUndo. Similar to Sublime Ctrl+Z
Ctrl+XCut. Similar to Word and Sublime Ctrl+X
Ctrl+CCopy. Similar to Sublime Ctrl+C
Ctrl+VPaste. Similar to Sublime Ctrl+V
Ctrl+BSpare. - let's keep that way for tmux compatibility
Ctrl+NCreate New File. Similar to Word.
Ctrl+MDo Not Use.

File Tab Commands

Alt+ttChange to next file tab. Similar to Sublime next_view Ctrl+Tab or Command+Shift+].
Alt+TTChange to previous file tab. Similar to Sublime prev_view Ctrl+Shift+Tab or Command+Shift+[.

Select Commands

Alt+siSimilar to Sublime Ctrl+shift+J. Select lines with the indentation.
Alt+sbSelect inside curly brace. Similar to Sublime Ctrl+Command+M
Alt+seSelect from cursor to End of line
Alt+SESelect from cursor to starting End of line
Alt+sbSelect to Bottom of File Buffer
Alt+SBSelect to Beginning of File Buffer
Alt+smSelect from mark (alt+mm) to cursor. Similar to Sublime Ctrl+K
Alt+ssTurn off/on selection. Similar to Sublime ESC-Key.
Alt+swSelect to End of word.
Alt+SWSelect to starting End of word.

Movement Commands

Alt+bbGoto bottom of file. Similar to Sublime END
Alt+BBGoto top of file. Similar to Sublime HOME
Alt+wwMove right one word. Similar to Sublime Ctrl+right_arrow.
Alt+WWMove left one word. Similar to Sublime Ctrl+left_arrow.
Alt+eeExpress mode - arrow keys move faster
Alt+>Move right half the distance
Alt+<Move left half the distance
Alt+rnreplay named keystroke sequence
Alt+rrreplay keystroke sequence again

Ctags / Exuberant Tags

Alt+cbctag back
Alt+cfctag forward in stack
Alt+ctctag jump. Similar Sublime Ctrl+R
Alt+CTctag jump back.
Alt+crctag read
Alt+cxctag delete history

Delete, Cut, Copy and Paste Commands

Alt+ceCopy current pos to eol
Alt+CECopy sol to current pos
Alt+cwCopy word
Alt+DDDuplicate line. Similar to Sublime Ctrl+Shift+D
Alt+ddaslt+dd214 duplicates 214 lines. 214 can be any number
Alt+ddel N char
Alt+xbDelete to Bottom of Tab/Buffer/Window/File
Alt+XBDelete to Beginning of Tab
Alt+xeSimilar to Sublime Ctrl+KK
Alt+XESimilar to Sublime Ctrl_K+<Backspace>
Alt+xlDelete line
Alt+xmDelete from mark (alt+mm) to cursor
Alt+xsDelete spaces from cursor to non-whitespace. If on non-whitespace then go to next line and do it.
Alt+XSDelete spaces to the left
Alt+xxDelete word under cursor
Alt+xwSimilar to Sublime Ctrl+KW
Alt+XWSimilar to Sublime Ctrl+Backspace
Alt+xCut multiple lines alt+x42<enter>
Alt+plPaste Line after current line
Alt+PLPaste Line before current line

Find and Replace Commands

Alt+dffind word under cursor
Alt+DFfind reverse word under cursor
Alt+faSimilar to Sublime Ctrl+Shift+F. search all open files for match
Alt+fbfind back. return to position before find operation.
Alt+ffSimilar to Sublime F3. Find next occurrence of search text.
Alt+FFSimilar to Sublime Shift+F3. Find previous occurrence.
Alt+kbshow sidebar with list of open files
Alt+KBhide sidbar with list of open files
Alt+FRFind previous occurrence.
Alt+fcset find case sensitive
Alt+FCclear find case sensitive (case insensitive)
Alt+fwset find whole word
Alt+FWclear find whole word
Alt+hhFind and Replace again.
Alt+VVPaste and Find Prev
Alt+vvPaste and Find Next
Alt+_minus_Jump back to previous position before Find. Similar to Sublime lued.jump_back.
Alt+_Jump forward to next position in jump stack. Similar to Sublime lued.jump_forward.

Line Swap Commands

Alt+slSwap current line with next line. Similar to Sublime Ctrl+DOWN arrow
Alt+SLSwap current line with prev line. Similar to Sublime Ctrl+UP arrow
Alt+blline sinks down towards bottom of file. Similar to sublime Ctrl+Shift+Down
Alt+BLline floats up towards top of file. Similar to Sublime Ctrl+Shift+Up
Alt+brswap current word with next word. Similar to Sublime move_word_right
Alt+BRswap current word with prev word. Similar to Sublime move_word_left

Indent and Align Commands

Alt+iiIndented selected lines one space
Alt+IIUnindent selected lines one space
Alt+irReindents selected per defined lued.indent size
Alt+isSet lued.indent size
Alt+aaSelect All (Entire File). Similar to Sublime Ctrl+A.
Alt+alAlign char on next line with current line
Alt+afAlign First char on next line with current line. If lines selected then align all lines with first line.

Center Cursor Commands

Alt+kcRecenters cursor to center, press again and recenters to top. Similar to Sublime's CTRL+KC. vim's zz/zt.
Alt+KCRecenters cursor to top, press again and recenters to center. Similar to Sublime's CTRL+KC. vim's zz/zt.

Comment Commands

Alt+ccComment out line. Similar to Sublime Ctrl+slash.
Alt+CCUncomment selected lines.
Alt+csComment set. Change start of comment string.

Upper / Lower Case Commands

Alt+klSimilar to Sublime Ctrl+KL. Convert to Lower Case
Alt+kuSimilar to Sublime Ctrl+KU. Convert to Upper Case

Mark Commands

Alt+smSimilar to Sublime Ctrl+KA. Select from mark to cursor (set mark with alt_mm)
Alt+dmSimilar to Sublime Ctrl+KW. Delete from mark to cursor (set mark with alt_mm)
Alt+mSet Named Marker
Alt+MGoto Named Marker
Alt+mmSimilar to Sublime Ctrl+K+space. Set Mark
Alt+MMGoto previous mark
Alt+mnGoto next mark in stack

Insert Line Before / After Commands

Alt+llGoto to end of line and insert new line. similar to vi's o. Similar to Sublime Ctrl+Enter
Alt+LLGoto beginning of line and insert new line. similar to vi's O. Similar to Sublime Ctrl+Shift+Enter

Page Up / Down Commands

Alt+pMove down N lines
Alt+PMove up N lines
Alt+ppSimilar to Sublime <PageDn> (or ctrl+u in vintage mode) , move down half page
Alt+PPSimilar to Sublime <PageUp> (or ctrl+d in vintage mode), move up half page

Remove Tabs and Spaces

Alt+raltReplace all leading tabs with spaces at start of line
Alt+ratsRemove all trailing spaces at end of line
Alt+ratsallRemove all trailing spaces in all files
Alt+zSimilar to Sublime Ctrl-z. Undo. After alt-z is used, ctrl-z becomes unix suspend command.
Alt+incrRead number at current position, go down a line, and replace number with incremented value.
Alt+decrDecrement next line's index.

Configuration Commands

Alt+.cToggle Ctrl+C between Cut and Kill Process
Alt+.indTurn auto-lued.indent on/off
Alt+.ediChange from Lua mode to Edit mode. You almost always want to be in edit mode.
Alt+.luaToggle to Lua mode to enter lua commands. Rarely used.
Alt+.mltSet minimum lines to from top of page to cursor
Alt+.mlbSet minimum lines from cursor to bottom of page
Alt+.psChange number of lines for page up/down command
Alt+.slToggle on/off the status line
Alt+.slrToggle status line being shown in reverse video
Alt+.tabToggle replace tabs with spaces as you type (defaults to replace)
Alt+.rtsToggle on/off remove trailing spaces as you type (defaults to don't remove)
Alt+p_squotePut string into lued.paste buffer

Misc Commands

Alt+^Delete from cursor to start of line
Alt+$Delete from cursor to end of line
Alt+//Find forward
Alt+:wSave File. Similar to Vi :w
Alt+colorsShow colors
Alt+cdChange directory
Alt+edChange to EDIT mode. You almost always want to be in EDIT mode.
Alt+helpHelp. Open lued_bindings.lua
Alt+jjSimilar to Sublime Ctrl+J. Join lines.
Alt+lnshow absolute line numbers
Alt+LNhide absolute line numbers
Alt+rlnshow relative line numbers
Alt+RLNhide relative line numbers
Alt+lsunix ls command. dos dir command
Alt+LUChange to LUA mode. You rarely want to be in lua mode.
Alt+nopNo Op. (same as Alt+NOOP)
Alt+noopNo Op (same as Alt+NOP)
Alt+qqWrap line at cursor. Subsequent lines end at previous line. Similar to Sublime Alt+q
Alt+QQset join wrap
Alt+reinitReload lued script
Alt+reviewReview mode prevents saving file
Alt+refreshReload current file
Alt+saSimilar to Sublime Ctrl+Shift+S. File Save as.
Alt+SaveSessionSave session file
Alt+LoadSessionLoad session file
Alt+SetiSet Scope Indent SI2 SI3 SI4