Skip to content

Instantly share code, notes, and snippets.

@igemnace
igemnace / i3-config-snippet
Created April 19, 2017 02:50
Example i3 bindings for todotxt-helper
# todo
mode "todo" {
bindsym a mode "default"; exec urxvt -g 80x1 +sb -name floating -e path/to/todo add
bindsym l mode "default"; exec urxvt +sb -name floating --hold -e path/to/todo ls -p
bindsym d mode "default"; exec urxvt +sb -name floating -e path/to/todo done --fzf
bindsym x mode "default"; exec urxvt +sb -name floating --hold -e path/to/todo ctx
bindsym p mode "default"; exec urxvt +sb -name floating --hold -e path/to/todo proj
bindsym Escape mode "default"
}
@igemnace
igemnace / rofi-terminal.sh
Created April 25, 2017 17:14
Open urxvt at a path chosen by rofi.
#!/usr/bin/env bash
rofi_path=$(find "$HOME" -type d -path '*/\.*' -prune -o -not -name '.*' -type d | rofi -dmenu)
[[ $rofi_path != "" ]] && exec urxvt -e zsh -c "cd $rofi_path; zsh -i"
@igemnace
igemnace / arc-window-controls.css
Created May 1, 2017 15:22
Vivaldi tweak for Arc theme
.window-buttongroup button {
background-color: rgba(0,0,0,0) !important;
width: 30px !important;
}
.window-buttongroup button:hover {
background-color: rgba(0,0,0,0) !important;
}
.window-buttongroup button:active {
@igemnace
igemnace / line_preview_hack.patch
Last active May 13, 2017 15:55
A hack for fzf.vim to allow a preview window for :Lines
diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim
index 7ec7b92..dee6d81 100644
--- a/autoload/fzf/vim.vim
+++ b/autoload/fzf/vim.vim
@@ -281,11 +281,11 @@ function! fzf#vim#_lines(all)
if display_bufnames
let bufnames = {}
for b in s:buflisted()
- let bufnames[b] = pathshorten(fnamemodify(bufname(b), ":~:."))
+ let bufnames[b] = fnamemodify(bufname(b), ":~:.")
@igemnace
igemnace / .vimrc
Last active June 16, 2017 14:32
Example template with vim-template-lite and abolish.vim.
augroup TemplatesVim
autocmd!
" trigger vim-abolish on template load
autocmd User TemplateLoad silent! execute "%S/skeleton-name/" . expand('%:t:r:r') . "/g"
augroup END
@igemnace
igemnace / .tern_config
Created July 27, 2017 08:30
Minimum Tern config for reproduction
{
"plugins": {
"node": {},
"modules": {},
"es_modules": {},
"complete_strings": {}
},
"libs": [
"browser",
"ecmascript"
# map only what I declare
# to avoid clashing with Vivaldi keys
unmapAll
# scrolling behavior
map j scrollDown
map k scrollUp
map gg scrollToTop
map G scrollToBottom
map <c-d> scrollPageDown
@igemnace
igemnace / no-statusline-wednesdays.vim
Created September 5, 2017 09:36
No-statusline-wednesdays on #vim! Place in your ~/.vim/after/plugin directory for best results.
if system("date +%a") =~? "wed" | set laststatus=0 | endif
@igemnace
igemnace / .bashrc
Created September 13, 2017 15:07
Snippets for an inotifywait loop to regenerate ctags.
watchdir() {
inotifywait -rme modify --format '%w%f' "$1"
}
@igemnace
igemnace / template-lite.vim
Created October 24, 2017 02:11
Example for filetype-specific template replacement. Nice to go in your vimrc, or in $VIM/after/plugin/template-lite.vim.
function! TemplateReplace() abort
if expand('%') =~ glob2regpat('*.js')
" do JS-specific replacement
elseif expand('%') =~ glob2regpat('*.sh')
" do sh-specific replacement
endif
endfunction
augroup TemplateLite
autocmd!