add nvim-qt config and lsp config
This commit is contained in:
parent
a1d61a1144
commit
f1ad37b19c
29
ginit.vim
Normal file
29
ginit.vim
Normal 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
|
@ -10,7 +10,7 @@ M.load_default_options = function()
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
foldmethod = "manual", -- folding, set to "expr" 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
|
||||
hidden = true, -- required to keep multiple buffers and open multiple buffers
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
|
@ -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({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
@ -20,7 +37,7 @@ require("lualine").setup({
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
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_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
|
@ -2,6 +2,8 @@ return require("packer").startup(function()
|
||||
-- Packer can manage itself
|
||||
use("wbthomason/packer.nvim")
|
||||
|
||||
-- lua 调试
|
||||
use("rafcamlet/nvim-luapad")
|
||||
------------------ themes --------------------------
|
||||
-- Nova theme for neovim light
|
||||
-- use({
|
||||
@ -166,9 +168,6 @@ return require("packer").startup(function()
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
})
|
||||
|
||||
-- lsp-status
|
||||
use("nvim-lua/lsp-status.nvim")
|
||||
|
||||
-- 补全引擎
|
||||
use("hrsh7th/nvim-cmp")
|
||||
-- Snippet 引擎
|
||||
|
Loading…
Reference in New Issue
Block a user