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" },
"asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" },
"bufferline.nvim": { "branch": "main", "commit": "99f0932365b34e22549ff58e1bea388465d15e99" },
"cellular-automaton.nvim": { "branch": "main", "commit": "679943b8e1e5ef79aaeeaf4b00782c52eb4e928f" },
"cloak.nvim": { "branch": "main", "commit": "c6a92e2fbc6b931bc9ed0d07e80931c2324e05cb" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" },
"copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" },
"copilot.vim": { "branch": "release", "commit": "a4a6d6b3f9e284e7f5c849619e06cd228cad8abd" },
"dressing.nvim": { "branch": "master", "commit": "829bc80400651aea31b03d8fc9a99135512fe67a" },
"flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
@ -24,10 +24,10 @@
"nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
"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-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-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" },
@ -37,12 +37,12 @@
"readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" },
"refactoring.nvim": { "branch": "master", "commit": "5359e74291164fcaeaaecdea9ba753ad54eb53d0" },
"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" },
"trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"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-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },

View file

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

View file

@ -8,7 +8,8 @@ return {
"dstein64/vim-startuptime",
-- lazy-load on a command
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()
vim.g.startuptime_tries = 10
end,
@ -71,15 +72,15 @@ return {
end,
desc = "Find Files (cwd)",
},
{
"<c-p>",
function()
local Util = require("rayandrew.util")
local fun = Util.telescope("git_files")
fun()
end,
desc = "Find Git Files",
},
-- {
-- "<c-p>",
-- function()
-- local Util = require("rayandrew.util")
-- local fun = Util.telescope("git_files")
-- fun()
-- end,
-- desc = "Find Git Files",
-- },
{
"<space>sm",
function()
@ -114,9 +115,7 @@ return {
-- disable rtp plugin, as we only need its queries for mini.ai
-- In case other textobject modules are enabled, we will load them
-- once nvim-treesitter is loaded
require("lazy.core.loader").disable_rtp_plugin(
"nvim-treesitter-textobjects"
)
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
load_textobjects = true
end,
},
@ -181,8 +180,7 @@ return {
if opts.textobjects[mod] and opts.textobjects[mod].enable then
local Loader = require("lazy.core.loader")
Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil
local plugin =
require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
local plugin = require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
require("lazy.core.loader").source_runtime(plugin.dir, "plugin")
break
end
@ -461,6 +459,13 @@ return {
"notify",
"toggleterm",
"lazyterm",
"qf",
},
buftype_exclude = {
"terminal",
"nofile",
"quickfix",
"prompt",
},
show_trailing_blankline_indent = false,
show_current_context = false,
@ -629,19 +634,19 @@ return {
},
-- Copilot
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
markdown = true,
help = true,
},
},
},
-- {
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- build = ":Copilot auth",
-- opts = {
-- suggestion = { enabled = false },
-- panel = { enabled = false },
-- filetypes = {
-- markdown = true,
-- help = true,
-- },
-- },
-- },
-- Autocompletion
{
@ -649,23 +654,24 @@ return {
event = "InsertEnter",
dependencies = {
{ "L3MON4D3/LuaSnip", build = "make install_jsregexp" },
{
"zbirenbaum/copilot-cmp",
dependencies = "copilot.lua",
opts = {},
config = function(_, opts)
local Util = require("rayandrew.util")
local copilot_cmp = require("copilot_cmp")
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
Util.on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end)
end,
},
-- {
-- "zbirenbaum/copilot-cmp",
-- dependencies = "copilot.lua",
-- enabled = false,
-- opts = {},
-- config = function(_, opts)
-- local Util = require("rayandrew.util")
-- local copilot_cmp = require("copilot_cmp")
-- copilot_cmp.setup(opts)
-- -- attach cmp source whenever copilot attaches
-- -- fixes lazy-loading issues with the copilot cmp source
-- Util.on_attach(function(client)
-- if client.name == "copilot" then
-- copilot_cmp._on_insert_enter({})
-- end
-- end)
-- end,
-- },
},
config = function()
require("lsp-zero.cmp").extend()
@ -677,7 +683,7 @@ return {
cmp.setup({
sources = {
{ name = "copilot", group_index = 2 },
-- { name = "copilot", group_index = 2 },
{ name = "nvim_lsp", group_index = 2 },
{ name = "path", group_index = 2 },
{ name = "luasnip", group_index = 2 },
@ -844,12 +850,7 @@ return {
config = function(_, opts)
local nls = require("null-ls")
nls.setup({
root_dir = require("null-ls.utils").root_pattern(
".null-ls-root",
".neoconf.json",
"Makefile",
".git"
),
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
sources = {
nls.builtins.completion.spell,
nls.builtins.code_actions.gitsigns,
@ -862,8 +863,7 @@ return {
-- js/ts linter
-- only enable eslint if root has .eslintrc.js (not in youtube nvim video)
condition = function(utils)
return utils.root_has_file(".eslintrc.js")
or utils.root_has_file(".eslintrc.cjs")
return utils.root_has_file(".eslintrc.js") or utils.root_has_file(".eslintrc.cjs")
end,
filetypes = {
"javascript",
@ -966,8 +966,7 @@ return {
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring()
or vim.bo.commentstring
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
end,
},
},
@ -1125,9 +1124,9 @@ return {
{
"theprimeagen/refactoring.nvim",
},
-- {
-- "github/copilot.vim",
-- },
{
"github/copilot.vim",
},
{
"eandrju/cellular-automaton.nvim",
},
@ -1137,6 +1136,26 @@ return {
{
"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
{
@ -1308,16 +1327,12 @@ return {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype
~= "TelescopeResults"
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
end,
},
},
action = function(match)
local picker =
require("telescope.actions.state").get_current_picker(
prompt_bufnr
)
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
picker:set_selection(match.pos[1] - 1)
end,
})
@ -1341,37 +1356,37 @@ return {
},
-- Copilot Lualine
{
"nvim-lualine/lualine.nvim",
-- optional = true,
event = "VeryLazy",
opts = function(_, opts)
local Util = require("rayandrew.util")
local colors = {
[""] = Util.fg("Special"),
["Normal"] = Util.fg("Special"),
["Warning"] = Util.fg("DiagnosticError"),
["InProgress"] = Util.fg("DiagnosticWarn"),
}
table.insert(opts.sections.lualine_x, 2, {
function()
local icon = require("rayandrew.themes").icons.kinds.Copilot
local status = require("copilot.api").status.data
return icon .. (status.message or "")
end,
cond = function()
local ok, clients =
pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
return ok and #clients > 0
end,
color = function()
if not package.loaded["copilot"] then
return
end
local status = require("copilot.api").status.data
return colors[status.status] or colors[""]
end,
})
end,
},
-- {
-- "nvim-lualine/lualine.nvim",
-- -- optional = true,
-- event = "VeryLazy",
-- opts = function(_, opts)
-- local Util = require("rayandrew.util")
-- local colors = {
-- [""] = Util.fg("Special"),
-- ["Normal"] = Util.fg("Special"),
-- ["Warning"] = Util.fg("DiagnosticError"),
-- ["InProgress"] = Util.fg("DiagnosticWarn"),
-- }
-- table.insert(opts.sections.lualine_x, 2, {
-- function()
-- local icon = require("rayandrew.themes").icons.kinds.Copilot
-- local status = require("copilot.api").status.data
-- return icon .. (status.message or "")
-- end,
-- cond = function()
-- local ok, clients =
-- pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
-- return ok and #clients > 0
-- end,
-- color = function()
-- if not package.loaded["copilot"] then
-- return
-- end
-- local status = require("copilot.api").status.data
-- return colors[status.status] or colors[""]
-- 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(
{ "i", "v", "n", "s" },
"<C-s>",
"<cmd>w<cr><esc>",
{ desc = "Save file" }
)
Util.map({ "i", "v", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
-- Move Lines
Util.map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
Util.map("n", "<A-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", "<A-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", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
Util.map("n", "<C-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
Util.map("n", "<C-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
Util.map("i", "<C-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
Util.map("i", "<C-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
Util.map("v", "<C-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
Util.map("v", "<C-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
------------------------------
-- Windowing + Navigation
------------------------------
-- better up/down
Util.map(
{ "n", "x" },
"j",
"v:count == 0 ? 'gj' : 'j'",
{ expr = true, silent = true }
)
Util.map(
{ "n", "x" },
"k",
"v:count == 0 ? 'gk' : 'k'",
{ expr = true, silent = true }
)
Util.map({ "n", "x" }, "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
Util.map(
"n",
"<C-Up>",
"<cmd>resize +2<cr>",
{ 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" }
)
Util.map("n", "<C-Up>", "<cmd>resize +2<cr>", { 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
Util.map(
"n",
"<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
Util.map("n", "<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
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>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>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>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
Util.map(
"n",
"<S-h>",
"<cmd>BufferLineCyclePrev<cr>",
{ desc = "Prev buffer" }
)
Util.map(
"n",
"<S-l>",
"<cmd>BufferLineCycleNext<cr>",
{ desc = "Next buffer" }
)
Util.map("n", "<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>BufferLineCycleNext<cr>", { desc = "Next buffer" })
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>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
Util.map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
Util.map(
"n",
"<leader><tab>[",
"<cmd>tabprevious<cr>",
{ desc = "Previous Tab" }
)
Util.map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
-- close
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
Util.map("n", "<leader>gg", function()
Util.float_term(
{ "lazygit" },
{ cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }
)
Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false })
end, { desc = "Lazygit (root dir)" })
Util.map("n", "<leader>gG", function()
Util.float_term({ "lazygit" }, { esc_esc = false, ctrl_hjkl = false })

View file

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

View file

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