From 3526eb6d756e3c37190814eca2e22ce9f7d9f1de Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 28 Jun 2024 01:24:13 +0800 Subject: Update --- snippets/snippets | 1 - snippets/use_curl_send_mail | 38 +++++++++ snippets/use_openssl_send_mail | 36 ++++++++ vim/autoload/foo.vim | 3 + vim/init/basic.vim | 6 +- vim/init/config.vim | 174 ++++++++++++++++++++++----------------- vim/init/keymaps.vim | 183 +++++++++++++++++++++-------------------- vim/lua/configs/conform.lua | 6 +- vim/lua/configs/telescope.lua | 6 +- vim/lua/plugins/init.lua | 11 ++- 10 files changed, 289 insertions(+), 175 deletions(-) delete mode 120000 snippets/snippets create mode 100644 snippets/use_curl_send_mail create mode 100644 snippets/use_openssl_send_mail create mode 100644 vim/autoload/foo.vim diff --git a/snippets/snippets b/snippets/snippets deleted file mode 120000 index a05fd8e..0000000 --- a/snippets/snippets +++ /dev/null @@ -1 +0,0 @@ -/home/pham/helper/snippets \ No newline at end of file diff --git a/snippets/use_curl_send_mail b/snippets/use_curl_send_mail new file mode 100644 index 0000000..70eeb7c --- /dev/null +++ b/snippets/use_curl_send_mail @@ -0,0 +1,38 @@ +#! /usr/bin/env bash + +# User input +sender=typebrook@gmail.com +receiver=typebrook@gmail.com +gapp=$(pass google/imap_for_typebrook) +sub="$(date) test mail from curl" +body="$(echo -e 'just\na\ntest\nmail')" + +# check for provided attachment file as a positional parameter +# -z indicating an empty positional parameter +# attachment doesn't exist condition +if [ -z "$1" ]; then + + # curl command for accessing the smtp server + + curl -s --url 'smtps://smtp.gmail.com:465' --ssl-reqd \ + --mail-from $sender \ + --mail-rcpt $receiver --user $sender:$gapp \ + -T <(echo -e "From: ${sender} +To: ${receiver} +Subject: ${sub} + + ${body}") + +# attachment exists condition +else + file="$1" # set file as the 1st positional parameter + + # MIME type for multiple type of input file extensions + MIMEType=$(file --mime-type "$file" | sed 's/.*: //') + curl -s --url 'smtps://smtp.gmail.com:465' --ssl-reqd \ + --mail-from $sender \ + --mail-rcpt $receiver --user $sender:$gapp \ + -H "Subject: $sub" -H "From: $sender" -H "To: $receiver" -F \ + '=(;type=multipart/mixed' -F "=$body;type=text/plain" -F \ + "file=@$file;type=$MIMEType;encoder=base64" -F '=)' +fi diff --git a/snippets/use_openssl_send_mail b/snippets/use_openssl_send_mail new file mode 100644 index 0000000..fabaca3 --- /dev/null +++ b/snippets/use_openssl_send_mail @@ -0,0 +1,36 @@ +#!/bin/bash + +# ref: https://stackoverflow.com/questions/9998710/is-it-possible-to-send-mails-by-bash-script-via-smtp +# Use "host -t mx host" to find out mail server + +set -e + +MAIL_SERVER=smtp.gmail.com +PORT=465 +MAIL_FROM=typebrook@gmail.com +RCPT_TO=typebrook@gmail.com + +send_message_line_by_line() { + while read line; do + echo $line >/dev/tty + echo $line + sleep 1 + done | openssl s_client -connect $MAIL_SERVER:$PORT -crlf +} + +# 1. openssl do RENEGOTIATING when input starts with R, so use "rcpt to:" instead of "RCPT TO:" +# 2. End mail with an empty line, and followed by '.' and 'QUIT' +cat < +rcpt to: <$RCPT_TO> +DATA +Subject: $(date) test mail from bash +Another test mail + +. +QUIT +MAILEND diff --git a/vim/autoload/foo.vim b/vim/autoload/foo.vim new file mode 100644 index 0000000..223f482 --- /dev/null +++ b/vim/autoload/foo.vim @@ -0,0 +1,3 @@ +function bar#Hello() + echo "Hello" +endfunction diff --git a/vim/init/basic.vim b/vim/init/basic.vim index 5008b2f..b843476 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim @@ -66,8 +66,8 @@ set autoindent " If current line has indent, automatically set indent for n set cindent set ttimeout set ttimeoutlen=50 -set updatetime=500 -autocmd CursorHold * normal! m' +" set updatetime=1000 +" autocmd CursorHold * normal! m' imap l " Change IM to US when exit to Normal mode @@ -209,7 +209,7 @@ set matchtime=2 set display=lastline " 允許下方顯示目錄 -set wildmenu +set wildmenu wildoptions=pum,fuzzy " Improve performance set lazyredraw diff --git a/vim/init/config.vim b/vim/init/config.vim index 489521f..20beab2 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim @@ -10,25 +10,49 @@ " Open help page in a new tab autocmd BufEnter *.txt if &filetype == 'help' | wincmd T | endif -" Quickly edit html tag class -function! s:ChangeAttr(pattern) - - let l:attr = matchstr(getline('.'), a:pattern.'="') - if l:attr == '' - let l:all_attrs = matchstr(getline('.'), '<[[:alnum:]]\+\zs\s\?[^>]*>\ze') - execute 's/'.l:all_attrs.'/ '.a:pattern.'=""'.l:all_attrs.'/' - noh - normal! 0f"l - startinsert - else - normal! 0 - call search(l:attr) - normal! f"l - noh - startinsert +" Automatically apply filetype by shebang +function! s:ApplyShebang() + let l:filetype = matchstr(getline(1), '^#!.*[ /]\zs[[:alnum:]]\+$') + let l:shebangMatch = #{node: "javascript"} + if l:filetype != "" + if has_key(shebangMatch, l:filetype) + let l:filetype = shebangMatch[l:filetype] endif + echo "filetype from shebang: ".l:filetype + execute "set filetype=".l:filetype + endif endfunction +autocmd BufReadPost * call ApplyShebang() + +" For vimscript +if executable('vim-language-server') + echo "set vim language server" + au User lsp_setup call lsp#register_server({ + \ 'name': 'vimscript-language-server', + \ 'cmd': {server_info->['vimscript-language-server']}, + \ 'whitelist': ['vim'], + \ }) +endif +" html +" Quickly edit html tag class +function! s:ChangeAttr(pattern) + let l:attr = matchstr(getline('.'), a:pattern.'="') + if l:attr == '' + let l:all_attrs = matchstr(getline('.'), '<[[:alnum:]]\+\zs\s\?[^>]*>\ze') + execute 's/'.l:all_attrs.'/ '.a:pattern.'=""'.l:all_attrs.'/' + noh + normal! 0f"l + startinsert + else + normal! 0 + call search(l:attr) + normal! f"l + noh + startinsert + endif +endfunction +" Edit class and id for javascript files autocmd FileType html nnoremap cl :call ChangeAttr("class") autocmd BufLeave nunmap cl autocmd FileType html nnoremap id :call ChangeAttr("id") @@ -38,9 +62,9 @@ autocmd BufLeave nunmap id " 有 tmux 何没有的功能键超时(毫秒) "---------------------------------------------------------------------- if $TMUX != '' - set ttimeoutlen=30 + set ttimeoutlen=30 elseif &ttimeoutlen > 80 || &ttimeoutlen <= 0 - set ttimeoutlen=80 + set ttimeoutlen=80 endif @@ -49,22 +73,22 @@ endif " 记得设置 ttimeout (见 init-basic.vim) 和 ttimeoutlen (上面) "---------------------------------------------------------------------- if has('nvim') == 0 && has('gui_running') == 0 - function! s:metacode(key) - exec "set =\e".a:key - endfunc - for i in range(10) - call s:metacode(nr2char(char2nr('0') + i)) - endfor - for i in range(26) - call s:metacode(nr2char(char2nr('a') + i)) - call s:metacode(nr2char(char2nr('A') + i)) - endfor - for c in [',', '.', '/', ';', '{', '}'] - call s:metacode(c) - endfor - for c in ['?', ':', '-', '_', '+', '=', "'"] - call s:metacode(c) - endfor + function! s:metacode(key) + exec "set =\e".a:key + endfunc + for i in range(10) + call s:metacode(nr2char(char2nr('0') + i)) + endfor + for i in range(26) + call s:metacode(nr2char(char2nr('a') + i)) + call s:metacode(nr2char(char2nr('A') + i)) + endfor + for c in [',', '.', '/', ';', '{', '}'] + call s:metacode(c) + endfor + for c in ['?', ':', '-', '_', '+', '=', "'"] + call s:metacode(c) + endfor endif @@ -72,9 +96,9 @@ endif " 终端下功能键设置 "---------------------------------------------------------------------- function! s:key_escape(name, code) - if has('nvim') == 0 && has('gui_running') == 0 - exec "set ".a:name."=\e".a:code - endif + if has('nvim') == 0 && has('gui_running') == 0 + exec "set ".a:name."=\e".a:code + endif endfunc @@ -104,10 +128,10 @@ call s:key_escape('', '[24;2~') " Refer: http://sunaku.github.io/vim-256color-bce.html "---------------------------------------------------------------------- if &term =~ '256color' && $TMUX != '' - " disable Background Color Erase (BCE) so that color schemes - " render properly when inside 256-color tmux and GNU screen. - " see also http://snk.tuxfamily.org/log/vim-256color-bce.html - set t_ut= + " disable Background Color Erase (BCE) so that color schemes + " render properly when inside 256-color tmux and GNU screen. + " see also http://snk.tuxfamily.org/log/vim-256color-bce.html + set t_ut= endif @@ -143,26 +167,26 @@ silent! call mkdir(expand('~/.vim/tmp'), "p", 0755) " 会令一些支持 xterm 不完全的终端解析错误,显示为错误的字符,比如 q 字符 " 如果你确认你的终端支持,不会在一些不兼容的终端上运行该配置,可以注释 if has('nvim') - set guicursor= + set guicursor= elseif (!has('gui_running')) && has('terminal') && has('patch-8.0.1200') - let g:termcap_guicursor = &guicursor - let g:termcap_t_RS = &t_RS - let g:termcap_t_SH = &t_SH - set guicursor= - set t_RS= - set t_SH= + let g:termcap_guicursor = &guicursor + let g:termcap_t_RS = &t_RS + let g:termcap_t_SH = &t_SH + set guicursor= + set t_RS= + set t_SH= endif " 打开文件时恢复上一次光标所在位置 autocmd BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif " 定义一个 DiffOrig 命令用于查看文件改动 if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis + \ | wincmd p | diffthis endif @@ -172,16 +196,16 @@ endif "---------------------------------------------------------------------- augroup InitFileTypesGroup - " 清除同组的历史 autocommand - au! + " 清除同组的历史 autocommand + au! - " C/C++ 文件使用 // 作为注释 - au FileType c,cpp setlocal commentstring=//\ %s + " C/C++ 文件使用 // 作为注释 + au FileType c,cpp setlocal commentstring=//\ %s - " markdown 允许自动换行 - au FileType markdown setlocal wrap - au FileType markdown set sw=2 - au FileType markdown set ts=2 + " markdown 允许自动换行 + au FileType markdown setlocal wrap + au FileType markdown set sw=2 + au FileType markdown set ts=2 " Fold markdown by heading level function MarkdownLevel() @@ -195,24 +219,24 @@ augroup InitFileTypesGroup au FileType markdown setlocal foldexpr=MarkdownLevel() au FileType markdown setlocal foldmethod=expr - " lisp 进行微调 - au FileType lisp setlocal ts=8 sts=2 sw=2 et + " lisp 进行微调 + au FileType lisp setlocal ts=8 sts=2 sw=2 et - " scala 微调 - au FileType scala setlocal sts=4 sw=4 noet + " scala 微调 + au FileType scala setlocal sts=4 sw=4 noet - " haskell 进行微调 - au FileType haskell setlocal et + " haskell 进行微调 + au FileType haskell setlocal et - " quickfix 隐藏行号 - au FileType qf setlocal nonumber + " quickfix 隐藏行号 + au FileType qf setlocal nonumber - " 强制对某些扩展名的 filetype 进行纠正 - au BufNewFile,BufRead *.as setlocal filetype=actionscript - au BufNewFile,BufRead *.pro setlocal filetype=prolog - au BufNewFile,BufRead *.es setlocal filetype=erlang - au BufNewFile,BufRead *.asc setlocal filetype=asciidoc - au BufNewFile,BufRead *.vl setlocal filetype=verilog - au BufRead /tmp/mutt-* set tw=72 + " 强制对某些扩展名的 filetype 进行纠正 + au BufNewFile,BufRead *.as setlocal filetype=actionscript + au BufNewFile,BufRead *.pro setlocal filetype=prolog + au BufNewFile,BufRead *.es setlocal filetype=erlang + au BufNewFile,BufRead *.asc setlocal filetype=asciidoc + au BufNewFile,BufRead *.vl setlocal filetype=verilog + au BufRead /tmp/mutt-* set tw=72 augroup END diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index ff4821e..dc7f616 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim @@ -128,7 +128,8 @@ vnoremap so :source "---------------------------------------------------------------------- " MANAGE_VIMRC "---------------------------------------------------------------------- -nnoremap e :edit $MYVIMRC +nnoremap e :scriptnames +nnoremap ee :edit $MYVIMRC autocmd! BUFWRITEPOST $MYVIMRC source $MYVIMRC @@ -227,16 +228,16 @@ map te :tabedit =expand("%:p:h") " Tab move functions function! Tab_MoveLeft() - let l:tabnr = tabpagenr() - 2 - if l:tabnr >= 0 - exec 'tabmove '.l:tabnr - endif + let l:tabnr = tabpagenr() - 2 + if l:tabnr >= 0 + exec 'tabmove '.l:tabnr + endif endfunc function! Tab_MoveRight() - let l:tabnr = tabpagenr() + 1 - if l:tabnr <= tabpagenr('$') - exec 'tabmove '.l:tabnr - endif + let l:tabnr = tabpagenr() + 1 + if l:tabnr <= tabpagenr('$') + exec 'tabmove '.l:tabnr + endif endfunc @@ -283,22 +284,22 @@ vnoremap Q ``>la」 " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window " function! Redir(cmd) - for win in range(1, winnr('$')) - if getwinvar(win, 'scratch') - execute win . 'windo close' - endif - endfor - if a:cmd =~ '^!' - let output = system(matchstr(a:cmd, '^!\zs.*')) - else - redir => output - execute a:cmd - redir END - endif - vnew - let w:scratch = 1 - setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile - call setline(1, split(output, "\n")) + for win in range(1, winnr('$')) + if getwinvar(win, 'scratch') + execute win . 'windo close' + endif + endfor + if a:cmd =~ '^!' + let output = system(matchstr(a:cmd, '^!\zs.*')) + else + redir => output + execute a:cmd + redir END + endif + vnew + let w:scratch = 1 + setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile + call setline(1, split(output, "\n")) endfunction command! -nargs=1 -complete=command Redir silent call Redir() @@ -340,22 +341,22 @@ inoremap j inoremap k if has('terminal') && exists(':terminal') == 2 && has('patch-8.1.1') - " vim 8.1 支持 termwinkey ,不需要把 terminal 切换成 normal 模式 - " 设置 termwinkey 为 CTRL 加减号(GVIM),有些终端下是 CTRL+? - " 后面四个键位是搭配 termwinkey 的,如果 termwinkey 更改,也要改 - set termwinkey= - tnoremap h - tnoremap l - tnoremap j - tnoremap k - tnoremap + " vim 8.1 支持 termwinkey ,不需要把 terminal 切换成 normal 模式 + " 设置 termwinkey 为 CTRL 加减号(GVIM),有些终端下是 CTRL+? + " 后面四个键位是搭配 termwinkey 的,如果 termwinkey 更改,也要改 + set termwinkey= + tnoremap h + tnoremap l + tnoremap j + tnoremap k + tnoremap elseif has('nvim') - " neovim 没有 termwinkey 支持,必须把 terminal 切换回 normal 模式 - tnoremap h - tnoremap l - tnoremap j - tnoremap k - tnoremap + " neovim 没有 termwinkey 支持,必须把 terminal 切换回 normal 模式 + tnoremap h + tnoremap l + tnoremap j + tnoremap k + tnoremap endif @@ -394,7 +395,7 @@ nnoremap :AsyncRun -cwd= cmake . " Windows 下支持直接打开新 cmd 窗口运行 if has('win32') || has('win64') - nnoremap :AsyncRun -cwd= -mode=4 make run + nnoremap :AsyncRun -cwd= -mode=4 make run endif @@ -402,45 +403,45 @@ endif " F5 运行当前文件:根据文件类型判断方法,并且输出到 quickfix 窗口 "---------------------------------------------------------------------- function! ExecuteFile() - let cmd = '' - if index(['c', 'cpp', 'rs', 'go'], &ft) >= 0 - " native 语言,把当前文件名去掉扩展名后作为可执行运行 - " 写全路径名是因为后面 -cwd=? 会改变运行时的当前路径,所以写全路径 - " 加双引号是为了避免路径中包含空格 - let cmd = '"$(VIM_FILEDIR)/$(VIM_FILENOEXT)"' - elseif &ft == 'python' - let $PYTHONUNBUFFERED=1 " 关闭 python 缓存,实时看到输出 - let cmd = 'python "$(VIM_FILEPATH)"' - elseif &ft == 'javascript' - let cmd = 'node "$(VIM_FILEPATH)"' - elseif &ft == 'perl' - let cmd = 'perl "$(VIM_FILEPATH)"' - elseif &ft == 'ruby' - let cmd = 'ruby "$(VIM_FILEPATH)"' - elseif &ft == 'php' - let cmd = 'php "$(VIM_FILEPATH)"' - elseif &ft == 'lua' - let cmd = 'lua "$(VIM_FILEPATH)"' - elseif &ft == 'zsh' - let cmd = 'zsh "$(VIM_FILEPATH)"' - elseif &ft == 'ps1' - let cmd = 'powershell -file "$(VIM_FILEPATH)"' - elseif &ft == 'vbs' - let cmd = 'cscript -nologo "$(VIM_FILEPATH)"' - elseif &ft == 'sh' - let cmd = 'bash "$(VIM_FILEPATH)"' - else - return - endif - " Windows 下打开新的窗口 (-mode=4) 运行程序,其他系统在 quickfix 运行 - " -raw: 输出内容直接显示到 quickfix window 不匹配 errorformat - " -save=2: 保存所有改动过的文件 - " -cwd=$(VIM_FILEDIR): 运行初始化目录为文件所在目录 - if has('win32') || has('win64') - exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=4 '. cmd - else - exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=0 '. cmd - endif + let cmd = '' + if index(['c', 'cpp', 'rs', 'go'], &ft) >= 0 + " native 语言,把当前文件名去掉扩展名后作为可执行运行 + " 写全路径名是因为后面 -cwd=? 会改变运行时的当前路径,所以写全路径 + " 加双引号是为了避免路径中包含空格 + let cmd = '"$(VIM_FILEDIR)/$(VIM_FILENOEXT)"' + elseif &ft == 'python' + let $PYTHONUNBUFFERED=1 " 关闭 python 缓存,实时看到输出 + let cmd = 'python "$(VIM_FILEPATH)"' + elseif &ft == 'javascript' + let cmd = 'node "$(VIM_FILEPATH)"' + elseif &ft == 'perl' + let cmd = 'perl "$(VIM_FILEPATH)"' + elseif &ft == 'ruby' + let cmd = 'ruby "$(VIM_FILEPATH)"' + elseif &ft == 'php' + let cmd = 'php "$(VIM_FILEPATH)"' + elseif &ft == 'lua' + let cmd = 'lua "$(VIM_FILEPATH)"' + elseif &ft == 'zsh' + let cmd = 'zsh "$(VIM_FILEPATH)"' + elseif &ft == 'ps1' + let cmd = 'powershell -file "$(VIM_FILEPATH)"' + elseif &ft == 'vbs' + let cmd = 'cscript -nologo "$(VIM_FILEPATH)"' + elseif &ft == 'sh' + let cmd = 'bash "$(VIM_FILEPATH)"' + else + return + endif + " Windows 下打开新的窗口 (-mode=4) 运行程序,其他系统在 quickfix 运行 + " -raw: 输出内容直接显示到 quickfix window 不匹配 errorformat + " -save=2: 保存所有改动过的文件 + " -cwd=$(VIM_FILEDIR): 运行初始化目录为文件所在目录 + if has('win32') || has('win64') + exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=4 '. cmd + else + exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=0 '. cmd + endif endfunc @@ -452,17 +453,17 @@ endfunc " 下面进行 grep,这样能方便的对相关项目进行搜索 "---------------------------------------------------------------------- if executable('rg') - noremap :AsyncRun! -cwd= rg -n --no-heading - \ --color never -g *.h -g *.c* -g *.py -g *.js -g *.vim - \ "" + noremap :AsyncRun! -cwd= rg -n --no-heading + \ --color never -g *.h -g *.c* -g *.py -g *.js -g *.vim + \ "" elseif has('win32') || has('win64') - noremap :AsyncRun! -cwd= findstr /n /s /C:"" - \ "\%CD\%\*.h" "\%CD\%\*.c*" "\%CD\%\*.py" "\%CD\%\*.js" - \ "\%CD\%\*.vim" - \ + noremap :AsyncRun! -cwd= findstr /n /s /C:"" + \ "\%CD\%\*.h" "\%CD\%\*.c*" "\%CD\%\*.py" "\%CD\%\*.js" + \ "\%CD\%\*.vim" + \ else - noremap :AsyncRun! -cwd= grep -n -s -R - \ --include='*.h' --include='*.c*' --include='*.py' - \ --include='*.js' --include='*.vim' - \ '' + noremap :AsyncRun! -cwd= grep -n -s -R + \ --include='*.h' --include='*.c*' --include='*.py' + \ --include='*.js' --include='*.vim' + \ '' endif diff --git a/vim/lua/configs/conform.lua b/vim/lua/configs/conform.lua index 411336e..b6fa6bb 100644 --- a/vim/lua/configs/conform.lua +++ b/vim/lua/configs/conform.lua @@ -1,12 +1,12 @@ local options = { formatters_by_ft = { lua = { "stylua" }, - css = { "prettier" }, - html = { "prettier" }, - markdown = { "prettier" }, sh = {"shfmt"}, bash = {"shfmt"}, zsh = {"shfmt"}, + markdown = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, }, -- format_on_save = { diff --git a/vim/lua/configs/telescope.lua b/vim/lua/configs/telescope.lua index 60828e9..70eddf4 100644 --- a/vim/lua/configs/telescope.lua +++ b/vim/lua/configs/telescope.lua @@ -6,6 +6,10 @@ return { -- [""] = "move_selection_previous", [""] = require("telescope.actions.layout").toggle_preview, [""] = false, + [""] = function(p_bufnr) + require("telescope.actions").send_selected_to_qflist(p_bufnr) + vim.cmd.cfdo("edit") + end, }, }, layout_config = { @@ -45,7 +49,7 @@ return { }, }, }, - on_attach = function () + on_attach = function() require("telescope").load_extension("aerial") end } diff --git a/vim/lua/plugins/init.lua b/vim/lua/plugins/init.lua index f54e21d..c74e8d4 100644 --- a/vim/lua/plugins/init.lua +++ b/vim/lua/plugins/init.lua @@ -138,6 +138,14 @@ return { -- end -- return tostring(os.time()) .. suffix end, + -- Optional, for templates (see below). + templates = { + folder = "templates", + date_format = "%Y-%m-%d", + time_format = "%H:%M", + -- A map for custom variables, the key should be the variable and the value a function + substitutions = {}, + }, }, }, @@ -209,9 +217,10 @@ return { opts = { automatically_installation = true, ensure_installed = { + "vim-language-server", + "lua-language-server", "css-lsp", "html-lsp", - "lua-language-server", "prettier", "stylua", }, -- cgit v1.2.3-70-g09d2