From 1db82922dcff661670a47cb081046ce14db81a72 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 10 Jan 2024 22:25:40 +0100 Subject: bash: use vi editing mode --- configs/bash/default.nix | 9 +++++++++ configs/vim.nix | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'configs') diff --git a/configs/bash/default.nix b/configs/bash/default.nix index 2e18d5b..46b90b1 100644 --- a/configs/bash/default.nix +++ b/configs/bash/default.nix @@ -1,4 +1,13 @@ { config, mylib, pkgs, ... }: { + environment.etc.inputrc.source = pkgs.writeText "inputrc" /* readline */ '' + set bell-style visible + set colored-stats on + set editing-mode vi + set show-mode-in-prompt on + # [cursor] keep in sync with + set vi-ins-mode-string \1\e[6 q\2 + set vi-cmd-mode-string \1\e[2 q\2 + ''; programs.bash = { interactiveShellInit = /* sh */ '' HISTCONTROL='erasedups:ignorespace' diff --git a/configs/vim.nix b/configs/vim.nix index 757d702..cfe30eb 100644 --- a/configs/vim.nix +++ b/configs/vim.nix @@ -113,7 +113,13 @@ filetype plugin indent on + # [cursor] keep in sync with + &t_SI = "\e[6 q" + &t_EI = "\e[2 q" + au VimEnter * silent !echo -ne "\e[2 q" + set t_Co=256 + colorscheme hack au Syntax * syn match Garbage containedin=ALL /\s\+$/ -- cgit v1.2.3