change to pylsp add vue change to jaq to run code
This commit is contained in:
parent
3eee395fbf
commit
bb51b61c79
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ plugin
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
snippets/go.json
|
snippets/go.json
|
||||||
|
snippets/python.json
|
4
init.lua
4
init.lua
@ -23,12 +23,10 @@ require("plugin-config/dashboard")
|
|||||||
require("plugin-config/neoscroll")
|
require("plugin-config/neoscroll")
|
||||||
require("plugin-config/hop")
|
require("plugin-config/hop")
|
||||||
require("plugin-config/live_command")
|
require("plugin-config/live_command")
|
||||||
-- require("plugin-config/JABS")
|
require("plugin-config/jaq")
|
||||||
require("plugin-config/toggleterm")
|
require("plugin-config/toggleterm")
|
||||||
require("plugin-config/indent-blankline")
|
require("plugin-config/indent-blankline")
|
||||||
require("plugin-config/coderunner")
|
|
||||||
require("plugin-config/lazygit")
|
require("plugin-config/lazygit")
|
||||||
-- require("plugin-config/neogit")
|
|
||||||
|
|
||||||
require("autocmd")
|
require("autocmd")
|
||||||
require("lsp")
|
require("lsp")
|
||||||
|
@ -18,8 +18,8 @@ end
|
|||||||
local autoCommands = {
|
local autoCommands = {
|
||||||
-- other autocommands
|
-- other autocommands
|
||||||
open_folds = {
|
open_folds = {
|
||||||
{ "BufEnter", "*", "normal zx" },
|
{ "BufAdd", "*", "normal zx" },
|
||||||
{ "BufEnter", "*", "normal zR" },
|
{ "BufEnter,BufModifiedSet", "*", "normal zR" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ end
|
|||||||
|
|
||||||
-- code related
|
-- code related
|
||||||
-- 代码相关
|
-- 代码相关
|
||||||
map("n", ",", ":RunCode<CR>", opt)
|
map("n", ",", ":Jaq<CR>", opt)
|
||||||
|
|
||||||
-- markdown related
|
-- markdown related
|
||||||
-- markdown 相关
|
-- markdown 相关
|
||||||
@ -115,6 +115,8 @@ wk.register({
|
|||||||
b = { ":Telescope buffers<CR>", "Open buffers" },
|
b = { ":Telescope buffers<CR>", "Open buffers" },
|
||||||
n = { ":ls<CR>", "Buffer numbers" },
|
n = { ":ls<CR>", "Buffer numbers" },
|
||||||
c = { ":noh<CR>", "Cancel highlight" },
|
c = { ":noh<CR>", "Cancel highlight" },
|
||||||
|
C = { ":call setqflist([], 'r')<CR>", "Clear quickfix" },
|
||||||
|
q = { ":copen<CR>", "Open quickfix" },
|
||||||
s = { ":Telescope current_buffer_fuzzy_find<CR>", "Searching in buffer" },
|
s = { ":Telescope current_buffer_fuzzy_find<CR>", "Searching in buffer" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -207,6 +209,11 @@ function SetKeybinds()
|
|||||||
["d"] = { ":HeaderDecrease<CR>", "All header decrease" },
|
["d"] = { ":HeaderDecrease<CR>", "All header decrease" },
|
||||||
["i"] = { ":HeaderIncrease<CR>", "All header increase" },
|
["i"] = { ":HeaderIncrease<CR>", "All header increase" },
|
||||||
}, opts)
|
}, opts)
|
||||||
|
elseif fileTy == "python" then
|
||||||
|
wk.register({
|
||||||
|
["r"] = { ":MagmaEvaluateOperator<CR>", "Jupyter evaluate" },
|
||||||
|
["c"] = { ":MagmaEvaluateCell<CR>", "Jupyter evaluate cell" },
|
||||||
|
}, opts)
|
||||||
-- elseif fileTy == "sh" then
|
-- elseif fileTy == "sh" then
|
||||||
-- wk.register({
|
-- wk.register({
|
||||||
-- ["W"] = { ":w<CR>", "test write" },
|
-- ["W"] = { ":w<CR>", "test write" },
|
||||||
|
44
lua/lsp/config/pylsp.lua
Normal file
44
lua/lsp/config/pylsp.lua
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
on_setup = function(server)
|
||||||
|
server.setup({
|
||||||
|
settings = {
|
||||||
|
pylsp = {
|
||||||
|
plugins = {
|
||||||
|
pycodestyle = {
|
||||||
|
ignore = { "E501" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
flags = {
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- 禁用格式化功能,交给专门插件插件处理
|
||||||
|
client.server_capabilities.document_formatting = false
|
||||||
|
client.server_capabilities.document_range_formatting = false
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
local opts = {
|
||||||
|
focusable = false,
|
||||||
|
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||||
|
border = "rounded",
|
||||||
|
source = "always",
|
||||||
|
prefix = " ",
|
||||||
|
scope = "cursor",
|
||||||
|
}
|
||||||
|
vim.diagnostic.open_float(nil, opts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
local function buf_set_keymap(...)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||||
|
end
|
||||||
|
-- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||||
|
-- 绑定快捷键
|
||||||
|
require("keybindings").maplsp(buf_set_keymap)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
@ -1 +1,43 @@
|
|||||||
return require("lsp.config.basic_config")
|
return {
|
||||||
|
on_setup = function(server)
|
||||||
|
server.setup({
|
||||||
|
filetypes = {
|
||||||
|
"typescript",
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue",
|
||||||
|
"json",
|
||||||
|
},
|
||||||
|
flags = {
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- 禁用格式化功能,交给专门插件插件处理
|
||||||
|
client.server_capabilities.document_formatting = false
|
||||||
|
client.server_capabilities.document_range_formatting = false
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
local opts = {
|
||||||
|
focusable = false,
|
||||||
|
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||||
|
border = "rounded",
|
||||||
|
source = "always",
|
||||||
|
prefix = " ",
|
||||||
|
scope = "cursor",
|
||||||
|
}
|
||||||
|
vim.diagnostic.open_float(nil, opts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
local function buf_set_keymap(...)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||||
|
end
|
||||||
|
-- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||||
|
-- 绑定快捷键
|
||||||
|
require("keybindings").maplsp(buf_set_keymap)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
@ -10,14 +10,15 @@ local servers = {
|
|||||||
gopls = require("lsp.config.gopls"),
|
gopls = require("lsp.config.gopls"),
|
||||||
eslint = require("lsp.config.eslint"),
|
eslint = require("lsp.config.eslint"),
|
||||||
-- bashls = require("lsp.config.bash"),
|
-- bashls = require("lsp.config.bash"),
|
||||||
pyright = require("lsp.config.pyright"),
|
-- pyright = require("lsp.config.pyright"),
|
||||||
|
pylsp = require("lsp.config.pylsp"),
|
||||||
|
volar = require("lsp.config.vue"),
|
||||||
-- jedi_language_server = require("lsp.config.jedi"),
|
-- jedi_language_server = require("lsp.config.jedi"),
|
||||||
vuels = require("lsp.config.vue"),
|
|
||||||
-- html = require("lsp.config.html"),
|
-- html = require("lsp.config.html"),
|
||||||
-- cssls = require("lsp.config.css"),
|
-- cssls = require("lsp.config.css"),
|
||||||
-- emmet_ls = require("lsp.config.emmet"),
|
-- emmet_ls = require("lsp.config.emmet"),
|
||||||
-- jsonls = require("lsp.config.json"),
|
-- jsonls = require("lsp.config.json"),
|
||||||
tsserver = require("lsp.config.ts"),
|
-- tsserver = require("lsp.config.ts"),
|
||||||
-- rust_analyzer = require("lsp.config.rust"),
|
-- rust_analyzer = require("lsp.config.rust"),
|
||||||
-- yamlls = require("lsp.config.yamlls"),
|
-- yamlls = require("lsp.config.yamlls"),
|
||||||
-- remark_ls = require("lsp.config.markdown"),
|
-- remark_ls = require("lsp.config.markdown"),
|
||||||
|
@ -16,6 +16,8 @@ require("null-ls").setup({
|
|||||||
require("null-ls").builtins.formatting.clang_format,
|
require("null-ls").builtins.formatting.clang_format,
|
||||||
require("null-ls").builtins.formatting.gofmt,
|
require("null-ls").builtins.formatting.gofmt,
|
||||||
require("null-ls").builtins.formatting.black,
|
require("null-ls").builtins.formatting.black,
|
||||||
|
require("null-ls").builtins.formatting.eslint_d,
|
||||||
|
require("null-ls").builtins.formatting.jq,
|
||||||
},
|
},
|
||||||
-- you can reuse a shared lspconfig on_attach callback here
|
-- you can reuse a shared lspconfig on_attach callback here
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
require("jabs").setup({})
|
|
@ -1,9 +0,0 @@
|
|||||||
require("code_runner").setup({
|
|
||||||
focus = false,
|
|
||||||
filetype = {
|
|
||||||
c = "cd $dir && gcc $fileName -o $fileNameWithoutExt -g && $dir/$fileNameWithoutExt",
|
|
||||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt -g -w -std=c++11 && $dir/$fileNameWithoutExt",
|
|
||||||
go = "cd $dir && go run $fileName",
|
|
||||||
python = "cd $dir && python3 $fileName",
|
|
||||||
},
|
|
||||||
})
|
|
72
lua/plugin-config/jaq.lua
Normal file
72
lua/plugin-config/jaq.lua
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
require("jaq-nvim").setup({
|
||||||
|
cmds = {
|
||||||
|
-- Uses vim commands
|
||||||
|
internal = {
|
||||||
|
lua = "luafile %",
|
||||||
|
vim = "source %",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Uses shell commands
|
||||||
|
external = {
|
||||||
|
markdown = "glow %",
|
||||||
|
python = "python %",
|
||||||
|
go = "go run %",
|
||||||
|
sh = "sh %",
|
||||||
|
c = "cd $dir && gcc $file -o $fileBase -g && $dir/$fileBase",
|
||||||
|
cpp = "cd $dir && g++ $file -o $fileBase -g -w -std=c++11 && $dir/$fileBase",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
behavior = {
|
||||||
|
-- Default type
|
||||||
|
default = "terminal",
|
||||||
|
|
||||||
|
-- Start in insert mode
|
||||||
|
startinsert = false,
|
||||||
|
|
||||||
|
-- Use `wincmd p` on startup
|
||||||
|
wincmd = false,
|
||||||
|
|
||||||
|
-- Auto-save files
|
||||||
|
autosave = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
ui = {
|
||||||
|
float = {
|
||||||
|
-- See ':h nvim_open_win'
|
||||||
|
border = "none",
|
||||||
|
|
||||||
|
-- See ':h winhl'
|
||||||
|
winhl = "Normal",
|
||||||
|
borderhl = "FloatBorder",
|
||||||
|
|
||||||
|
-- See ':h winblend'
|
||||||
|
winblend = 0,
|
||||||
|
|
||||||
|
-- Num from `0-1` for measurements
|
||||||
|
height = 0.8,
|
||||||
|
width = 0.8,
|
||||||
|
x = 0.5,
|
||||||
|
y = 0.5,
|
||||||
|
},
|
||||||
|
|
||||||
|
terminal = {
|
||||||
|
-- Window position
|
||||||
|
position = "bot",
|
||||||
|
|
||||||
|
-- Window size
|
||||||
|
size = 10,
|
||||||
|
|
||||||
|
-- Disable line numbers
|
||||||
|
line_no = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
quickfix = {
|
||||||
|
-- Window position
|
||||||
|
position = "bot",
|
||||||
|
|
||||||
|
-- Window size
|
||||||
|
size = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
@ -153,8 +153,7 @@ return require("packer").startup(function()
|
|||||||
|
|
||||||
-- coderunner
|
-- coderunner
|
||||||
-- 代码运行
|
-- 代码运行
|
||||||
use({ "CRAG666/code_runner.nvim", requires = "nvim-lua/plenary.nvim" })
|
use({ "is0n/jaq-nvim" })
|
||||||
|
|
||||||
-- cmake support
|
-- cmake support
|
||||||
-- cmake 支持
|
-- cmake 支持
|
||||||
use("Civitasv/cmake-tools.nvim")
|
use("Civitasv/cmake-tools.nvim")
|
||||||
@ -194,6 +193,9 @@ return require("packer").startup(function()
|
|||||||
-- copilot 增强
|
-- copilot 增强
|
||||||
use("github/copilot.vim")
|
use("github/copilot.vim")
|
||||||
|
|
||||||
|
------------------- repl ----------------------
|
||||||
|
use({ "hkupty/iron.nvim" })
|
||||||
|
|
||||||
------------------- dap -----------------------
|
------------------- dap -----------------------
|
||||||
-- dap for neovim
|
-- dap for neovim
|
||||||
-- dap ui和适配器
|
-- dap ui和适配器
|
||||||
|
@ -13,6 +13,12 @@
|
|||||||
"markdown"
|
"markdown"
|
||||||
],
|
],
|
||||||
"path":"./markdown.json"
|
"path":"./markdown.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"language":[
|
||||||
|
"python"
|
||||||
|
],
|
||||||
|
"path":"./python.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user