change style

This commit is contained in:
Ray Andrew 2023-08-01 22:47:08 -05:00
parent bd7c5dc6c4
commit a56cb9a0a2
No known key found for this signature in database
GPG key ID: E2E8D63137DD489E
6 changed files with 146 additions and 225 deletions

View file

@ -1,11 +1,11 @@
{ {
"LuaSnip": { "branch": "master", "commit": "e81cbe6004051c390721d8570a4a0541ceb0df10" }, "LuaSnip": { "branch": "master", "commit": "e81cbe6004051c390721d8570a4a0541ceb0df10" },
"asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" },
"bufferline.nvim": { "branch": "main", "commit": "99f0932365b34e22549ff58e1bea388465d15e99" }, "bufferline.nvim": { "branch": "main", "commit": "99f0932365b34e22549ff58e1bea388465d15e99" },
"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-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, "copilot.vim": { "branch": "release", "commit": "a4a6d6b3f9e284e7f5c849619e06cd228cad8abd" },
"copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" },
"dressing.nvim": { "branch": "master", "commit": "829bc80400651aea31b03d8fc9a99135512fe67a" }, "dressing.nvim": { "branch": "master", "commit": "829bc80400651aea31b03d8fc9a99135512fe67a" },
"flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" }, "flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
@ -24,10 +24,10 @@
"nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" },
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" }, "nvim-lspconfig": { "branch": "master", "commit": "a59d74e12340242c0735666fb2e91afdbe6f2496" },
"nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" }, "nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" },
"nvim-spectre": { "branch": "master", "commit": "3ba6edeea1390457caaf73e96ab9c086ff6f90e9" }, "nvim-spectre": { "branch": "master", "commit": "3ba6edeea1390457caaf73e96ab9c086ff6f90e9" },
"nvim-treesitter": { "branch": "master", "commit": "1c79da3300951e934f635eaf8703480b57644e7e" }, "nvim-treesitter": { "branch": "master", "commit": "4c4d586a05e236d8199ab6faab8cb733a9b5bd24" },
"nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, "nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" },
"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" },
@ -37,12 +37,12 @@
"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": "b6fccfb0f7589a87587875206786daccba62acc3" }, "telescope.nvim": { "branch": "master", "commit": "d2e17ba18a6840b7e7079764b282616c3188e0de" },
"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": "a2907275a6899c570d16e95b9db5fd921c167502" }, "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" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },

View file

@ -64,12 +64,7 @@ vim.api.nvim_create_autocmd("FileType", {
}, },
callback = function(event) callback = function(event)
vim.bo[event.buf].buflisted = false vim.bo[event.buf].buflisted = false
vim.keymap.set( vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
"n",
"q",
"<cmd>close<cr>",
{ buffer = event.buf, silent = true }
)
end, end,
}) })

View file

