agdsn and networking updates

This commit is contained in:
Rouven Seifert 2023-10-26 12:12:45 +02:00
parent 5148ff5953
commit 45628bdbc3
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
22 changed files with 86 additions and 476 deletions

View file

@ -11,7 +11,7 @@
- **Editor:** [Helix](https://helix-editor.com) - **Editor:** [Helix](https://helix-editor.com)
- **Notifications:** [swaync](https://github.com/ErikReider/SwayNotificationCenter) - **Notifications:** [swaync](https://github.com/ErikReider/SwayNotificationCenter)
- **Panel:** [Waybar](https://github.com/Alexays/Waybar) - **Panel:** [Waybar](https://github.com/Alexays/Waybar)
- **File Manager:** [Vifm](https://vifm.info/) - **File Manager:** [Yazi](https://yazi-rs.github.io/)
## Installation ## Installation
Should work out of the box:\ Should work out of the box:\

View file

@ -171,11 +171,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697964592, "lastModified": 1698250431,
"narHash": "sha256-fua0LKNLkYYK2Dgdm9P+VPdqrVgDXUIx+EkQAQByhuc=", "narHash": "sha256-qs2gTeH4wpnWPO6Oi6sOhp2IhG0i0DzcnrJxIY3/CP8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "219d268a69512ff520fe8da1739ac22d95d52355", "rev": "09587fbbc6a669f7725613e044c2577dc5d43ab5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -191,11 +191,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1695887080, "lastModified": 1698313822,
"narHash": "sha256-LaLn0edsKq66xYgLq2xLBTcUZV0ZcXFyyKNQjpWpN2E=", "narHash": "sha256-YBsZB7IVcOfeofWel2UczNt68i0uaY6PUQndxAFjXUs=",
"owner": "therealr5", "owner": "therealr5",
"repo": "TruckSimulatorBot-images", "repo": "TruckSimulatorBot-images",
"rev": "9a0a72077a90232ecf0de26dec25f7aadc692feb", "rev": "6f0726ef62d346d8b8276335f7294a4634b4714d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,11 +287,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1697748412, "lastModified": 1698053470,
"narHash": "sha256-5VSB63UE/O191cuZiGHbCJ9ipc7cGKB8cHp0cfusuyo=", "narHash": "sha256-sP8D/41UiwC2qn0X40oi+DfuVzNHMROqIWdSdCI/AYA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "72d53d51704295f1645d20384cd13aecc182f624", "rev": "80d98a7d55c6e27954a166cb583a41325e9512d7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -301,11 +301,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1697723726, "lastModified": 1698134075,
"narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", "narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", "rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -368,11 +368,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1694795979, "lastModified": 1698315015,
"narHash": "sha256-u86BfJNeHwPJrVfJE11OrBx6n/2NICohJsOkBARdWn0=", "narHash": "sha256-RWYymaHHx6pi4HRLfJJTF3u4Im22uUtVZDUvTbP0Qrc=",
"owner": "therealr5", "owner": "therealr5",
"repo": "pfersel", "repo": "pfersel",
"rev": "2fcfdf8a481db9e2fe0d241ee9ac2739c1aace71", "rev": "40292aa59ed9f6630dc39405f318842a9c8e7cb3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -419,11 +419,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697981942, "lastModified": 1698314496,
"narHash": "sha256-D+2k9UubyeBaq0+L+nqmF0J9iqllhyO5gdJgg9UoGTA=", "narHash": "sha256-LMuYKvaRaVPYbJo9mJR0fJg1a7uAsmQosq28+Ir44/M=",
"owner": "therealr5", "owner": "therealr5",
"repo": "purge", "repo": "purge",
"rev": "7e3f832be406e1323138a6ec0e0d10347c8c9689", "rev": "bc1264a7954bcc572582d485c9384c62797e4ebc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -481,11 +481,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1697943852, "lastModified": 1698273636,
"narHash": "sha256-DaBxUPaZhQ3yLCmAATshYB7qo7NwcMvSFWz9T3bjYYY=", "narHash": "sha256-swsqg/ckSVJnravx7ie9NFQSKIH27owtlk0wh4+xStk=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "30a0ba4a20703b4bfe047fe5def1fc24978e322c", "rev": "014e44d334a39481223a5d163530d4c4ca2e75cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -516,11 +516,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1696139715, "lastModified": 1698314552,
"narHash": "sha256-iR455di8qCGvZjut4aXQbCBipl+s6hwVH/pme+RTziw=", "narHash": "sha256-WR3jJC/vLx4jdom17Fk3SGynZy/mC0w80sVHB6ItVCg=",
"owner": "therealr5", "owner": "therealr5",
"repo": "TruckSimulatorBot", "repo": "TruckSimulatorBot",
"rev": "71bdfba7f79d091f47f9301e84f9f6982a7ddcc5", "rev": "1d572d6b5b7f1ea84ea7e81a3899bd84da2907c7",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -170,6 +170,5 @@
}; };
}; };
}; };
checks = builtins.mapAttrs (_system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
}; };
} }

