If you want to know more Please refer to here!
The following is the process from installation to activation.
pip install -U pip && pip install wheel pandas bs4 selenium requests googletrans emoji jupyter jupyter_contrib_nbextensions jupyterthemes && jupyter nbextensions_configurator enable --user && mkdir -p $(jupyter --data-dir)/nbextensions && cd $(jupyter --data-dir)/nbextensions && git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && chmod -R go-w vim_binding && jupyter nbextension enable vim_binding/vim_binding
pip install jupyter
Automatically reload the imported module
Type in cell and shift+enter
%load_ext autoreload
%autoreload 2
When looking at the DataFrame of pandas, if the cell width is the default, the characters will be cut off, so set the cell width to the maximum
css:~/.jupyter/custom/custom.css
.container { width:100% !important; }
jupyter-nbextension
Make extensions available
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
https://github.com/ipython-contrib/jupyter_contrib_nbextensions
table of content Show list of markdown
Nbextension
tab
toc2
Perameter
Check Display toc window / sidebar at startup
jupyter-themes
pip install jupyterthemes
https://github.com/dunovank/jupyter-themes
Get your favorite font from ~ / usr / share / fonts
and create a folder with the same font name ** in fonts / monospace etc. in the jupyterthemes installation directory ** (python / site-packages / jupyterthemes / fonts / monospace / font name folder
)
Put the font in this folder.
jupyterthemes
├── fonts
│ ├── monospace
│ │ ├── migu
| | | ├── migu.ttf
After that, describe the font you want to add to python / site-packages / jupyterthemes / stylefx.py
.
python/site-packages/jupyterthemes/fonts/monospace/stylefx.py
def stored_font_dicts(fontcode, get_all=False):
fonts = {'mono':
{'anka': ['Anka/Coder', 'anka-coder'],
........
........
'ubuntu': ['Ubuntu Mono', 'ubuntu'],
'migu': ['Migu 1M', 'migu']}, #Newly added font
'sans':
{'droidsans': ['Droid Sans', 'droidsans'],
........
........
set theme
#Dark system
jt -t monokai -cellw 100% -fs 15 -T -f migu
# Light system
jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T
There is a problem that the background color of the figure and the theme color are covered, so respecify the background color
Add to the following file
css:~/.jupyter/custom.css
div.output_area img, div.output_area svg {
background: #fff;
}
css:~/.jupyter/custom.css
.edit_mode .cell.selected .CodeMirror-focused.cm-fat-cursor {
/*When it's a dark theme*/
/* background-color: #282828; */
/*When the theme is light*/
background-color: #fffae6;
color: #f8f8f0;
}
.edit_mode .cell.selected .CodeMirror-focused:not(.cm-fat-cursor) {
/*When it's a dark theme*/
/* background-color: #282828; */
/*When the theme is light*/
background-color: #fffae6;
color: #f8f8f0;
}
Vim
pip install jupyter_contrib_nbextensions
jupyter nbextensions_configurator enable --user
mkdir -p $(jupyter --data-dir)/nbextensions
If you don't have git, install it.
cd $(jupyter --data-dir)/nbextensions
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding
chmod -R go-w vim_binding
jupyter nbextension enable vim_binding/vim_binding
Successful introduction if OK
Enabling notebook extension vim_binding/vim_binding...
- Validating: OK
In the case of monokai, it would be nice to do something like # 272822
.
css:~/.local/share/jupyter/nbextensions/vim_binding/vim_binding.css
...
...
...
.edit_mode .cell.selected .CodeMirror-focused.cm-fat-cursor {
background-color: #272822;
}
.edit_mode .cell.selected .CodeMirror-focused:not(.cm-fat-cursor) {
background-color: #272822;
}
** Maybe you don't have to set it? ?? ?? ?? ?? ?? ?? ** **
js:~/.jupyter/custom/custom.js
// Configure CodeMirror Keymap
require([
'nbextensions/vim_binding/vim_binding', // depends your installation
], function() {
// Map jj to <Esc>
CodeMirror.Vim.map("jj", "<Esc>", "insert");
// Swap j/k and gj/gk (Note that <Plug> mappings)
CodeMirror.Vim.map("j", "<Plug>(vim-binding-gj)", "normal");
CodeMirror.Vim.map("k", "<Plug>(vim-binding-gk)", "normal");
CodeMirror.Vim.map("gj", "<Plug>(vim-binding-j)", "normal");
CodeMirror.Vim.map("gk", "<Plug>(vim-binding-k)", "normal");
});
jupyter-vim-binding link https://github.com/lambdalisue/jupyter-vim-binding#customization
About keymap https://codemirror.net/keymap/vim.js
Shortcuts to remember & set at a minimum If you remember more than necessary, Vim commands will overlap, so don't worry
** Premise **
--Introduced vim-binding
--How to use jupyter mode
--Some shortcut keys can only be used after entering jupyter mode
with Shift + Esc
.
--Cut cell (dd), paste (p), etc.
** Common to all modes **
** Jupyter mode only **
Well, you can remember more, but if you have a head to remember. If you don't get confused with other Editors and shortcuts, add more and more to become a jupyter master.
Recommended Posts