Skip to content

<C-c><C-c> adds a --- at the end when sending commands to IPython (Anaconda) #299

@ubaldot

Description

@ubaldot

When I select and hit the command ^cpaste -p is sent to IPython but for some reasons it add a --- at the end, preventing the command in IPython to be executed, see screenshot. . I am running on a Windows 10 machine.
I am using vim that comes with Anaconda that I launch with with the following .bat file

@echo off
call C:/Users/yt75534/Anaconda3/Scripts/activate.bat C:\Users\yt75534\Anaconda3
vim -c "bo terminal powershell ipython"

IPython version is 7.27.0, vim version is

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 21 2021 22:13:38)
MS-Windows 32-bit console version
Included patches: 1-3452
Compiled by appveyor@APPVYR-WIN 

and my _vimrc is:

set encoding=utf-8
set nu
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nobackup
set backspace=indent,eol,start
set nocompatible              " required
set clipboard=unnamed
set laststatus=2
set statusline=%f "tail of the filename
set incsearch " for displaying while searching
set smartcase
colorscheme industry
set nofoldenable
set foldmethod=syntax
set foldlevelstart=20

" Automatically open VimGoodies.txt 
"autocmd VimEnter * edit ~/VimGoodies.txt | tabnew
" To switch windows :wincmd
:nnoremap <Leader>w <C-w>

" Buffer management
nnoremap <leader>b :ls<CR>:b

" Open terminal below all splits
" For Cygwin
" cabbrev bterm bo term
" For Windows
cabbrev bterm bo terminal powershell


" --- VUNDLE PLUGIN STUFF BEGIN --------
filetype off                  " required
" Vundle plugin manager
"set the runtime path to include Vundle and initialize
set rtp+=C:/Users/yt75534/vimfiles/bundle/Vundle.vim
 call vundle#begin('C:/Users/yt75534/vimfiles/bundle')
" let Vundle manage Vundle, required
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
Plugin 'gmarik/Vundle.vim'
Plugin 'tmhedberg/SimpylFold.vim'
Plugin 'dense-analysis/ale'
Plugin 'ctrlpvim/ctrlp'
Plugin 'nvie/vim-flake8'
Plugin 'davidhalter/jedi-vim'
Plugin 'jpalardy/vim-slime'
Plugin 'hanschen/vim-ipython-cell'
call vundle#end()            " required
filetype plugin indent on    " required for Vundle
" ---- VUNDLE PLUGIN STUFF END ----------

" ---- Plugin tweak ------
" SimylFold tweak
" Enable folding with the spacebar
nnoremap <space> za


" vim-slime fix paste issues in ipython
let g:slime_python_ipython = 1
let g:slime_target = "vimterminal"


" Matlab-like bindings for vim-iphyton-cell
" map <F5> to save and run script
nnoremap <F5> :w<CR>:IPythonCellRun<CR>
inoremap <F5> <C-o>:w<CR><C-o>:IPythonCellRun<CR>

" map <F6> to evaluate current cell without saving
nnoremap <F6> :IPythonCellExecuteCell<CR>
inoremap <F6> <C-o>:IPythonCellExecuteCell<CR>

" map <F7> to evaluate current cell and jump to next cell without saving
nnoremap <F7> :IPythonCellExecuteCellJump<CR>
inoremap <F7> <C-o>:IPythonCellExecuteCellJump<CR>


" Ctrlp stuff
set wildignore+=*\\_out\\*,*\\Cantata\\*
" ctrlp search from current director
let g:ctrlp_cmd='CtrlP :pwd'
let g:ctrlp_max_files=0


"   ALE linter stuff
let g:ale_linters = {'c': ['clangtidy'],'python':['flake8']}
let g:ale_fixers = {
\   'c':['astyle','clangtidy','remove_trailing_lines', 'trim_whitespace'], 
\}
let g:ale_c_clangtidy_checks = ['*']
let g:ale_c_clangtidy_extra_options = '--extra-arg=-I --extra-arg=C:\Devtools\Install\Cygwin\3.0.7\usr\include --extra-arg=-I --extra-arg=C:\PE_Builds\sw-ecu\BSW\_out\P_AMTG_MC_TEA2P\bin\all_inc' " change header file path if needed

" Matlab syntax stuff. To use the code checker use :make
source $VIMRUNTIME/macros/matchit.vim
filetype indent on
autocmd BufEnter *.m    compiler mlint

syntax on

VimSlime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions