Install the tss
tool.
git clone https://github.com/clausreinke/typescript-tools.git
cd typescript-tools
git checkout testing_ts1.4
npm install -g
Install vim plugin (my fork has a tiny tweak that made it work for me).
#!/bin/bash | |
# This script takes a remote repository and merges it into | |
# the current one as a subdirectory | |
set -e | |
if [ -z "$1" ] | |
then | |
echo "Usage:" |
--- this shells out to https://llm.datasette.io/en/stable/ | |
vim.api.nvim_create_user_command("LLM", function(opts) | |
local system = [[ | |
You are a neovim expert. | |
You help users write commands. | |
When a user asks a question, your output will be copied directly into the neovim command prompt. | |
Do not add any explanation. | |
Since the output is being copied in the command line, it should all be on a single line. | |
]] | |
local output = vim.system( |
#!/usr/bin/env python | |
# | |
# Copyright (C) 2015 Google Inc. | |
# | |
# This file is part of YouCompleteMe. | |
# | |
# YouCompleteMe is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
#!/usr/bin/expect -f | |
# Set timeout to prevent the script from hanging | |
set timeout -1 | |
# Get the search pattern as a command line argument | |
if {[llength $argv] != 0} { | |
set pattern [lindex $argv 0] | |
} else { | |
puts "Error: search pattern not provided" |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"path/filepath" |
package httpx | |
import ( | |
"net/http" | |
) | |
func WithStatus(code int, handler http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
w.WriteHeader(code) | |
handler.ServeHTTP(w, r) |
Install the tss
tool.
git clone https://github.com/clausreinke/typescript-tools.git
cd typescript-tools
git checkout testing_ts1.4
npm install -g
Install vim plugin (my fork has a tiny tweak that made it work for me).
#compdef godoc | |
typeset -A opt_args | |
local context state line | |
local pkgdir usrpkgdir | |
pkgdir="$GOROOT/src/pkg" | |
usrpkgdir="$GOPATH/src" | |
godoctmpl=~/.godoc_templates |
This is pretty specific to my setup but the idea can be adapted to work with pretty much anything.
Go has a flag package which makes parsing command line arguments really easy.
package main
-- The TypeScript LSP server takes a while before it's responsive. This is a janky way of indicating the server status in | |
-- airline. It works by adding "..." to the statusline when the LSP connects, and then removing the "..." when the first | |
-- set of diagnostics come in. | |
vim.cmd([[ | |
let g:lsp_wait_added = 0 | |
let g:lsp_wait_done = 0 | |
function! LspWait(...) | |
let builder = a:1 | |
let context = a:2 |