View file

@ -258,4 +258,25 @@ in
}; };
}; };
}; };
systemd = {
services.rspamd-dmarc-report = {
description = "rspamd dmarc reporter";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.rspamd}/bin/rspamadm dmarc_report -v";
User = "rspamd";
Group = "rspamd";
};
};
timers.rspamd-dmarc-report = {
description = "Timer for daily dmarc reports";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Unit = "rspamd-dmarc-report.service";
};
};
};
} }

View file

@ -10,6 +10,7 @@
}; };
networking = { networking = {
hostName = "falkenstein-1"; hostName = "falkenstein-1";
nftables.enable = true;
domain = "rfive.de"; domain = "rfive.de";
useNetworkd = true; useNetworkd = true;
enableIPv6 = true; enableIPv6 = true;

View file

@ -8,7 +8,7 @@
# ./modules/adguard # ./modules/adguard
./modules/networks ./modules/networks
./modules/backup ./modules/backup
./modules/hydra # ./modules/hydra
./modules/matrix ./modules/matrix
./modules/nextcloud ./modules/nextcloud
./modules/seafile ./modules/seafile

View file

@ -5,6 +5,7 @@
domain = "rfive.de"; domain = "rfive.de";
useNetworkd = true; useNetworkd = true;
enableIPv6 = true; enableIPv6 = true;
nftables.enable = true;
}; };
services.lldpd.enable = true; services.lldpd.enable = true;
services.resolved = { services.resolved = {

View file

@ -158,6 +158,10 @@
devmon.enable = true; # automount stuff devmon.enable = true; # automount stuff
printing = { printing = {
enable = true; enable = true;
browsedConf = ''
BrowsePoll cups.agdsn.network
LocalQueueNamingRemoteCUPS RemoteName
'';
}; };
avahi = { avahi = {
# autodiscover printers # autodiscover printers
@ -226,9 +230,7 @@
unzip unzip
pciutils pciutils
lm_sensors lm_sensors
sbctl sbctl
deploy-rs deploy-rs
man-pages man-pages
]; ];

View file

@ -23,6 +23,7 @@
dnssec = "allow-downgrade"; dnssec = "allow-downgrade";
}; };
networking = { networking = {
nftables.enable = true;
useNetworkd = true; useNetworkd = true;
hostName = "thinkpad"; hostName = "thinkpad";
hostId = "d8d34032"; hostId = "d8d34032";

File diff suppressed because one or more lines are too long

View file

@ -7,6 +7,7 @@
./sops.nix ./sops.nix
./vim.nix ./vim.nix
./tmux.nix ./tmux.nix
./yazi.nix
./zsh.nix ./zsh.nix
]; ];
} }

14
shared/yazi.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
ripgrep
fd
zoxide
ffmpegthumbnailer
poppler_utils
];
programs.yazi = {
enable = true;
};
}

View file

