feat(nvim): debloat setup, tweak lsp
This commit is contained in:
parent
a1d56b8afd
commit
8e4e909be2
6 changed files with 407 additions and 385 deletions
|
@ -1,13 +1,13 @@
|
|||
-- vim:fdm=marker
|
||||
pcall(require, "impatient")
|
||||
pcall(require, "plugins")
|
||||
pcall(require, "lsp")
|
||||
require("impatient")
|
||||
require("plugins")
|
||||
require("lsp")
|
||||
|
||||
-- true colors
|
||||
vim.o.termguicolors = true
|
||||
-- map leader to space
|
||||
vim.g.mapleader = " "
|
||||
vim.o.cmdheight = 0
|
||||
vim.o.cmdheight = 1
|
||||
-- line numbers
|
||||
vim.o.mouse = ""
|
||||
vim.o.number = true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require("bufferline").setup({
|
||||
options = {
|
||||
show_close_icon = false,
|
||||
separator_style = "slant",
|
||||
separator_style = "thin",
|
||||
show_buffer_close_icons = false,
|
||||
offsets = { { filetype = "NvimTree" } },
|
||||
left_mouse_command = "buffer %d",
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
local home = os.getenv("HOME")
|
||||
local db = require("dashboard")
|
||||
|
||||
db.custom_header = function()
|
||||
local cringe = {
|
||||
"Have fun coding!",
|
||||
"Sisyphus wasn't forbidden to smile.",
|
||||
"Pro tip: Run :q! to exit. Now!",
|
||||
"neovim got rid of the :smile command.",
|
||||
"Pro tip: You can use :q to exit. Do it. Now!",
|
||||
}
|
||||
local random_cringe = cringe[math.random(#cringe)]
|
||||
return {
|
||||
|
@ -34,34 +33,48 @@ db.custom_header = function()
|
|||
}
|
||||
end
|
||||
|
||||
local padding = 25
|
||||
local function pad(string)
|
||||
local str = string
|
||||
for _ = 1, padding - #string do
|
||||
str = str .. " "
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
db.custom_center = {
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Projects ",
|
||||
desc = pad("Open Projects"),
|
||||
action = "Telescope project",
|
||||
shortcut = "SPC f p",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find File ",
|
||||
desc = pad("Find File"),
|
||||
action = "Telescope find_files find_command=rg,--hidden,--files",
|
||||
shortcut = "SPC f f",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "File Browser ",
|
||||
desc = pad("File Browser"),
|
||||
action = "Telescope file_browser",
|
||||
shortcut = "SPC f b",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find word ",
|
||||
desc = pad("Find word"),
|
||||
action = "Telescope live_grep",
|
||||
shortcut = "SPC f g",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Settings ",
|
||||
desc = pad("Open Settings"),
|
||||
action = function()
|
||||
vim.cmd("cd " .. home .. "/.config/nvim/")
|
||||
vim.cmd("edit init.lua")
|
||||
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||
require("telescope.builtin").find_files({ cwd = confpath })
|
||||
end,
|
||||
shortcut = "SPC f s",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ function string.starts(self, str)
|
|||
end
|
||||
|
||||
local conceal = function()
|
||||
local home = os.getenv("HOME")
|
||||
local home = vim.fn.expand("$HOME") .. "/Code/"
|
||||
local blacklist = {
|
||||
[home .. "/git/work"] = "Using nvim at work.",
|
||||
[home .. "/git/freelance"] = "Using nvim to freelance.",
|
||||
[vim.fn.resolve(home .. "work")] = "Using nvim at work.",
|
||||
[vim.fn.resolve(home .. "freelance")] = "Using nvim to freelance.",
|
||||
[vim.fn.resolve(vim.fn.stdpath("config"))] = "Stuck in the hell of nvim config.",
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,27 @@ vim.opt.completeopt = "menu,menuone,noselect"
|
|||
|
||||
local present, cmp = pcall(require, "cmp")
|
||||
if not present or not cmp then
|
||||
vim.pretty_print("cmp not found")
|
||||
return
|
||||
end
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0
|
||||
and vim.api
|
||||
.nvim_buf_get_lines(0, line - 1, line, true)[1]
|
||||
:sub(col, col)
|
||||
:match("%s")
|
||||
== nil
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(
|
||||
vim.api.nvim_replace_termcodes(key, true, true, true),
|
||||
mode,
|
||||
true
|
||||
)
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
|
@ -29,19 +46,30 @@ cmp.setup({
|
|||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
-- This little snippet will confirm with tab, and if no entry is selected, will confirm the first item
|
||||
if cmp.visible() then
|
||||
local entry = cmp.get_selected_entry()
|
||||
if not entry then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
else
|
||||
cmp.confirm()
|
||||
end
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||
end
|
||||
end, { "i", "s", "c" }),
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
|
@ -187,6 +215,3 @@ local toggle_formatters = function()
|
|||
end
|
||||
|
||||
vim.api.nvim_create_user_command("ToggleFormatters", toggle_formatters, {})
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
|
|
@ -1,23 +1,4 @@
|
|||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath("data")
|
||||
.. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
})
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
local packer = require("packer")
|
||||
|
||||
-- auto-compile when lua files in `~/.config/nvim/*` change
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
|
@ -32,343 +13,346 @@ vim.api.nvim_create_autocmd("BufWritePost", {
|
|||
end,
|
||||
})
|
||||
|
||||
return require("packer").startup(function(use)
|
||||
-- Packer managing itself
|
||||
use("wbthomason/packer.nvim")
|
||||
-- startup time or some shit
|
||||
use("lewis6991/impatient.nvim")
|
||||
return packer.startup({
|
||||
function(use)
|
||||
-- Packer managing itself
|
||||
use("wbthomason/packer.nvim")
|
||||
-- startup time or some shit
|
||||
use("lewis6991/impatient.nvim")
|
||||
|
||||
-- colour scheme
|
||||
use({
|
||||
"catppuccin/nvim",
|
||||
as = "catppuccin",
|
||||
run = ":CatppuccinCompile",
|
||||
config = function()
|
||||
require("config/catppuccin")
|
||||
end,
|
||||
})
|
||||
|
||||
-- git gutter
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("config/gitsigns")
|
||||
end,
|
||||
})
|
||||
-- rainbow indents
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
require("indent_blankline").setup({
|
||||
space_char_blankline = " ",
|
||||
show_current_conext = true,
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
})
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"neogitstatus",
|
||||
"fugitive",
|
||||
"packer",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- top bar
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
config = function()
|
||||
require("config/bufferline")
|
||||
end,
|
||||
})
|
||||
|
||||
-- bottom bar
|
||||
use({
|
||||
"feline-nvim/feline.nvim",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
after = { "catppuccin" },
|
||||
config = function()
|
||||
require("config/feline")
|
||||
end,
|
||||
})
|
||||
|
||||
-- DJI Osmo
|
||||
use({
|
||||
"luukvbaal/stabilize.nvim",
|
||||
config = function()
|
||||
require("stabilize").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
config = function()
|
||||
require("config/treesitter")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"p00f/nvim-ts-rainbow",
|
||||
requires = "nvim-treesitter/nvim-treesitter",
|
||||
})
|
||||
|
||||
-- show possible key combos
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use("alker0/chezmoi.vim")
|
||||
use("ron-rs/ron.vim")
|
||||
use("elkowar/yuck.vim")
|
||||
|
||||
-- tooling
|
||||
use("gpanders/editorconfig.nvim")
|
||||
-- read and write encrypted pgp files
|
||||
use("jamessan/vim-gnupg")
|
||||
|
||||
-- additional functionality
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
})
|
||||
use("ggandor/lightspeed.nvim")
|
||||
|
||||
use("windwp/nvim-autopairs")
|
||||
use({
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
})
|
||||
--
|
||||
-- git
|
||||
use("tpope/vim-fugitive")
|
||||
-- why not both?
|
||||
use({
|
||||
"TimUntersberger/neogit",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
Map("n", "<leader>ng", "<Cmd>Neogit<CR>")
|
||||
end,
|
||||
})
|
||||
use("dhruvasagar/vim-table-mode")
|
||||
use({
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
config = function()
|
||||
require("nvim-tree").setup({ update_cwd = true })
|
||||
Map("n", "<C-n>", ":NvimTreeToggle<CR>")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvchad/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("config/colorizer")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"simrat39/symbols-outline.nvim",
|
||||
config = function()
|
||||
require("symbols-outline").setup()
|
||||
Map("n", "<leader>so", ":SymbolsOutline<CR>")
|
||||
end,
|
||||
})
|
||||
|
||||
-- databases
|
||||
use("tpope/vim-dadbod")
|
||||
use("kristijanhusak/vim-dadbod-completion")
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
config = function()
|
||||
Map("n", "<leader>db", ":DBUIToggle<CR>")
|
||||
vim.g.db_ui_use_nerd_fonts = true
|
||||
vim.g.db_ui_win_position = "right"
|
||||
end,
|
||||
})
|
||||
|
||||
-- telescope
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
Map("n", "<leader>fr", "<cmd>Telescope asynctasks all<CR>")
|
||||
Map("n", "<leader>fb", "<cmd>Telescope buffers<CR>")
|
||||
Map("n", "<leader>ff", "<cmd>Telescope find_files<CR>")
|
||||
Map("n", "<leader>fg", "<cmd>Telescope live_grep<CR>")
|
||||
Map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
run = "make",
|
||||
requires = "nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
telescope.setup({
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("file_browser")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-project.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("project")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-packer.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("packer")
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"andweeb/presence.nvim",
|
||||
config = function()
|
||||
require("config/presence")
|
||||
end,
|
||||
})
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
||||
|
||||
-- external extensions
|
||||
use("williamboman/mason.nvim")
|
||||
-- LSP
|
||||
use("williamboman/mason-lspconfig.nvim")
|
||||
use("neovim/nvim-lspconfig")
|
||||
-- completion
|
||||
use("hrsh7th/nvim-cmp")
|
||||
use("hrsh7th/cmp-buffer")
|
||||
use("hrsh7th/cmp-cmdline")
|
||||
use("hrsh7th/cmp-nvim-lsp")
|
||||
use("hrsh7th/cmp-path")
|
||||
use("hrsh7th/cmp-vsnip")
|
||||
use("hrsh7th/vim-vsnip")
|
||||
use("petertriho/cmp-git")
|
||||
use("rafamadriz/friendly-snippets")
|
||||
use("jose-elias-alvarez/null-ls.nvim")
|
||||
use({
|
||||
"glepnir/lspsaga.nvim",
|
||||
branch = "main",
|
||||
config = function()
|
||||
require("config/lspsaga")
|
||||
end,
|
||||
})
|
||||
|
||||
use("b0o/schemastore.nvim")
|
||||
use({
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
local opt = { noremap = true, silent = true, expr = true }
|
||||
Map("i", "<C-J>", "copilot#Accept(<Tab>)", opt)
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- organization
|
||||
use({
|
||||
"vimwiki/vimwiki",
|
||||
branch = "dev",
|
||||
config = function()
|
||||
vim.g.vimwiki_global_ext = 0
|
||||
vim.g.vimwiki_list = {
|
||||
{
|
||||
auto_export = 1,
|
||||
path = "~/.local/share/vimwiki/",
|
||||
syntax = "markdown",
|
||||
ext = ".md",
|
||||
path_html = "~/vimwiki/",
|
||||
template_path = "~/.config/vimwiki/templates/",
|
||||
template_default = "default",
|
||||
template_ext = ".tpl",
|
||||
custom_wiki2html = "vimwiki_markdown",
|
||||
html_filename_parameterization = 1,
|
||||
},
|
||||
}
|
||||
end,
|
||||
})
|
||||
use("tools-life/taskwiki")
|
||||
|
||||
use({
|
||||
"skywind3000/asyncrun.vim",
|
||||
config = function()
|
||||
vim.g.asyncrun_open = 6
|
||||
end,
|
||||
})
|
||||
use({ "skywind3000/asynctasks.vim" })
|
||||
use({
|
||||
"GustavoKatel/telescope-asynctasks.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("asynctasks")
|
||||
end,
|
||||
})
|
||||
|
||||
-- startup
|
||||
use({
|
||||
"glepnir/dashboard-nvim",
|
||||
config = function()
|
||||
require("config/dashboard")
|
||||
end,
|
||||
})
|
||||
|
||||
-- automatic theme switching
|
||||
if vim.fn.has("macunix") then
|
||||
-- colour scheme
|
||||
use({
|
||||
"f-person/auto-dark-mode.nvim",
|
||||
"catppuccin/nvim",
|
||||
as = "catppuccin",
|
||||
run = ":CatppuccinCompile",
|
||||
config = function()
|
||||
local auto_dark_mode = require("auto-dark-mode")
|
||||
auto_dark_mode.setup({
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
update_interval = 1000,
|
||||
set_dark_mode = function()
|
||||
vim.cmd("Catppuccin frappe")
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.cmd("Catppuccin latte")
|
||||
end,
|
||||
})
|
||||
auto_dark_mode.init()
|
||||
require("config/catppuccin")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
if packer_bootstrap then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
-- git gutter
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("config/gitsigns")
|
||||
end,
|
||||
})
|
||||
-- rainbow indents
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
require("indent_blankline").setup({
|
||||
space_char_blankline = " ",
|
||||
show_current_conext = true,
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
})
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"neogitstatus",
|
||||
"fugitive",
|
||||
"packer",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- top bar
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
config = function()
|
||||
require("config/bufferline")
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_lsp" },
|
||||
-- Displays diagnostics for the defined severity types
|
||||
sections = { "error", "warn", "info", "hint" },
|
||||
diagnostics_color = {
|
||||
-- Same values as the general color option can be used here.
|
||||
error = "DiagnosticError", -- Changes diagnostics' error color.
|
||||
warn = "DiagnosticWarn", -- Changes diagnostics' warn color.
|
||||
info = "DiagnosticInfo", -- Changes diagnostics' info color.
|
||||
hint = "DiagnosticHint", -- Changes diagnostics' hint color.
|
||||
},
|
||||
symbols = { error = "E", warn = "W", info = "I", hint = "H" },
|
||||
colored = true, -- Displays diagnostics status in color if set to true.
|
||||
update_in_insert = false, -- Update diagnostics in insert mode.
|
||||
always_visible = false, -- Show diagnostics even if there are none.
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- DJI Osmo
|
||||
use({
|
||||
"luukvbaal/stabilize.nvim",
|
||||
config = function()
|
||||
require("stabilize").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
config = function()
|
||||
require("config/treesitter")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"p00f/nvim-ts-rainbow",
|
||||
requires = "nvim-treesitter/nvim-treesitter",
|
||||
})
|
||||
|
||||
-- show possible key combos
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use("alker0/chezmoi.vim")
|
||||
-- tooling
|
||||
use("gpanders/editorconfig.nvim")
|
||||
-- read and write encrypted pgp files
|
||||
use("jamessan/vim-gnupg")
|
||||
|
||||
-- additional functionality
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
})
|
||||
use("ggandor/lightspeed.nvim")
|
||||
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- git
|
||||
use("tpope/vim-fugitive")
|
||||
-- why not both?
|
||||
use({
|
||||
"TimUntersberger/neogit",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
Map("n", "<leader>ng", "<Cmd>Neogit<CR>")
|
||||
end,
|
||||
})
|
||||
use("dhruvasagar/vim-table-mode")
|
||||
use({
|
||||
"nvchad/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("config/colorizer")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"simrat39/symbols-outline.nvim",
|
||||
config = function()
|
||||
require("symbols-outline").setup()
|
||||
Map("n", "<leader>so", ":SymbolsOutline<CR>")
|
||||
end,
|
||||
})
|
||||
|
||||
-- databases
|
||||
use("tpope/vim-dadbod")
|
||||
use("kristijanhusak/vim-dadbod-completion")
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
config = function()
|
||||
Map("n", "<leader>db", ":DBUIToggle<CR>")
|
||||
vim.g.db_ui_use_nerd_fonts = true
|
||||
vim.g.db_ui_win_position = "right"
|
||||
end,
|
||||
})
|
||||
|
||||
-- telescope
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
Map("n", "<leader>fr", "<cmd>Telescope asynctasks all<CR>")
|
||||
Map("n", "<leader>fb", "<cmd>Telescope file_browser<CR>")
|
||||
Map("n", "<leader>ff", "<cmd>Telescope find_files<CR>")
|
||||
Map("n", "<leader>fg", "<cmd>Telescope live_grep<CR>")
|
||||
Map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>")
|
||||
Map("n", "<leader>fp", "<cmd>Telescope project<CR>")
|
||||
Map("n", "<leader>fs", function()
|
||||
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||
require("telescope.builtin").find_files({ cwd = confpath })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
run = "make",
|
||||
requires = "nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
telescope.setup({
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("file_browser")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope-project.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("project")
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"andweeb/presence.nvim",
|
||||
config = function()
|
||||
require("config/presence")
|
||||
end,
|
||||
})
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
||||
|
||||
-- LSP
|
||||
use("williamboman/mason.nvim")
|
||||
use("williamboman/mason-lspconfig.nvim")
|
||||
use("neovim/nvim-lspconfig")
|
||||
-- completion
|
||||
use("hrsh7th/nvim-cmp")
|
||||
use("hrsh7th/cmp-buffer")
|
||||
use("hrsh7th/cmp-cmdline")
|
||||
use("hrsh7th/cmp-nvim-lsp")
|
||||
use("hrsh7th/cmp-path")
|
||||
use("hrsh7th/cmp-vsnip")
|
||||
use("hrsh7th/vim-vsnip")
|
||||
use("petertriho/cmp-git")
|
||||
use("rafamadriz/friendly-snippets")
|
||||
use("jose-elias-alvarez/null-ls.nvim")
|
||||
use({
|
||||
"glepnir/lspsaga.nvim",
|
||||
branch = "main",
|
||||
config = function()
|
||||
require("config/lspsaga")
|
||||
end,
|
||||
})
|
||||
|
||||
use("b0o/schemastore.nvim")
|
||||
use({
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
local opt = { noremap = true, silent = true, expr = true }
|
||||
Map("i", "<C-J>", "copilot#Accept(<Tab>)", opt)
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- organization
|
||||
use({
|
||||
"vimwiki/vimwiki",
|
||||
branch = "dev",
|
||||
config = function()
|
||||
vim.g.vimwiki_global_ext = 0
|
||||
vim.g.vimwiki_list = {
|
||||
{
|
||||
auto_export = 1,
|
||||
path = "~/.local/share/vimwiki/",
|
||||
syntax = "markdown",
|
||||
ext = ".md",
|
||||
path_html = "~/vimwiki/",
|
||||
template_path = "~/.config/vimwiki/templates/",
|
||||
template_default = "default",
|
||||
template_ext = ".tpl",
|
||||
custom_wiki2html = "vimwiki_markdown",
|
||||
html_filename_parameterization = 1,
|
||||
},
|
||||
}
|
||||
end,
|
||||
})
|
||||
use("tools-life/taskwiki")
|
||||
|
||||
use({
|
||||
"skywind3000/asyncrun.vim",
|
||||
config = function()
|
||||
vim.g.asyncrun_open = 6
|
||||
end,
|
||||
})
|
||||
use({ "skywind3000/asynctasks.vim" })
|
||||
use({
|
||||
"GustavoKatel/telescope-asynctasks.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("asynctasks")
|
||||
end,
|
||||
})
|
||||
|
||||
-- startup
|
||||
use({
|
||||
"glepnir/dashboard-nvim",
|
||||
config = function()
|
||||
require("config/dashboard")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
config = {
|
||||
display = {
|
||||
open_fn = require("packer.util").float,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue