Nvim recognizes the following events. Names are case-insensitive.
BufAdd
Just after creating a new buffer which is
added to the buffer list, or adding a buffer
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
:hiccup [:iframe { | |
:height 550 | |
:width 750 | |
:scrollbar 0 | |
:srcdoc "<!DOCTYPE html> <div id=\"observablehq-eb3a0382\"> | |
<div class=\"observablehq-chart\"></div> | |
</div> | |
<script type=\"module\"> | |
import {Runtime, Inspector} from \"https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js\"; |
FOREWORDS
I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.
My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.
# References: | |
# https://cmake.org/cmake/help/latest/command/add_custom_target.html | |
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/ | |
# https://gist.github.com/socantre/7ee63133a0a3a08f3990 | |
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install | |
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target | |
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command | |
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777 | |
cmake_minimum_required(VERSION 3.10) |
tell application "Skim" | |
set thedoc to the front document | |
set anno to the active note of thedoc | |
set newtext to text of anno | |
set startpoint to (offset of "org-id:{" in newtext) + 8 | |
set endpoint to (offset of "}:org-id" in newtext) - 1 | |
if (startpoint - 8 is not equal to endpoint + 1) and (endpoint + 1 is not 0) then | |
set orgid to characters startpoint thru endpoint of newtext as string | |
do shell script "/usr/local/bin/emacsclient -n -e \"(progn (org-id-goto \\\"" & orgid & "\\\") (x-focus-frame (selected-frame)) (evil-exit-visual-state))\"" | |
end if |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py
file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture
(* EXPORT ALL SKIM NOTES TO THE CLIPBOARD WITH MARKDOWN REFERENCE LINKS | |
(no longer) requires hackademic URL handler from github user smargh | |
entirely rewritten to take advantage of Skim's built-in templating | |
2016-06-26 by derickfay | |
*) |