feat(nvim): pcall everything, minor updates

This commit is contained in:
winston 2023-01-04 13:32:59 +01:00
parent 8670166cba
commit 52dae9143e
Signed by: winston
GPG key ID: 3786770EDBC2B481
13 changed files with 118 additions and 89 deletions

View file

@ -1,4 +1,7 @@
require("bufferline").setup({
local present, bufferline = pcall(require, "bufferline")
if not present then return end
bufferline.setup({
highlights = require("catppuccin.groups.integrations.bufferline").get(),
options = {
show_close_icon = false,

View file

@ -1,6 +1,8 @@
vim.g.catppuccin_flavour = "mocha"
local present, catppuccin = pcall(require, "catppuccin")
if not present then return end
if not present then
return
end
catppuccin.setup({
dim_inactive = {

View file

@ -1,4 +1,7 @@
require("colorizer").setup({
local present, colorizer = pcall(require, "colorizer")
if not present then return end
colorizer.setup({
user_default_options = {
RGB = true,
RRGGBB = true,
@ -17,6 +20,7 @@ require("colorizer").setup({
buftypes = {
"*",
"!dashboard",
"!lazy",
"!popup",
"!prompt",
},

View file

@ -51,20 +51,20 @@ db.custom_center = {
{
icon = "",
desc = pad("Restore last session"),
shortcut = "SPC s l",
shortcut = " s l",
action = "SessionLoad",
},
{
icon = "",
desc = pad("Open Projects"),
action = "Telescope project",
shortcut = "SPC f p",
shortcut = " f p",
},
{
icon = "",
desc = pad("File Browser"),
action = "Telescope file_browser",
shortcut = "SPC f b",
shortcut = " f b",
},
{
icon = "",
@ -73,7 +73,7 @@ db.custom_center = {
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
require("telescope.builtin").find_files({ cwd = confpath })
end,
shortcut = "SPC f s",
shortcut = " f s",
},
}

View file

@ -1,5 +1,4 @@
local ctp_present, clrs = pcall(require, "catppuccin.palettes")
local _, ctp_feline = pcall(require, "catppuccin.groups.integrations.feline")
local ctp_present, ctp_feline = pcall(require, "catppuccin.groups.integrations.feline")
local present, feline = pcall(require, "feline")
if not present then
@ -7,7 +6,7 @@ if not present then
end
if ctp_present then
clrs = clrs.get_palette("catppuccin")
local clrs = require("catppuccin.palettes").get_palette()
ctp_feline.setup({
assets = {
left_separator = "",
@ -19,6 +18,13 @@ if ctp_present then
git = {
branch = "",
},
lsp = {
server = "",
error = "",
warning = "",
info = "",
hint = "",
},
},
sett = {
show_modified = true,

View file

@ -1,11 +1,15 @@
require("indent_blankline").setup({
local present, indent_blankline = pcall(require, "indent_blankline")
if not present then return end
indent_blankline.setup({
space_char_blankline = " ",
})
vim.g.indent_blankline_filetype_exclude = {
"dashboard",
"help",
"neogitstatus",
"fugitive",
"help",
"lazy",
"NvimTree",
"neogitstatus",
"Trouble",
}

View file

@ -311,6 +311,11 @@ lspconfig.ltex.setup({
})
-- }}}
lspconfig.teal_ls.setup({
on_attach = on_attach,
capabilities = capabilities,
})
-- Null LS {{{
local null = require("null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})

View file

@ -1,4 +1,10 @@
local telescope = require("telescope")
local present, telescope = pcall(require, "telescope")
if not present then return end
pcall(telescope.load_extension, "fzf")
pcall(telescope.load_extension, "asynctasks")
pcall(telescope.load_extension, "file_browser")
pcall(telescope.load_extension, "project")
telescope.setup({
defaults = {
@ -15,9 +21,8 @@ telescope.setup({
},
})
local present, easypick = pcall(require, "easypick")
if not present then return end
local ep_present, easypick = pcall(require, "easypick")
if not ep_present then return end
easypick.setup({
pickers = { {
@ -26,6 +31,3 @@ easypick.setup({
previewer = easypick.previewers.default()
} }
})
telescope.load_extension("fzf")

View file

@ -1,4 +1,7 @@
require("nvim-treesitter.configs").setup({
local present, treesitter = pcall(require, "nvim-treesitter.configs")
if not present then return end
treesitter.setup({
auto_install = true,
ignore_install = {
"phpdoc",
@ -16,34 +19,18 @@ require("nvim-treesitter.configs").setup({
"css",
"dockerfile",
"go",
"gomod",
"graphql",
"help",
"hjson",
"html",
"http",
"javascript",
"jsdoc",
"json",
"json5",
"jsonc",
"latex",
"lua",
"make",
"markdown",
"php",
"prisma",
"python",
"regex",
"rust",
"scss",
"sql",
"svelte",
"teal",
"toml",
"tsx",
"typescript",
"vim",
"yaml",
},
})

View file

@ -1,10 +1,11 @@
local wk = require("which-key")
wk.setup({
key_labels = {
["<space>"] = "SPC",
["<leader>"] = "SPC",
["<space>"] = "",
["<leader>"] = "",
["<cr>"] = "",
["<tab>"] = "",
["<esc>"] = "",
},
window = {
border = "double",

View file

@ -1,9 +1,9 @@
{
"Comment.nvim": { "branch": "master", "commit": "5f01c1a89adafc52bf34e3bf690f80d9d726715d" },
"Comment.nvim": { "branch": "master", "commit": "7bb563ff2d811a63b207e9de63e3e9c0877cb6d5" },
"asyncrun.vim": { "branch": "master", "commit": "ea59f760c223100edcffc52ffe019f502a792039" },
"asynctasks.vim": { "branch": "master", "commit": "784a4b1f75a913cc6c43dd6c4dbe69d648dbbfa5" },
"bufferline.nvim": { "branch": "main", "commit": "4ecfa81e470a589e74adcde3d5bb1727dd407363" },
"catppuccin": { "branch": "main", "commit": "55f43a952856bc0029e6cef066297c6cfab3451d" },
"bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" },
"catppuccin": { "branch": "main", "commit": "3020af75aae098a77737d91ee37c7147c8450d99" },
"chezmoi.vim": { "branch": "main", "commit": "df01e4108be9f2e4092cd753ebfb46d04e6e47ce" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" },
@ -12,59 +12,61 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
"copilot.lua": { "branch": "master", "commit": "81eb5d1bc2eddad5ff0b4e3c1c4be5c09bdfaa63" },
"easypick.nvim": { "branch": "main", "commit": "08390110ef1ceb15507a98c2dc984880890b5810" },
"dashboard-nvim": { "branch": "master", "commit": "e517188dab55493fb9034b4d4f1a508ccacfcd45" },
"easypick.nvim": { "branch": "main", "commit": "acfb53aa35d75fdc938b8818321bed770b6c9f92" },
"editorconfig.nvim": { "branch": "master", "commit": "2af880947129f1ab776b732a4eecb92528472ef5" },
"feline.nvim": { "branch": "master", "commit": "573e6d1e213de976256c84e1cb2f55665549b828" },
"feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" },
"fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" },
"friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" },
"gitsigns.nvim": { "branch": "main", "commit": "2ab3bdf0a40bab53033048c6be75bda86316b55d" },
"go.nvim": { "branch": "master", "commit": "5cefc346e7f3955b90a7d53157e5db6b9258c510" },
"guihua.lua": { "branch": "master", "commit": "2f8939599ef04057dee6504724a2ff04fe12d758" },
"impatient.nvim": { "branch": "main", "commit": "9f7eed8133d62457f7ad2ca250eb9b837a4adeb7" },
"go.nvim": { "branch": "master", "commit": "399a3a834e03a635583d24d771dad93074afda0b" },
"guihua.lua": { "branch": "master", "commit": "38ae885e4223d2b2250b454c68b7703a647d5de1" },
"impatient.nvim": { "branch": "main", "commit": "c90e273f7b8c50a02f956c24ce4804a47f18162e" },
"indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" },
"lazy.nvim": { "branch": "main", "commit": "fd1fbefc3df2b8e92209ed932144edc49877c41e" },
"lazy.nvim": { "branch": "main", "commit": "0fadb5e1cec709de839ecd6937b338b9201734ad" },
"lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" },
"lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" },
"ltex-extra.nvim": { "branch": "master", "commit": "c5046a6eabfee378f781029323efd941fcc53483" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "5bea0e851b8f48479d2cb927cd26733b4058b2b3" },
"mason.nvim": { "branch": "main", "commit": "28408c857a8f821ff504c9383c96af22b7ca66d9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" },
"neogit": { "branch": "master", "commit": "0d6002c6af432343937283fb70791fc76fa7227c" },
"null-ls.nvim": { "branch": "main", "commit": "ef9010b2ac11e2068a8e1d5a4eff576289a1f9a4" },
"nvim-autopairs": { "branch": "master", "commit": "b5994e6547d64f781cfca853a1aa6174d238fe0e" },
"nvim-cmp": { "branch": "main", "commit": "8868cf9a09e5f3c2612a22ccb82dcc6d9f0d0d35" },
"null-ls.nvim": { "branch": "main", "commit": "647a1eeeefc43ce15d941972642210637c370471" },
"nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" },
"nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" },
"nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" },
"nvim-dap": { "branch": "master", "commit": "6f2ea9e33b48a51849ec93c6c38148a5372018e4" },
"nvim-dap": { "branch": "master", "commit": "69b7c684cd42e60b48875c580e616a70bccfdbe7" },
"nvim-dap-ui": { "branch": "master", "commit": "54365d2eb4cb9cfab0371306c6a76c913c5a67e3" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "2971ce3e89b1711cc26e27f73d3f854b559a77d4" },
"nvim-lspconfig": { "branch": "master", "commit": "5292d60976b3084a987bf5634150f6201830ac18" },
"nvim-surround": { "branch": "main", "commit": "6cc6b54d3728a17e34bb5c9b9db05c7e5690813d" },
"nvim-tree.lua": { "branch": "master", "commit": "e14c2895b4f36a22001f7773244041c173dcf867" },
"nvim-treesitter": { "branch": "master", "commit": "e8b765bee1f760b0153fb4edf2391ff5d7a85475" },
"nvim-lspconfig": { "branch": "master", "commit": "6b43ce561d97412cc512b569db6938e44529293e" },
"nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" },
"nvim-surround": { "branch": "main", "commit": "64e21061953102b19bbb22e824fbb96054782799" },
"nvim-tree.lua": { "branch": "master", "commit": "dcc344cc72a617ff01db950aedfd3b3430ba5b59" },
"nvim-treesitter": { "branch": "master", "commit": "168567efb8aa3874f3da8832dbcd3d1a4ff40d3b" },
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
"nvim-ts-rainbow": { "branch": "master", "commit": "064fd6c0a15fae7f876c2c6dd4524ca3fad96750" },
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
"playground": { "branch": "master", "commit": "3421bbbfec25a7c54ee041ffb9cb226b69b2b995" },
"playground": { "branch": "master", "commit": "8a887bcf66017bd775a0fb19c9d8b7a4d6759c48" },
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" },
"presence.nvim": { "branch": "main", "commit": "c1c54758824cbecd4e18065d37191f7666fdd097" },
"py_lsp.nvim": { "branch": "main", "commit": "9b549141d2d66f7c73902d511c543713171610d6" },
"py_lsp.nvim": { "branch": "main", "commit": "1117e5e93b8accd84df90ab74a1f943366293fe4" },
"rust-tools.nvim": { "branch": "master", "commit": "99fd1238c6068d0637df30b6cee9a264334015e9" },
"schemastore.nvim": { "branch": "main", "commit": "d1625bb74b3a7f84aad278a7968f4496ae8936c6" },
"schemastore.nvim": { "branch": "main", "commit": "0ede16cee0f69f86a406f913c0cc6507990d236b" },
"stabilize.nvim": { "branch": "master", "commit": "34069870a8e72632c5447188e638e1c6bfebc353" },
"telescope-asynctasks.nvim": { "branch": "main", "commit": "065300fb0a8ba6a1c81991da1873c73e136dcdc0" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "cad567e11131a01f2934930c1efc8b1b09a0dc56" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "eb4f026735f781ea5749331a5059021328d6eee8" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" },
"telescope-project.nvim": { "branch": "master", "commit": "ff4d3cea905383a67d1a47b9dd210c4907d858c2" },
"telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" },
"telescope-project.nvim": { "branch": "master", "commit": "8e8ee37b7210761502cdf2c3a82b5ba8fb5b2972" },
"telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" },
"true-zen.nvim": { "branch": "main", "commit": "98740c76254c65576ec294551028b65081053588" },
"vim-astro": { "branch": "main", "commit": "34732be5e9a5c28c2409f4490edf92d46d8b55a9" },
"vim-dadbod": { "branch": "master", "commit": "34151ccce9f5ff16229b8e482a97e46997914cb3" },
"vim-dadbod": { "branch": "master", "commit": "a09e40664e9cd30cd2b3f8866b796598302070f6" },
"vim-dadbod-completion": { "branch": "master", "commit": "e71eb6140556c5ced80de6299a1fdfe22bd3c1b1" },
"vim-dadbod-ui": { "branch": "master", "commit": "6a2b841d2f0b82386c637ce4e9954ae12c7eaee8" },
"vim-fugitive": { "branch": "master", "commit": "5b0b138483de17a8fd8dfcec0b491782c8fbf102" },
"vim-dadbod-ui": { "branch": "master", "commit": "ecf07480687a13fe1bd3899270a6c9c99de51f4b" },
"vim-fugitive": { "branch": "master", "commit": "99cdb88bc64063dc4656ae53496f06fb2a394cd4" },
"vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" },
"vim-table-mode": { "branch": "master", "commit": "9555a3e6e5bcf285ec181b7fc983eea90500feb4" },
"vim-vsnip": { "branch": "master", "commit": "8dde8c0ef10bb1afdbb301e2bd7eb1c153dd558e" },
"which-key.nvim": { "branch": "main", "commit": "61553aeb3d5ca8c11eea8be6eadf478062982ac9" }
"which-key.nvim": { "branch": "main", "commit": "8682d3003595017cd8ffb4c860a07576647cc6f8" }
}

View file

@ -17,6 +17,11 @@ map("n", "gdh", ":diffget //2<CR>")
map("n", "gdl", ":diffget //3<CR>")
-- escape :terminal easier
map("t", "<Esc>", "<C-\\><C-n>")
-- keep cursor in the middle when scrolling and searching
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
-- NvimTree
map("n", "<C-N>", ":NvimTreeToggle<CR>")

View file

@ -1,12 +1,21 @@
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", "--single-branch",
"https://github.com/folke/lazy.nvim.git", lazypath
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
vim.api.nvim_create_user_command("LazySyncOneshot", function()
require("lazy").sync({ wait = true })
vim.cmd("qa")
end, {})
local plugins = {
-- startup time or some shit
"lewis6991/impatient.nvim",
@ -19,7 +28,7 @@ local plugins = {
-- rainbow indents
"lukas-reineke/indent-blankline.nvim",
"akinsho/bufferline.nvim",
-- "feline-nvim/feline.nvim",
"feline-nvim/feline.nvim",
-- DJI Osmo
"luukvbaal/stabilize.nvim",
-- syntax
@ -50,7 +59,7 @@ local plugins = {
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end
end,
},
{
"kylechui/nvim-surround",
@ -77,7 +86,7 @@ local plugins = {
"dhruvasagar/vim-table-mode",
config = function()
vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']])
end
end,
},
"nvchad/nvim-colorizer.lua",
-- databases
@ -97,13 +106,6 @@ local plugins = {
-- telescope
{
"nvim-telescope/telescope.nvim",
config = function()
local telescope = require("telescope")
telescope.load_extension("fzf")
telescope.load_extension("asynctasks")
telescope.load_extension("file_browser")
telescope.load_extension("project")
end,
dependencies = {
"nvim-lua/plenary.nvim",
{
@ -114,7 +116,7 @@ local plugins = {
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-project.nvim",
"axkirillov/easypick.nvim",
}
},
},
-- nvimtree
@ -123,7 +125,7 @@ local plugins = {
"nvim-tree/nvim-tree.lua",
config = function()
require("nvim-tree").setup()
end
end,
},
-- discord
@ -153,15 +155,21 @@ local plugins = {
"j-hui/fidget.nvim",
config = function()
require("fidget").setup({})
end
end,
},
"barreiroleo/ltex-extra.nvim",
"b0o/schemastore.nvim",
"HallerPatrick/py_lsp.nvim",
"simrat39/rust-tools.nvim",
{ "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } },
{ "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "theHamsta/nvim-dap-virtual-text" } },
}
{
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
"theHamsta/nvim-dap-virtual-text",
},
},
},
},
-- lua github copilot
"zbirenbaum/copilot.lua",
@ -200,8 +208,8 @@ require("lazy").setup(plugins, {
"vimballPlugin",
"zip",
"zipPlugin",
}
}
},
},
},
ui = {
icons = {
@ -217,6 +225,6 @@ require("lazy").setup(plugins, {
start = "",
task = "",
},
border = "double"
}
border = "double",
},
})