add livecommand and del specture
This commit is contained in:
parent
ecbe6a626d
commit
c366a7abfd
2
init.lua
2
init.lua
@ -6,7 +6,6 @@ require("keybindings")
|
||||
|
||||
require("plugin-config/nvim-tree")
|
||||
require("plugin-config/buffer_line")
|
||||
require("plugin-config/spectre")
|
||||
require("plugin-config/treesitter")
|
||||
require("plugin-config/telescope")
|
||||
require("plugin-config/whichkey")
|
||||
@ -21,6 +20,7 @@ require("plugin-config/project")
|
||||
require("plugin-config/dashboard")
|
||||
require("plugin-config/neoscroll")
|
||||
require("plugin-config/hop")
|
||||
require("plugin-config/live_command")
|
||||
-- require("plugin-config/JABS")
|
||||
require("plugin-config/toggleterm")
|
||||
require("plugin-config/indent-blankline")
|
||||
|
@ -65,7 +65,7 @@ M.load_default_options = function()
|
||||
vim.g[k] = v
|
||||
end
|
||||
|
||||
vim.cmd("colorscheme melange")
|
||||
vim.cmd("colorscheme onenord")
|
||||
end
|
||||
|
||||
return M
|
||||
|
35
lua/lsp/config/eslint.lua
Normal file
35
lua/lsp/config/eslint.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
on_setup = function(server)
|
||||
server.setup({
|
||||
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,
|
||||
}
|
35
lua/lsp/config/ts.lua
Normal file
35
lua/lsp/config/ts.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
on_setup = function(server)
|
||||
server.setup({
|
||||
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,
|
||||
}
|
35
lua/lsp/config/vue.lua
Normal file
35
lua/lsp/config/vue.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
on_setup = function(server)
|
||||
server.setup({
|
||||
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,
|
||||
}
|
@ -8,13 +8,15 @@ local servers = {
|
||||
sumneko_lua = require("lsp.config.lua"), -- lua/lsp/config/lua.lua
|
||||
clangd = require("lsp.config.clangd"),
|
||||
gopls = require("lsp.config.gopls"),
|
||||
eslint = require("lsp.config.eslint"),
|
||||
-- bashls = require("lsp.config.bash"),
|
||||
pyright = require("lsp.config.pyright"),
|
||||
vuels = require("lsp.config.vue"),
|
||||
-- html = require("lsp.config.html"),
|
||||
-- cssls = require("lsp.config.css"),
|
||||
-- emmet_ls = require("lsp.config.emmet"),
|
||||
-- jsonls = require("lsp.config.json"),
|
||||
-- tsserver = require("lsp.config.ts"),
|
||||
tsserver = require("lsp.config.ts"),
|
||||
-- rust_analyzer = require("lsp.config.rust"),
|
||||
-- yamlls = require("lsp.config.yamlls"),
|
||||
-- remark_ls = require("lsp.config.markdown"),
|
||||
|
@ -2,7 +2,7 @@ vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
update_in_insert = true,
|
||||
severity_sort = false,
|
||||
})
|
||||
|
||||
|
@ -2,9 +2,9 @@ require("hop").setup({})
|
||||
--- place this in one of your configuration file(s)
|
||||
local hop = require("hop")
|
||||
local directions = require("hop.hint").HintDirection
|
||||
vim.keymap.set("", "f", function()
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||
end, { remap = true })
|
||||
-- vim.keymap.set("", "f", function()
|
||||
-- hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||
-- end, { remap = true })
|
||||
vim.keymap.set("", "F", function()
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||
end, { remap = true })
|
||||
|
5
lua/plugin-config/live_command.lua
Normal file
5
lua/plugin-config/live_command.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require("live-command").setup({
|
||||
commands = {
|
||||
Norm = { cmd = "norm" },
|
||||
},
|
||||
})
|
@ -1 +0,0 @@
|
||||
require("spectre").setup({})
|
@ -14,6 +14,7 @@ return require("packer").startup(function()
|
||||
-- require("nova").load()
|
||||
-- end,
|
||||
-- })
|
||||
use("rmehri01/onenord.nvim")
|
||||
|
||||
use({
|
||||
"navarasu/onedark.nvim",
|
||||
@ -21,18 +22,15 @@ return require("packer").startup(function()
|
||||
|
||||
use("savq/melange")
|
||||
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
-- a good terminal
|
||||
-- 一个好的nvim内终端
|
||||
use({ "akinsho/toggleterm.nvim", tag = "*" })
|
||||
|
||||
-- chrome intergration
|
||||
-- 浏览器集成
|
||||
-- use({
|
||||
-- "glacambre/firenvim",
|
||||
-- run = function()
|
||||
-- vim.fn["firenvim#install"](0)
|
||||
-- end,
|
||||
-- })
|
||||
-- make live command
|
||||
-- 实时命令
|
||||
use({ "smjonas/live-command.nvim" })
|
||||
|
||||
-- lazygit support
|
||||
-- 使用lazygit接口
|
||||
@ -112,8 +110,6 @@ return require("packer").startup(function()
|
||||
})
|
||||
|
||||
--------------------- buffer related -----------------
|
||||
-- search and replace
|
||||
use("windwp/nvim-spectre")
|
||||
|
||||
-- indent-blankline
|
||||
-- 竖向加竖线显示对齐
|
||||
|
Loading…
Reference in New Issue
Block a user