update several things

This commit is contained in:
Ray Andrew 2023-08-07 00:46:21 -05:00
parent 51fb990de0
commit e5f10c2dee
No known key found for this signature in database
GPG key ID: E2E8D63137DD489E
4 changed files with 243 additions and 121 deletions

View file

@ -1,6 +1,7 @@
{ {
"LuaSnip": { "branch": "master", "commit": "e81cbe6004051c390721d8570a4a0541ceb0df10" }, "LuaSnip": { "branch": "master", "commit": "99a94cc35ec99bf06263d0346128e908a204575c" },
"asyncrun.vim": { "branch": "master", "commit": "762e5ce9a60861af4fb25fb8719cef294ab8e894" }, "asyncrun.vim": { "branch": "master", "commit": "0f99f96b1a408c37ea6f78e5990554328bc22dd1" },
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"cellular-automaton.nvim": { "branch": "main", "commit": "679943b8e1e5ef79aaeeaf4b00782c52eb4e928f" }, "cellular-automaton.nvim": { "branch": "main", "commit": "679943b8e1e5ef79aaeeaf4b00782c52eb4e928f" },
"cloak.nvim": { "branch": "main", "commit": "c6a92e2fbc6b931bc9ed0d07e80931c2324e05cb" }, "cloak.nvim": { "branch": "main", "commit": "c6a92e2fbc6b931bc9ed0d07e80931c2324e05cb" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@ -8,9 +9,9 @@
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"copilot.vim": { "branch": "release", "commit": "a4a6d6b3f9e284e7f5c849619e06cd228cad8abd" }, "copilot.vim": { "branch": "release", "commit": "4a361e8cf327590d51d214c5c01c6391727390d7" },
"dressing.nvim": { "branch": "master", "commit": "829bc80400651aea31b03d8fc9a99135512fe67a" },
"flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" }, "flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" },
"focus.nvim": { "branch": "master", "commit": "31f41d91b6b331faa07f0a513adcbc37087d028d" },
"friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" }, "friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" },
@ -23,33 +24,36 @@
"mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" }, "mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" },
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
"neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" },
"neodev.nvim": { "branch": "main", "commit": "f860e226abd283a4fa5505ea7aa8c066ce495e04" }, "neodev.nvim": { "branch": "main", "commit": "9f0205a08757711f57589a1dffa8abf525f4a23b" },
"noice.nvim": { "branch": "main", "commit": "894db25ec726d32047799d4d0a982b701bec453b" },
"nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
"nvim-bqf": { "branch": "main", "commit": "60ebdf05c273e8e7f420851c6a33bbd731a1de8d" }, "nvim-bqf": { "branch": "main", "commit": "c920a55c6153766bd909e474b7feffa9739f07e8" },
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" },
"nvim-lspconfig": { "branch": "master", "commit": "a59d74e12340242c0735666fb2e91afdbe6f2496" }, "nvim-lspconfig": { "branch": "master", "commit": "c0de180ddb3df36feef8ac3607670894d0e7497f" },
"nvim-spectre": { "branch": "master", "commit": "3ba6edeea1390457caaf73e96ab9c086ff6f90e9" }, "nvim-spectre": { "branch": "master", "commit": "5b39919a2947b1266b3aa34d0b0b14c35523bc69" },
"nvim-treesitter": { "branch": "master", "commit": "80aee02921085435b04e880cabd1fbe29f6da99a" }, "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" },
"nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, "nvim-treesitter": { "branch": "master", "commit": "8d5e5dc40a4c480483690777cefb8cf67e710702" },
"nvim-treesitter-context": { "branch": "master", "commit": "3d4ab25056dcaf6dd11ebacf1da8525c8df6550f" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" },
"nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, "nvim-ufo": { "branch": "main", "commit": "5be5b800b4f3512bca128f345e9c98574b5637c0" },
"nvim-web-devicons": { "branch": "master", "commit": "eb8f80f30fd5e9a6176dee5c46661ebd7437ac46" },
"oil.nvim": { "branch": "master", "commit": "eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a" }, "oil.nvim": { "branch": "master", "commit": "eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a" },
"playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" },
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" }, "readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" },
"refactoring.nvim": { "branch": "master", "commit": "5359e74291164fcaeaaecdea9ba753ad54eb53d0" }, "refactoring.nvim": { "branch": "master", "commit": "5359e74291164fcaeaaecdea9ba753ad54eb53d0" },
"rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" }, "rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" },
"telescope.nvim": { "branch": "master", "commit": "d2e17ba18a6840b7e7079764b282616c3188e0de" }, "smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope.nvim": { "branch": "master", "commit": "5a3fb8a012f9fcf777ba8deeae1c759362413efa" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" },
"vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" }, "vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
} }

