Skip to content

Instantly share code, notes, and snippets.

@simon-lang
simon-lang / init.lua
Last active February 13, 2023 07:07
init.lua
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
vim.cmd [[packadd packer.nvim]]
end
require('packer').startup(function(use)
@simon-lang
simon-lang / .aliases
Created October 1, 2013 23:21
.aliases
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
{
// Require .prettierrc
"prettier.requireConfig": true,
// Show diagnostics for current line
"diagnostic.checkCurrentLine": true,
// Tslint on save
"tslint.enable": true,
"tslint.autoFixOnSave": true,
" https://github.com/neoclide/coc.nvim#example-vim-configuration
inoremap <silent><expr> <c-space> coc#refresh()
" gd - go to definition of word under cursor
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
" gi - go to implementation
nmap <silent> gi <Plug>(coc-implementation)
@simon-lang
simon-lang / wikipedia-samples.json
Created March 29, 2017 01:08
intro paragraphs from wikipedia for top 500 universities
[{
"institution": "Harvard University",
"collectionId": 8590,
"url": "https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&redirects=1&titles=Harvard University",
"intro": "Harvard is a large, highly residential research university. The nominal cost of attendance is high, but the University's large endowment allows it to offer generous financial aid packages. It operates several arts, cultural, and scientific museums, alongside the Harvard Library, which is the world's largest academic and private library system, comprising 79 individual libraries with over 18 million volumes. Harvard's alumni include eight U.S. presidents, several foreign heads of state, 62 living billionaires, 359 Rhodes Scholars, and 242 Marshall Scholars. To date, some 130 Nobel laureates, 18 Fields Medalists, and 13 Turing Award winners have been affiliated as students, faculty, or staff."
},
{
"institution": "Stanford University",
"collectionId": 8634,
"url": "https://en.wikipedia
@simon-lang
simon-lang / .vimrc
Last active October 22, 2021 01:56
syntax on
" colorscheme onedark
set shortmess=I
set backspace=start,eol,indent
" set colorcolumn=80
" set cursorline
set expandtab
set foldlevel=2

Author Search

Step 1:

Use this aggregation:

{
  "aggregations": {
    "result": {
@simon-lang
simon-lang / html.json
Created August 5, 2020 01:53
VSCode HTML Snippets
{
"bind": {
"prefix": "bind",
"body": [
"{{$1}}"
],
"description": ""
},
"message": {
"prefix": "message",
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+y",
"command": "redo",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "editor.action.moveLinesDownAction",