Skip to content

Instantly share code, notes, and snippets.

View veirus's full-sized avatar

Alex veirus

View GitHub Profile
@veirus
veirus / ff2tg.ahk
Last active October 27, 2020 17:20
quickly share a picture from browser to somewhere else
#v::
; CoordMode, Mouse, Screen
SetKeyDelay, 200
;---------------------------
#IfWinNotActive, ahk_class MozillaWindowClass
WinActivate, MozillaWindowClass
; Send, {Click, right, 470, 674}{y}
Send, {Click, right, 960, 600}
#IfWinActive, ahk_class MozillaDropShadowWindowClass
{
@veirus
veirus / todo.vim
Created June 14, 2020 15:40 — forked from huytd/todo.vim
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
@veirus
veirus / grok_vi.mdown
Created April 11, 2020 15:49 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@veirus
veirus / AddPlugFromClipboard.vim
Created March 31, 2020 13:32
Quick add plugin from Github to your *.vimrc* or wherever you keep your plugins. Also minpac
command! -nargs=+ -bar Plug call minpac#add(<args>)
" quick add plugins for a minpac {{{1
function! AddPacFromCb(arg) 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
@veirus
veirus / emacs-essential-keybindings.md
Created March 16, 2020 16:00 — forked from ulysses4ever/emacs-essential-keybindings.md
Emacs: основные сочетания клавиш

Обозначения:

  • C — клавиша Control, обычно настроена на Ctrl.
  • M — клавиша Meta, обычно настроена на Alt.

Emacs: Общее

  • M-x ввести команду
  • C-x C-c закрыть Emacs
  • C-g прекратить текущую операцию
@veirus
veirus / base.el
Created January 4, 2019 21:00
Emacs config
;;; Package --- Summary
;;; Commentary:
;;; General Emacs configuration
;;; Code:
;;; Закрывать *scratch* при запуске.
(kill-buffer "*scratch*")
;; (desktop-save-mode 1)
(fset 'yes-or-no-p 'y-or-n-p)
" 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
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
@veirus
veirus / .eslintrc.js
Created November 7, 2018 13:39 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@veirus
veirus / InsertFoldmarker.vim
Last active October 8, 2018 14:38
Quick and "smart" (not really...) insertion of current foldmarker + mostly accurate (not really...) foldlevel
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)