View file

@ -18,7 +18,18 @@ return {
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
cmd = "Telescope", cmd = "Telescope",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = "make",
cond = function()
return vim.fn.executable("make") == 1
end,
},
},
version = false, version = false,
opts = { opts = {
pickers = { pickers = {
@ -30,6 +41,7 @@ return {
actions.delete_buffer(prompt_bufnr) actions.delete_buffer(prompt_bufnr)
actions.move_to_top(prompt_bufnr) actions.move_to_top(prompt_bufnr)
end, end,
["<c-u>"] = false,
}, },
n = { n = {
["d"] = "delete_buffer", ["d"] = "delete_buffer",
@ -113,6 +125,29 @@ return {
end, end,
desc = "Find Help Tags", desc = "Find Help Tags",
}, },
{
"<space>/",
function()
-- require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
-- winblend = 10,
-- previewer = false,
-- }))
local Util = require("rayandrew.util")
local fun = Util.telescope("current_buffer_fuzzy_find", {
winblend = 10,
previewer = false,
})
fun()
end,
},
{
"<space>sd",
function()
local Util = require("rayandrew.util")
local fun = Util.telescope("diagnostics")
fun()
end,
},
}, },
}, },
@ -165,6 +200,49 @@ return {
node_decremental = "<bs>", node_decremental = "<bs>",
}, },
}, },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
}, },
cmd = { "TSUpdateSync" }, cmd = { "TSUpdateSync" },
keys = { keys = {
@ -226,18 +304,13 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = { "Oil" }, cmd = { "Oil" },
keys = { keys = {
-- {
-- "-",
-- function()
-- require("oil").open()
-- end,
-- desc = "Open parent directory",
-- },
{ {
"<leader>e", "<leader>e",
function() function()
-- split window then open oil -- disable in oil filetype
-- vim.cmd.vsplit() if vim.bo.filetype == "oil" then
return
end
require("oil").open() require("oil").open()
end, end,
desc = "Open current directory", desc = "Open current directory",
@ -245,8 +318,10 @@ return {
{ {
"<leader>E", "<leader>E",
function() function()
-- split window then open oil -- disable in oil filetype
-- vim.cmd.vsplit() if vim.bo.filetype == "oil" then
return
end
require("oil").open(".") require("oil").open(".")
end, end,
desc = "Open current directory", desc = "Open current directory",
@ -295,75 +370,6 @@ return {
------------------------------ ------------------------------
-- User Interface -- User Interface
------------------------------ ------------------------------
-- {
-- "folke/noice.nvim",
-- event = "VeryLazy",
-- opts = {
-- lsp = {
-- override = {
-- ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
-- ["vim.lsp.util.stylize_markdown"] = true,
-- ["cmp.entry.get_documentation"] = true,
-- },
-- hover = {
-- enabled = false,
-- },
-- signature = {
-- enabled = false,
-- },
-- },
-- cmdline = {
-- enabled = true,
-- view = "cmdline",
-- },
-- routes = {
-- {
-- filter = {
-- event = "msg_show",
-- any = {
-- { find = "%d+L, %d+B" },
-- { find = "; after #%d+" },
-- { find = "; before #%d+" },
-- },
-- },
-- view = "mini",
-- },
-- },
-- presets = {
-- bottom_search = true,
-- command_palette = true,
-- long_message_to_split = true,
-- inc_rename = true,
-- },
-- },
-- -- stylua: ignore
-- keys = {
-- { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
-- { "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
-- { "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
-- { "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
-- { "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
-- { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
-- { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
-- },
-- },
-- {
-- "stevearc/dressing.nvim",
-- lazy = true,
-- init = function()
-- ---@diagnostic disable-next-line: duplicate-set-field
-- vim.ui.select = function(...)
-- require("lazy").load({ plugins = { "dressing.nvim" } })
-- return vim.ui.select(...)
-- end
-- ---@diagnostic disable-next-line: duplicate-set-field
-- vim.ui.input = function(...)
-- require("lazy").load({ plugins = { "dressing.nvim" } })
-- return vim.ui.input(...)
-- end
-- end,
-- },
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
@ -400,9 +406,6 @@ return {
-- icons -- icons
{ "nvim-tree/nvim-web-devicons", lazy = true }, { "nvim-tree/nvim-web-devicons", lazy = true },
-- ui components
{ "MunifTanjim/nui.nvim", lazy = true },
------------------------------ ------------------------------
-- LSP Configuration -- LSP Configuration
------------------------------ ------------------------------
@ -443,7 +446,16 @@ return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter", event = "InsertEnter",
dependencies = { dependencies = {
{ "L3MON4D3/LuaSnip", build = "make install_jsregexp" }, {
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
-- event = "InsertEnter",
config = function()
local luasnip = require("luasnip")
require("luasnip.loaders.from_vscode").lazy_load()
luasnip.config.setup({})
end,
},
{ "rafamadriz/friendly-snippets" }, { "rafamadriz/friendly-snippets" },
{ "hrsh7th/nvim-cmp" }, { "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-buffer" },
@ -483,7 +495,8 @@ return {
sorting, sorting,
snippet = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) local luasnip = require("luasnip")
luasnip.lsp_expand(args.body)
end, end,
}, },
}) })
@ -499,9 +512,13 @@ return {
{ "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-nvim-lsp" },
{ "williamboman/mason-lspconfig.nvim" }, { "williamboman/mason-lspconfig.nvim" },
{ "williamboman/mason.nvim" }, { "williamboman/mason.nvim" },
{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, { "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } },
{ "folke/neodev.nvim", opts = {} }, { "folke/neodev.nvim", opts = {} },
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
opts = {},
},
}, },
config = function() config = function()
local lsp = require("lsp-zero") local lsp = require("lsp-zero")
@ -581,6 +598,17 @@ return {
}, },
}) })
lsp.set_server_config({
capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
},
},
},
})
lsp.setup() lsp.setup()
vim.diagnostic.config({ vim.diagnostic.config({
@ -694,6 +722,37 @@ return {
------------------------------ ------------------------------
-- Utilities -- Utilities
------------------------------ ------------------------------
{
"nvim-focus/focus.nvim",
version = "*",
opts = {},
cmd = { "FocusToggle", "FocusSplitNicely", "FocusSplitCycle", "FocusSplitCycleReverse" },
keys = {
{
"<space>wf",
"<cmd>FocusToggle<CR>",
desc = "Toggle Focus",
},
},
},
{
"simrat39/symbols-outline.nvim",
opts = {},
cmd = { "SymbolsOutline", "SymbolsOutlineOpen", "SymbolsOutlineClose" },
keys = {
{ "<leader>so", "<cmd>SymbolsOutline<CR>", desc = "Symbols Outline" },
},
},
{
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
opts = {},
},
{ {
"RRethy/vim-illuminate", "RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" }, event = { "BufReadPost", "BufNewFile" },
@ -1087,7 +1146,7 @@ return {
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
opts = { opts = {
window = { window = {
width = 90, width = 100,
}, },
plugins = { plugins = {
tmux = { tmux = {
@ -1098,11 +1157,13 @@ return {
vim.wo.wrap = false vim.wo.wrap = false
vim.wo.number = false vim.wo.number = false
vim.wo.rnu = false vim.wo.rnu = false
vim.wo.signcolumn = "no"
end, end,
on_close = function() on_close = function()
vim.wo.wrap = true vim.wo.wrap = true
vim.wo.number = true vim.wo.number = true
vim.wo.rnu = true vim.wo.rnu = true
vim.wo.signcolumn = "yes"
end, end,
}, },
keys = { keys = {
@ -1147,13 +1208,21 @@ return {
-- Tmux -- Tmux
{ {
"christoomey/vim-tmux-navigator", "mrjones2014/smart-splits.nvim",
cmd = { dependencies = {
"TmuxNavigateLeft", {
"TmuxNavigateDown", "kwkarlwang/bufresize.nvim",
"TmuxNavigateUp", opts = {},
"TmuxNavigateRight",
}, },
keys = { "<C-h>", "<C-j>", "<C-k>", "<C-l>" }, },
config = function()
require("smart-splits").setup({
resize_mode = {
hooks = {
on_leave = require("bufresize").register,
},
},
})
end,
}, },
} }

View file

@ -35,10 +35,10 @@ Util.map("n", "<leader>ws", "<cmd>split<cr>", { desc = "[W]indow Horizontal [S]p
Util.map("n", "<leader>wv", "<cmd>vsplit<cr>", { desc = "[W]indow [V]ertical Split" }) -- split vertical Util.map("n", "<leader>wv", "<cmd>vsplit<cr>", { desc = "[W]indow [V]ertical Split" }) -- split vertical
-- move -- move
Util.map("n", "<leader>wh", "<cmd>TmuxNavigateLeft<cr>", { desc = "Go to Left [W]indow" }) -- Util.map("n", "<leader>wh", "<cmd>TmuxNavigateLeft<cr>", { desc = "Go to Left [W]indow" })
Util.map("n", "<leader>wj", "<cmd>TmuxNavigateDown<cr>", { desc = "Go to [W]indow Below" }) -- Util.map("n", "<leader>wj", "<cmd>TmuxNavigateDown<cr>", { desc = "Go to [W]indow Below" })
Util.map("n", "<leader>wk", "<cmd>TmuxNavigateUp<cr>", { desc = "Go to Top [W]indow" }) -- Util.map("n", "<leader>wk", "<cmd>TmuxNavigateUp<cr>", { desc = "Go to Top [W]indow" })
Util.map("n", "<leader>wl", "<cmd>TmuxNavigateRight<cr>", { desc = "Go to Right [W]indow" }) -- Util.map("n", "<leader>wl", "<cmd>TmuxNavigateRight<cr>", { desc = "Go to Right [W]indow" })
if Util.has("bufferline.nvim") then if Util.has("bufferline.nvim") then
Util.map("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" }) Util.map("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
@ -52,6 +52,45 @@ else
Util.map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" }) Util.map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
end end
Util.map("n", "<leader>wh", function()
require("smart-splits").resize_left()
end, { desc = "Window Resize Left" })
Util.map("n", "<leader>wj", function()
require("smart-splits").resize_down()
end, { desc = "Window Resize Down" })
Util.map("n", "<leader>wk", function()
require("smart-splits").resize_up()
end, { desc = "Window Resize Up" })
Util.map("n", "<leader>wl", function()
require("smart-splits").resize_right()
end, { desc = "Window Resize Right" })
-- moving between splits
Util.map("n", "<C-h>", function()
require("smart-splits").move_cursor_left()
end, { desc = "Focus to Left Window" })
Util.map("n", "<C-j>", function()
require("smart-splits").move_cursor_down()
end, { desc = "Focus to Lower Window" })
Util.map("n", "<C-k>", function()
require("smart-splits").move_cursor_up()
end, { desc = "Focus to Upper Window" })
Util.map("n", "<C-l>", function()
require("smart-splits").move_cursor_right()
end, { desc = "Focus to Right Window" })
-- swapping buffers between windows
Util.map("n", "<leader><leader>h", function()
require("smart-splits").swap_buf_left()
end, { desc = "Swap Buffer Left" })
Util.map("n", "<leader><leader>j", function()
require("smart-splits").swap_buf_down()
end, { desc = "Swap Buffer Down" })
Util.map("n", "<leader><leader>k", function()
require("smart-splits").swap_buf_up()
end, { desc = "Swap Buffer Up" })
Util.map("n", "<leader><leader>l", function()
require("smart-splits").swap_buf_right()
end, { desc = "Swap Buffer Right" })
-- tabs -- tabs
Util.map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" }) Util.map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
Util.map("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First Tab" }) Util.map("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First Tab" })
@ -114,15 +153,10 @@ Util.map("n", "<leader>tT", function()
Util.float_term() Util.float_term()
end, { desc = "Terminal (cwd)" }) end, { desc = "Terminal (cwd)" })
Util.map("n", "`", lazyterm, { desc = "Terminal (root dir)" }) Util.map("n", "`", lazyterm, { desc = "Terminal (root dir)" })
-- Util.map("n", "<c-`>", lazyterm, { desc = "Terminal (root dir)" })
Util.map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" }) Util.map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
Util.map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" }) Util.map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
Util.map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" }) Util.map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
-- Util.map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
-- Util.map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
-- Util.map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
-- Util.map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
Util.map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" }) Util.map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
Util.map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" }) Util.map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
@ -130,10 +164,18 @@ Util.map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- Others -- Others
------------------------------ ------------------------------
-- ufo
Util.map("n", "zR", function()
require("ufo").openAllFolds()
end)
Util.map("n", "zM", function()
require("ufo").closeAllFolds()
end)
-- lazy -- lazy
Util.map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" }) Util.map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
-- source file -- source file
Util.map("n", "<leader><leader>", function() Util.map("n", "<leader><leader>s", function()
vim.cmd("so") vim.cmd("so")
end) end, { desc = "Source File" })

View file

@ -59,6 +59,13 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap opt.wrap = false -- Disable line wrap
-- For UFO
vim.o.foldcolumn = "1"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
if vim.fn.has("nvim-0.9.0") == 1 then if vim.fn.has("nvim-0.9.0") == 1 then
opt.splitkeep = "screen" opt.splitkeep = "screen"
opt.shortmess:append({ C = true }) opt.shortmess:append({ C = true })