├── LICENSE ├── changelog.md ├── doc └── externalminimap.txt ├── plugin └── externalminimap.vim ├── readme.md ├── test-file1.txt └── vim-external-minimap-notes.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Ryan L McIntyre 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | 2 | CHANGELOG 3 | ================================================================================ 4 | This project is using [Semantic Versioning 2.0.0](http://semver.org/) 5 | 6 | - v1.0.0-alpha 7 | - alpha "release" - screenshots and raw notes 8 | -------------------------------------------------------------------------------- /doc/externalminimap.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanoasis/vim-external-minimap/9192dd941038de2a8640a9b3b56bf9e1990ee962/doc/externalminimap.txt -------------------------------------------------------------------------------- /plugin/externalminimap.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " Minimap: NOT A TRUE PLUGIN (YET) DO NOT USE 3 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | 6 | " test vim-external-minimap server bindings: 7 | 8 | ":nmap h h:let curwin=winnr():keepjumps windo redraw:execute curwin . "wincmd w" 9 | ":nnoremap j j:let curwin=winnr():keepjumps windo redrawj:execute curwin . "wincmd w" 10 | ":nmap k k:let curwin=winnr():keepjumps windo redraw:execute curwin . "wincmd w" 11 | ":nmap l l:let curwin=winnr():keepjumps windo redraw:execute curwin . "wincmd w" 12 | 13 | "nmap j j | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send 'j'" 14 | "nmap k k | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send 'k'" 15 | "nmap | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ''" 16 | "nmap | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ''" 17 | 18 | " ^ these need to be mapped to a goto line on the server! 19 | 20 | "function! externalMinimap#GotoLine(line) 21 | function! GotoLine(line) 22 | "echom "gotoline called" 23 | "echom a:line 24 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . a:line . "'" 25 | endfunction 26 | 27 | function! MinimapOpen() 28 | execute "silent !gvim -R % +" . shellescape(line(".")) . ' "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set norelativenumber" "+set noruler" "+set laststatus=0" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3" "+set lines=130" "+set columns=90" --servername VIM-EXTERNAL-MINIMAP' 29 | endfunction 30 | 31 | function! UpdateHighlight() 32 | let l:start = line("w0") 33 | let l:end = line("w$") 34 | let l:centerize = "zz" 35 | let l:file = expand('%:t') 36 | "let l:matchUpdate = "match externalminimap /".'\\%'."".l:start.'l\|'.'\\%'."".l:end."l/" 37 | " now lets match the range: /\%>10l\&\%<14l/ 38 | " ^ matches line 10 to 14^ 39 | let l:matchUpdate = "match externalminimap /".'\\%>'."".l:start.'l\&'.'\\%<'."".l:end."l/" 40 | let l:signStartUnplaceUpdate = "sign unplace 1 file=" . l:file 41 | let l:signEndUnplaceUpdate = "sign unplace 2 file=" . l:file 42 | let l:signStartUpdate = "sign place 1 line=" . l:start . " name=wholeline file=" . l:file 43 | let l:signEndUpdate = "sign place 2 line=" . l:end . " name=wholeline file=" . l:file 44 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . l:matchUpdate . "'" 45 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . l:signStartUnplaceUpdate . "'" 46 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . l:signEndUnplaceUpdate . "'" 47 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . l:signStartUpdate . "'" 48 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . l:signEndUpdate . "'" 49 | execute "silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send '" . l:centerize . "'" 50 | endfunction 51 | 52 | " could try signs (to get it to appear the width of the window): 53 | " :sign define wholeline linehl=ErrorMsg 54 | " :sign place 1 line=3 name=wholeline file=aw.advancedfilters.js 55 | 56 | function! GotoCurrentLine() 57 | call GotoLine(line('.')) 58 | endfunction 59 | 60 | function! ServerRunning() 61 | "execute "silent !vim --serverlist " 62 | let l:servers = split(system("vim --serverlist"), "\n") 63 | let l:running = 0 64 | "echom l:servers[0] 65 | for i in l:servers 66 | if i == "VIM-EXTERNAL-MINIMAP" 67 | "echom "running" 68 | let l:running = 1 69 | endif 70 | endfor 71 | 72 | if l:running == 1 73 | "echom "server is running, execute methods" 74 | else 75 | "echom "server is NOT running, NOT executing methods" 76 | endif 77 | 78 | return l:running 79 | endfunction 80 | 81 | 82 | function! MinimapUpdate() 83 | "echom "minimapupdate" 84 | if ServerRunning() == 1 85 | call GotoCurrentLine() 86 | call UpdateHighlight() 87 | endif 88 | endfunction 89 | 90 | 91 | "nmap j j | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . line('.') . "'" 92 | "nmap k k | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . shellescape(line(".")) . "'" 93 | "nmap | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . shellescape(line(".")) . "'" 94 | "nmap | :execute ":silent !vim --servername VIM-EXTERNAL-MINIMAP --remote-send ':" . shellescape(line(".")) . "'" 95 | 96 | " refactor: 97 | " using map_bar (help map_bar) 98 | 99 | "highlight externalminimap ctermbg=lightgray guibg=lightgray 100 | highlight link externalminimap Visual 101 | sign define wholeline linehl=Search 102 | 103 | 104 | "nmap j j | :call MinimapExecute() 105 | "nmap k k | :call MinimapExecute() 106 | "nmap | :call MinimapExecute() 107 | "nmap | :call MinimapExecute() 108 | "nmap | :call MinimapExecute() 109 | "nmap j :call GotoLine(2) 110 | 111 | "nnoremap j j | :call MinimapExecute() 112 | "nnoremap k k | :call MinimapExecute() 113 | "nnoremap | :call MinimapExecute() 114 | "nnoremap | :call MinimapExecute() 115 | 116 | " patch/hack fix the screen flashing annoyance until proper solution? 117 | set novisualbell 118 | 119 | " see: help map_bar 120 | "nnoremap j j|:call MinimapUpdate() 121 | "nnoremap k k|:call MinimapUpdate() 122 | "nnoremap |:call MinimapUpdate() 123 | "nnoremap |:call MinimapUpdate() 124 | "nnoremap |:call MinimapUpdate() 125 | "nnoremap gg gg |:call MinimapUpdate() 126 | "nnoremap |:call MinimapUpdate() 127 | 128 | nnoremap mm :call MinimapOpen() 129 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Vim External Minimap 2 | ======================================== 3 | 4 | > Minimap for GVim 5 | 6 | Version: v1.0.0-alpha 7 | 8 | ![image](https://github.com/ryanoasis/vim-external-minimap/wiki/screenshots/example-usage-1.gif) 9 | 10 | #### TODO 11 | - [X] upload code from vimrc :P 12 | - [ ] convert code to proper plugin ^_^ 13 | - [ ] fix only directional mapping (only keys from client [file that launched minimap] update server [minimap]) instead it should be able to go both ways (bi-directional) 14 | - [ ] fix odd issues 15 | - [ ] release first version? o_O 16 | -------------------------------------------------------------------------------- /test-file1.txt: -------------------------------------------------------------------------------- 1 | asdf 2 | asdf 3 | asdf 4 | asdf 5 | -------------------------------------------------------------------------------- /vim-external-minimap-notes.md: -------------------------------------------------------------------------------- 1 | silent !gvim +line(".") "+set lines=30" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2" % 2 | 3 | !gvim +line(".") "+set lines=30" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2" % 4 | 5 | 6 | ==== 7 | 8 | execute ':silent !gvim +line(".") "+set lines=30" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2" %' 9 | 10 | execute ":silent !gvim +line('.') '+set lines=30' '+set columns=20' '+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2' %" 11 | 12 | execute ": !gvim +" . shellescape(line(".")) . " '+set lines=30' '+set columns=20' '+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2' %" 13 | 14 | 15 | execute ": !gvim +" . shellescape(line(".")) . ' "+set lines=30" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2" %' 16 | 17 | execute ": !gvim +" . shellescape(line(".")) . ' % "+set lines=30" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 2"' 18 | 19 | 20 | execute ": !gvim +" . shellescape(line(".")) . ' % "+set lines=30" "+winpos 0 0" "+set columns=20" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3"' 21 | 22 | 23 | == hide shit: 24 | 25 | === too many arguments? 26 | 27 | execute ": !gvim -R +" . shellescape(line(".")) . ' % "+set lines=30" "+winpos 0 0" "+set columns=20" "+set norelativenumber" "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set noshowmode" "+set noruler" "+set laststatus=0" "+set noshowcmd" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3"' 28 | 29 | === 30 | 31 | 32 | execute ": !gvim -R % +" . shellescape(line(".")) . ' "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set noshowmode" "+set noruler" "+set laststatus=0" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3" "+set lines=30" "+set columns=20"' 33 | 34 | 35 | === show mode remove? no effect? add set norelativenumber instead: 36 | 37 | execute ": !gvim -R % +" . shellescape(line(".")) . ' "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set norelativenumber" "+set noruler" "+set laststatus=0" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3" "+set lines=30" "+set columns=20"' 38 | 39 | === same as above ^ but silent and tweaked cols and lines to match the small font size (it is set before): 40 | 41 | execute ":silent !gvim -R % +" . shellescape(line(".")) . ' "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set norelativenumber" "+set noruler" "+set laststatus=0" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3" "+set lines=130" "+set columns=90"' 42 | 43 | === server-name: 44 | 45 | execute ":silent !gvim -R % +" . shellescape(line(".")) . ' "+set nonumber" "+set foldcolumn=0" "+set tabline=" "+set norelativenumber" "+set noruler" "+set laststatus=0" "+set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 3" "+set lines=130" "+set columns=90" --servername vim-external-minimap' 46 | 47 | --------------------------------------------------------------------------------