home: create 'modules/home' folder
Consolidating all modules under the same path, to clear out the top-level directory.
This commit is contained in:
parent
c856933803
commit
65a8f7c481
119 changed files with 2 additions and 2 deletions
28
modules/home/firefox/tridactyl/default.nix
Normal file
28
modules/home/firefox/tridactyl/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.firefox.tridactyl;
|
||||
|
||||
term = config.my.home.terminal.program;
|
||||
|
||||
vimCommandLine = {
|
||||
alacritty = ''-e "vim" "%f" "+normal!%lGzv%c|"'';
|
||||
# Termite wants the whole command in a single argument...
|
||||
termite = ''-e "vim %f '+normal!%lGzv%c|'"'';
|
||||
};
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.configFile."tridactyl/tridactylrc".source = pkgs.substituteAll {
|
||||
src = ./tridactylrc;
|
||||
|
||||
editorcmd = lib.concatStringsSep " " [
|
||||
# Use my configured terminal
|
||||
term
|
||||
# Make it easy to pick out with a window class name
|
||||
"--class tridactyl_editor"
|
||||
# Open vim with the cursor in the correct position
|
||||
vimCommandLine.${term}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
82
modules/home/firefox/tridactyl/tridactylrc
Normal file
82
modules/home/firefox/tridactyl/tridactylrc
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
" Shamelessly taken from bovine3dom's example configuration file from the docs
|
||||
|
||||
" Basics {{{
|
||||
" Use dark color scheme
|
||||
colorscheme dark
|
||||
|
||||
" Make tridactyl open Vim in my prefered terminal
|
||||
set editorcmd @editorcmd@
|
||||
|
||||
" Remove editor file after use
|
||||
alias editor_rm composite editor | jsb -p tri.native.run(`rm -f '${JS_ARG[0]}'`)
|
||||
bind --mode=insert <C-i> editor_rm
|
||||
bind --mode=input <C-i> editor_rm
|
||||
" }}}
|
||||
|
||||
" Binds {{{
|
||||
" Reddit et al. {{{
|
||||
" Toggle comments on Reddit, Hacker News, Lobste.rs
|
||||
bind ;c hint -Jc [class*="expand"],[class*="togg"],[class="comment_folder"]
|
||||
|
||||
" Make `gu` take me back to subreddit from comments
|
||||
bindurl reddit.com gu urlparent 3
|
||||
|
||||
" Only hint search results on Google
|
||||
bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a
|
||||
bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a
|
||||
|
||||
" Only hint search results on DuckDuckGo
|
||||
bindurl ^https://duckduckgo.com f hint -Jc [data-testid="result-title-a"]
|
||||
bindurl ^https://duckduckgo.com F hint -Jbc [data-testid="result-title-a"]
|
||||
|
||||
" Only hint item pages on Hacker News
|
||||
bindurl news.ycombinator.com ;f hint -Jc .age > a
|
||||
bindurl news.ycombinator.com ;F hint -Jtc .age > a
|
||||
" }}}
|
||||
|
||||
" Better bindings {{{
|
||||
" Handy multiwindow binds
|
||||
bind gd tabdetach
|
||||
bind gD composite tabduplicate; tabdetach
|
||||
|
||||
" Duplicate a tab without detaching window
|
||||
bind <Space>d tabduplicate
|
||||
|
||||
" Make yy use canonical links on the few websites that support them
|
||||
bind yy clipboard yankcanon
|
||||
" }}}
|
||||
|
||||
" Search {{{
|
||||
" Case insensitive only if fully lowercase
|
||||
set findcase smart
|
||||
|
||||
" Search forward/backward
|
||||
bind / fillcmdline find
|
||||
bind ? fillcmdline find -?
|
||||
|
||||
" Go to next/previous match
|
||||
bind n findnext 1
|
||||
bind N findnext -1
|
||||
|
||||
" Because :nohls never works
|
||||
bind <Space><Space> nohlsearch
|
||||
|
||||
" Use browser's native find when using Ctrl-F
|
||||
unbind <C-f>
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" Redirections {{{
|
||||
" Always redirect Reddit to the old site
|
||||
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
|
||||
" Use a better Twitter front-end
|
||||
autocmd DocStart ^http(s?)://twitter.com js tri.excmds.urlmodify("-t", "twitter.com", "nitter.net")
|
||||
" }}}
|
||||
|
||||
" Disabled websites {{{
|
||||
blacklistadd netflix.com
|
||||
blacklistadd primevideo.com
|
||||
blacklistadd jellyfin.belanyi.fr
|
||||
" }}}
|
||||
|
||||
" vim: set filetype=vim foldmethod=marker:
|
||||
Loading…
Add table
Add a link
Reference in a new issue