From c3864f21c97f96577b2bfc3b4b1f492840fd850b Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Mon, 28 Jun 2021 13:07:10 -0400 Subject: [PATCH] readline config --- .config/shell/commonrc | 6 +++++- .inputrc | 10 ++++++++++ .vimrc | 44 +++++++++++++++++++++++++++++------------- Scripts/ufetch-arch | 2 +- 4 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 .inputrc diff --git a/.config/shell/commonrc b/.config/shell/commonrc index 3d9870a..a529887 100644 --- a/.config/shell/commonrc +++ b/.config/shell/commonrc @@ -15,9 +15,13 @@ alias drill-srs='drill-srs 2>/dev/null' alias scrkey='screenkey -t 2.5 --mods-mode emacs -s small -p fixed -g $(slop -n -f '%g')' alias mdp='export TERM=st; mdp' alias R='R --vanilla' -alias fzf="fzf --color=16 --header=fzf --info=inline --preview='echo {}; file -b {}; echo =-=-=-=-=-=-=-=-=-=-=-=-=-=; if [ -d '{}' ]; then ls -A {}; else head -$LINES {}; fi'" +alias fzf="fzf --color=16 --header=fzf --info=inline --preview='echo {}; file -b {}; echo =-=-=-=-=-=-=-=-=-=-=-=-=-=; if [ -d '{}' ]; then ls -A {}; else head -$LINES {}; fi'" # fzf options when running from shell alias gdb="gdb -q" +mkcd() { + mkdir "$1" && cd "$1" +} + alias v="$EDITOR" alias z="$READER" alias b="$BROWSER" diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..b35afd2 --- /dev/null +++ b/.inputrc @@ -0,0 +1,10 @@ + +# cursors + indicator depending on mode +set editing-mode vi +set vi-ins-mode-string \1\e[34;1m\2[i]\1\e[0m\2\1\e[5 q\e]12;\a\2 +set vi-cmd-mode-string \1\e[33;1m\2[n]\1\e[0m\2\1\e[1 q\e]12;\a\2 +set show-mode-in-prompt on + +# tab completion options +set show-all-if-ambiguous on +set page-completions off diff --git a/.vimrc b/.vimrc index 56cc40c..90857cc 100644 --- a/.vimrc +++ b/.vimrc @@ -13,7 +13,7 @@ set incsearch set encoding=utf-8 set tabstop=4 set shiftwidth=4 -set expandtab +" set expandtab set ignorecase set smartcase set nrformats+=alpha "inc/dec alpha @@ -30,7 +30,7 @@ set conceallevel=2 " Bindings let mapleader = ' ' -" File stuff +" netrw stuff map f :Ex map l :bn map h :bp @@ -65,7 +65,7 @@ map r :source ~/.vimrc:echo "vimrc reloaded" function! StatusModeColor() if (mode() =~# '\v(n|no)') hi StatusLine cterm=None gui=None ctermfg=black ctermbg=Yellow - elseif (mode() =~# '\v(v|V)') + elseif (mode() =~# '\v(v|V|)') hi StatusLine cterm=None gui=None ctermfg=black ctermbg=Red elseif (mode() ==# 'i') hi StatusLine cterm=None gui=None ctermfg=black ctermbg=LightBlue @@ -126,22 +126,27 @@ augroup END " vim plug " this blob auto installs vim plug if it isnt already -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC - endif +fun! s:VimPlugSetup() + if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC + else + echo 'VimPlug is already installed' + endif +endfun +command PlugSetup :call s:VimPlugSetup() " template stuff call plug#begin('~/.vim/plugged') Plug 'sirver/ultisnips' +Plug 'tpope/vim-commentary' +Plug 'ap/vim-buftabline' Plug 'lervag/vimtex' Plug 'PietroPate/vim-tex-conceal' " Plug 'jiangmiao/auto-pairs' -Plug 'tpope/vim-commentary' -Plug 'rlue/vim-barbaric' -Plug 'ap/vim-buftabline' +" Plug 'rlue/vim-barbaric' +" Plug 'junegunn/fzf' call plug#end() @@ -156,6 +161,15 @@ let g:UltiSnipsSnippetDirectories=["UltiSnips", "mysnippets"] map sr :call UltiSnips#RefreshSnippets():echo "Refreshed Snippets" +" latex stuff +" fun! LatexCompile() +" echo 'compiling latex' +" endfun +" augroup latex +" autocmd! +" autocmd BufWritePost *.tex :call LatexCompile() +" augroup END + " Vimtex let g:tex_flavor='latex' let g:vimtex_view_method='zathura' @@ -170,12 +184,16 @@ let g:vimtex_compiler_latexmk = { " \], " vim-barbaric -let g:barbaric_ime = 'ibus' -set ttimeoutlen=0 +" let g:barbaric_ime = 'ibus' +" set ttimeoutlen=0 " buftabline let g:buftabline_show = 1 +" fzf +" let g:fzf_layout = { 'down': '40%' } +" let g:fzf_layout = { 'window': '-tabnew' } + " Run after plugins autocmd FileType * set formatoptions-=o diff --git a/Scripts/ufetch-arch b/Scripts/ufetch-arch index 6882763..5a834ab 100755 --- a/Scripts/ufetch-arch +++ b/Scripts/ufetch-arch @@ -5,7 +5,7 @@ ## INFO # user is already defined -hostname="$(hostname)" +hostname="$(uname -a | awk '{ print $2 }')" os='Arch Linux' host="$(cat /sys/devices/virtual/dmi/id/product_name) $(cat /sys/devices/virtual/dmi/id/product_family)" kernel="$(uname -sr)" -- 2.20.1