From 5748cb3fea53dbd71e529d18e40e015f17433723 Mon Sep 17 00:00:00 2001 From: "dth@taiga.ai" Date: Sat, 18 Feb 2023 22:01:59 +0100 Subject: [PATCH] :sparkles: add vim-textobj-hydrogen + iron.vim ... --- .config/nvim/init.vim | 16 ++++++++++++++++ .config/nvim/plugins.lua | 17 +++++++++++++++++ makefile | 1 + 3 files changed, 34 insertions(+) create mode 100644 .config/nvim/plugins.lua diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 75abcc4..4b61573 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -32,6 +32,12 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " fuzzy-finder Plug 'ibhagwan/fzf-lua', {'branch': 'main'} " optional for icon support Plug 'kyazdani42/nvim-web-devicons' +" for nvim nirvana +Plug 'hkupty/iron.nvim' " connect to REPLs (i.e. ipython) +Plug 'kana/vim-textobj-user' +Plug 'kana/vim-textobj-line' +Plug 'GCBallesteros/vim-textobj-hydrogen' +Plug 'GCBallesteros/jupytext.vim' call plug#end() @@ -60,6 +66,16 @@ let g:syntastic_python_checkers = ['python', 'flake8'] let g:syntastic_python_python_exec = 'python3' let g:syntastic_rst_checkers=['sphinx'] +" nvim nirvana +" Jupytext +let g:jupytext_fmt = 'py' +let g:jupytext_style = 'hydrogen' +" Send cell to IronRepl and move to next cell. +" Depends on the text object defined in vim-textobj-hydrogen +" You first need to be connected to IronRepl +nmap ]x ctrih/^# %% +luafile $HOME/.config/nvim/plugins.lua + " python stuff let g:python3_host_prog = "$HOME/.venvs/nvim/bin/python" diff --git a/.config/nvim/plugins.lua b/.config/nvim/plugins.lua new file mode 100644 index 0000000..c4a09bc --- /dev/null +++ b/.config/nvim/plugins.lua @@ -0,0 +1,17 @@ +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", + }, +}) diff --git a/makefile b/makefile index 44da630..2718fcb 100644 --- a/makefile +++ b/makefile @@ -39,6 +39,7 @@ setup_nvim: setup_vimwiki1 setup_vimwiki2 setup_vimwiki3 echo "configuring nvim" mkdir -p ~/.config/nvim ln -s -f ~/dotfiles/.config/nvim/init.vim ~/.config/nvim/init.vim + ln -s -f ~/dotfiles/.config/nvim/plugins.lua ~/.config/nvim/plugins.lua setup_music: mkdir -p ~/.config/mpd/playlists/