diff --git a/init.lua b/init.lua index 7aeb3b0..39d6af2 100644 --- a/init.lua +++ b/init.lua @@ -17,9 +17,9 @@ require("plugin-config/nvim-autopairs") require("plugin-config/lua_snip") require("plugin-config/table-mode") require("plugin-config/mkdnflow") -require("plugin-config/orgmode") require("plugin-config/project") --- require("plugin-config/dashboard") +-- require("plugin-config/alpha") +require("plugin-config/dashboard") require("plugin-config/hop") require("plugin-config/neotree") require("plugin-config/live_command") @@ -30,6 +30,7 @@ require("plugin-config/lazygit") require("autocmd") require("lsp") +require("lsp.flutter") require("lsp.cmp") -- require("lsp.coc") require("lsp.null-ls") diff --git a/lua/autocmd.lua b/lua/autocmd.lua index a0281eb..6da9e2d 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -17,10 +17,11 @@ end function set_colorscheme() local colorschemes = vim.fn.getcompletion("", "color") - local desired_colorscheme = "everforest" + local desired_colorscheme = "material" if vim.tbl_contains(colorschemes, desired_colorscheme) then vim.cmd("colorscheme " .. desired_colorscheme) + vim.g.material_style = "lighter" else vim.cmd("colorscheme default") end diff --git a/lua/basic.lua b/lua/basic.lua index a9b936d..4bb743b 100644 --- a/lua/basic.lua +++ b/lua/basic.lua @@ -72,6 +72,12 @@ M.load_default_options = function() for k, v in pairs(let_options) do vim.g[k] = v end + + local colorschemes = vim.fn.getcompletion("", "color") + local desired_colorscheme = "material" + if vim.tbl_contains(colorschemes, desired_colorscheme) then + vim.g.material_style = "lighter" + end end return M diff --git a/lua/lsp/config/marksman.lua b/lua/lsp/config/marksman.lua new file mode 100644 index 0000000..723c978 --- /dev/null +++ b/lua/lsp/config/marksman.lua @@ -0,0 +1 @@ +return require("lsp.config.basic_config") diff --git a/lua/lsp/config/pylsp.lua b/lua/lsp/config/pylsp.lua index 9df9c36..0a6cd72 100644 --- a/lua/lsp/config/pylsp.lua +++ b/lua/lsp/config/pylsp.lua @@ -5,7 +5,11 @@ return { pylsp = { plugins = { pycodestyle = { - ignore = { "E501" }, + ignore = { "E501", "E265" }, + }, + jedi_completion = { + enabled = true, + fuzzy = true, }, }, }, diff --git a/lua/lsp/flutter.lua b/lua/lsp/flutter.lua new file mode 100644 index 0000000..3e64f77 --- /dev/null +++ b/lua/lsp/flutter.lua @@ -0,0 +1 @@ +require("flutter-tools").setup({}) -- use defaults diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index 14d117a..46eade5 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -14,9 +14,9 @@ local servers = { omnisharp = require("lsp.config.csharp"), -- bashls = require("lsp.config.bash"), pyright = require("lsp.config.pyright"), - -- pylsp = require("lsp.config.pylsp"), + marksman = require("lsp.config.marksman"), + pylsp = require("lsp.config.pylsp"), volar = require("lsp.config.vue"), - -- jedi_language_server = require("lsp.config.jedi"), -- html = require("lsp.config.html"), -- cssls = require("lsp.config.css"), -- emmet_ls = require("lsp.config.emmet"), diff --git a/lua/plugin-config/dashboard.lua b/lua/plugin-config/dashboard.lua index 489fabd..40b7638 100644 --- a/lua/plugin-config/dashboard.lua +++ b/lua/plugin-config/dashboard.lua @@ -1,81 +1,89 @@ --- local db = require("dashboard") --- db.custom_header = { --- "", --- "┳┻| ", --- "┻┳| ", --- "┳┻|ヘ ∧ ", --- "┻┳| ● w ● )", --- "┳┻|⊂ノ ", --- "┻┳|J ", --- "", --- } -require("dashboard").setup{ - custom_header = { - "", - "┳┻| ", - "┻┳| ", - "┳┻|ヘ ∧ ", - "┻┳| ● w ● )", - "┳┻|⊂ノ ", - "┻┳|J ", - "", - }, - custom_section = { - a = { - description = { " Find File " }, - command = "Telescope find_files find_command=rg,--hidden,--files", - }, - b = { - description = { " Recently Used Files" }, - command = "Telescope oldfiles", - }, - c = { - description = { " Find Word " }, - command = "Telescope live_grep", - }, - d = { - description = { "洛 New File " }, - command = "DashboardNewFile", - }, - e = { - description = { " Bookmarks " }, - command = "Telescope marks", - }, - f = { - description = { " Load Last Session " }, - command = "SessionLoad", - }, - }, - custom_footer = { - "Neovim", - }, -} +local db = require("dashboard") +local function foot() + -- local total_plugins = #vim.tbl_keys(packer_plugins) + local function get_table_size(t) + local count = 0 + for _, __ in pairs(t) do + count = count + 1 + end + return count + end + local opt, start = require("packer.plugin_utils").list_installed_plugins() + local plugin_count = get_table_size(opt) + get_table_size(start) + local datetime = os.date(" %d-%m-%Y  %H:%M:%S") + local version = vim.version() + local nvim_version_info = "  v" .. version.major .. "." .. version.minor .. "." .. version.patch + return datetime .. "  " .. plugin_count .. " plugins" .. nvim_version_info +end --- db.custom_center = { --- { --- icon = " ", --- desc = "Find File ", --- action = "Telescope find_files find_command=rg,--hidden,--files", --- shortcut = "SPC f f", --- }, --- { --- icon = " ", --- desc = "Recently opened files ", --- action = "Telescope oldfiles", --- shortcut = "SPC f r", --- }, --- { --- icon = " ", --- desc = "Open Project ", --- action = "Telescope Project ", --- shortcut = "SPC f p", --- }, --- { --- icon = " ", --- desc = "File Browser ", --- action = "Telescope file_browser", --- shortcut = "SPC f b", --- }, --- } +db.setup({ + theme = "doom", + config = { + header = { + " :*+++++********++=-:. ", + " #- =+*+", + " .% %", + " ++ .#", + " -# #.", + " *= :# ", + " .%. *- ", + " +* .% ", + " %- == ", + " -@++++++++++======----::#. ", + " *- .....::::--** ", + " .% %= ", + " ++ =%: ", + " .+++**+++%%##########%%%%%%%%%%%%%***-", + " .+ .* -+ ..:=+*%%%%%. ", + " +: :+ *: :+%* ", + " % *. .+- *: ", + " =+ %==-::-===. .-=+* ", + " :%= #. .. .:--=+-:+:+ ", + " +%%%= +*---+----:* = :+: ", + "=%%%%%%= .==-*. .*:---=:. .... ", + " ", + }, + center = { + { + icon = " ", + icon_hl = "Title", + desc = "Find File ", + desc_hl = "String", + key = "b", + keymap = "SPC f f", + key_hl = "Number", + action = "Telescope find_files find_command=rg,--hidden,--files", + }, + { + icon = " ", + desc = "Recently opened files ", + desc_hl = "String", + key = "a", + keymap = "SPC f r", + key_hl = "Number", + action = "Telescope oldfiles", + }, + { + icon = " ", + desc = "Open Project ", + desc_hl = "String", + key = "c", + keymap = "SPC f p", + key_hl = "Number", + action = "Telescope Project ", + }, + { + icon = " ", + desc = "File Browser ", + desc_hl = "String", + key = "d", + keymap = "SPC f b", + key_hl = "Number", + action = "Telescope file_browser", + }, + }, + footer = { foot() }, --your footer + }, +}) diff --git a/lua/plugin-config/lua_line.lua b/lua/plugin-config/lua_line.lua index caba7b4..093a8ca 100644 --- a/lua/plugin-config/lua_line.lua +++ b/lua/plugin-config/lua_line.lua @@ -33,6 +33,7 @@ require("lualine").setup({ tabline = 1000, winbar = 1000, }, + theme = "material-nvim", }, sections = { lualine_a = { "mode" }, diff --git a/lua/plugins.lua b/lua/plugins.lua index 87b3eff..1d7ef1d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -13,6 +13,8 @@ return require("packer").startup(function() use("folke/tokyonight.nvim") use("sainnhe/everforest") + + use("marko-cerovac/material.nvim") ----------------------------------------------------------------------------------------- -- a good terminal @@ -40,7 +42,7 @@ return require("packer").startup(function() -- orgmode support -- orgmode 支持 - use({ "nvim-orgmode/orgmode" }) + -- use({ "nvim-orgmode/orgmode" }) -- nvim-tree for file manage -- use({ @@ -60,16 +62,10 @@ return require("packer").startup(function() -- vim dashboard -- vim 开始界面 - -- use({ - -- "glepnir/dashboard-nvim", - -- event = "VimEnter", - -- -- config = function() - -- -- require("dashboard").setup({ - -- -- -- config - -- -- }) - -- -- end, - -- requires = { "nvim-tree/nvim-web-devicons" }, - -- }) + use({ + "glepnir/dashboard-nvim", + requires = { "nvim-tree/nvim-web-devicons" }, + }) -- smooth neovim scroll -- 顺滑的neovim滚动 @@ -79,9 +75,6 @@ return require("packer").startup(function() -- 顶部状态栏 use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) - -- 更方便的切换buffer - -- use({ "matbme/JABS.nvim" }) - -- treesitter use({ "nvim-treesitter/nvim-treesitter", @@ -167,14 +160,20 @@ return require("packer").startup(function() "neovim/nvim-lspconfig", }) - -- coc-nvim complete - -- use({ "neoclide/coc.nvim", branch = "release" }) -- null-ls for formatter and others -- null-ls 用于格式化和其他 use({ "jose-elias-alvarez/null-ls.nvim", }) + -- flutter support + use({ + "akinsho/flutter-tools.nvim", + requires = { + "nvim-lua/plenary.nvim", + "stevearc/dressing.nvim", -- optional for vim.ui.select + }, + }) -- -- 补全引擎 use("hrsh7th/nvim-cmp") -- Snippet 引擎