" Windows Registry Editor Version 5.00 " " [HKEY_CLASSES_ROOT\*\shell\Edit with Vim] " " [HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command] " @="nvim-qt.exe \"%L\"" "============================================================================== let g:loaded_rrhelper = 1 let g:did_install_default_menus = 1 " avoid stupid menu.vim (saves ~100ms) let s:plugins = filereadable(expand("~/.config/nvim/autoload/plug.vim", 1)) let s:plugins_extra = s:plugins if !s:plugins "{{{ fun! InstallPlug() "bootstrap plug.vim on new systems silent call mkdir(expand("~/.config/nvim/autoload", 1), 'p') exe '!curl -fLo '.expand("~/.config/nvim/autoload/plug.vim", 1) \ .' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endfun else call plug#begin('~/.local/share/nvim/bundle') if v:false " Bring the circus to town! " Plug 'terryma/vim-multiple-cursors' Plug 'vim-airline/vim-airline' " Plug 'lfv89/vim-interestingwords' Plug 'majutsushi/tagbar' endif Plug 'justinmk/molokai' Plug 'mptre/vim-printf' " git clone https://github.com/sunaku/dasht " dasht-docsets-install python Plug 'sunaku/vim-dasht' nnoremap gK :call Dasht([expand(''), expand('')]) Plug 'sbdchd/neoformat' if has('nvim') Plug 'justinmk/vim-highlightedyank' endif if v:version > 703 && !has('win32') && !has('win32unix') Plug 'ludovicchabant/vim-gutentags' let g:gutentags_ctags_exclude = [ \'.vim-src/**', \'venv/**', \'data/**', \'dist/**', \'notebooks/**', \'Notebooks/**', \'*graphhopper_data/*.json', \'*graphhopper/*.json', \'*.json', \'qgis/**' \] endif Plug 'tommcdo/vim-exchange' Plug 'https://github.com/justinmk/vim-ipmotion.git' Plug 'https://github.com/justinmk/vim-gtfo.git' Plug 'https://github.com/justinmk/vim-dirvish.git' " Disable netrw, but autoload it for `gx`. let g:loaded_netrwPlugin = 0 nmap gx NetrwBrowseX nnoremap NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '')),netrw#CheckIfRemote()) Plug 'https://github.com/justinmk/vim-sneak.git' let g:sneak#label = 1 let g:sneak#use_ic_scs = 1 let g:sneak#absolute_dir = 1 map f Sneak_f map F Sneak_F map t Sneak_t map T Sneak_T map Sneak_, if executable("tmux") Plug 'wellle/tmux-complete.vim' endif Plug 'tpope/vim-characterize' " Plug 'tpope/vim-sleuth' Plug 'tpope/vim-scriptease' Plug 'tpope/vim-apathy' Plug 'zhaocai/DirDiff.vim', { 'on': ['DirDiff'] } Plug 'tpope/vim-fugitive' Plug 'junegunn/gv.vim' Plug 'tpope/vim-rhubarb' Plug 'tpope/vim-surround' let g:surround_indent = 0 let g:surround_no_insert_mappings = 1 Plug 'tpope/vim-dispatch' nnoremap !t :FocusDispatch NVIM_LISTEN_ADDRESS= VIMRUNTIME= TEST_FILE=% make functionaltest nnoremap !T :FocusDispatch NVIM_LISTEN_ADDRESS= VIMRUNTIME= TEST_FILE=% TEST_TAG=x make functionaltest nnoremap !F :FocusDispatch NVIM_LISTEN_ADDRESS= VIMRUNTIME= TEST_FILE=% TEST_FILTER="" make functionaltest " nnoremap yr :set opfunc=tmux_run_operatorg@ " xnoremap R :call tmux_run_operator(visualmode(), 1) Plug 'tpope/vim-repeat' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-rsi' Plug 'tpope/vim-unimpaired' nmap co yo Plug 'tpope/vim-endwise' inoremap ( ()O inoremap { {}O inoremap {; {};O inoremap {, {},O inoremap [ []O inoremap ([[ ([[]])O inoremap ([=[ ([=[]=])O inoremap [; [];O inoremap [, [],O Plug 'tpope/vim-obsession' let g:obsession_no_bufenter = 1 " https://github.com/tpope/vim-obsession/issues/40 let g:markdown_syntax_conceal = 0 Plug 'AndrewRadev/linediff.vim' let g:linediff_buffer_type = 'scratch' Plug 'mbbill/undotree', { 'on': ['UndotreeToggle'] } Plug 'kana/vim-niceblock' Plug 'tpope/vim-commentary' if s:plugins_extra Plug 'prabirshrestha/async.vim' Plug 'prabirshrestha/vim-lsp' if executable('pyls') " pip install python-language-server au User lsp_setup call lsp#register_server({ \ 'name': 'pyls', \ 'cmd': {server_info->['pyls']}, \ 'whitelist': ['python'], \ }) endif if executable(expand('~/neovim/.deps/usr/bin/lua-lsp')) au User lsp_setup call lsp#register_server({ \ 'name': 'lua-lsp', \ 'cmd': {server_info->[expand('~/neovim/.deps/usr/bin/lua-lsp')]}, \ 'whitelist': ['lua'], \ }) endif Plug 'guns/vim-sexp' Plug 'guns/vim-clojure-highlight' let g:clojure_fold = 1 let g:sexp_filetypes = '' Plug 'tpope/vim-salve' let g:salve_auto_start_repl = 1 Plug 'tpope/vim-fireplace' Plug 'justinmk/nvim-repl' nmap yx (ReplSend) nmap yxx (ReplSendLine) xmap (ReplSend) nnoremap :Repl Plug 'PProvost/vim-ps1' Plug 'chrisbra/Colorizer', { 'on': ['ColorHighlight'] } Plug 'tommcdo/vim-lion' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes n \| ./install' } Plug 'junegunn/fzf.vim' let g:fzf_command_prefix = 'Fz' Plug 'tpope/vim-dadbod' Plug 'tpope/vim-projectionist' " look at derekwyatt/vim-fswitch for more C combos. if has("nvim") && exists('*luaeval') lua << EOF vim.api.nvim_set_var('projectionist_heuristics', { ['*.sln'] = { ['*.cs'] = {['alternate'] = {'{}.designer.cs'}}, ['*.designer.cs'] = {['alternate'] = {'{}.cs'}}, }, ['/*.c|src/*.c'] = { ['*.c'] = {['alternate'] = {'../include/{}.h', '{}.h'}}, ['*.h'] = {['alternate'] = '{}.c'}, }, ['Makefile'] = { ['*Makefile'] = {['alternate'] = '{dirname}CMakeLists.txt'}, ['*CMakeLists.txt'] = {['alternate'] = '{dirname}Makefile'}, }, }) EOF endif " Plug 'Valloric/MatchTagAlways', { 'for': 'xml' } endif call plug#end() " Eager-load these plugins so we can override their settings. {{{ runtime! plugin/rsi.vim runtime! plugin/commentary.vim " }}} endif "}}} " Searches process tree for a process name. Limited breadth/depth. fun! s:find_proc_in_tree(rootpid, name, accum) abort if a:accum > 9 || !exists('*nvim_get_proc') return v:false endif let p = nvim_get_proc(a:rootpid) if !empty(p) && p.name ==# a:name return v:true endif for c in nvim_get_proc_children(a:rootpid)[:9] if s:find_proc_in_tree(c, a:name, 1 + a:accum) return v:true endif endfor return v:false endfun if has("nvim") set inccommand=split tnoremap find_proc_in_tree(b:terminal_job_pid, 'nvim', 0) ? '' : '' augroup vimrc_nvim autocmd! " https://github.com/neovim/neovim/issues/3463#issuecomment-148757691 " autocmd CursorHold,FocusGained,FocusLost * silent! rshada|silent! wshada " :checktime is SLOW " autocmd CursorHold,FocusGained * silent! checktime autocmd FocusGained * call halo() augroup END endif " Use to: " - redraw " - clear 'hlsearch' " - update the current diff (if any) " Use {count} to: " - reload (:edit) the current buffer nnoremap (v:count ? '::call save_change_marks()\|edit\|call restore_change_marks()' : '') \ . ':nohlsearch'.(has('diff')?'\|diffupdate':'') \ . '' inoremap u function! s:ctrl_u() abort "{{{ rsi ctrl-u, ctrl-w if getcmdpos() > 1 let @- = getcmdline()[:getcmdpos()-2] endif return "\" endfunction function! s:ctrl_w_before() abort let s:cmdline = getcmdpos() > 1 ? getcmdline() : "" return "\" endfunction function! s:ctrl_w_after() abort if strlen(s:cmdline) > 0 let @- = s:cmdline[(getcmdpos()-1) : (getcmdpos()-2)+(strlen(s:cmdline)-strlen(getcmdline()))] endif return "" endfunction cnoremap ctrl_u() cnoremap (ctrl_w_before) ctrl_w_before() cnoremap (ctrl_w_after) ctrl_w_after() cmap