@ -8,7 +8,8 @@ return {
"dstein64/vim-startuptime", "dstein64/vim-startuptime",
-- lazy-load on a command -- lazy-load on a command
cmd = "StartupTime", cmd = "StartupTime",
-- init is called during startup. Configuration for vim plugins typically should be set in an init function -- init is called during startup.
-- Configuration for vim plugins typically should be set in an init function
init = function() init = function()
vim.g.startuptime_tries = 10 vim.g.startuptime_tries = 10
end, end,
@ -71,15 +72,15 @@ return {
end, end,
desc = "Find Files (cwd)", desc = "Find Files (cwd)",
}, },
{ -- {
"<c-p>", -- "<c-p>",
function() -- function()
local Util = require("rayandrew.util") -- local Util = require("rayandrew.util")
local fun = Util.telescope("git_files") -- local fun = Util.telescope("git_files")
fun() -- fun()
end, -- end,
desc = "Find Git Files", -- desc = "Find Git Files",
}, -- },
{ {
"<space>sm", "<space>sm",
function() function()
@ -114,9 +115,7 @@ return {
-- disable rtp plugin, as we only need its queries for mini.ai -- disable rtp plugin, as we only need its queries for mini.ai
-- In case other textobject modules are enabled, we will load them -- In case other textobject modules are enabled, we will load them
-- once nvim-treesitter is loaded -- once nvim-treesitter is loaded
require("lazy.core.loader").disable_rtp_plugin( require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
"nvim-treesitter-textobjects"
)
load_textobjects = true load_textobjects = true
end, end,
}, },
@ -181,8 +180,7 @@ return {
if opts.textobjects[mod] and opts.textobjects[mod].enable then if opts.textobjects[mod] and opts.textobjects[mod].enable then
local Loader = require("lazy.core.loader") local Loader = require("lazy.core.loader")
Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil
local plugin = local plugin = require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
require("lazy.core.loader").source_runtime(plugin.dir, "plugin") require("lazy.core.loader").source_runtime(plugin.dir, "plugin")
break break
end end
@ -461,6 +459,13 @@ return {
"notify", "notify",
"toggleterm", "toggleterm",
"lazyterm", "lazyterm",
"qf",
},
buftype_exclude = {
"terminal",
"nofile",
"quickfix",
"prompt",
}, },
show_trailing_blankline_indent = false, show_trailing_blankline_indent = false,
show_current_context = false, show_current_context = false,
@ -629,19 +634,19 @@ return {
}, },
-- Copilot -- Copilot
{ -- {
"zbirenbaum/copilot.lua", -- "zbirenbaum/copilot.lua",
cmd = "Copilot", -- cmd = "Copilot",
build = ":Copilot auth", -- build = ":Copilot auth",
opts = { -- opts = {
suggestion = { enabled = false }, -- suggestion = { enabled = false },
panel = { enabled = false }, -- panel = { enabled = false },
filetypes = { -- filetypes = {
markdown = true, -- markdown = true,
help = true, -- help = true,
}, -- },
}, -- },
}, -- },
-- Autocompletion -- Autocompletion
{ {
@ -649,23 +654,24 @@ return {
event = "InsertEnter", event = "InsertEnter",
dependencies = { dependencies = {
{ "L3MON4D3/LuaSnip", build = "make install_jsregexp" }, { "L3MON4D3/LuaSnip", build = "make install_jsregexp" },
{ -- {
"zbirenbaum/copilot-cmp", -- "zbirenbaum/copilot-cmp",
dependencies = "copilot.lua", -- dependencies = "copilot.lua",
opts = {}, -- enabled = false,
config = function(_, opts) -- opts = {},
local Util = require("rayandrew.util") -- config = function(_, opts)
local copilot_cmp = require("copilot_cmp") -- local Util = require("rayandrew.util")
copilot_cmp.setup(opts) -- local copilot_cmp = require("copilot_cmp")
-- attach cmp source whenever copilot attaches -- copilot_cmp.setup(opts)
-- fixes lazy-loading issues with the copilot cmp source -- -- attach cmp source whenever copilot attaches
Util.on_attach(function(client) -- -- fixes lazy-loading issues with the copilot cmp source
if client.name == "copilot" then -- Util.on_attach(function(client)
copilot_cmp._on_insert_enter({}) -- if client.name == "copilot" then
end -- copilot_cmp._on_insert_enter({})
end) -- end
end, -- end)
}, -- end,
-- },
}, },
config = function() config = function()
require("lsp-zero.cmp").extend() require("lsp-zero.cmp").extend()
@ -677,7 +683,7 @@ return {
cmp.setup({ cmp.setup({
sources = { sources = {
{ name = "copilot", group_index = 2 }, -- { name = "copilot", group_index = 2 },
{ name = "nvim_lsp", group_index = 2 }, { name = "nvim_lsp", group_index = 2 },
{ name = "path", group_index = 2 }, { name = "path", group_index = 2 },
{ name = "luasnip", group_index = 2 }, { name = "luasnip", group_index = 2 },
@ -844,12 +850,7 @@ return {
config = function(_, opts) config = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
nls.setup({ nls.setup({
root_dir = require("null-ls.utils").root_pattern( root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
".null-ls-root",
".neoconf.json",
"Makefile",
".git"
),
sources = { sources = {
nls.builtins.completion.spell, nls.builtins.completion.spell,
nls.builtins.code_actions.gitsigns, nls.builtins.code_actions.gitsigns,
@ -862,8 +863,7 @@ return {
-- js/ts linter -- js/ts linter
-- only enable eslint if root has .eslintrc.js (not in youtube nvim video) -- only enable eslint if root has .eslintrc.js (not in youtube nvim video)
condition = function(utils) condition = function(utils)
return utils.root_has_file(".eslintrc.js") return utils.root_has_file(".eslintrc.js") or utils.root_has_file(".eslintrc.cjs")
or utils.root_has_file(".eslintrc.cjs")
end, end,
filetypes = { filetypes = {
"javascript", "javascript",
@ -966,8 +966,7 @@ return {
opts = { opts = {
options = { options = {
custom_commentstring = function() custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
or vim.bo.commentstring
end, end,
}, },
}, },
@ -1125,9 +1124,9 @@ return {
{ {
"theprimeagen/refactoring.nvim", "theprimeagen/refactoring.nvim",
}, },
-- { {
-- "github/copilot.vim", "github/copilot.vim",
-- }, },
{ {
"eandrju/cellular-automaton.nvim", "eandrju/cellular-automaton.nvim",
}, },
@ -1137,6 +1136,26 @@ return {
{ {
"mbbill/undotree", "mbbill/undotree",
}, },
{
"skywind3000/asyncrun.vim",
cmd = { "AsyncRun", "AsyncStop" },
keys = {
{
"<leader>cc",
function()
local input = vim.fn.input("Command: ")
vim.cmd("AsyncRun " .. input)
-- vim.cmd("sleep 1")
-- vim.cmd("copen")
end,
desc = "AsyncRun",
},
{ "<leader>ck", desc = "AsyncStop" },
},
config = function()
vim.g.asyncrun_open = 6
end,
},
-- Folke -- Folke
{ {
@ -1308,16 +1327,12 @@ return {
mode = "search", mode = "search",
exclude = { exclude = {
function(win) function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
~= "TelescopeResults"
end, end,
}, },
}, },
action = function(match) action = function(match)
local picker = local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
require("telescope.actions.state").get_current_picker(
prompt_bufnr
)
picker:set_selection(match.pos[1] - 1) picker:set_selection(match.pos[1] - 1)
end, end,
}) })
@ -1341,37 +1356,37 @@ return {
}, },
-- Copilot Lualine -- Copilot Lualine
{ -- {
"nvim-lualine/lualine.nvim", -- "nvim-lualine/lualine.nvim",
-- optional = true, -- -- optional = true,
event = "VeryLazy", -- event = "VeryLazy",
opts = function(_, opts) -- opts = function(_, opts)
local Util = require("rayandrew.util") -- local Util = require("rayandrew.util")
local colors = { -- local colors = {
[""] = Util.fg("Special"), -- [""] = Util.fg("Special"),
["Normal"] = Util.fg("Special"), -- ["Normal"] = Util.fg("Special"),
["Warning"] = Util.fg("DiagnosticError"), -- ["Warning"] = Util.fg("DiagnosticError"),
["InProgress"] = Util.fg("DiagnosticWarn"), -- ["InProgress"] = Util.fg("DiagnosticWarn"),
} -- }
table.insert(opts.sections.lualine_x, 2, { -- table.insert(opts.sections.lualine_x, 2, {
function() -- function()
local icon = require("rayandrew.themes").icons.kinds.Copilot -- local icon = require("rayandrew.themes").icons.kinds.Copilot
local status = require("copilot.api").status.data -- local status = require("copilot.api").status.data
return icon .. (status.message or "") -- return icon .. (status.message or "")
end, -- end,
cond = function() -- cond = function()
local ok, clients = -- local ok, clients =
pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 }) -- pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
return ok and #clients > 0 -- return ok and #clients > 0
end, -- end,
color = function() -- color = function()
if not package.loaded["copilot"] then -- if not package.loaded["copilot"] then
return -- return
end -- end
local status = require("copilot.api").status.data -- local status = require("copilot.api").status.data
return colors[status.status] or colors[""] -- return colors[status.status] or colors[""]
end, -- end,
}) -- })
end, -- end,
}, -- },
} }

View file

@ -6,118 +6,43 @@ local Util = require("rayandrew.util")
Util.map("n", "<leader>fs", "<cmd>w<cr><esc>", { desc = "Save file" }) Util.map("n", "<leader>fs", "<cmd>w<cr><esc>", { desc = "Save file" })
Util.map( Util.map({ "i", "v", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
{ "i", "v", "n", "s" },
"<C-s>",
"<cmd>w<cr><esc>",
{ desc = "Save file" }
)
-- Move Lines -- Move Lines
Util.map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" }) Util.map("n", "<C-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
Util.map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" }) Util.map("n", "<C-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
Util.map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" }) Util.map("i", "<C-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
Util.map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" }) Util.map("i", "<C-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
Util.map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" }) Util.map("v", "<C-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
Util.map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" }) Util.map("v", "<C-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
------------------------------ ------------------------------
-- Windowing + Navigation -- Windowing + Navigation
------------------------------ ------------------------------
-- better up/down -- better up/down
Util.map( Util.map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
{ "n", "x" }, Util.map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
"j",
"v:count == 0 ? 'gj' : 'j'",
{ expr = true, silent = true }
)
Util.map(
{ "n", "x" },
"k",
"v:count == 0 ? 'gk' : 'k'",
{ expr = true, silent = true }
)
-- resize -- resize
Util.map( Util.map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
"n", Util.map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
"<C-Up>", Util.map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
"<cmd>resize +2<cr>", Util.map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
{ desc = "Increase window height" }
)
Util.map(
"n",
"<C-Down>",
"<cmd>resize -2<cr>",
{ desc = "Decrease window height" }
)
Util.map(
"n",
"<C-Left>",
"<cmd>vertical resize -2<cr>",
{ desc = "Decrease window width" }
)
Util.map(
"n",
"<C-Right>",
"<cmd>vertical resize +2<cr>",
{ desc = "Increase window width" }
)
-- split -- split
Util.map( Util.map("n", "<leader>ws", "<cmd>split<cr>", { desc = "[W]indow Horizontal [S]plit" }) -- split horizontal
"n", Util.map("n", "<leader>wv", "<cmd>vsplit<cr>", { desc = "[W]indow [V]ertical Split" }) -- split vertical
"<leader>ws",
"<cmd>split<cr>",
{ desc = "[W]indow Horizontal [S]plit" }
) -- split horizontal
Util.map(
"n",
"<leader>wv",
"<cmd>vsplit<cr>",
{ desc = "[W]indow [V]ertical Split" }
) -- split vertical
-- move -- move
Util.map( Util.map("n", "<leader>wh", "<cmd>TmuxNavigateLeft<cr>", { desc = "Go to Left [W]indow" })
"n", Util.map("n", "<leader>wj", "<cmd>TmuxNavigateDown<cr>", { desc = "Go to [W]indow Below" })
"<leader>wh", Util.map("n", "<leader>wk", "<cmd>TmuxNavigateUp<cr>", { desc = "Go to Top [W]indow" })
"<cmd>TmuxNavigateLeft<cr>", Util.map("n", "<leader>wl", "<cmd>TmuxNavigateRight<cr>", { desc = "Go to Right [W]indow" })
{ desc = "Go to Left [W]indow" }
)
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>wl",
"<cmd>TmuxNavigateRight<cr>",
{ desc = "Go to Right [W]indow" }
)
if Util.has("bufferline.nvim") then if Util.has("bufferline.nvim") then
Util.map( Util.map("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
"n", Util.map("n", "<S-l>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
"<S-h>",
"<cmd>BufferLineCyclePrev<cr>",
{ desc = "Prev buffer" }
)
Util.map(
"n",
"<S-l>",
"<cmd>BufferLineCycleNext<cr>",
{ desc = "Next buffer" }
)
Util.map("n", "[b", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" }) Util.map("n", "[b", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
Util.map("n", "]b", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" }) Util.map("n", "]b", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
else else
@ -133,12 +58,7 @@ Util.map("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First Tab" })
Util.map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" }) Util.map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
Util.map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" }) Util.map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
Util.map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" }) Util.map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
Util.map( Util.map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
"n",
"<leader><tab>[",
"<cmd>tabprevious<cr>",
{ desc = "Previous Tab" }
)
-- close -- close
Util.map("n", "<leader>wq", "<C-w>q", { desc = "[W]indow [Q]uit" }) -- quit Util.map("n", "<leader>wq", "<C-w>q", { desc = "[W]indow [Q]uit" }) -- quit
@ -179,10 +99,7 @@ Util.map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
-- lazygit -- lazygit
Util.map("n", "<leader>gg", function() Util.map("n", "<leader>gg", function()
Util.float_term( Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false })
{ "lazygit" },
{ cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }
)
end, { desc = "Lazygit (root dir)" }) end, { desc = "Lazygit (root dir)" })
Util.map("n", "<leader>gG", function() Util.map("n", "<leader>gG", function()
Util.float_term({ "lazygit" }, { esc_esc = false, ctrl_hjkl = false }) Util.float_term({ "lazygit" }, { esc_esc = false, ctrl_hjkl = false })

View file

@ -16,8 +16,7 @@ end
function M.fg(name) function M.fg(name)
---@type {foreground?:number}? ---@type {foreground?:number}?
local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) or vim.api.nvim_get_hl_by_name(name, true)
or vim.api.nvim_get_hl_by_name(name, true)
local fg = hl and hl.fg or hl.foreground local fg = hl and hl.fg or hl.foreground
return fg and { fg = string.format("#%06x", fg) } return fg and { fg = string.format("#%06x", fg) }
end end
@ -106,12 +105,7 @@ function M.telescope(builtin, opts)
local line = action_state.get_current_line() local line = action_state.get_current_line()
M.telescope( M.telescope(
params.builtin, params.builtin,
vim.tbl_deep_extend( vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
"force",
{},
params.opts or {},
{ cwd = false, default_text = line }
)
)() )()
end) end)
return true return true

View file

@ -1,3 +1,3 @@
indent_type = "Spaces" indent_type = "Spaces"
indent_width = 2 indent_width = 2
column_width = 80 column_width = 120