Skip to content

Instantly share code, notes, and snippets.

# 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 / fzf-snippets.sh
Last active April 11, 2023 23:29
Some fzf snippets
fzf_argfiles() {
fzf --multi | tr '\n' ' '
}
# for unstaged changes and untracked files
fzf_dirty_files() {
git status --porcelain | cut -c 1,2,3 --complement | fzf --multi --preview-window=up:50% --preview='git diff --color=always {}'
}
fzf_modified_files() {
@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 / rofi-pass
Last active December 20, 2023 21:32
Rofi script to find a password from password-store and copy it to clipboard.
#!/usr/bin/env bash
cd "$HOME/.password-store" || exit 1
pass_name=$(fd --type file --exec echo '{.}' | rofi -dmenu -i -p "pass")
[[ -n $pass_name ]] || exit 1
if pass show -c "$pass_name"; then
notify-send --urgency=normal "$pass_name" "Password copied to clipboard!"
fi
@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"
@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