"***************************************************************************** "" Plugins "***************************************************************************** " https://github.com/sheerun/vim-polyglot#troubleshooting let g:polyglot_disabled = ['markdown'] let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim') " https://github.com/glacambre/firenvim/issues/1285#issuecomment-1004578943 set laststatus=0 if exists('g:started_by_firenvim') let g:firenvim_config = { \ 'globalSettings': { \ "alt": "all", \ "cmdlineTimeout": 0 \ } \ } endif let g:vim_bootstrap_langs = "python" let g:vim_bootstrap_editor = "nvim" " nvim or vim if !filereadable(vimplug_exists) if !executable("curl") echoerr "You have to install curl or first install vim-plug yourself!" execute "q!" endif echo "Installing Vim-Plug..." echo "" silent exec "!\curl -fLo " . vimplug_exists . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" let g:not_finish_vimplug = "yes" autocmd VimEnter * PlugInstall endif " Required: call plug#begin(expand('~/.config/nvim/plugged')) "***************************************************************************** "" Plug install packages "***************************************************************************** Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'preservim/nerdtree' | \ Plug 'Xuyuanp/nerdtree-git-plugin' | \ Plug 'ryanoasis/vim-devicons' Plug 'sheerun/vim-polyglot' Plug 'tpope/vim-speeddating' Plug 'tpope/vim-commentary' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-obsession' Plug 'tpope/vim-rhubarb' " required by fugitive to :Gbrowse Plug 'tommcdo/vim-exchange' Plug 'inkarkat/vim-ReplaceWithRegister' Plug 'unblevable/quick-scope' Plug 'justinmk/vim-sneak' Plug 'easymotion/vim-easymotion' Plug 'bronson/vim-visual-star-search' Plug 'inkarkat/argtextobj.vim' Plug 'michaeljsmith/vim-indent-object' Plug 'kana/vim-textobj-entire' Plug 'kana/vim-textobj-user' Plug 'mbbill/undotree' Plug 'simnalamburt/vim-mundo' Plug 'jiangmiao/auto-pairs' Plug 'SirVer/ultisnips' Plug 'szw/vim-maximizer' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } if isdirectory('$HOMEBREW_PREFIX/opt/fzf') Plug '$HOMEBREW_PREFIX/opt/fzf' | Plug 'junegunn/fzf.vim' else Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } Plug 'junegunn/fzf.vim' endif "" Snippets Plug 'honza/vim-snippets' "" Color Plug 'navarasu/onedark.nvim' "" Python Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'} " https://cirw.in/blog/bracketed-paste Plug 'ConradIrwin/vim-bracketed-paste' " The main R plugin providing RStudio-esque features " Nvim-R handles citation of its own: https://github.com/jalvesaq/Nvim-R/issues/346 " Plug 'jalvesaq/Nvim-R' " https://github.com/quarto-dev/quarto-nvim " Plug 'quarto-dev/quarto-nvim' Plug 'quarto-dev/quarto-vim' Plug 'neovim/nvim-lspconfig' " Plug 'jmbuhr/otter.nvim' Plug 'hrsh7th/nvim-cmp' " https://github.com/neovim/neovim/issues/1822#issuecomment-233152833 Plug 'bfredl/nvim-miniyank' " R setup: https://kadekillary.work/post/nvim-r/ " R setup: https://github.com/beigebrucewayne/vim-ide-4-all/blob/master/R-neovim.md " For Rmarkdown syntax Plug 'vim-pandoc/vim-rmarkdown' Plug 'vim-pandoc/vim-pandoc' Plug 'vim-pandoc/vim-pandoc-syntax' " From Vimcast 73: http://vimcasts.org/episodes/neovim-eyecandy/ " Plug 'machakann/vim-highlightedyank' Plug 'tpope/vim-surround' Plug 'tpope/vim-repeat' Plug 'tpope/vim-unimpaired' Plug 'ntpeters/vim-better-whitespace' Plug 'godlygeek/tabular' call plug#end() "***************************************************************************** "" Basic Setup "*****************************************************************************" " Required: filetype plugin indent on " Firenvim settings if !has('gui_vimr') set guifont=Ewka\ Nerd\ Font:h28 endif " enable omni-completion set omnifunc=syntaxcomplete#Complete "" Encoding set encoding=utf-8 set fileencoding=utf-8 set fileencodings=utf-8 set ttyfast "" Fix backspace indent set backspace=indent,eol,start "" Tabs. May be overridden by autocmd rules set tabstop=4 set softtabstop=0 set shiftwidth=4 set expandtab "" Map leader to , let mapleader='\' " https://github.com/unblevable/quick-scope#highlight-on-key-press " let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] " Map the leader key + q to toggle quick-scope's highlighting in normal/visual mode. " Note that you must use nmap/xmap instead of their non-recursive versions (nnoremap/xnoremap). let g:qs_enable=0 nmap q (QuickScopeToggle) xmap q (QuickScopeToggle) " https://github.com/kana/vim-textobj-entire/blob/64a856c9dff3425ed8a863b9ec0a21dbaee6fb3a/doc/textobj-entire.txt#L91 let g:textobj_entire_no_default_key_mappings = 1 " https://stackoverflow.com/questions/16622566/how-to-solve-the-collision-of-tab-key-mapping-of-ultisnips-plugin-in-the-vim " This seems to be necessary for coc tab completion to work let g:UltiSnipsExpandTrigger = "" " https://github.com/jiangmiao/auto-pairs#shortcuts let g:AutoPairsShortcutBackInsert = "" let g:AutoPairsShortcutFastWrap = "" let g:AutoPairsMapCR = 0 let g:EasyMotion_startofline = 0 " keep cursor column when JK motion let g:EasyMotion_smartcase = 1 let g:EasyMotion_use_smartsign_us = 1 "" Enable hidden buffers set hidden "" Searching set hlsearch set incsearch set ignorecase set smartcase set fileformats=unix,dos,mac set nrformats=alpha set formatoptions=croqj if exists('$SHELL') set shell=$SHELL else set shell=/bin/sh endif "***************************************************************************** "" Visual Settings "***************************************************************************** syntax on set ruler " Use vim-unimpaired's yon and yor to toggle set number and relativenumber let no_buffers_menu=1 let g:pandoc#syntax#conceal#use=0 silent! colorscheme onedark set mousemodel=popup set t_Co=256 set guioptions=egmrti set title set titleold="Terminal" set titlestring=%F set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} if exists("*fugitive#statusline") set statusline+=%{fugitive#statusline()} endif "***************************************************************************** "" Custom configs "***************************************************************************** " https://github.com/jpalardy/vim-slime#tmux let g:slime_target = "tmux" let g:slime_default_config = {"socket_name": "default", "target_pane": "{last}"} let g:slime_dont_ask_default = 1 let g:slime_cell_delimiter = "# %%" " Remove all vim slime mappings (remapped below) let g:slime_no_mappings = 1 " Syntax highlight " Default highlight is better than polyglot let g:polyglot_disabled = ['python'] let python_highlight_all = 1 " Remove all vim surround mappings (remapped below) let g:surround_no_mappings = 1 " vim-pandoc inserts citations with " disable automatic folding by vim-pandoc let g:pandoc#modules#disabled = ["folding"] let g:pandoc#syntax#conceal#blacklist = ["codeblock_start", "codeblock_delim"] " In addition to vim-pandoc, zotcite and nvim-r can insert citations " https://github.com/jalvesaq/Nvim-R/blob/master/doc/Nvim-R.txt#L1940" set completeopt=longest,menuone " https://neovim.io/doc/user/options.html#'autowrite' set autowrite " https://jovicailic.org/2017/04/vim-persistent-undo/ set undofile set undodir=~/.local/share/nvim/undo " https://www.johnhawthorn.com/2012/09/vi-escape-delays/ set timeoutlen=1000 ttimeoutlen=10 "" Directories for swp files set nobackup set noswapfile set nowritebackup " Better display for messages set cmdheight=1 " You will have bad experience for diagnostic messages when it's default 4000. set updatetime=300 " Don't pass messages to |ins-completion-menu|. " https://vim.fandom.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts set shortmess=aoOstTWAIcqFS " (In times of great desperation) allow use of the mouse set mouse=a " https://github.com/neovim/neovim/wiki/FAQ#how-to-change-cursor-shape-in-the-terminal set guicursor=n-v-c-sm-ve:block,i-ci:ver25,r-cr:hor20,o:hor50,a:blinkon100 " Share system clipboard ("+) and unnamed ("") registers " http://vimcasts.org/episodes/accessing-the-system-clipboard-from-vim/ " http://vimcasts.org/blog/2013/11/getting-vim-with-clipboard-support/ set clipboard=unnamed if has('unnamedplus') set clipboard=unnamed,unnamedplus endif set go+=a " Neovim defaults https://neovim.io/doc/user/vim_diff.html " 'autoindent' is enabled " 'background' defaults to "dark" (unless set automatically by the terminal/UI) " 'belloff' defaults to "all" " 'compatible' is always disabled " 'complete' excludes "i" " 'cscopeverbose' is enabled " 'history' defaults to 10000 (the maximum) " 'showcmd' is enabled " 'sidescroll' defaults to 1 " 'smarttab' is enabled " 'tabpagemax' defaults to 50 " 'wildmenu' is enabled " Neovim defaults? set path+=** " Provides tab-completion for all file-related tasks set lazyredraw " Don't redraw while executing macros (good performance config) set showmatch " Show matching brackets when text indicator is over them set hidden " can put buffer to the background without writing to disk, will remember history/marks. set fillchars+=vert:│ set laststatus=0 highlight EndOfBuffer ctermbg=NONE guibg=NONE highlight LineNr ctermbg=NONE guibg=NONE highlight NonText ctermbg=NONE guibg=NONE highlight Normal ctermbg=NONE guibg=NONE ctermfg=white guifg=white highlight SignColumn ctermbg=NONE guibg=NONE highlight VertSplit ctermbg=NONE guibg=NONE highlight pandocEmphasis gui=italic cterm=italic guifg=#ffff00 ctermfg=Yellow highlight pandocString guifg=#00ff00 ctermfg=Green highlight pandocNoFormatted guifg=#ff8700 ctermfg=214 highlight Terminal ctermbg=NONE guibg=NONE ctermfg=white guifg=white "" fzf.vim set wildmode=list:longest,list:full set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__ let $FZF_DEFAULT_OPTS="'--bind=change:top,ctrl-/:toggle-preview,ctrl-n:down,ctrl-p:up,ctrl-k:kill-line,alt-p:toggle-preview,alt-w:toggle-preview-wrap,alt-y:execute-silent(echo {1} | pbcopy)' --cycle --delimiter=':, ' --exit-0 --inline-info --multi --no-height --no-sort --preview='bat --style=numbers --color=always {1}' --preview-window='70%:hidden' --reverse --tiebreak=index" " Disable visualbell set noerrorbells visualbell t_vb= " http://sherifsoliman.com/2017/07/22/nvim-r/ " press alt+, to have Nvim-R insert the assignment operator: <- let R_assign_map = "" let R_auto_start = 0 " https://github.com/randy3k/radian#nvim-r-support let R_esc_term = 0 let R_app = "radian" let R_cmd = "R" let R_hl_term = 0 let R_args = [] " if you had set any let R_bracketed_paste = 1 let R_source = '~/tmux_split.vim' " https://github.com/jalvesaq/Nvim-R/blob/master/doc/Nvim-R.txt#L1669 " set a minimum source editor width let R_min_editor_width = 18 " make sure the console is on the right by making it narrow let R_rconsole_width = 57 " https://www.freecodecamp.org/news/turning-vim-into-an-r-ide-cd9602e8c217/ " let g:rout_follow_colorscheme = 1 " let g:Rout_more_colors = 1 " Don't expand a dataframe to show columns by default " let R_objbr_opendf = 0 " https://github.com/jalvesaq/Nvim-R/blob/master/doc/Nvim-R.txt#L2152 " Only use the mappings listed below let R_user_maps_only = 1 " Do not replace grave accent with chunk delimiters in Rmd files " Use alt-i to insert code chunks instead let R_rmdchunk = 0 " COC settings " https://github.com/neoclide/coc.nvim/blob/82c3834f8bfc5d91ce907405722fe0f297e13cff/doc/coc.txt#L1202 let g:coc_global_extensions = ['coc-bibtex', 'coc-git', 'coc-json', 'coc-python', 'coc-r-lsp', 'coc-sh', 'coc-snippets', 'coc-yaml', 'coc-yank'] " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. if has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one set signcolumn=number else set signcolumn=yes endif " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} let g:coc_snippet_next = '' let g:coc_snippet_prev = '' "" NERDTree configuration let g:NERDTreeChDirMode=2 let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] let g:NERDTreeShowBookmarks=1 let g:nerdtree_tabs_focus_on_files=1 let g:NERDTreeMapOpenInTabSilent = '' let g:NERDTreeWinSize = 50 set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite " https://vi.stackexchange.com/a/8858 if executable('rg') set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case set grepformat=%f:%l:%c:%m elseif executable('ag') set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor\ --smart-case\ $* set grepformat=%f:%l:%c:%m elseif executable('pt') set grepprg=pt\ --nogroup\ --nocolor set grepformat=%f:%l:%c:%m elseif executable('ack') set grepprg=ack\ -s\ --with-filename\ --nopager\ --nocolor\ --nogroup\ --column\ --smart-case set grepformat=%f:%l:%c:%m,%f:%l:%m elseif executable('git') set grepprg=git\ --no-pager\ grep\ --no-color\ --line-number\ $* set grepformat=%f:%l:%m,%m\ %f\ match%ts,%f elseif executable('grep') let &grepprg='grep --recursive --line-number --exclude=' . shellescape(&wildignore) . ' $*' else set grepprg=internal endif set autoread "***************************************************************************** "" Abbreviations "***************************************************************************** "" No one is really happy until you have this shortcuts cnoreabbrev W! w! cnoreabbrev Q! q! cnoreabbrev Qall! qall! cnoreabbrev Wq wq cnoreabbrev Wa wa cnoreabbrev wQ wq cnoreabbrev WQ wq cnoreabbrev W w cnoreabbrev Q q cnoreabbrev Qall qall "***************************************************************************** "" Commands "***************************************************************************** " remove trailing whitespaces command! FixWhitespace :%s/\s\+$//e " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocAction('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') "***************************************************************************** "" Autocmd Rules "***************************************************************************** " https://neovim.io/doc/user/lua.html#vim.highlight au TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false} " https://til.hashrocket.com/posts/17c44eda91-persistent-folds-between-vim-sessions augroup remember_folds autocmd! autocmd BufWinLeave * mkview autocmd BufWinEnter * silent! loadview augroup END "" The PC is fast enough, do syntax highlight syncing from start unless 200 lines augroup vimrc-sync-fromstart autocmd! autocmd BufEnter * :syntax sync maxlines=200 augroup END " https://vimways.org/2018/formatting-lists-with-vim/ autocmd FileType pandoc,markdown,text setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 formatoptions+=tnp formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s+[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: " Syntax highlighting for files with weird extensions autocmd BufNewFile,BufRead .tmux.conf* set syntax=tmux autocmd BufNewFile,BufRead *radian_profile set syntax=r autocmd BufNewFile,BufRead *.R set ft=r autocmd BufNewFile,BufRead shortcuts.jupyterlab-settings set syntax=json "" Remember cursor position augroup vimrc-remember-cursor-position autocmd! autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif augroup END "" make/cmake augroup vimrc-make-cmake autocmd! autocmd FileType make setlocal noexpandtab autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake augroup END if has('autocmd') autocmd GUIEnter * set visualbell t_vb= endif " python " vim-python augroup vimrc-python autocmd! autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8 colorcolumn=79 \ formatoptions+=croq softtabstop=4 \ cinwords=if,elif,else,for,while,try,except,finally,def,class,with augroup END " Snakemake au BufNewFile,BufRead Snakefile set syntax=snakemake au BufNewFile,BufRead *.smk set syntax=snakemake au BufNewFile,BufRead *.snk set syntax=snakemake au BufNewFile,BufRead *.snakefile set syntax=snakemake au FileType snakemake let Comment="#" au FileType snakemake setlocal completeopt=menuone,longest au FileType snakemake setlocal tw=79 tabstop=4 shiftwidth=4 softtabstop=4 " Nvim-R mappings autocmd FileType r,rmd nnoremap a :!wmctrl -r "R Graphics" -b add,above autocmd FileType r,rmd nnoremap A :!wmctrl -r "R Graphics" -b remove,above " Keyboard shortcuts for <- -> and other operators in R specific files " https://github.com/jalvesaq/Nvim-R/issues/85 " The trailing spaces below are intentional! autocmd FileType r,rmd inoremap :normal! a %>%a autocmd FileType r,rmd inoremap :normal! a %>%a autocmd FileType r,rmd inoremap :normal! a %in%a autocmd FileType r,rmd inoremap :normal! a <-a autocmd FileType r,rmd inoremap :normal! a ->a autocmd FileType r,rmd inoremap :normal! a %/%a autocmd FileType rmd inoremap :normal! a ```{r}```O autocmd FileType rmd nnoremap :w :!Rscript -e "rmarkdown::render('%')" autocmd FileType rmd nnoremap ] :w :!Rscript -e "bookdown::render_book('%')" autocmd FileType r nnoremap :w :!Rscript % autocmd FileType python nnoremap :w !python " https://github.com/jalvesaq/Nvim-R/blob/master/doc/Nvim-R.txt#L2586 " https://github.com/beigebrucewayne/vim-ide-4-all/blob/master/R-neovim.md "" Remapping the basic :: send line (RDSendLine doesn't work well) " Remappings based on RStudio shortcuts: https://rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf "" Remapping selection :: send multiple lines + echo lines " Remapping double character nvim-R mappings to single character autocmd FileType r nmap RSendAboveLines autocmd FileType r nmap RESendFile autocmd FileType r nmap a RESendFile autocmd FileType r,rmd nmap RClearAll autocmd FileType r,rmd nmap RClearConsole autocmd FileType r,rmd nmap - RCloseLists autocmd FileType r,rmd nmap 0 RUpdateObjBrowser autocmd FileType r,rmd nmap ; RRightComment autocmd FileType r,rmd nmap = ROpenLists autocmd FileType r,rmd nmap b REDSendMBlock autocmd FileType r,rmd nmap d RSetwd autocmd FileType r,rmd nmap e RShowEx autocmd FileType r,rmd nmap f RDSendFunction autocmd FileType r,rmd nmap g RPlot autocmd FileType r,rmd nmap h RHelp autocmd FileType r,rmd nmap i RObjectPr autocmd FileType r,rmd nmap k Rknit autocmd FileType r,rmd nmap m RSendMotion autocmd FileType r,rmd nmap n RObjectNames autocmd FileType r,rmd nmap o RDSendLineAndInsertOutput autocmd FileType r,rmd nmap p REDSendParagraph autocmd FileType r,rmd nmap q RClose autocmd FileType r,rmd nmap r RShowArgs autocmd FileType r,rmd nmap s RStart autocmd FileType r,rmd nmap t RObjectStr autocmd FileType r,rmd nmap u RSummary autocmd FileType r,rmd nmap v RViewDFv autocmd FileType r,rmd nmap w RMakeWord autocmd FileType r,rmd nmap x RToggleComment autocmd FileType r,rmd nmap :call SendLineToR("down") autocmd FileType r,rmd nmap l :call SendLineToR("down") autocmd FileType r,rmd xmap o RSendSelAndInsertOutput autocmd FileType r,rmd xmap v REDSendSelection autocmd FileType r,rmd xmap REDSendSelection autocmd FileType rmd nmap RSendChunkFH autocmd FileType rmd nmap REDSendChunk autocmd FileType rmd nmap c REDSendChunk autocmd FileType rmd nmap :normal! a ```{r}```O " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end "***************************************************************************** "" Mappings "***************************************************************************** " remap entire text object to match doom emacs " https://docs.doomemacs.org/v21.12/modules/editor/evil/ onoremap ag (textobj-entire-a) onoremap ig (textobj-entire-i) xnoremap ag (textobj-entire-a) xnoremap ig (textobj-entire-i) function! MakeItEasyToLeaveCommandWindow() nnoremap ZZ nnoremap ZQ nnoremap endfunction " No need to undo au CmdwinEnter * silent! call MakeItEasyToLeaveCommandWindow() cnoremap =expand("%:p:h") . "/" " unimpaired style mapping for toggling autoformat nnoremap yoa &fo =~ 'a' ? ':set fo-=a' : ':set fo+=a' vmap gy (Exchange) nmap gy (Exchange) " brilliant mapping to toggle emacs-style ctrl-k mapping " https://vi.stackexchange.com/a/15579 let s:ctrlKmapped=1 function! ToggleCtrlK() if s:ctrlKmapped iunmap else inoremap col('.') == col('$') ? '' : 'd$' endif let s:ctrlKmapped = !s:ctrlKmapped endfunction nnoremap yok :call ToggleCtrlK() " brilliant mapping to toggle emacs-style ctrl-v mapping " https://vi.stackexchange.com/a/15579 let s:ctrlVmapped=1 function! ToggleCtrlV() if s:ctrlVmapped iunmap else inoremap endif let s:ctrlVmapped = !s:ctrlVmapped endfunction nnoremap yov :call ToggleCtrlV() " pbcopy for OSX copy/paste if has('macunix') xmap :!pbcopy xmap :w !pbcopy endif "" Vmap for maintain Visual Mode after shifting > and < xmap < >gv "" Move visual block xnoremap J :m '>+1gv=gv xnoremap K :m '<-2gv=gv " https://vi.stackexchange.com/a/22233 " copied from plugin/surround.vim nmap ds Dsurround nmap cs Csurround nmap cS CSurround nmap ys Ysurround nmap yS YSurround nmap yss Yssurround nmap ySs YSsurround nmap ySS YSsurround xmap S VSurround xmap gS VgSurround imap Isurround " ----- remove these ----- " imap s Isurround " imap S ISurround " Emacs and bash style insert mode CTRL shortcuts " = Move to start of the line; like in vim command mode: c_ctrl-b; To insert previously inserted text, use . or (below) inoremap cnoremap " = Move one character backward; the opposite of inoremap cnoremap " = Delete one character forward; the opposite of inoremap "\u" cnoremap " = Move to end of the line (already exists in command mode: c_ctrl-e), this also cancels completion inoremap " = Move one character forward; the opposite of ; is too useful (for : / ?) to remap inoremap " = Cancel completion inoremap pumvisible() ? "\" : "" " = Delete one character backward; the opposite of ; already exists in command mode: c_ctrl-h inoremap "\u" " = Delete to end of line; the opposite of ; https://www.reddit.com/r/vim/comments/9i58q8/question_re_delete_word_forward_in_insert_mode/e6he226/; https://superuser.com/a/855997 inoremap col(".") == col("$") ? "" : "d$" cnoremap estrpart(getcmdline(),0,getcmdpos()-1) " cnoremap d$ " = make paste from register undoable in insert mode; already exists in command mode: c_ctrl-r inoremap "\u" " = Delete to start of line; the opposite of ; already exists in command mode: c_ctrl-u inoremap "\u" " = Delete word backward; opposite of ; same as ; already exists in command mode: c_ctrl-w inoremap "\u" " = Paste from system clipboard (not from killring like in bash/emacs) inoremap :call ResetKillRing()" cnoremap " " = Undo like in bash/emacs (this works really well) inoremap u inoremap u " = Undo like in bash/emacs (this works really well) inoremap u " = Redo; opposite of inoremap " Vimacs imap inoremap :call StartMarkSel()v1G0o inoremap > :call StartMarkSel()vG$o inoremap :call QueryReplaceRegexp() inoremap inoremap :echoerr " not supported yet; sorry!" inoremap :call StartSearch('?')? inoremap :call StartSearch('/')/ inoremap inoremap W inoremap w inoremap inoremap :call StartSearch('/')/ inoremap xp inoremap inoremap + = inoremap / :call PointToRegister() inoremap 0 c inoremap 1 o inoremap 2 s inoremap 3 v inoremap 4 :FindFileOtherWindow inoremap 4f :FindFileOtherWindow inoremap d( inoremap :buffers inoremap :confirm qall inoremap :hide edit inoremap :call DeleteBlankLines() inoremap :set invreadonly inoremap :hide view inoremap :update inoremap ddp inoremap :write inoremap = inoremap O W inoremap h :call StartMarkSel()1G0vGo inoremap i :read inoremap k :bdelete inoremap o w inoremap p inoremap r :call PointToRegister() inoremap r :call PointToRegister() inoremap r :call PointToRegister() inoremap rj :call JumpToRegister() inoremap s :wall inoremap