@ -86,7 +86,7 @@
unset PKGS unset PKGS
for var in "$@" for var in "$@"
do do
PKGS=$PKGS\ nixpkgs/nixos-unstable\#$var PKGS=$PKGS\ nixpkgs/nixos-unstable\\#$var
done done
eval ${pkgs.nix-output-monitor}/bin/nom shell $PKGS eval ${pkgs.nix-output-monitor}/bin/nom shell $PKGS
} }
@ -99,6 +99,7 @@
cat ${../images/cat.sixel} cat ${../images/cat.sixel}
fi fi
eval "$(${pkgs.mcfly}/bin/mcfly init zsh)" eval "$(${pkgs.mcfly}/bin/mcfly init zsh)"
eval "$(${pkgs.zoxide}/bin/zoxide init zsh)"
''; '';
}; };
} }

View file

@ -22,6 +22,11 @@ in
default = { default = {
withExternalGnupg = true; withExternalGnupg = true;
isDefault = true; isDefault = true;
settings = {
"intl.date_time.pattern_override.connector_short" = "{1} {0}";
"intl.date_time.pattern_override.date_short" = "yyyy-MM-dd";
"intl.date_time.pattern_override.time_short" = "HH:mm";
};
}; };
}; };
}; };

View file

@ -11,7 +11,6 @@
./sops ./sops
./spotify ./spotify
./ssh ./ssh
./vifm
./theme ./theme
./packages.nix ./packages.nix
]; ];

View file

@ -1,7 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let let
tex = (pkgs.texlive.combine { tex = (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full inherit (pkgs.texlive) scheme-small
dvisvgm dvipng# for preview and export as html dvisvgm dvipng# for preview and export as html
wrapfig amsmath ulem hyperref capt-of; wrapfig amsmath ulem hyperref capt-of;
# (setq org-latex-compiler "lualatex") # (setq org-latex-compiler "lualatex")
@ -48,6 +48,7 @@ in
element-desktop element-desktop
gomuks # alternative matrix client gomuks # alternative matrix client
mattermost-desktop mattermost-desktop
gajim
# games # games
# dwarf-fortress-packages.dwarf-fortress-full # dwarf-fortress-packages.dwarf-fortress-full
@ -71,7 +72,6 @@ in
bacula bacula
hcloud hcloud
jq jq
logseq
xournalpp xournalpp
libreoffice libreoffice
@ -82,6 +82,7 @@ in
clippy clippy
gcc gcc
nodejs_20 nodejs_20
gnumake
plantuml plantuml

View file

@ -63,7 +63,7 @@ in
}; };
"router" = matchBlocks."cudy"; "router" = matchBlocks."cudy";
"cudy" = { "cudy" = {
hostname = "192.168.1.1"; hostname = "192.168.42.1";
user = "root"; user = "root";
}; };
"git@raspi" = { "git@raspi" = {
@ -74,6 +74,10 @@ in
match = "Host ifsr.de User git"; match = "Host ifsr.de User git";
identityFile = git; identityFile = git;
}; };
"git@git.agdsn.de" = {
match = "Host git.agdsn.de User git";
identityFile = git;
};
}; };
extraConfig = '' extraConfig = ''
PKCS11Provider /run/current-system/sw/lib/libtpm2_pkcs11.so PKCS11Provider /run/current-system/sw/lib/libtpm2_pkcs11.so

View file

@ -5,7 +5,7 @@
colorScheme = nix-colors.colorSchemes.dracula; colorScheme = nix-colors.colorSchemes.dracula;
# theme hardcoded to dracula, too lazy to make all this base16 # theme hardcoded to dracula, too lazy to make all this base16
home.sessionVariables.GTK_THEME = "Dracula"; systemd.user.sessionVariables.GTK_THEME = "Dracula";
qt = { qt = {
enable = true; enable = true;
style = { style = {

View file

@ -1,17 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
vifm
ffmpegthumbnailer
dumptorrent
poppler_utils
fontpreview
];
xdg.configFile."vifm/vifmrc".source = ./vifmrc;
xdg.configFile."vifm/colors/dracula.vifm".source = ./dracula.vifm;
xdg.configFile."vifm/scripts/vifm-sixel" = {
executable = true;
source = ./vifm-sixel;
};
}

View file

@ -1,117 +0,0 @@
" VIFM COLORS
" dracula
" based on: https://github.com/istib/dotfiles/blob/master/vifm/vifm-colors
" Default = -1 = None, can be used for transparency or default color
" Black = 0
" Red = 1
" Green = 2
" Yellow = 3
" Blue = 4
" Magenta = 5
" Cyan = 6
" White = 7
" STYLES
" bold
" underline
" reverse or inverse
" standout
" none
highlight clear
highlight Win cterm=none ctermfg=default ctermbg=none
highlight TopLine cterm=none ctermfg=blue ctermbg=none
highlight TopLineSel cterm=none ctermfg=magenta ctermbg=none
highlight StatusLine cterm=none ctermfg=blue ctermbg=none
highlight Border cterm=none ctermfg=blue ctermbg=none
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold ctermfg=236 ctermbg=blue
highlight WildMenu cterm=none,reverse ctermfg=blue ctermbg=236
highlight CmdLine cterm=none ctermfg=255 ctermbg=236
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Directory cterm=none ctermfg=blue ctermbg=default
highlight Link cterm=none ctermfg=cyan ctermbg=default
highlight BrokenLink cterm=none ctermfg=red ctermbg=default
highlight Socket cterm=none ctermfg=magenta ctermbg=black
highlight Device cterm=none ctermfg=red ctermbg=default
highlight Fifo cterm=none ctermfg=yellow ctermbg=black
highlight Executable cterm=none ctermfg=green ctermbg=default
" Ranger devicons for ViFM
" https://github.com/cirala/vifm_devicons
"
" Filetypes/directories
set classify=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::'
" Specific files
set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::'
set classify+=' ::dropbox::'
set classify+=' ::favicon.*,,README,,readme::'
set classify+=' ::.vim,,.vimrc,,.gvimrc,,.vifm::'
set classify+=' ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::'
set classify+=' ::gulpfile.coffee,,gulpfile.js,,gulpfile.ls::'
set classify+=' ::ledger::'
set classify+=' ::license,,copyright,,copying,,LICENSE,,COPYRIGHT,,COPYING::'
set classify+=' ::node_modules::'
set classify+=' ::react.jsx::'
" File extensions
set classify+='λ ::*.ml,,*.mli::'
set classify+=' ::*.styl::'
set classify+=' ::*.scss::'
set classify+=' ::*.py,,*.pyc,,*.pyd,,*.pyo::'
set classify+=' ::*.php::'
set classify+=' ::*.markdown,,*.md::'
set classify+=' ::*.json::'
set classify+=' ::*.js::'
set classify+=' ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*.drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,*.mef,,*.mos,,*.mrw,,*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srw,,*.tif,,*.x3f,,*.webp,,*.avif,,*.jxl::'
set classify+=' ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::'
set classify+=' ::*.mustasche::'
set classify+=' ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg::'
set classify+=' ::*.rss::'
set classify+=' ::*.coffee::'
set classify+=' ::*.twig::'
set classify+=' ::*.c++,,*.cpp,,*.cxx,,*.h::'
set classify+=' ::*.cc,,*.c::'
set classify+=' ::*.hs,,*.lhs::'
set classify+=' ::*.lua::'
set classify+=' ::*.jl::'
set classify+=' ::*.go::'
set classify+=' ::*.ts::'
set classify+=' ::*.db,,*.dump,,*.sql::'
set classify+=' ::*.sln,,*.suo::'
set classify+=' ::*.exe::'
set classify+=' ::*.diff,,*.sum,,*.md5,,*.sha512::'
set classify+=' ::*.scala::'
set classify+=' ::*.java,,*.jar::'
set classify+=' ::*.xul::'
set classify+=' ::*.clj,,*.cljc::'
set classify+=' ::*.pl,,*.pm,,*.t::'
set classify+=' ::*.cljs,,*.edn::'
set classify+=' ::*.rb::'
set classify+=' ::*.fish,,*.sh,,*.bash::'
set classify+=' ::*.dart::'
set classify+=' ::*.f#,,*.fs,,*.fsi,,*.fsscript,,*.fsx::'
set classify+=' ::*.rlib,,*.rs::'
set classify+=' ::*.d::'
set classify+=' ::*.erl,,*.hrl::'
set classify+=' ::*.ai::'
set classify+=' ::*.psb,,*.psd::'
set classify+=' ::*.jsx::'
set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::'
set classify+=' ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm,,*.av1::'
set classify+=' ::*.epub,,*.pdf,,*.fb2,,*.djvu::'
set classify+=' ::*.7z,,*.apk,,*.bz2,,*.cab,,*.cpio,,*.deb,,*.gem,,*.gz,,*.gzip,,*.lh,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xz,,*.zip,,*.zst::'
set classify+=' ::*.cbr,,*.cbz::'
set classify+=' ::*.log::'
set classify+=' ::*.nix::'
set classify+=' ::*.doc,,*.docx,,*.adoc::'
set classify+=' ::*.xls,,*.xlsmx::'
set classify+=' ::*.pptx,,*.ppt::'

View file

@ -1,55 +0,0 @@
#!/run/current-system/sw/bin/bash
[ -d "$HOME/.cache/vifm" ] || mkdir -p "$HOME/.cache/vifm"
# $1 action
action="$1"
# $2 panel width
# $3 panel height
panel_width=$2
panel_height=$3
cell_width=10
cell_height=18
width=$((panel_width*cell_width))
height=$((panel_height*cell_height))
# $4 image path
image_file="$4"
background=black
PCACHE="$HOME/.cache/vifm/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$PWD/$image_file")" | sha256sum | awk '{print $1}')"
cleanup() {
printf '\33[s\33[5A\33[2K\33[u'
clear
exit 0
}
case "$action" in
"clear")
cleanup
;;
"draw")
img2sixel -S --width=$width $image_file
;;
"video")
[ ! -f "${PCACHE}.jpg" ] && \
ffmpegthumbnailer -i "$4" -o "${PCACHE}.jpg" -s 0 -q 5
img2sixel --width=$width ${PCACHE}.jpg
;;
"epub")
[ ! -f "${PCACHE}.jpg" ] && \
epub-thumbnailer "$image_file" "$PCACHE" 1024
img2sixel --width=$width --height=$height ${PCACHE}.jpg
;;
"pdf")
[ ! -f "${PCACHE}.jpg" ] && \
pdftoppm -jpeg -f 1 -singlefile "$image_file" "$PCACHE"
img2sixel --height=$height ${PCACHE}.jpg
;;
"font")
[ ! -f "${PCACHE}.jpg" ] && \
fontpreview -i "$image_file" -o "${PCACHE}.jpg"
img2sixel --width=$width --height=$height ${PCACHE}.jpg
;;
*)
esac

