mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-04 18:14:40 +02:00
snippets and emmet
This commit is contained in:
parent
88f156841b
commit
264df1df7f
5 changed files with 81 additions and 47 deletions
|
@ -40,7 +40,14 @@
|
|||
"python.linting.pylintEnabled": true,
|
||||
|
||||
// snippets
|
||||
"snippets.ultisnips.directories": ["UltiSnips", "~/.config/nvim/utils/snips"],
|
||||
// "snippets.ultisnips.directories": ["UltiSnips"],
|
||||
"snippets.userSnippetsDirectory": "~/.config/nvim/snips",
|
||||
|
||||
// emmet
|
||||
"emmet.includeLanguages": {
|
||||
"vue-html": "html",
|
||||
"javascript": "javascriptreact"
|
||||
},
|
||||
|
||||
// explorer
|
||||
"explorer.width": 30,
|
||||
|
|
|
@ -73,31 +73,32 @@ let g:which_key_map.b = {
|
|||
" s is for search
|
||||
let g:which_key_map.s = {
|
||||
\ 'name' : '+search' ,
|
||||
\ '/' : [':History/' , 'history'],
|
||||
\ ';' : [':Commands' , 'commands'],
|
||||
\ 'a' : [':Ag' , 'text Ag'],
|
||||
\ 'b' : [':BLines' , 'current buffer'],
|
||||
\ 'B' : [':Buffers' , 'open buffers'],
|
||||
\ 'c' : [':Commits' , 'commits'],
|
||||
\ 'C' : [':BCommits' , 'buffer commits'],
|
||||
\ 'f' : [':Files' , 'files'],
|
||||
\ 'g' : [':GFiles' , 'git files'],
|
||||
\ 'G' : [':GFiles?' , 'modified git files'],
|
||||
\ 'h' : [':History' , 'file history'],
|
||||
\ 'H' : [':History:' , 'command history'],
|
||||
\ 'l' : [':Lines' , 'lines'] ,
|
||||
\ 'm' : [':Marks' , 'marks'] ,
|
||||
\ 'M' : [':Maps' , 'normal maps'] ,
|
||||
\ 'p' : [':Helptags' , 'help tags'] ,
|
||||
\ 'P' : [':Tags' , 'project tags'],
|
||||
\ 's' : [':Snippets' , 'snippets'],
|
||||
\ 'S' : [':Colors' , 'color schemes'],
|
||||
\ 't' : [':Rg' , 'text Rg'],
|
||||
\ 'T' : [':BTags' , 'buffer tags'],
|
||||
\ 'w' : [':Windows' , 'search windows'],
|
||||
\ 'y' : [':Filetypes' , 'file types'],
|
||||
\ 'z' : [':FZF' , 'FZF'],
|
||||
\ '/' : [':History/' , 'history'],
|
||||
\ ';' : [':Commands' , 'commands'],
|
||||
\ 'a' : [':Ag' , 'text Ag'],
|
||||
\ 'b' : [':BLines' , 'current buffer'],
|
||||
\ 'B' : [':Buffers' , 'open buffers'],
|
||||
\ 'c' : [':Commits' , 'commits'],
|
||||
\ 'C' : [':BCommits' , 'buffer commits'],
|
||||
\ 'f' : [':Files' , 'files'],
|
||||
\ 'g' : [':GFiles' , 'git files'],
|
||||
\ 'G' : [':GFiles?' , 'modified git files'],
|
||||
\ 'h' : [':History' , 'file history'],
|
||||
\ 'H' : [':History:' , 'command history'],
|
||||
\ 'l' : [':Lines' , 'lines'] ,
|
||||
\ 'm' : [':Marks' , 'marks'] ,
|
||||
\ 'M' : [':Maps' , 'normal maps'] ,
|
||||
\ 'p' : [':Helptags' , 'help tags'] ,
|
||||
\ 'P' : [':Tags' , 'project tags'],
|
||||
\ 's' : [':CocList snippets' , 'snippets'],
|
||||
\ 'S' : [':Colors' , 'color schemes'],
|
||||
\ 't' : [':Rg' , 'text Rg'],
|
||||
\ 'T' : [':BTags' , 'buffer tags'],
|
||||
\ 'w' : [':Windows' , 'search windows'],
|
||||
\ 'y' : [':Filetypes' , 'file types'],
|
||||
\ 'z' : [':FZF' , 'FZF'],
|
||||
\ }
|
||||
" \ 's' : [':Snippets' , 'snippets'],
|
||||
|
||||
" g is for git
|
||||
let g:which_key_map.g = {
|
||||
|
@ -156,6 +157,7 @@ let g:which_key_map.l = {
|
|||
\ 'r' : ['<Plug>(coc-rename)' , 'rename'],
|
||||
\ 'R' : ['<Plug>(coc-references)' , 'references'],
|
||||
\ 's' : [':CocList -I symbols' , 'references'],
|
||||
\ 'S' : [':CocList snippets' , 'snippets'],
|
||||
\ 't' : ['<Plug>(coc-type-definition)' , 'type definition'],
|
||||
\ 'u' : [':CocListResume' , 'resume list'],
|
||||
\ 'U' : [':CocUpdate' , 'update CoC'],
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
" let g:coc_global_extensions = [
|
||||
" \ 'coc-snippets',
|
||||
" \ 'coc-actions',
|
||||
" \ 'coc-emmet',
|
||||
" \ 'coc-pairs',
|
||||
" \ 'coc-tsserver',
|
||||
" \ 'coc-floaterm',
|
||||
" \ 'coc-html',
|
||||
" \ 'coc-css',
|
||||
" \ 'coc-cssmodules',
|
||||
" \ 'coc-yaml',
|
||||
" \ 'coc-python',
|
||||
" \ 'coc-explorer',
|
||||
" \ 'coc-svg',
|
||||
" \ 'coc-prettier',
|
||||
" \ 'coc-vimlsp',
|
||||
" \ 'coc-flutter',
|
||||
" \ 'coc-xml',
|
||||
" \ 'coc-yank',
|
||||
" \ 'coc-json',
|
||||
" \ 'coc-vimtex',
|
||||
" \ ]
|
||||
let g:coc_global_extensions = [
|
||||
\ 'coc-snippets',
|
||||
\ 'coc-actions',
|
||||
\ 'coc-emmet',
|
||||
\ 'coc-pairs',
|
||||
\ 'coc-tsserver',
|
||||
\ 'coc-floaterm',
|
||||
\ 'coc-html',
|
||||
\ 'coc-css',
|
||||
\ 'coc-cssmodules',
|
||||
\ 'coc-yaml',
|
||||
\ 'coc-python',
|
||||
\ 'coc-explorer',
|
||||
\ 'coc-svg',
|
||||
\ 'coc-prettier',
|
||||
\ 'coc-vimlsp',
|
||||
\ 'coc-xml',
|
||||
\ 'coc-yank',
|
||||
\ 'coc-json',
|
||||
\ 'coc-vimtex',
|
||||
\ ]
|
||||
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
inoremap <silent><expr> <TAB>
|
||||
|
@ -155,3 +154,18 @@ let g:coc_explorer_global_presets = {
|
|||
" nmap <space>f :CocCommand explorer --preset floatingRightside<CR>
|
||||
autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif
|
||||
|
||||
" Snippets
|
||||
" Use <C-l> for trigger snippet expand.
|
||||
imap <C-l> <Plug>(coc-snippets-expand)
|
||||
|
||||
" Use <C-j> for select text for visual placeholder of snippet.
|
||||
vmap <C-j> <Plug>(coc-snippets-select)
|
||||
|
||||
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
|
||||
let g:coc_snippet_next = '<c-j>'
|
||||
|
||||
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
|
||||
let g:coc_snippet_prev = '<c-k>'
|
||||
|
||||
" Use <C-j> for both expand and jump (make expand higher priority.)
|
||||
imap <C-j> <Plug>(coc-snippets-expand-jump)
|
||||
|
|
9
snips/markdown.snippets
Normal file
9
snips/markdown.snippets
Normal file
|
@ -0,0 +1,9 @@
|
|||
snippet meta(data)? "Markdown metadata front matter" br
|
||||
---
|
||||
title: $1
|
||||
date: "`!v strftime("%Y-%m-%d")`"
|
||||
image: "$2"
|
||||
author: "$3"
|
||||
tags: [$4]
|
||||
---
|
||||
endsnippet
|
|
@ -81,6 +81,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
|||
" Making stuff
|
||||
Plug 'neomake/neomake'
|
||||
" Snippets TODO fix TAB hijack
|
||||
Plug 'honza/vim-snippets'
|
||||
" Plug 'SirVer/ultisnips'
|
||||
" Better Comments
|
||||
" Plug 'jbgutierrez/vim-better-comments'
|
||||
|
@ -88,6 +89,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
|||
" Plug 'Shougo/echodoc.vim'
|
||||
" Interactive code
|
||||
Plug 'metakirby5/codi.vim'
|
||||
Plug 'mattn/emmet-vim'
|
||||
endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue