From af29bf9a72b57db003d8518401d98beb74088231 Mon Sep 17 00:00:00 2001 From: Wojtek Ryrych Date: Sun, 24 Jan 2016 17:52:24 +0100 Subject: [PATCH 1/2] Better syntax highlighting --- _config.yml | 3 +- _sass/_syntax-highlighting.scss | 71 -------------------- _sass/_syntax.scss | 114 ++++++++++++++++++++++++++++++++ css/main.scss | 2 +- 4 files changed, 117 insertions(+), 73 deletions(-) delete mode 100644 _sass/_syntax-highlighting.scss create mode 100644 _sass/_syntax.scss diff --git a/_config.yml b/_config.yml index 115dea5..47ddbcc 100644 --- a/_config.yml +++ b/_config.yml @@ -19,4 +19,5 @@ github_username: "vim-ctrlspace/vim-ctrlspace" excerpt_separator: "" # Build settings -markdown: kramdown +markdown: redcarpet +highlighter: pygments diff --git a/_sass/_syntax-highlighting.scss b/_sass/_syntax-highlighting.scss deleted file mode 100644 index 8fac597..0000000 --- a/_sass/_syntax-highlighting.scss +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Syntax highlighting styles - */ -.highlight { - background: #fff; - @extend %vertical-rhythm; - - .highlighter-rouge & { - background: #eef; - } - - .c { color: #998; font-style: italic } // Comment - .err { color: #a61717; background-color: #e3d2d2 } // Error - .k { font-weight: bold } // Keyword - .o { font-weight: bold } // Operator - .cm { color: #998; font-style: italic } // Comment.Multiline - .cp { color: #999; font-weight: bold } // Comment.Preproc - .c1 { color: #998; font-style: italic } // Comment.Single - .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special - .gd { color: #000; background-color: #fdd } // Generic.Deleted - .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific - .ge { font-style: italic } // Generic.Emph - .gr { color: #a00 } // Generic.Error - .gh { color: #999 } // Generic.Heading - .gi { color: #000; background-color: #dfd } // Generic.Inserted - .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific - .go { color: #888 } // Generic.Output - .gp { color: #555 } // Generic.Prompt - .gs { font-weight: bold } // Generic.Strong - .gu { color: #aaa } // Generic.Subheading - .gt { color: #a00 } // Generic.Traceback - .kc { font-weight: bold } // Keyword.Constant - .kd { font-weight: bold } // Keyword.Declaration - .kp { font-weight: bold } // Keyword.Pseudo - .kr { font-weight: bold } // Keyword.Reserved - .kt { color: #458; font-weight: bold } // Keyword.Type - .m { color: #099 } // Literal.Number - .s { color: #d14 } // Literal.String - .na { color: #008080 } // Name.Attribute - .nb { color: #0086B3 } // Name.Builtin - .nc { color: #458; font-weight: bold } // Name.Class - .no { color: #008080 } // Name.Constant - .ni { color: #800080 } // Name.Entity - .ne { color: #900; font-weight: bold } // Name.Exception - .nf { color: #900; font-weight: bold } // Name.Function - .nn { color: #555 } // Name.Namespace - .nt { color: #000080 } // Name.Tag - .nv { color: #008080 } // Name.Variable - .ow { font-weight: bold } // Operator.Word - .w { color: #bbb } // Text.Whitespace - .mf { color: #099 } // Literal.Number.Float - .mh { color: #099 } // Literal.Number.Hex - .mi { color: #099 } // Literal.Number.Integer - .mo { color: #099 } // Literal.Number.Oct - .sb { color: #d14 } // Literal.String.Backtick - .sc { color: #d14 } // Literal.String.Char - .sd { color: #d14 } // Literal.String.Doc - .s2 { color: #d14 } // Literal.String.Double - .se { color: #d14 } // Literal.String.Escape - .sh { color: #d14 } // Literal.String.Heredoc - .si { color: #d14 } // Literal.String.Interpol - .sx { color: #d14 } // Literal.String.Other - .sr { color: #009926 } // Literal.String.Regex - .s1 { color: #d14 } // Literal.String.Single - .ss { color: #990073 } // Literal.String.Symbol - .bp { color: #999 } // Name.Builtin.Pseudo - .vc { color: #008080 } // Name.Variable.Class - .vg { color: #008080 } // Name.Variable.Global - .vi { color: #008080 } // Name.Variable.Instance - .il { color: #099 } // Literal.Number.Integer.Long -} diff --git a/_sass/_syntax.scss b/_sass/_syntax.scss new file mode 100644 index 0000000..e1ccae7 --- /dev/null +++ b/_sass/_syntax.scss @@ -0,0 +1,114 @@ +// theme from: https://github.com/richleland/pygments-css +// .highlight box styles taken from https://github.com/suan/vim-instant-markdown + +.highlight pre { + background-color: rgb(247, 247, 247); + border-radius: 3px; + font-size: 68%; // 13.6px - github size + line-height: 1.45; + overflow-x: auto; + overflow-y: auto; + padding: 16px; + word-wrap: normal; +} + +.highlight pre code { + background-color: transparent; + border: 0px; + display: inline; + line-height: inherit; + margin: 0px; + max-width: initial; + overflow: initial; + padding: 0px; + word-wrap: normal; +} + +.highlight pre > code { + background: transparent; + border: 0px; + font-size: 100%; + margin: 0px; + padding: 0px; + white-space: pre; + word-break: normal; +} + +code { + background-color: rgba(0, 0, 0, 0.0392157); + border-radius: 3px; + font-size: 85%; + margin: 0px; + padding: 0.2em 0px; +} + +.highlight code, .highlight pre{color:#fdce93;background-color:#3f3f3f} +.highlight .hll{background-color:#222} +.highlight .c{color:#7f9f7f} +.highlight .err{color:#e37170;background-color:#3d3535} +.highlight .g{color:#7f9f7f} +.highlight .k{color:#f0dfaf} +.highlight .l{color:#ccc} +.highlight .n{color:#dcdccc} +.highlight .o{color:#f0efd0} +.highlight .x{color:#ccc} +.highlight .p{color:#41706f} +.highlight .cm{color:#7f9f7f} +.highlight .cp{color:#7f9f7f} +.highlight .c1{color:#7f9f7f} +.highlight .cs{color:#cd0000;font-weight:bold} +.highlight .gd{color:#cd0000} +.highlight .ge{color:#ccc;font-style:italic} +.highlight .gr{color:red} +.highlight .gh{color:#dcdccc;font-weight:bold} +.highlight .gi{color:#00cd00} +.highlight .go{color:gray} +.highlight .gp{color:#dcdccc;font-weight:bold} +.highlight .gs{color:#ccc;font-weight:bold} +.highlight .gu{color:purple;font-weight:bold} +.highlight .gt{color:#0040D0} +.highlight .kc{color:#dca3a3} +.highlight .kd{color:#ffff86} +.highlight .kn{color:#dfaf8f;font-weight:bold} +.highlight .kp{color:#cdcf99} +.highlight .kr{color:#cdcd00} +.highlight .kt{color:#00cd00} +.highlight .ld{color:#cc9393} +.highlight .m{color:#8cd0d3} +.highlight .s{color:#cc9393} +.highlight .na{color:#9ac39f} +.highlight .nb{color:#efef8f} +.highlight .nc{color:#efef8f} +.highlight .no{color:#ccc} +.highlight .nd{color:#ccc} +.highlight .ni{color:#c28182} +.highlight .ne{color:#c3bf9f;font-weight:bold} +.highlight .nf{color:#efef8f} +.highlight .nl{color:#ccc} +.highlight .nn{color:#8fbede} +.highlight .nx{color:#ccc} +.highlight .py{color:#ccc} +.highlight .nt{color:#9ac39f} +.highlight .nv{color:#dcdccc} +.highlight .ow{color:#f0efd0} +.highlight .w{color:#ccc} +.highlight .mf{color:#8cd0d3} +.highlight .mh{color:#8cd0d3} +.highlight .mi{color:#8cd0d3} +.highlight .mo{color:#8cd0d3} +.highlight .sb{color:#cc9393} +.highlight .sc{color:#cc9393} +.highlight .sd{color:#cc9393} +.highlight .s2{color:#cc9393} +.highlight .se{color:#cc9393} +.highlight .sh{color:#cc9393} +.highlight .si{color:#cc9393} +.highlight .sx{color:#cc9393} +.highlight .sr{color:#cc9393} +.highlight .s1{color:#cc9393} +.highlight .ss{color:#cc9393} +.highlight .bp{color:#efef8f} +.highlight .vc{color:#efef8f} +.highlight .vg{color:#dcdccc} +.highlight .vi{color:#ffffc7} +.highlight .il{color:#8cd0d3} diff --git a/css/main.scss b/css/main.scss index f2e566e..064cfed 100644 --- a/css/main.scss +++ b/css/main.scss @@ -49,5 +49,5 @@ $on-laptop: 800px; @import "base", "layout", - "syntax-highlighting" + "syntax" ; From f0f4e66f1380347ed7a5de2e3155f0c98aa35114 Mon Sep 17 00:00:00 2001 From: Wojtek Ryrych Date: Sun, 24 Jan 2016 18:06:29 +0100 Subject: [PATCH 2/2] Embed snippets in code --- ...015-12-01-adding_a_project_to_bookmarks.md | 9 ++++- .../2015-12-01-finding-bookmarked-projects.md | 6 ++- _posts/2015-12-01-grouping-files.md | 39 ++++++++++++++++++- getting-started.md | 35 ++++++++++++++++- 4 files changed, 85 insertions(+), 4 deletions(-) diff --git a/_posts/2015-12-01-adding_a_project_to_bookmarks.md b/_posts/2015-12-01-adding_a_project_to_bookmarks.md index f2f4f65..67ea03c 100644 --- a/_posts/2015-12-01-adding_a_project_to_bookmarks.md +++ b/_posts/2015-12-01-adding_a_project_to_bookmarks.md @@ -17,7 +17,14 @@ categories: asciicast change that! Fasten your seatbelts and add your first project to bookmarks following the steps below! -{% gist ryrych/5e4ec3fb8ccad17e04d8 %} +```console +$ vim +CTRL+C +b +a +⌗ Add directory to bookmarks: /Users/ryrych/projects/ember_awesome/Enter +⌗ New bookmark name: Ember is Awesome BookmarkEnter +``` After adding the project to bookmarks, you choose the project from the list using j and k keys. Press Enter to confirm. diff --git a/_posts/2015-12-01-finding-bookmarked-projects.md b/_posts/2015-12-01-finding-bookmarked-projects.md index cba002b..df3b5c6 100644 --- a/_posts/2015-12-01-finding-bookmarked-projects.md +++ b/_posts/2015-12-01-finding-bookmarked-projects.md @@ -16,7 +16,11 @@ Once you [added your first project to bookmarks][1], every time you start working on the project, after opening *Vim*, you have to select the project in *Vim-CtrlSpace*. Fortunately it’s a walk in the park! See below how easy it is: -{% gist ryrych/c2d868449e4dcf18cdd1 %} +```console +$ vim +[CTRL]+[C] +[B] +``` Capital B **opens the project list in a search mode** so you can start typing your search term. diff --git a/_posts/2015-12-01-grouping-files.md b/_posts/2015-12-01-grouping-files.md index 50ab894..7aade58 100644 --- a/_posts/2015-12-01-grouping-files.md +++ b/_posts/2015-12-01-grouping-files.md @@ -24,4 +24,41 @@ the project scope. This way a third tab, *Plans & goals* can be added. Will **learning Vim-CtrlSpace** land in your **2016 Plan & goals** list? -{% gist ryrych/e95ba23a5f71c93cfda4 %} +```console +$ vim + +# Open Ember project +[CTRL]+[SPACE] +[B] +>ember< +[Enter] + +# Search for `README.md` and open it in the current tab without closing the plugin window +[O] +>readme< +[enter][space] + +# Open 3 files in a separate tab (note the `+3` indicator) +[/] +[CTRL]+[U] +>computed< + +# Select each file with: +[SHIFT]+[T] + +# Clear search term +[/] +[CTRL]+[U] +[/] + +# Open list of tabs +[l] + +# Give second tab custom label +[j] +[=] +>Computed feature + spec< +[Enter] +[ESC] +[qa] +``` diff --git a/getting-started.md b/getting-started.md index fe90587..83a30b0 100644 --- a/getting-started.md +++ b/getting-started.md @@ -54,7 +54,40 @@ To not mess up your original config, plugins will be installed in Copy the content and store it somewhere. - +```vim +set nocompatible +filetype off + +set rtp+=~/.vim/bundle/Vundle.vim +" Change path if necessary +call vundle#begin('~/vim-ctrlspace-learning') + +Plugin 'VundleVim/Vundle.vim' +Plugin 'szw/vim-ctrlspace' +Plugin 'NLKNguyen/papercolor-theme' + +call vundle#end() +filetype plugin indent on + +set t_Co=256 +set background=dark +colorscheme PaperColor + +set nocompatible +set hidden +set wildignore=.git,.svn,CVS,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,tags,*.tags + +if has("gui_running") + " Settings for MacVim and Inconsolata font + let g:CtrlSpaceSymbols = { "File": "◯", "CTab": "▣", "Tabs": "▢" } +endif + +if executable("ag") + let g:CtrlSpaceGlobCommand = 'ag -l --nocolor -g ""' +endif + +let g:CtrlSpaceIgnoredFiles = '\v(tmp|temp|Godeps)[\/]' +``` ### Install Vim-CtrlSpace and plugins