-
Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.
You can do a normal within-file search first, then re-use the same pattern to
| # I'll be doing another one for Linux, but this one will give you | |
| # a pop up notification and sound alert (using the built-in sounds for macOS) | |
| # Requires https://github.com/caarlos0/timer to be installed | |
| # Mac setup for pomo | |
| alias work="timer 60m && terminal-notifier -message 'Pomodoro'\ | |
| -title 'Work Timer is up! Take a Break 😊'\ | |
| -appIcon '~/Pictures/pumpkin.png'\ | |
| -sound Crystal" |
| import { CfnOutput, Stack, StackProps } from "aws-cdk-lib"; | |
| import { Construct } from "constructs"; | |
| import * as lambda from "aws-cdk-lib/aws-lambda"; | |
| import * as apigateway from "@aws-cdk/aws-apigatewayv2-alpha"; | |
| import { HttpLambdaIntegration } from "@aws-cdk/aws-apigatewayv2-integrations-alpha"; | |
| import * as cdk from "aws-cdk-lib"; | |
| export class CdkBrefStack extends Stack { | |
| constructor(scope: Construct, id: string, props?: StackProps) { |
| vim.keymap.set("n", "<F5>", ":lua require'dap'.continue()<CR>") | |
| vim.keymap.set("n", "<F10>", ":lua require'dap'.step_over()<CR>") | |
| vim.keymap.set("n", "<F11>", ":lua require'dap'.step_into()<CR>") | |
| vim.keymap.set("n", "<F12>", ":lua require'dap'.step_out()<CR>") | |
| vim.keymap.set("n", "<Leader>b", ":lua require'dap'.toggle_breakpoint()<CR>") | |
| vim.keymap.set("n", "<Leader>B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>") | |
| vim.keymap.set("n", "<Leader>lp", ":lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>") | |
| vim.keymap.set("n", "<Leader>dr", ":lua require'dap'.repl.open()<CR>") | |
| vim.keymap.set("n", "<Leader>dl", ":lua require'dap'.run_last()<CR>") | |
| vim.keymap.set("n", "<Leader>dl", ":lua require'dap'.run_last()<CR>") |
Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.
You can do a normal within-file search first, then re-use the same pattern to
Awk is a text processing language that comes standard with most distributions of Linux/Unix. In my personal experience, awk is faster at parsing, filtering, and writing text files than either python or R with few exceptions. This cheat sheet goes over the basic awk commands that I use the most.
Awk processes a text file line by line and is used to apply some condition to each based on its contents. I have found the most use for it on text files of large matrices (that is text files with distinct, consistent columns) or on text that has clear consistent delimeters. Awk interpretes each column in your line and stores it as a variable from 1 to n where n is the number of columns you have. Say you have a file that looks as such:
ID gene_name type start stop Chr
ENSG0 C1orf22 protein_coding 178965 183312 chr2
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.
NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.
Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.
Here, we look at making one from scratch.
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.