add nvim-qt config and lsp config

This commit is contained in:
gameloader 2022-10-31 11:44:48 +08:00
parent a1d61a1144
commit f1ad37b19c
4 changed files with 50 additions and 5 deletions

29
ginit.vim Normal file
View File

@ -0,0 +1,29 @@
" Enable Mouse
set mouse=a
" Set Editor Font
if exists(':GuiFont')
" Use GuiFont! to ignore font errors
GuiFont FiraCode Nerd Font:h20
endif
" Disable GUI Tabline
if exists(':GuiTabline')
GuiTabline 0
endif
" Disable GUI Popupmenu
if exists(':GuiPopupmenu')
GuiPopupmenu 0
endif
" Enable GUI ScrollBar
if exists(':GuiScrollBar')
GuiScrollBar 1
endif
" Right Click Context Menu (Copy-Cut-Paste)
nnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>
inoremap <silent><RightMouse> <Esc>:call GuiShowContextMenu()<CR>
xnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>gv
snoremap <silent><RightMouse> <C-G>:call GuiShowContextMenu()<CR>gv

View File

@ -10,7 +10,7 @@ M.load_default_options = function()
fileencoding = "utf-8", -- the encoding written to a file fileencoding = "utf-8", -- the encoding written to a file
foldmethod = "manual", -- folding, set to "expr" for treesitter based folding foldmethod = "manual", -- folding, set to "expr" for treesitter based folding
foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding
guifont = "Menlo:h20", -- the font used in graphical neovim applications guifont = "FiraCode Nerd Font:h20", -- the font used in graphical neovim applications
background = "light", -- set the background to light or dark background = "light", -- set the background to light or dark
hidden = true, -- required to keep multiple buffers and open multiple buffers hidden = true, -- required to keep multiple buffers and open multiple buffers
hlsearch = true, -- highlight all matches on previous search pattern hlsearch = true, -- highlight all matches on previous search pattern

View File

@ -1,3 +1,20 @@
-- 显示lsp_name
local function lsp_name()
local msg = "No Active Lsp"
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
require("lualine").setup({ require("lualine").setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
@ -20,7 +37,7 @@ require("lualine").setup({
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" }, lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "require'lsp-status'.status()" }, lualine_c = { { lsp_name, icon = " LSP:", color = { fg = "#9933ff", gui = "bold" } } },
lualine_x = { "encoding", "fileformat", "filetype" }, lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" }, lualine_y = { "progress" },
lualine_z = { "location" }, lualine_z = { "location" },

View File

@ -2,6 +2,8 @@ return require("packer").startup(function()
-- Packer can manage itself -- Packer can manage itself
use("wbthomason/packer.nvim") use("wbthomason/packer.nvim")
-- lua 调试
use("rafcamlet/nvim-luapad")
------------------ themes -------------------------- ------------------ themes --------------------------
-- Nova theme for neovim light -- Nova theme for neovim light
-- use({ -- use({
@ -166,9 +168,6 @@ return require("packer").startup(function()
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",
}) })
-- lsp-status
use("nvim-lua/lsp-status.nvim")
-- 补全引擎 -- 补全引擎
use("hrsh7th/nvim-cmp") use("hrsh7th/nvim-cmp")
-- Snippet 引擎 -- Snippet 引擎