From 2b17afeaac4ad244c0d449efb45b740075c4a058 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 9 May 2022 23:21:35 +0800 Subject: [PATCH] feat(snippet): add `SPC x s s` to edit snippet --- autoload/SpaceVim/layers/autocomplete.vim | 3 +++ autoload/SpaceVim/layers/edit.vim | 2 +- autoload/SpaceVim/layers/framework/django.vim | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/layers/autocomplete.vim b/autoload/SpaceVim/layers/autocomplete.vim index d0caa9e83..ca81768e2 100644 --- a/autoload/SpaceVim/layers/autocomplete.vim +++ b/autoload/SpaceVim/layers/autocomplete.vim @@ -221,6 +221,9 @@ function! SpaceVim#layers#autocomplete#config() abort call SpaceVim#logger#warn('Can not use same value for escape_key_binding and auto_completion_complete_with_key_sequence') endif endif + let g:_spacevim_mappings_space.x = {'name' : '+Text'} + let g:_spacevim_mappings_space.x.s = {'name' : '+String/Snippet'} + call SpaceVim#mapping#space#def('nnoremap', ['x', 's', 's'], 'NeoSnippetEdit', 'edit-snippet-file', 1) endfunction function! SpaceVim#layers#autocomplete#set_variable(var) abort diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 57d94d010..2f0303c82 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -268,7 +268,7 @@ function! SpaceVim#layers#edit#config() abort " word let g:_spacevim_mappings_space.x.w = {'name' : '+Word'} call SpaceVim#mapping#space#def('vnoremap', ['x', 'w', 'c'], 'normal! ' . ":'<,'>s/\\\w\\+//gn" . "\", 'count the words in the select region', 1) - let g:_spacevim_mappings_space.x.s = {'name' : '+String'} + let g:_spacevim_mappings_space.x.s = {'name' : '+String/Snippet'} call SpaceVim#mapping#space#def('nnoremap', ['x', 's', 'j'], 'call call(' \ . string(s:_function('s:join_string_with')) . ', [])', \ 'join-string-with', 1) diff --git a/autoload/SpaceVim/layers/framework/django.vim b/autoload/SpaceVim/layers/framework/django.vim index 1970d76ab..c4b34332a 100644 --- a/autoload/SpaceVim/layers/framework/django.vim +++ b/autoload/SpaceVim/layers/framework/django.vim @@ -28,3 +28,11 @@ function! SpaceVim#layers#framework#django#health() abort call SpaceVim#layers#framework#django#plugins() return 1 endfunction + +" @todo add code formatter and linter for htmldjango +" https://code.djangoproject.com/wiki/UsingVimWithDjango +" https://github.com/yaegassy/coc-htmldjango +" https://github.com/rtts/djhtml +" https://github.com/Riverside-Healthcare/djlint +" https://stackoverflow.com/questions/42170561/vscode-html-autoformat-on-django-template +" https://www.reddit.com/r/django/comments/fnzrxv/is_there_an_autoformatter_plugin_for_vs_code_that/