There is no better working environment than vim plus tmux.
IMHO, better than htop.
- Install with
pip3 install bpytop --upgrade
orsudo snap install bpytop
orconda install -c conda-forge bpytop
-
Step 1: Download the neovim.
- If you are root, simply do
sudo apt-get install neovim
. If neovim is not in the repository, then:sudo apt-get install software-properties-common; sudo add-apt-repository ppa:neovim-ppa/stable; sudo apt-get update
- If not, download the prebuilt version: from here, and add an alias nvim to where the neovim program saved. Or add the program to the PATH.
- Prerequisites for python modules:
sudo apt-get install python-dev python-pip python3-dev python3-pip
- If you are root, simply do
-
Step 2: Downlaod the neovim-plug from here
-
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'```
-
-
Step 3: init.vim
- Move the init.vim file to ~/.config/nvim/
-
Step 4: Install NodeJS version > v12 with this method.
- Install with nvm (node version manager):
sudo apt update; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash;
- check current nodejs version:
nvm ls
- check remote versions:
nvm ls-remote
- install the required version:
nvm install [version.number]
- Or install with conda and install yarn with conda
- Then, cd ~/.config/nvim/pack/coc.nvim
- yarn install
- yarn build
- Install with nvm (node version manager):
-
Step 5: Open the nvim and do
:PlugInstall
- If there is any problem with NodeJS, try any method to install a running version of it and do
:CocUpdate
.
- If there is any problem with NodeJS, try any method to install a running version of it and do
-
Step 6: Install pynvim packages
- Install pip and pip3 if it's not installed yet:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip2.py
python get-pip2.py; python3 get-pip.py
- Then add the path to the $PATH
- Install pynvim
pip2 install pynvim; pip3 install pynvim
- Install pip and pip3 if it's not installed yet:
-
Step 7: checkhealth provider,
-
Step 8: CocConfig
- pyright sometimes cannot understand the imported packages, and raises erors. One solution is to install everything with pip/pip3, then coc should be able to naturally understand the packages from the default environment.
- However, if you are using virtual environment, i.e. conda. I am not sure the perfect solution but this is what I do to solve this problem in certain level:
- do
:CocConfig
and add the following lines into the coc-setting.json file.
{ "python.linting.pylintArgs": ["--generate-members=numpy.*,torch.*", "--errors-only"], "python.pythonPath": "PATH-TO-PYTHON-IN-CURRENT-VIRTUAL-ENVIRONMENT", "python.analysis.typeCheckingMode": "off" <- this solve the torch problem. pyright cannot properly parse the torch lib. }
- do
sudo apt install fzf
orconda install -c conda-forge fzf
sudo apt-get install fd-find
orconda install -c conda-forge fd-find
- Might need to do some changes in .bashrc for fd depends on environment setup.
Bash
====
Append this line to ~/.bashrc to enable fzf keybindings for Bash:
source /usr/share/doc/fzf/examples/key-bindings.bash
Append this line to ~/.bashrc to enable fuzzy auto-completion for Bash:
source /usr/share/doc/fzf/examples/completion.bash
apt install bat
orconda install -c conda-forge bat
conda install -c conda-forge tree
- This configuration file works with tmux version 3.0a (and potentially above)
- Download the tmux.conf to home directory, and change the name to
.tmux.conf
- Downlaod tmux plugin manager: link, run prefix + I in tmux session.
(Basic knownledge of vim and tmux will be added soon...)
- Install jupytext:
pip install jupytext
- Now, open a ipynb file, and do set syntax=python to enable syntax.
Install Lua from here
Follow the steps here.
Basically, create a file plugins.lua
under $HOME/.config/nvim/
with this script:
local iron = require "iron.core"
iron.setup({
config = {
should_map_plug = false,
scratch_repl = true,
repl_definition = {
python = {
command = { "ipython" },
format = require("iron.fts.common").bracketed_paste,
},
},
},
keymaps = {
send_motion = "ctr",
visual_send = "ctr",
},
})
- Install with
sudo apt install openssh-server
- Edit config file with
sudo nvim /etc/ssh/sshd_config
- enable the
HostKey
want to use, and enableAuthorizedKeysFile
. - create the authorized key file and put local machine's public key to the file
- copy the public key from
/etc/ssh/sshd_config
on the host to the.ssh
folder on local machine. - sudo systemctl restart ssh
- Open terminal app, press ctrl+shift+j, paste the following command.
term_.prefs_.set('font-family', 'DejaVu Sans Mono Nerd');
term_.prefs_.set('user-css-text', '@font-face {font-family: "DejaVu Sans Mono Nerd"; src: url("https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf"); font-weight: normal; font-style: normal;}')
exa, an alternative of ls
. cargo install exa
dust, an alternative of du
. cargo install du-dust
default shell for mac (fresh start) source
Steps:
- Install Homebrew if you haven't already.
- Install the latest bash shell with Homebrew:
brew update && brew install bash
- If you have an Apple Intel computer, change the shell like this:
sudo chsh -s /usr/local/bin/bash $(whoami)
- Or if you have Apple Silicon (e.g. M1):
sudo chsh -s /opt/homebrew/bin/bash $(whoami)