Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
" Motion for "next/last object". For example, "din(" would go to the next "()" pair | |
" and delete its contents. | |
onoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr> | |
xnoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr> | |
onoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr> | |
xnoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr> | |
onoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr> | |
xnoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr> |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
" Next and Last {{{ | |
" Motion for "next/last object". "Last" here means "previous", not "final". | |
" Unfortunately the "p" motion was already taken for paragraphs. | |
" | |
" Next acts on the next object of the given type in the current line, last acts | |
" on the previous object of the given type in the current line. | |
" | |
" Currently only works for (, [, {, b, r, B, ', and ". | |
" |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-} | |
import Data.Monoid | |
import Data.Monoid.Action | |
import Data.Monoid.MList (SM(..)) | |
import Control.Monad.Trans.Class | |
newtype UpdateT p s m a = UpdateT { runUpdateT :: s -> m (p, a) } |
" Zip Right | |
" | |
" Moves the character under the cursor to the end of the line. Handy when you | |
" have something like: | |
" | |
" foo | |
" | |
" And you want to wrap it in a method call, so you type: | |
" | |
" println()foo |
function! GetTextObject(type) | |
let saved_register = @@ | |
if a:type == 'v' | |
normal! `<v`>y | |
elseif a:type ==# 'char' || a:type ==# 'line' | |
normal! `[v`]y | |
endif | |
let text = @@ | |
let @@ = saved_register | |
return text |
% \documentclass[9pt,a4paper,twocolumn,landscape,oneside]{amsart} | |
\documentclass[9pt,a4paper,landscape,oneside]{amsart} | |
\usepackage{amsmath, amsthm, amssymb, amsfonts} | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} | |
\usepackage{booktabs} | |
\usepackage{fancyhdr} | |
\usepackage{float} | |
\usepackage{fullpage} | |
%\usepackage{geometry} |
%% Copyright 2020 Alexander Yakushev | |
% | |
% This work may be distributed and/or modified under the | |
% conditions of the LaTeX Project Public License, either version 1.3 | |
% of this license or (at your option) any later version. | |
% The latest version of this license is in | |
% http://www.latex-project.org/lppl.txt | |
% and version 1.3 or later is part of all distributions of LaTeX | |
% version 2005/12/01 or later. | |
% |
{ | |
"kind": "List", | |
"apiVersion": "v1", | |
"metadata": {}, | |
"items": [ | |
{ | |
"kind": "Pod", | |
"apiVersion": "v1", | |
"metadata": { | |
"name": "mongo-controller-h714w", |