This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Auto-insert closing parenthesis/brace {{{2 | |
" TODO: make bracket insertion a little smarter | |
" right now it gets in the way more than it helps | |
inoremap ( ()<Left> | |
inoremap { {}<Left> | |
inoremap [ []<Left> | |
" Auto-delete closing parenthesis/brace | |
function! BetterBackSpace() abort | |
let cur_line = getline('.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6 | |
# -*- coding: utf-8 -*- | |
# dror - pathlib edition | |
# Based on https://gist.github.com/dansku/9040240#file-dropboxorganize-py | |
__lastchanged__ = '2018-06-07 06:07' | |
__verstion__ = '0.6.2' | |
from datetime import date | |
from pathlib import Path | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" screen line scroll - very useful with wrap on | |
" https://bluz71.github.io/2017/05/15/vim-tips-tricks.html | |
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj' | |
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" quick add plugins for a plugin manager to load {{{1 | |
function! AddPacFromCb() abort | |
if v:version >= 801 || (v:version == 800 && has("patch1630")) | |
let l:cb = trim(@+) | |
else | |
" do oldschool way to trim all spaces and whatnot | |
let l:cb = substitute(@+,'\v^\s*(.{-})\s*\n$','\1','') | |
endif | |
let l:cb = substitute(l:cb, '\v^https://github.com/','','') | |
put = 'Plugin ''' . l:cb . '''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! InsertFoldMarker(...) abort | |
let l:cur_line = getline('.') | |
let l:markers = split(&l:fmr, ',') | |
let l:marker = (a:0) && len(l:markers)>1 ? l:markers[1] : l:markers[0] | |
let l:level = foldlevel('.') | |
let l:level = l:level == 0 ? '1' : l:level | |
let l:cms = split(&l:cms, '%s') | |
" TODO: handle paired comment markers | |
let l:cms = (a:0) && len(l:cms)>1 ? l:cms[1] : l:cms[0] | |
let l:marker_cnt = count(l:cur_line, l:cms) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = document.body.getElementsByClassName('gameListRowItemName'); | |
var namesString = ''; | |
for (var i = 0; i < names.length; i++) namesString += (names[i].innerText + '\n'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" even easier with `.\{-}`: | |
%s/\[\(.\{-}\)](\(.\{-}\))/[[\2][\1]]/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import numpy as np | |
import matplotlib.pyplot as pyplot | |
import pandas as pd | |
from datetime import datetime | |
import seaborn as sns | |
ini = datetime.now() | |
fle = "Cosmonaut" # File name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" It's probably not exactly what you want, because you mentioned autocmds in the original post, but you may be interested in :h :DiffOrig. FWIW, here's a modified version of this custom command which I'm using: | |
com! -bar DiffOrig echo s:diff_orig() | |
fu! s:diff_orig() abort | |
let cole_save = &l:cole | |
setl cole=0 | |
vnew | |
setl bh=wipe nobl bt=nofile noswf |