-
Extend the functionality of a bash shell by adding a few extra lines to the .bashrc:
cdl() { clear -x ; cd "$1" ; pushd . > /dev/null ; tput setaf 1; pwd ; tput sgr 0 ; ls ; }
cdp() { clear -x ; cd .. "$1" ; dirs -c ;tput setaf 1; pwd ; ls ;}
Function
cdl
andcdp
are extending thecd
andcd ..
, respectively, with: (1) clearing the screen, (2) listing the content of the folder and (3) printing the current working directory as the first line.The
cdl
is extended withpushd
as well, just in case you accidentally hit 'enter' aftercd
. When that happens typepopd
and you are back where you were instead of the '/home' directory.Example:
-
Default auto completion in bash uses the tabulator key to match up until the next ambiguous character. In case you want to circulate between all possibilities (similaly to zsh default) use
bind
. Adding the followingbind
commands to the .bashrc will asign the key combination of LEFT-SHIFT + the UP arrow to bind and will execute the autocomplete by iteration through all complete possibilities, not just up untill the next common character.bind '"\e[1;2A":menu-complete-backward
bind '"\e[1;2B":menu-complete'
To list out all available sockets to bind see
bind -ls
. The LEFT-SHIFT+Up arrow has the^[[1;2A
metacharacter, while the LEFT-SHIFT+Down arrow has the^[[1;2B
. -
To further customize the shell use different colors for various extensions. Evaluate the .dircolors by:
eval "$(dircolors -b .dircolors)"
sudo add-apt-repository ppa:ultradvorka/ppa
sudo apt-get update
sudo apt-get install hstr
https://github.com/dvorka/hstr
Use VimPlug to install plugins from https://github.com/junegunn/vim-plug
Enable autocomplete with Coc - needs yarn to build and install from .vimrc coc folder
To support autocomplete from a venv in python, add the line to .vimrc
let g:python3_host_prog='/usr/bin/python3'
https://vimawesome.com/plugin/vim-python-virtualenv-hard-things
https://vimawesome.com/plugin/coc-nvim
For this installation nodejs will be required
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
cd ~ curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh sudo bash /tmp/nodesource_setup.sh sudo apt install nodejs
yarn installation
sudo npm install --global yarn
Coc
~/.vim/pluggins/coc
yarn install
Coc-python plugin
:CocInstall coc-pyright
:%!jq .
in vi, install jq
first sudo apt-get jq