From 9ad33f1b4e45a0bd2db48b94ecafdd316c814d82 Mon Sep 17 00:00:00 2001 From: Robot Date: Thu, 22 Feb 2024 16:58:30 -0800 Subject: [PATCH] add wether and ufo --- lua/core/keymaps.lua | 11 +++++++---- lua/core/options.lua | 4 ++++ lua/plugins/cmp.lua | 1 + lua/plugins/lsp.lua | 15 ++++++++++++--- lua/plugins/lualine.lua | 6 +++++- lua/plugins/misc.lua | 12 ++++++++++++ 6 files changed, 41 insertions(+), 8 deletions(-) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 770d0b0..9cc9844 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -1,5 +1,7 @@ local map = require("helpers.keys").map + + -- Quick access to some common actions map("n", "fw", "w", "Write") map("n", "fa", "wa", "Write all") @@ -62,15 +64,16 @@ map("n", "ur", "nohl", "Clear highlights") -- Open config map("n", "Nc", "tabnew ~/.config/nvim/init.lua", "Open Config") +-- Open Weather +map("n", "w", "lua require'wttr'.get_forecast()", "Open Weather") + -- Open Common Files map("n", "fm", "tabnew ~/vex/roberts", "Open Roberts") map("n", "fp", "tabnew ~/vex/patch", "Open Patch") -- New Tab Terminal (for more perminent use) -map("n", "ft", "tabf term://fish", "Open New Terminal") -map("t", "", "", "Return to normal mode") -map("t", "", "gt", "Go to next tab") -map("t", "", "q", "Close current terminal") +map("n", "ft", "tabf term://fishi", "Open New Terminal") +map("t", "", "", "Return to normal mode") -- Lazygit config diff --git a/lua/core/options.lua b/lua/core/options.lua index 47e3b50..0be31fe 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -6,6 +6,10 @@ local opts = { termguicolors = true, number = true, relativenumber = true, + foldcolumn = '0', + foldlevel = 99, + foldlevelstart = 99, + foldenable = true, } -- Set options from table diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 779297d..8fd3cc7 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -93,6 +93,7 @@ return { end, { "i", "s" }), }), formatting = { + expandable_indicator = true, fields = { "kind", "abbr", "menu" }, format = function(entry, vim_item) -- Kind icons diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index b6d7edb..022818e 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -9,6 +9,8 @@ return { "folke/neodev.nvim", "RRethy/vim-illuminate", "hrsh7th/cmp-nvim-lsp", + "kevinhwang91/nvim-ufo", + "kevinhwang91/promise-async", -- "simrat39/rust-tools.nvim", }, config = function() @@ -31,9 +33,11 @@ return { -- Turn on LSP status information require("fidget").setup({ - text = { - spinner = "meter", - }, + progress = { + display = { + progress_icon = { "meter" } + } + } }) -- Set up cool signs for diagnostics @@ -92,6 +96,10 @@ return { -- nvim-cmp supports additional completion capabilities, so broadcast that to servers local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } -- Lua require("lspconfig")["lua_ls"].setup({ @@ -149,6 +157,7 @@ return { on_attach = on_attach, capabilities = capabilities, }) + require('ufo').setup({}) -- local rt = require("rust-tools") -- rt.setup({ -- server = { diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index f0097d7..636267f 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -11,5 +11,9 @@ return { component_separators = "|", section_separators = "", }, + sections = { + lualine_x = { "require'wttr'.text", "encoding", "fileformat", "filetype" } + } }) - end, } + end, +} diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua index 158cf3b..5327511 100644 --- a/lua/plugins/misc.lua +++ b/lua/plugins/misc.lua @@ -48,6 +48,18 @@ return { opts = {} }, "rcarriga/nvim-notify", + { + "lazymaniac/wttr.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTnjim/nui.nvim", + }, + opts = { + location = "las+vegas", + format = 2, + + } + } }