Merge branch 'update-nvim'
This commit is contained in:
commit
c92e7d43a9
35 changed files with 990 additions and 998 deletions
2
nvim/after/ftplugin/go.lua
Normal file
2
nvim/after/ftplugin/go.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- quick way to handle errors in Go
|
||||
vim.keymap.set("n", "<leader>ee", "oif err != nil {<CR>}<ESC>Oreturn err<ESC>")
|
||||
|
|
@ -1,17 +1,18 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local Utils = require("juancwu.utils")
|
||||
require("juancwu.config").setup({
|
||||
colorscheme = Utils.colors.get_timebased_colorscheme(),
|
||||
})
|
||||
require("juancwu.config").setup({})
|
||||
|
|
|
|||
|
|
@ -1,49 +1,46 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b3104910bb5ebf40492aadffae18f2528fa757d9" },
|
||||
"catppuccin": { "branch": "main", "commit": "f19cab18ec4dc86d415512c7a572863b2adbcc18" },
|
||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"catppuccin": { "branch": "main", "commit": "8c4125e3c746976ba025dc5d908fa22c6aa09486" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
|
||||
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "ed4dc336a73c18da6fea6e1cf7ad6e1b76d281eb" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a1067cf84b4ff81b66d2bf4d01f4cbdb5de40bd0" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1d77bd86e1c3eaa777010c95dad455b83823f247" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||
"mini.nvim": { "branch": "main", "commit": "256d35c9e24c9cf5f5da568e121e988c6ceb1e3f" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-lint": { "branch": "master", "commit": "0864f81c681e15d9bdc1156fe3a17bd07db5a3ed" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b3cce1419ca67871ae782b3e529652f8a016f0de" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
|
||||
"mini.nvim": { "branch": "main", "commit": "d1a91582bf2d16026ae84292874c70fb2d0ffe42" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
||||
"nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a9b2fb560c4ab22c10728fd5149dbd7b62aa4f69" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "a9742cbc1f95db9eaf3293bf8cd0622ca36542bb" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
|
||||
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "de495fabe171d48aed5525f002d14414efcecbb2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "9ab9dade85d8c7d411cc89b592028da3d1b7955a" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "bfd67f1402b97ac619cb538f4bbaed12a7fa89aa" },
|
||||
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||
"solarized-osaka.nvim": { "branch": "main", "commit": "f796014c14b1910e08d42cc2077fef34f08e0295" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "14fd5ff7f84027064724ec3157fe903199e77ded" },
|
||||
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "4fe1b0c44f5d6ee769cdfbdffc7ccb703f53feda" },
|
||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ local M = {}
|
|||
---@class ConfigOptions
|
||||
local defaultOpts = {
|
||||
---@type string | fun()
|
||||
colorscheme = "rose-pine",
|
||||
colorscheme = "catppuccin",
|
||||
}
|
||||
|
||||
vim.g.disable_autoformat = false
|
||||
|
|
@ -58,13 +58,6 @@ function M.setup(opts)
|
|||
vim.api.nvim_create_user_command("FormatEnable", function(args)
|
||||
vim.g.disable_autoformat = false
|
||||
end, { desc = "Enable Autoformat" })
|
||||
|
||||
-- create command to toggle colorscheme
|
||||
vim.api.nvim_create_user_command(
|
||||
"ToggleColors",
|
||||
require("juancwu.utils.colors").toggle_colors,
|
||||
{ desc = "Toggle colorscheme" }
|
||||
)
|
||||
end
|
||||
|
||||
setmetatable(M, {
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
|||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- keymap below needs a better combo, need this to enable macros
|
||||
-- vim.keymap.set("n", "<leader>q", "q", { noremap = true })
|
||||
|
||||
-- select and replace
|
||||
vim.keymap.set("n", "<leader>ss", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
|
|
@ -48,6 +45,7 @@ vim.keymap.set("n", "dw", '"_dw')
|
|||
vim.keymap.set("n", "db", 'vb"_d') -- delete in backwards
|
||||
|
||||
vim.keymap.set("n", "<C-a>", "gg<S-v>G") -- select all
|
||||
|
||||
-- split pane
|
||||
vim.keymap.set("n", "ss", ":split<Return><C-w>w", { silent = true }) -- horizontal
|
||||
vim.keymap.set("n", "sv", ":vsplit<Return><C-w>w", { silent = true }) -- vertical
|
||||
|
|
@ -60,19 +58,10 @@ vim.keymap.set("n", "sl", "<C-w>l")
|
|||
vim.keymap.set("n", "sj", "<C-w>j")
|
||||
|
||||
-- resize pane
|
||||
vim.keymap.set("n", "<C-w><left>", "<C-w><")
|
||||
vim.keymap.set("n", "<C-w><right>", "<C-w>>")
|
||||
vim.keymap.set("n", "<C-w><up>", "<C-w>+")
|
||||
vim.keymap.set("n", "<C-w><down>", "<C-w>-")
|
||||
|
||||
-- my arrow keys babyyyy
|
||||
vim.keymap.set("i", "<C-h>", "<Left>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-j>", "<Down>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-k>", "<Up>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-l>", "<Right>", { noremap = true })
|
||||
vim.keymap.set("n", "<C-w><left>", "<C-w>5>")
|
||||
vim.keymap.set("n", "<C-w><right>", "<C-w>5<")
|
||||
vim.keymap.set("n", "<C-w><up>", "<C-w>5+")
|
||||
vim.keymap.set("n", "<C-w><down>", "<C-w>5-")
|
||||
|
||||
-- lazygit on floaterm
|
||||
vim.keymap.set("n", "<leader>g", "<cmd>FloatermNew lazygit<CR>", { noremap = true })
|
||||
|
||||
-- quick way to handle errors in Go
|
||||
vim.keymap.set("n", "<leader>ee", "oif err != nil {<CR>}<ESC>Oreturn err<ESC>")
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ vim.opt.ignorecase = true -- case-insensitive search
|
|||
vim.opt.backspace = { "start", "eol", "indent" }
|
||||
|
||||
-- don't want to look into these...
|
||||
vim.opt.wildignore:append({ "*/node_modules/*", "*/__pycache__/*" })
|
||||
vim.opt.wildignore:append({ "*/node_modules/*", "*/__pycache__/*", "*/vendor/*" })
|
||||
|
||||
-- add '*' in block comments
|
||||
vim.opt.formatoptions:append({ "r" })
|
||||
|
|
|
|||
|
|
@ -1,93 +1,139 @@
|
|||
return { -- Autocompletion
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (function()
|
||||
-- Build Step is needed for regex support in snippets.
|
||||
-- This step is not supported in many windows environments.
|
||||
-- Remove the below condition to re-enable on windows.
|
||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
return
|
||||
end
|
||||
return "make install_jsregexp"
|
||||
end)(),
|
||||
dependencies = {
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
config = function()
|
||||
-- See `:help cmp`
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
luasnip.config.setup({})
|
||||
-- return { -- Autocompletion
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- event = "InsertEnter",
|
||||
-- dependencies = {
|
||||
-- -- Snippet Engine & its associated nvim-cmp source
|
||||
-- {
|
||||
-- "L3MON4D3/LuaSnip",
|
||||
-- build = (function()
|
||||
-- -- Build Step is needed for regex support in snippets.
|
||||
-- -- This step is not supported in many windows environments.
|
||||
-- -- Remove the below condition to re-enable on windows.
|
||||
-- if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
-- return
|
||||
-- end
|
||||
-- return "make install_jsregexp"
|
||||
-- end)(),
|
||||
-- dependencies = {
|
||||
-- {
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
-- config = function()
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- "saadparwaiz1/cmp_luasnip",
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
-- "hrsh7th/cmp-path",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- -- See `:help cmp`
|
||||
-- local cmp = require("cmp")
|
||||
-- local luasnip = require("luasnip")
|
||||
-- luasnip.config.setup({})
|
||||
--
|
||||
-- cmp.setup({
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- luasnip.lsp_expand(args.body)
|
||||
-- end,
|
||||
-- },
|
||||
-- completion = { completeopt = "menu,menuone,noinsert" },
|
||||
--
|
||||
-- -- For an understanding of why these mappings were
|
||||
-- -- chosen, you will need to read `:help ins-completion`
|
||||
-- --
|
||||
-- -- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- -- Select the [n]ext item
|
||||
-- ["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
-- -- Select the [p]revious item
|
||||
-- ["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
--
|
||||
-- -- Scroll the documentation window [b]ack / [f]orward
|
||||
-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
--
|
||||
-- -- Accept ([y]es) the completion.
|
||||
-- -- This will auto-import if your LSP supports it.
|
||||
-- -- This will expand snippets if the LSP sent a snippet.
|
||||
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
--
|
||||
-- -- Manually trigger a completion from nvim-cmp.
|
||||
-- -- Generally you don't need this, because nvim-cmp will display
|
||||
-- -- completions whenever it has completion options available.
|
||||
-- ["<C-Space>"] = cmp.mapping.complete({}),
|
||||
--
|
||||
-- -- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- -- <c-h> is similar, except moving you backwards.
|
||||
-- ["<C-l>"] = cmp.mapping(function()
|
||||
-- if luasnip.expand_or_locally_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- ["<C-h>"] = cmp.mapping(function()
|
||||
-- if luasnip.locally_jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- }),
|
||||
-- sources = {
|
||||
-- {
|
||||
-- name = "lazydev",
|
||||
-- -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||
-- group_index = 0,
|
||||
-- },
|
||||
-- { name = "nvim_lsp" },
|
||||
-- { name = "luasnip" },
|
||||
-- { name = "path" },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
--
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = { completeopt = "menu,menuone,noinsert" },
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
|
||||
-- For an understanding of why these mappings were
|
||||
-- chosen, you will need to read `:help ins-completion`
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- Select the [n]ext item
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
-- Select the [p]revious item
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "enter" },
|
||||
signature = {
|
||||
enabled = true,
|
||||
},
|
||||
|
||||
-- Scroll the documentation window [b]ack / [f]orward
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- Accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = false } },
|
||||
|
||||
-- Manually trigger a completion from nvim-cmp.
|
||||
-- Generally you don't need this, because nvim-cmp will display
|
||||
-- completions whenever it has completion options available.
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
|
||||
-- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- <c-h> is similar, except moving you backwards.
|
||||
["<C-l>"] = cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-h>"] = cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
{
|
||||
name = "lazydev",
|
||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||
group_index = 0,
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
ft = {
|
||||
'html',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
'svelte',
|
||||
'vue',
|
||||
'tsx',
|
||||
'jsx',
|
||||
'xml',
|
||||
'php',
|
||||
'markdown',
|
||||
'astro',
|
||||
'glimmer',
|
||||
'handlebars',
|
||||
'hbs',
|
||||
'templ',
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"svelte",
|
||||
"vue",
|
||||
"tsx",
|
||||
"jsx",
|
||||
"xml",
|
||||
"php",
|
||||
"markdown",
|
||||
"astro",
|
||||
"glimmer",
|
||||
"handlebars",
|
||||
"hbs",
|
||||
"templ",
|
||||
},
|
||||
config = function()
|
||||
local autotag = require('nvim-ts-autotag')
|
||||
local autotag = require("nvim-ts-autotag")
|
||||
autotag.setup({
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ return {
|
|||
priority = 1000,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
integrations = { blink_cmp = true },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -4,31 +4,30 @@ return {
|
|||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
config = function()
|
||||
local comment = require('Comment')
|
||||
local comment = require("Comment")
|
||||
comment.setup({
|
||||
pre_hook = function(ctx)
|
||||
-- only for tsx/jsx filetypes
|
||||
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
|
||||
local U = require('Comment.utils')
|
||||
local U = require("Comment.utils")
|
||||
|
||||
-- determine wheter to use linwise or blockwise commentstring
|
||||
local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline'
|
||||
|
||||
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
|
||||
|
||||
-- determine the location where to calcualte commentstring from
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.blockwise then
|
||||
location = require('ts_context_commentstring.utils').get_cursor_location()
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require('ts_context_commentstring.utils').get_visual_start_location()
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require('ts_context_commentstring.internal').calculate_commentstring({
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = type,
|
||||
location = location,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ local formatters_by_ft = {
|
|||
yml = { "yamlfmt" },
|
||||
zig = { "zigfmt" },
|
||||
rust = { "rustfmt" },
|
||||
templ = { "templ" },
|
||||
php = { "biome" },
|
||||
blade = { "blade-formatter" },
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
@ -34,12 +37,21 @@ return {
|
|||
require("conform").setup({
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
["blade-formatter"] = {
|
||||
command = "blade-formatter",
|
||||
args = {
|
||||
"--write",
|
||||
"--stdin",
|
||||
},
|
||||
},
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
timeout_ms = 2500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end,
|
||||
|
|
@ -58,4 +70,3 @@ return {
|
|||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return {
|
|||
"GRemove",
|
||||
"GRename",
|
||||
"Glgrep",
|
||||
"Gedit"
|
||||
"Gedit",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git status" },
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ return {
|
|||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol',
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
ignore_whitespace = false
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '-' },
|
||||
changedelete = { text = '~' },
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "-" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<leader>q", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<leader>w", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<leader>e", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<leader>r", function() ui.nav_file(4) end)
|
||||
vim.keymap.set("n", "<leader>,", ui.nav_prev)
|
||||
vim.keymap.set("n", "<leader>.", ui.nav_next)
|
||||
end
|
||||
}
|
||||
|
|
@ -8,5 +8,5 @@ return {
|
|||
show_end = true,
|
||||
},
|
||||
},
|
||||
main = "ibl"
|
||||
main = "ibl",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
return {
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ return {
|
|||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
config = function()
|
||||
local lualine = require('lualine')
|
||||
local lualine = require("lualine")
|
||||
|
||||
lualine.setup {
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
--[[ section_separators = {
|
||||
|
|
@ -15,44 +15,48 @@ return {
|
|||
left = '',
|
||||
right = ''
|
||||
}, ]]
|
||||
section_separators = '',
|
||||
component_separators = '|',
|
||||
disabled_filetypes = {}
|
||||
section_separators = "",
|
||||
component_separators = "|",
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { },
|
||||
lualine_b = { },
|
||||
lualine_c = { {
|
||||
'filename',
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- display file status
|
||||
path = 1 -- no file path
|
||||
} },
|
||||
path = 1, -- no file path
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' },
|
||||
symbols = { error = ' ', warn = ' ', info = ' ', hint = '' }
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = "" },
|
||||
},
|
||||
'enconding',
|
||||
'filetype'
|
||||
"enconding",
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { {
|
||||
'filename',
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true,
|
||||
path = 1
|
||||
} },
|
||||
lualine_x = { 'location' },
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { 'fugitive' }
|
||||
}
|
||||
end
|
||||
extensions = { "fugitive" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
return {
|
||||
'Bilal2453/luvit-meta',
|
||||
"Bilal2453/luvit-meta",
|
||||
lazy = true,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ return {
|
|||
cmd = { "Neotree" },
|
||||
keys = {
|
||||
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" }
|
||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" },
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
|
@ -44,8 +44,8 @@ return {
|
|||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = "none" -- "none", "relative", "absolute"
|
||||
}
|
||||
show_path = "none", -- "none", "relative", "absolute"
|
||||
},
|
||||
},
|
||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||
["d"] = "delete",
|
||||
|
|
@ -66,6 +66,6 @@ return {
|
|||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ return {
|
|||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
keys = {
|
||||
{ "<leader>lg", function()
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
{
|
||||
"<leader>lg",
|
||||
function()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
direction = "float",
|
||||
|
|
@ -18,7 +20,9 @@ return {
|
|||
end,
|
||||
})
|
||||
lazygit:toggle()
|
||||
end, desc = "Open lazygit in a floating window" },
|
||||
end,
|
||||
desc = "Open lazygit in a floating window",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
size = 20,
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ return {
|
|||
vim.opt.undodir = target_path
|
||||
vim.opt.undofile = true
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,37 +13,37 @@ return {
|
|||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = '<Up> ',
|
||||
Down = '<Down> ',
|
||||
Left = '<Left> ',
|
||||
Right = '<Right> ',
|
||||
C = '<C-…> ',
|
||||
M = '<M-…> ',
|
||||
D = '<D-…> ',
|
||||
S = '<S-…> ',
|
||||
CR = '<CR> ',
|
||||
Esc = '<Esc> ',
|
||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||
NL = '<NL> ',
|
||||
BS = '<BS> ',
|
||||
Space = '<Space> ',
|
||||
Tab = '<Tab> ',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
}
|
||||
}
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
---@class juancwu.utils.colors
|
||||
local M = {}
|
||||
local light = "catppuccin-latte"
|
||||
local dark = "catppuccin-mocha"
|
||||
|
||||
---@return boolean
|
||||
function M.is_daytime()
|
||||
return false
|
||||
end
|
||||
|
||||
---@return boolean
|
||||
function M.legacy_is_daytime()
|
||||
return false
|
||||
end
|
||||
|
||||
---@return string
|
||||
function M.get_timebased_colorscheme()
|
||||
if M.is_daytime() then
|
||||
vim.g.is_light_colors = true
|
||||
return light
|
||||
else
|
||||
vim.g.is_light_colors = false
|
||||
return dark
|
||||
end
|
||||
end
|
||||
|
||||
function M.toggle_colors()
|
||||
if vim.g.is_light_colors then
|
||||
vim.g.is_light_colors = false
|
||||
vim.cmd.colorscheme(dark)
|
||||
else
|
||||
vim.g.is_light_colors = true
|
||||
vim.cmd.colorscheme(light)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
---@class Utils
|
||||
---@field os juancwu.utils.os
|
||||
---@field colors juancwu.utils.colors
|
||||
local M = setmetatable({}, {
|
||||
__index = function(t, k)
|
||||
t[k] = require("juancwu.utils." .. k)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
indent_width = 4
|
||||
column_width = 120
|
||||
|
|
@ -6,6 +6,7 @@ alias ll="lsd -alF"
|
|||
alias la="lsd -A"
|
||||
alias l="lsd -CF"
|
||||
alias lg="lazygit"
|
||||
alias vim="nvim"
|
||||
|
||||
# Nice line headers for logs
|
||||
ERROR=$'\033[39;41mERROR:\033[0m'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue