fix sqls bug, add start.sh
This commit is contained in:
parent
24cdd07e35
commit
9cd1989c5c
2
init.vim
2
init.vim
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
let g:username = 'veypi'
|
let g:username = 'veypi'
|
||||||
let g:email = 'veypi@qq.com'
|
let g:email = 'i@veypi.com'
|
||||||
|
|
||||||
runtime ./vimrc.vim
|
runtime ./vimrc.vim
|
||||||
" 插件管理
|
" 插件管理
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- https://github.com/mattn/efm-langserver
|
-- https://github.com/mattn/efm-langserver
|
||||||
return {
|
return {
|
||||||
init_options = { documentFormatting = true },
|
init_options = { documentFormatting = true },
|
||||||
filetypes = { 'python', 'json', 'css' },
|
filetypes = { 'python', 'json', 'css', 'yaml' },
|
||||||
settings = {
|
settings = {
|
||||||
rootMarkers = { ".git/" },
|
rootMarkers = { ".git/" },
|
||||||
languages = {
|
languages = {
|
||||||
@ -15,6 +15,10 @@ return {
|
|||||||
{ formatCommand = "fixjson", formatStdin = true }
|
{ formatCommand = "fixjson", formatStdin = true }
|
||||||
|
|
||||||
},
|
},
|
||||||
|
-- yarn global add yaml-lint
|
||||||
|
yaml = {
|
||||||
|
{ formatCommand = "yamllint -f parsable -", formatStdin = true }
|
||||||
|
},
|
||||||
css = {
|
css = {
|
||||||
-- yarn global add prettier
|
-- yarn global add prettier
|
||||||
{ formatCommand = "prettier --tab-width=4 ${--single-quote:singleQuote} --parser css", formatStdin = true }
|
{ formatCommand = "prettier --tab-width=4 ${--single-quote:singleQuote} --parser css", formatStdin = true }
|
||||||
|
|||||||
@ -35,6 +35,7 @@ local servers = {
|
|||||||
pyright = require "lsp.base",
|
pyright = require "lsp.base",
|
||||||
rust_analyzer = require "lsp.base",
|
rust_analyzer = require "lsp.base",
|
||||||
tailwindcss = require "lsp.tailwind",
|
tailwindcss = require "lsp.tailwind",
|
||||||
|
sqls = require "lsp.sql",
|
||||||
efm = require "lsp.efm"
|
efm = require "lsp.efm"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
30
lua/lsp/sql.lua
Normal file
30
lua/lsp/sql.lua
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#! /usr/bin/env lua
|
||||||
|
--
|
||||||
|
-- sql.lua
|
||||||
|
-- Copyright (C) 2022 veypi <i@veypi.com>
|
||||||
|
--
|
||||||
|
-- Distributed under terms of the Apache license.
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
sqls = {
|
||||||
|
connections = {
|
||||||
|
{
|
||||||
|
driver = 'mysql',
|
||||||
|
dataSourceName = 'root:123456@tcp(127.0.0.1:3306)/test',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = function(client)
|
||||||
|
-- sqls there seem a bug when format file
|
||||||
|
client.resolved_capabilities.document_formatting = false
|
||||||
|
client.resolved_capabilities.document_range_formatting = false
|
||||||
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
|
client.server_capabilities.documentRangeFormattingProvider = false
|
||||||
|
-- print(vim.inspect(client))
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -53,7 +53,6 @@ return require('packer').startup(function()
|
|||||||
|
|
||||||
use 'lewis6991/gitsigns.nvim'
|
use 'lewis6991/gitsigns.nvim'
|
||||||
|
|
||||||
use 'ybian/smartim'
|
|
||||||
|
|
||||||
use 'aperezdc/vim-template'
|
use 'aperezdc/vim-template'
|
||||||
|
|
||||||
|
|||||||
4
maps.vim
4
maps.vim
@ -50,8 +50,8 @@ nmap <C-a> gg<S-v>G
|
|||||||
" 切换页面
|
" 切换页面
|
||||||
" nmap <S-Tab> :bprev<Return>
|
" nmap <S-Tab> :bprev<Return>
|
||||||
" nmap <Tab> :bnext<Return>
|
" nmap <Tab> :bnext<Return>
|
||||||
nmap <S-Tab> :BufferLineCyclePrev<CR>
|
nmap <leader>[ :BufferLineCyclePrev<CR>
|
||||||
nmap <Tab> :BufferLineCycleNext<CR>
|
nmap <leader>] :BufferLineCycleNext<CR>
|
||||||
nmap <leader>1 :BufferLineGoToBuffer 1<CR>
|
nmap <leader>1 :BufferLineGoToBuffer 1<CR>
|
||||||
nmap <leader>2 :BufferLineGoToBuffer 2<CR>
|
nmap <leader>2 :BufferLineGoToBuffer 2<CR>
|
||||||
nmap <leader>3 :BufferLineGoToBuffer 3<CR>
|
nmap <leader>3 :BufferLineGoToBuffer 3<CR>
|
||||||
|
|||||||
3
plug.vim
3
plug.vim
@ -4,9 +4,8 @@ let g:mergetool_layout = 'LmR'
|
|||||||
|
|
||||||
|
|
||||||
let g:templates_directory = '~/.config/nvim/templates/'
|
let g:templates_directory = '~/.config/nvim/templates/'
|
||||||
|
let g:license = 'Apache'
|
||||||
|
|
||||||
let g:smartim_default = 'com.apple.keylayout.ABC'
|
|
||||||
let g:smartim_disable = 0
|
|
||||||
|
|
||||||
" autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
" autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||||
autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()
|
autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()
|
||||||
|
|||||||
12
start.sh
Normal file
12
start.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# start.sh
|
||||||
|
# Copyright (C) 2022 veypi <veypi@qq.com>
|
||||||
|
#
|
||||||
|
# Distributed under terms of the Apache license.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
yarn global add fixjson
|
||||||
|
yarn global add prettier
|
||||||
|
pip install yapf
|
||||||
9
templates/=template=Makefile
Normal file
9
templates/=template=Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# %FFILE%
|
||||||
|
# Copyright (C) %YEAR% %USER% <%MAIL%>
|
||||||
|
# %FDATE%
|
||||||
|
# Distributed under terms of the %LICENSE% license.
|
||||||
|
#
|
||||||
|
|
||||||
|
all:
|
||||||
|
%HERE%@echo "%FFILE% needs your attention"
|
||||||
Loading…
x
Reference in New Issue
Block a user