tyru / savemap.vim Goto Github PK
View Code? Open in Web Editor NEWsavemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".
Home Page: http://www.vim.org/scripts/script.php?script_id=3311
savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".
Home Page: http://www.vim.org/scripts/script.php?script_id=3311
|savemap| is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly". ...But remember, you can always use |:map-<buffer>| for "simple" case. > nmap foo blahblahblah let foo_nmap = savemap#save_map('n', 'foo') if empty(foo_nmap) echoerr 'your vim version is lower than 7.3.032!' endif nmap foo bar " Execute 'bar'. normal foo call foo_nmap.restore() " Execute 'blahblahblah'. normal foo Omit 2nd arg of |savemap#save_map()| to save all mappings of the mode. > let normal_mappings = savemap#save_map('n') if empty(normal_mappings) echoerr 'your vim version is lower than 7.3.032!' endif " Clear! nmapclear " Map own mappings. nnoremap a b nnoremap c d ... try ... " Do it finally call normal_mappings.restore() endtry See doc/savemap.txt or :help savemap for more details.
Hello, your plugin could be useful in the Plugin FastFold
to append the command :FastFoldUpdate!<CR>
to all mappings that close or open folds such as za,zc,zo,...
without overwriting user mappings.
Can the relevant parts of your plugin be copied and then it suffices to refer to your plugin, or does your plugin have to be installed alongside?
Edit: Regarding what the plugin's New BSD license says the first option sounds fine?
Hi !
Thanks for that incredibly useful plugin !
The plugin 'crash' when the rhs contains a |.
n [m *@:call <SNR>59_Python_jump('n', '\v^\s*(class|def|async def)>', 'Wb')<CR>
n [[ *@:call <SNR>59_Python_jump('n', '\v^(class|def|async def)>', 'Wb')<CR>
n ]m *@:call <SNR>59_Python_jump('n', '\v%$|^\s*(class|def|async def)>', 'W')<CR>
n ]] *@:call <SNR>59_Python_jump('n', '\v%$|^(class|def|async def)>', 'W')<CR>
The following
let mappings = savemap#save_map('n')
produce:
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line 11:
E492: Not an editor command: def|async def)>', 'Wb')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line 11:
E492: Not an editor command: def|async def)>', 'Wb')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line 11:
E492: Not an editor command: ^\s*(class|def|async def)>', 'W')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line 11:
E492: Not an editor command: ^(class|def|async def)>', 'W')<cr>
I fixed the error by duplicating the code that replace | with <bar> for the rhs. (it was a quick and dirty patch, i don't even know if that is the way to solve the issue)
function! s:maparg(...) "{{{
let info = call('maparg', a:000)
if has_key(info, 'lhs')
let info.lhs = substitute(info.lhs, '|', '<Bar>', 'g')
endif
if has_key(info, 'rhs')
let info.rhs = substitute(info.rhs, '|', '<Bar>', 'g')
endif
return info
endfunction "}}}
But now the mappings output (even though i didn't clear or restore the mappings)
E117: Unknown function: <SNR>77_Python_jump
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.