Skip to content

Instantly share code, notes, and snippets.

View joshukraine's full-sized avatar
🏠
Working from home

Joshua Steele joshukraine

🏠
Working from home
View GitHub Profile

That time I had to compile Vim from source...

January 2, 2018

Recently, something broke in Homebrew's version of Vim. Several things seemed weird, but what first caught my eye was that misspelled words were no longer highlighted in Markdown files. This is a feature that I have previously configured and I use it often when writing blog posts and such.

Initially, I assumed I had a problem with my Vim settings. After much troubleshooting and no joy, I finally uninstalled Homebrew's version of Vim which caused my system to fall back to the default version of Vim that ships with macOS. Suddenly the highlighting worked fine.

After doing some further research, I decided I would try to compile and install Vim myself. After some googling and patching together a few different articles, this is what worked for me.

@joshukraine
joshukraine / vim-performance.md
Created May 20, 2023 10:13
What I’ve learned about slow performance in Vim

What I’ve learned about slow performance in Vim

January 27, 2018

I started this PR because Vim had gotten very slow and laggy. The problem seemed particularly painful when editing Ruby files. For example, when trying to move down by holding the “j” key, the downward motion would continue for a second or two after I’d released the key, causing me to far overshoot my target.

There were many other performance issues beyond scrolling. Sometimes even just simply typing in insert mode was noticeably slow. I knew things were getting serious when I found myself watching tutorial videos for Microsoft Visual Studio Code.

Happily, I’ve found a path back to a speedy and responsive Vim. Here’s what I’ve learned.

@joshukraine
joshukraine / obsidian-web-clipper.js
Last active February 3, 2023 09:08 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "obsidian-main";
/* Optional folder name such as "Clippings/" */
@joshukraine
joshukraine / how-to-install-powerline-on-osx.md
Last active August 10, 2020 03:04
How to Install Powerline on OS X

How to Install Powerline on OS X

Preface

This whole thing hinges on having the right version of Python installed. We're going to do it via Homebrew. You have to install Python BEFORE you install Vim. So if Vim is already installed (the Homebrew version, that is) then remove it first.

Installation

Check to see if vim or python are installed.

brew list

@joshukraine
joshukraine / zsh-error.txt
Last active May 3, 2020 05:47
Permissions error from zsh
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 7 joshukraine admin 224 May 2 07:35 /usr/local/share/zsh
drwxrwxr-x 12 joshukraine admin 384 May 2 07:33 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
@joshukraine
joshukraine / syntime_re1.txt
Created January 27, 2018 07:47
Vim syntime report in a ruby file with regexpengine=1
TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.057130 9929 4703 0.000084 0.000006 rubySymbol [[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@=
0.052588 7070 1844 0.000155 0.000007 rubySymbol []})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@=
0.050374 5257 31 0.000122 0.000010 rubyKeywordAsMethod \(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]
0.042170 5228 0 0.000079 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`.*\)\@<=\n
0.040648 5228 0 0.000088 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\>.*$\)\@<=\n
0.039729 5228 0 0.000071 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'.*\)\@<=\n
0.039659 5228 0 0.000072
@joshukraine
joshukraine / syntime_re0.txt
Created January 27, 2018 07:44
Vim syntime report in a ruby file with regexpengine=0
TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.494780 7555 0 0.000914 0.000065 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`.*\)\@<=\n
0.489842 7555 0 0.000980 0.000065 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\>.*$\)\@<=\n
0.481765 7555 0 0.000933 0.000064 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\).*$\)\@<=\n
0.478531 7555 0 0.000908 0.000063 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'.*\)\@<=\n
0.476628 7555 0 0.000893 0.000063 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<"\z([^"]*\)".*\)\@<=\n
0.475943 7555 0 0.000882 0.000063 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<`\z([^`]*\)`
rails: bin/rails server
postgres: postgres -D /usr/local/var/postgres
redis: redis-server /usr/local/etc/redis.conf
livereload: bin/guard -P livereload
@joshukraine
joshukraine / dev.log
Created December 15, 2013 17:51
in Safari
# Now in Safari. Start on homepage, enter invalid input. Flash is displayed
Started GET "/students/search?utf8=%E2%9C%93&search=asfsdf&submit=%EF%80%82" for 127.0.0.1 at 2013-12-15 18:33:01 +0200
Processing by StudentsController#search as HTML
Parameters: {"utf8"=>"✓", "search"=>"asfsdf", "submit"=>"?"}
Coach Load (0.4ms) SELECT "coaches".* FROM "coaches" WHERE "coaches"."remember_token" = 'qnT_bGpti6JLWWLtFaM7DA' ORDER BY coaches.created_at ASC LIMIT 1
@@@@ flash: #<ActionDispatch::Flash::FlashHash:0x007fa2d053d5e8>
@@@@ session: {"session_id"=>"996952e20fbf975af7a4396f8a3aa7da", "_csrf_token"=>"EwfOi3Ny0GDZXOIeHwG7NHcwbwr3WR2c6qPk6zSHRNU=", "return_to"=>"http://localhost:3000/"}
@@@@ request.referer: http://localhost:3000/
Redirected to http://localhost:3000/
@joshukraine
joshukraine / dev.log
Created December 15, 2013 17:50
in Chrome...
# In Chrome, start on home page, enter invalid input. Flash is displayed
Started GET "/students/search?utf8=%E2%9C%93&search=asdf&submit=%EF%80%82" for 127.0.0.1 at 2013-12-15 18:31:12 +0200
Processing by StudentsController#search as HTML
Parameters: {"utf8"=>"✓", "search"=>"asdf", "submit"=>"?"}
Coach Load (0.4ms) SELECT "coaches".* FROM "coaches" WHERE "coaches"."remember_token" = 'qnT_bGpti6JLWWLtFaM7DA' ORDER BY coaches.created_at ASC LIMIT 1
@@@@ flash: #<ActionDispatch::Flash::FlashHash:0x007fa2cda87290>
@@@@ session: {"session_id"=>"0d3e2d6679ba059a32fda992098d76bb", "_csrf_token"=>"FCi64KNpqW1ty7YTNibievP8VlmVm/PnGxWtNp0ylBM=", "return_to"=>"http://localhost:3000/"}
@@@@ request.referer: http://localhost:3000/
Redirected to http://localhost:3000/