Skip to content

Instantly share code, notes, and snippets.

View nhooyr's full-sized avatar

Anmol Sethi nhooyr

View GitHub Profile
syn region XMLFold start=+^<\(\%([^/?!><]\)*[^/]>\)\&.*\%(<\1\|[[:alnum:]]\)$+ end=+^</.*[^-?]>$+ fold transparent keepend extend
@nhooyr
nhooyr / demo
Created February 22, 2016 05:33
getkey(force=0): buffer 1b 4f 50
Driver terminfo yields TERMKEY_RES_KEY
Function F1 mod=+00
Key <F1>
getkey(force=0): buffer
Driver terminfo yields TERMKEY_RES_NONE
Driver CSI yields TERMKEY_RES_NONE
getkey_simple(force=0) yields TERMKEY_RES_NONE
getkey(force=0): buffer 1b 4f 51
Driver terminfo yields TERMKEY_RES_KEY
function! s:setFoldManual()
let w:last_fdm = &foldmethod
setlocal foldmethod=manual
endfunction
function! s:resFoldMethod()
let &l:foldmethod = w:last_fdm
silent! foldopen
endfunction
augroup fold
autocmd!
@nhooyr
nhooyr / array
Created February 25, 2016 03:08
['/Users/nhooyr/2', '/usr/local/etc/dotfiles/log.txt', '/usr/local/etc/dotfiles/nvim/autoload/fasd.vim', '/usr/local/etc/dotfiles/nvim/after/ftplugin/html.vim', '/usr/local/etc/dotfiles/nvim/init.vim', 'man://nvim(1)', '/Users/nhooyr/ec hi', '/Users/nhooyr/echo hi', '/usr/local/etc/dotfiles/zsh/zshenv', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/starting.txt', '/usr/local/etc/dotfiles/zsh/zshrc', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/options.txt', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/recover.txt', '/usr/local/etc/TunneLS/config.json', '/usr/local/etc/dotfiles/fasdrc', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/eval.txt', '/Users/nhooyr/:echo v:oldfiles|q', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/change.txt', '/usr/local/etc/dotfiles/nvim/shada/main.shada', 'man://fasd(1)', '/Users/nhooyr/scratch/fasd', '/usr/local/etc/dotfiles/nvim/plugged/fzf.vim/autoload/fzf/vim.vim', '/usr/local/bin/fasd', '/usr/local/etc/dotfiles/fasd', '/usr/local/etc/d
['man://sed(1)', '/usr/local/etc/dotfiles/nvim/init.vim', '/usr/local/bin/fasd', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/options.txt', '/usr/local/etc/dotfiles/nvim/after/ftplugin/html.vim', '/Users/nhooyr/2', '/usr/local/etc/dotfiles/log.txt', '/usr/local/etc/dotfiles/nvim/autoload/fasd.vim', 'man://nvim(1)', '/Users/nhooyr/ec hi', '/Users/nhooyr/echo hi', '/usr/local/etc/dotfiles/zsh/zshenv', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/starting.txt', '/usr/local/etc/dotfiles/zsh/zshrc', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/recover.txt', '/usr/local/etc/TunneLS/config.json', '/usr/local/etc/dotfiles/fasdrc', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/eval.txt', '/Users/nhooyr/:echo v:oldfiles|q', '/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/doc/change.txt', '/usr/local/etc/dotfiles/nvim/shada/main.shada', 'man://fasd(1)', '/Users/nhooyr/scratch/fasd', '/usr/local/etc/dotfiles/nvim/plugged/fzf.vim/autoload/fzf/vim.vim', '/usr/local/etc/dotfiles/fasd', '
[Unit]
Description=D-Bus System Message Bus
Documentation=man:dbus-daemon(1)
Requires=dbus.socket
[Service]
ExecStart=/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-
activation
ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.
DBus / org.freedesktop.DBus.ReloadConfig
inoremap <silent><expr><Tab> pumvisible() ? "\<c-n>"
\ : (<SID>is_whitespace() ? "\<Tab>" : deoplete#mappings#manual_complete())
inoremap <expr><S-Tab> pumvisible() ? "\<c-p>" : "\<c-h>"
function! s:is_whitespace()
let col = col('.') - 1
return !col || getline('.')[col - 1] =~? '\s'
endfunction
@nhooyr
nhooyr / main.go
Created March 2, 2016 21:37
swag
package main
import "log"
const (
call plug#begin('.')
Plug 'benekastah/neomake'
call plug#end()
let g:tagbar_autofocus = 1
set statusline+=%{neomake#statusline#QflistStatus('qf:\ ')}%{neomake#statusline#QflistStatus('qf:\ ')}
function! s:currentFilesList(ArgLead, CmdLine, CursorPos) abort
let l:head = expand('%:h')
let l:files = globpath(l:head, a:ArgLead.'*', 0, 1)
let l:head .='/'
for i in range(len(l:files))
if isdirectory(l:files[l:i])
let l:files[l:i] .= '/'
endif
let l:files[l:i] = substitute(l:files[l:i], l:head, '', '')
endfor