View file

@ -1,251 +0,0 @@
" vim: filetype=vifm :
set vicmd=hx
set syscalls
" Trash Directory
set trash
set history=100
" Automatically resolve symbolic links on l or Enter.
set nofollowlinks
" With this option turned on you can run partially entered commands with
" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
set fastrun
" Natural sort of (version) numbers within text.
set sortnumbers
" Maximum number of changes that can be undone.
set undolevels=100
" Use Vim's format of help file (has highlighting and "hyperlinks").
set vimhelp
" If you would like to run an executable file when you
" press return on the file name set this.
set norunexec
colorscheme dracula
set timefmt=%m/%d\ %H:%M
set wildmenu
set wildstyle=popup
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
set ignorecase
set smartcase
" Don't highlight search results automatically
set hlsearch
" Use increment searching (search while typing)
set incsearch
" Try to leave some space from cursor to upper/lower border in lists
set scrolloff=4
" Don't do too many requests to slow file systems
if !has('win')
set slowfs=curlftpfs
endif
" Set custom status line look
set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
" ------------------------------------------------------------------------------
" :mark mark /full/directory/path [filename]
mark h ~/
" ------------------------------------------------------------------------------
" :com[mand][!] command_name action
" The following macros can be used in a command
" %a is replaced with the user arguments.
" %c the current file under the cursor.
" %C the current file under the cursor in the other directory.
" %f the current selected file, or files.
" %F the current selected file, or files in the other directory.
" %b same as %f %F.
" %d the current directory name.
" %D the other window directory name.
" %m run the command in a menu window
command! df df -h %m 2> /dev/null
command! diff vim -d %f %F
command! zip zip -r %f.zip %f
command! run !! ./%f
command! make !!make %a
command! mkcd :mkdir %a | cd %a
command! vgrep vim "+grep %a"
command! reload :write | restart
" Man page
filetype *.[1-8] man ./%c
fileviewer *.[1-8] man ./%c | col -b
" MD5
filetype *.md5
\ {Check MD5 hash sum}
\ md5sum -c %f %S,
" SHA1
filetype *.sha1
\ {Check SHA1 hash sum}
\ sha1sum -c %f %S,
" SHA256
filetype *.sha256
\ {Check SHA256 hash sum}
\ sha256sum -c %f %S,
" SHA512
filetype *.sha512
\ {Check SHA512 hash sum}
\ sha512sum -c %f %S,
" GPG signature
filetype *.asc
\ {Check signature}
\ !!gpg --verify %c,
" Torrent
filetype *.torrent transmission-gtk %f &
fileviewer *.torrent dumptorrent -v %c
" FuseZipMount
filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
\ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents}
\ zip -sf %c | less,
\ {Extract here}
\ tar -xf %c,
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
" ArchiveMount
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
\ {Mount with archivemount}
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
fileviewer *.tar.txz,*.txz xz --list %c
fileviewer *.tar tar -tf %c
" Rar2FsMount and rar archives
filetype *.rar
\ {Mount with rar2fs}
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.rar unrar v %c
" IsoMount
filetype *.iso
\ {Mount with fuseiso}
\ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
" SshMount
filetype *.ssh
\ {Mount with sshfs}
\ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
" FtpMount
filetype *.ftp
\ {Mount with curlftpfs}
\ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
" Fuse7z and 7z archives
filetype *.7z
\ {Mount with fuse-7z}
\ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.7z 7z l %c
" Office files
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
fileviewer *.doc catdoc %c
fileviewer *.docx docx2txt.pl %f -
" Displaying pictures in terminal
fileviewer *.pdf
\ vifm-sixel pdf %pw %ph %c %pd
\ %pc
\ vifm-sixel clear
fileviewer *.epub
\ vifm-sixel epub %pw %ph %c %pd
\ %pc
\ vifm-sixel clear
fileviewer <video/*>
\ vifm-sixel video %pw %ph %c %pd
\ %pc
\ vifm-sixel clear
fileviewer <image/*>
\ vifm-sixel draw %pw %ph %c %pd
\ %pc
\ vifm-sixel clear
fileviewer <audio/*>
\ ffmpeg -i %c -hide_banner -f null /dev/null
fileviewer <font/*>
\ vifm-sixel font %pw %ph %c %pd
\ %pc
\ vifm-sixel clear
filetype * xdg-open
" Start shell in current directory
nnoremap S :shell<cr>
" Display sorting dialog
nnoremap s :sort<cr>
" Toggle visibility of preview window
nnoremap w :view<cr>
vnoremap w :view<cr>gv
" Open file in the background using its default program
nnoremap gb :file &<cr>l
" Interaction with system clipboard
if has('win')
" Yank current directory path to Windows clipboard with forward slashes
nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
" Yank path to current file to Windows clipboard with forward slashes
nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
elseif executable('xclip')
" Yank current directory path into the clipboard
nnoremap yd :!echo %d | xclip %i<cr>
" Yank current file path into the clipboard
nnoremap yf :!echo %c:p | xclip %i<cr>
elseif executable('xsel')
" Yank current directory path into primary and selection clipboards
nnoremap yd :!echo -n %d | xsel --input --primary %i &&
\ echo -n %d | xsel --clipboard --input %i<cr>
" Yank current file path into into primary and selection clipboards
nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
\ echo -n %c:p | xsel --clipboard --input %i<cr>
endif
" Mappings for faster renaming
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
" Toggle wrap setting on ,w key
nnoremap ,w :set wrap!<cr>
" Example of standard two-panel file managers mappings
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f8> :delete<cr>