From 67857e5ae8704dfc0a66fee8b7d66ffb945814f5 Mon Sep 17 00:00:00 2001 From: kp2pml30 Date: Sun, 26 May 2024 14:09:41 +0300 Subject: [PATCH] adopt stow --- home/.config/fish/config.fish | 50 ++++++++++++++++++++++---- home/.config/kitty/kitty.conf | 3 +- init.vim => home/.config/nvim/init.vim | 20 +++++------ set-symlinks.sh | 9 +++++ 4 files changed, 65 insertions(+), 17 deletions(-) rename init.vim => home/.config/nvim/init.vim (85%) create mode 100755 set-symlinks.sh diff --git a/home/.config/fish/config.fish b/home/.config/fish/config.fish index f90fe4b..56ca284 100644 --- a/home/.config/fish/config.fish +++ b/home/.config/fish/config.fish @@ -1,11 +1,49 @@ +function read_confirm + while true + read -l -P "$argv [y/N] " confirm + + switch $confirm + case Y y + return 0 + case '' N n + return 1 + end + end +end + +function fish_greeting + if status is-interactive && ! test -f /encrypt/.exists + if test -f /tmp/.skip-encrypt + echo "Encrypted drive not installed" + return + end + touch /tmp/.skip-encrypt + if read_confirm "Setup encrypted drive?" + set home "$HOME" + printf "su " + sudo bash -c "losetup /dev/loop0 '$HOME/encrypted.vhdx' && cryptsetup open /dev/loop0 loop0 && mount /dev/mapper/loop0 /encrypt" + echo "success: $status" + end + end +end + if status is-interactive - if test -f ~/.ghcup/env - bass source ~/.ghcup/env - end - if test -x ~/.rbenv/bin/rbenv - ~/.rbenv/bin/rbenv init - fish | source - end if command -v zoxide > /dev/null zoxide init fish | source end end +if command -v poetry > /dev/null + poetry completions fish | source +end +if test -f ~/.ghcup/env + bass source ~/.ghcup/env +end +if test -x ~/.rbenv/bin/rbenv + ~/.rbenv/bin/rbenv init - fish | source +end +if test -f ~/.opam/opam-init/init.fish + source /home/r3vdy-2-b10vv/.opam/opam-init/init.fish +end +alias clear="printf '\033[2J\033[3J\033[1;1H'" +export PATH="$PATH:$HOME/.bin:$HOME/.local/bin" +bass source ~/.bashrc diff --git a/home/.config/kitty/kitty.conf b/home/.config/kitty/kitty.conf index 0a84e53..5f334d9 100644 --- a/home/.config/kitty/kitty.conf +++ b/home/.config/kitty/kitty.conf @@ -1 +1,2 @@ -font_family firacode +include ~/.cache/wal/colors-kitty.conf +font_family FiraCode Nerd Font Mono diff --git a/init.vim b/home/.config/nvim/init.vim similarity index 85% rename from init.vim rename to home/.config/nvim/init.vim index 4bc1383..cfa4567 100644 --- a/init.vim +++ b/home/.config/nvim/init.vim @@ -1,14 +1,13 @@ call plug#begin() - # Plug 'nvim-tree/nvim-tree.lua' Plug 'preservim/nerdtree' Plug 'kyazdani42/nvim-web-devicons' Plug 'romgrk/barbar.nvim' - Plug 'lukas-reineke/indent-blankline.nvim' - Plug 'm4xshen/autoclose.nvim' + Plug 'jiangmiao/auto-pairs' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'spinks/vim-leader-guide' Plug 'feline-nvim/feline.nvim' Plug 'folke/tokyonight.nvim', { 'branch': 'main' } + Plug 'timakro/vim-yadi' call plug#end() set termguicolors @@ -17,6 +16,10 @@ if exists(':GuiRenderLigatures') GuiRenderLigatures 1 endif +if exists(':GuiFont') + GuiFont FiraCode\ Nerd\ Font +endif + set nowrap set clipboard=unnamedplus @@ -30,7 +33,7 @@ set noexpandtab nmap :w imap :w -nmap :NERDTreeToggle +map :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif noremap (col('.') == matchend(getline('.'), '^\s*')+1 ? '0' : '^') imap @@ -46,6 +49,8 @@ nmap :BufferNext nmap :BufferPrevious nmap :BufferClose +autocmd BufRead * DetectIndent + vnoremap > >gv vnoremap < ", "g:smap") -au BufReadPost *.ets set syntax=typescript - -lua require("feline").setup() -lua require("ibl").setup() -lua require("autoclose").setup() -lua require("nvim-tree").setup() +lua require('feline').setup() diff --git a/set-symlinks.sh b/set-symlinks.sh new file mode 100755 index 0000000..4022d85 --- /dev/null +++ b/set-symlinks.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +cd "$SCRIPT_DIR" + +stow --target "$HOME" --dir "$SCRIPT_DIR" home