Update nvim
This commit is contained in:
parent
d5b06aeb37
commit
f9ab04cd0a
@ -4,6 +4,12 @@ vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Initialize lazy.nvim
|
||||
require("config.lazy")
|
||||
-- vim.cmd([[
|
||||
-- augroup jdtls_lsp
|
||||
-- autocmd!
|
||||
-- autocmd FileType java lua require'jdtls.jdtls_setup'.setup()
|
||||
-- augroup end
|
||||
-- ]])
|
||||
|
||||
-- Source other configuration files
|
||||
require("keybindings")
|
||||
|
||||
@ -30,8 +30,8 @@ require("lazy").setup({
|
||||
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
-- automatically check for plugin updates, but don't notify during startup
|
||||
checker = { enabled = true, notify = false },
|
||||
-- don't notify on changes to configs
|
||||
change_detection = { enabled = false },
|
||||
})
|
||||
|
||||
@ -12,3 +12,6 @@ map("n", "<leader>k", "<C-w>k", opts)
|
||||
|
||||
opts.desc = "Navigate window right"
|
||||
map("n", "<leader>l", "<C-w>l", opts)
|
||||
|
||||
opts.desc = "Save session, write all buffers and quit"
|
||||
map("n", "<leader>qqq", ':lua require("auto-session").SaveSession()<CR>:wqa<CR>', opts)
|
||||
|
||||
42
.config/nvim/lua/plugins/file_navigation/neo-tree.lua
Normal file
42
.config/nvim/lua/plugins/file_navigation/neo-tree.lua
Normal file
@ -0,0 +1,42 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v2.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true, -- Show files and folders starting with a dot `.`
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>ee",
|
||||
"<cmd>Neotree focus<CR>",
|
||||
{ desc = "Open and focus Neotree", noremap = true, silent = true }
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>e",
|
||||
"<cmd>Neotree toggle<CR>",
|
||||
{ desc = "Toggle Neotree", noremap = true, silent = true }
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>eq",
|
||||
"<cmd>Neotree close<CR>",
|
||||
{ desc = "Close Neotree", noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
46
.config/nvim/lua/plugins/file_navigation/telescope.lua
Normal file
46
.config/nvim/lua/plugins/file_navigation/telescope.lua
Normal file
@ -0,0 +1,46 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"folke/todo-comments.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, -- fuzzy search
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local trouble_telescope = require("trouble.sources.telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local open_with_trouble = require("trouble.sources.telescope").open
|
||||
|
||||
-- Use this to add more results without clearing the trouble list
|
||||
local add_to_trouble = require("trouble.sources.telescope").add
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-t>"] = trouble_telescope.open,
|
||||
},
|
||||
n = { ["<C-t>"] = open_with_trouble },
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
-- Set keymaps to load pickers
|
||||
local keymap = vim.keymap
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd (Telescope)" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files (Telescope)" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd (Telescope)" })
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>fc",
|
||||
"<cmd>Telescope grep_string<cr>",
|
||||
{ desc = "Find string under cursor in cwd (Telescope)" }
|
||||
)
|
||||
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "Find todos (Telescope)" })
|
||||
end,
|
||||
}
|
||||
38
.config/nvim/lua/plugins/language_support/conform.lua
Normal file
38
.config/nvim/lua/plugins/language_support/conform.lua
Normal file
@ -0,0 +1,38 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
nginx = { "nginxfmt" },
|
||||
python = { "black" },
|
||||
yaml = { "yamlfix" },
|
||||
-- Use the "*" filetype to run formatters on all filetypes.
|
||||
-- ["*"] = { "codespell" },
|
||||
},
|
||||
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
format_on_save = {
|
||||
lua = true,
|
||||
nginx = true,
|
||||
yaml = true,
|
||||
lsp_format = "fallback",
|
||||
timeout_ms = 500,
|
||||
},
|
||||
format_after_save = {
|
||||
lsp_format = "fallback",
|
||||
timeout_ms = 500,
|
||||
},
|
||||
-- Set the log level. Use `:ConformInfo` to see the location of the log file.
|
||||
log_level = vim.log.levels.ERROR,
|
||||
-- Conform will notify you when a formatter errors
|
||||
notify_on_error = true,
|
||||
-- Conform will notify you when no formatters are available for the buffer
|
||||
notify_no_formatters = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
17
.config/nvim/lua/plugins/language_support/neotest.lua
Normal file
17
.config/nvim/lua/plugins/language_support/neotest.lua
Normal file
@ -0,0 +1,17 @@
|
||||
return {
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"nvim-neotest/nvim-nio",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"rcasia/neotest-java",
|
||||
},
|
||||
config = function()
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-java"),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
142
.config/nvim/lua/plugins/language_support/nvim-cmp.lua
Normal file
142
.config/nvim/lua/plugins/language_support/nvim-cmp.lua
Normal file
@ -0,0 +1,142 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
"hrsh7th/cmp-cmdline", -- source for command mode
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release of given major
|
||||
version = "v2.*",
|
||||
-- install jsregexp
|
||||
build = "make install_jsregexp",
|
||||
}, -- snippet engine
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- Loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
-- `/` cmdline setup.
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- `:` cmdline setup.
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{
|
||||
name = "cmdline",
|
||||
option = {
|
||||
ignore_cmds = { "Man", "!" },
|
||||
},
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
-- Setup completion options and snippets and mappings
|
||||
cmp.setup({
|
||||
-- Configure how the completion menu behaves
|
||||
-- menu: show menu
|
||||
-- menuone: show menu even when there is only one option
|
||||
-- preview: preview window explaining the offered completion
|
||||
-- select: select an option automatically (noselect is the reverse)
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,select",
|
||||
},
|
||||
-- Configure how nvim-cmp interacts with snippet engine
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4), -- scroll down in docs
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4), -- scroll up in docs
|
||||
["<C-Up>"] = cmp.mapping.scroll_docs(-4), -- scroll down in docs
|
||||
["<C-Down>"] = cmp.mapping.scroll_docs(4), -- scroll up in docs
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<C-l>"] = cmp.mapping.complete({
|
||||
config = { sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
} },
|
||||
}), -- show only lsp completions
|
||||
["<C-s"] = cmp.mapping.complete({
|
||||
config = { sources = {
|
||||
{ name = "luasnip" },
|
||||
} },
|
||||
}), -- show only snippet completions
|
||||
|
||||
-- On CR, insert selected snippet or completion
|
||||
["<CR>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
else
|
||||
cmp.confirm({
|
||||
select = true,
|
||||
})
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
|
||||
-- On tab with completion open, go to next option
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", "c" }),
|
||||
|
||||
-- On shift tab with completion open, go to prev option
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", "c" }),
|
||||
}),
|
||||
|
||||
-- Sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" }, -- lsp suggestions
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
|
||||
-- Configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
show_labelDetails = true,
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"css",
|
||||
"dockerfile",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"make",
|
||||
"pug",
|
||||
"scss",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
modules = {},
|
||||
auto_install = false,
|
||||
ignore_install = {},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
sync_install = false,
|
||||
})
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"java",
|
||||
},
|
||||
modules = {},
|
||||
auto_install = false,
|
||||
ignore_install = {},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
sync_install = false,
|
||||
custom_captures = {
|
||||
-- Highlight @Test annotations
|
||||
["annotation.identifier"] = "TSAnnotation",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
56
.config/nvim/lua/plugins/lsp/mason.lua
Normal file
56
.config/nvim/lua/plugins/lsp/mason.lua
Normal file
@ -0,0 +1,56 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
-- enable mason and configure icons
|
||||
require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"cssls",
|
||||
"dockerls",
|
||||
"emmet_ls",
|
||||
"html",
|
||||
"jdtls",
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"pylsp",
|
||||
"ts_ls",
|
||||
"vimls",
|
||||
"yamlls",
|
||||
},
|
||||
})
|
||||
|
||||
-- formatters, linters and debug adapters for mason to install
|
||||
require("mason-tool-installer").setup({
|
||||
ensure_installed = {
|
||||
"biome",
|
||||
"black",
|
||||
"checkstyle",
|
||||
"chrome-debug-adapter",
|
||||
"codespell",
|
||||
"eslint_d",
|
||||
"firefox-debug-adapter",
|
||||
"flake8",
|
||||
"java-debug-adapter",
|
||||
"jq",
|
||||
"nginx-config-formatter",
|
||||
"prettierd",
|
||||
"stylua",
|
||||
"yamlfix",
|
||||
"yamllint",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
3
.config/nvim/lua/plugins/lsp/nvim-jdtls.lua
Normal file
3
.config/nvim/lua/plugins/lsp/nvim-jdtls.lua
Normal file
@ -0,0 +1,3 @@
|
||||
return {
|
||||
"mfussenegger/nvim-jdtls",
|
||||
}
|
||||
148
.config/nvim/lua/plugins/lsp/nvim-lspconfig.lua
Normal file
148
.config/nvim/lua/plugins/lsp/nvim-lspconfig.lua
Normal file
@ -0,0 +1,148 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
-- Replace symbols to use for diagnostics
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
},
|
||||
},
|
||||
})
|
||||
--
|
||||
-- Create keymaps when using an LSP
|
||||
local keymap = vim.keymap
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
local opts = { buffer = ev.buf, silent = true }
|
||||
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
|
||||
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
|
||||
|
||||
opts.desc = "Show LSP implementations"
|
||||
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
|
||||
|
||||
opts.desc = "Show LSP type definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
|
||||
|
||||
opts.desc = "See available code actions"
|
||||
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
|
||||
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
opts.desc = "Show buffer diagnostics"
|
||||
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
|
||||
|
||||
opts.desc = "Show line diagnostics"
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
|
||||
opts.desc = "Go to previous diagnostic"
|
||||
keymap.set("n", "[d", function()
|
||||
vim.diagnostic.jump({ count = -1, float = true })
|
||||
end, opts) -- jump to previous diagnostic in buffer
|
||||
|
||||
opts.desc = "Go to next diagnostic"
|
||||
keymap.set("n", "]d", function()
|
||||
vim.diagnostic.jump({ count = 1, float = true })
|
||||
end, opts) -- jump to next diagnostic in buffer
|
||||
|
||||
opts.desc = "Show documentation for what is under cursor"
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
|
||||
|
||||
opts.desc = "Restart LSP"
|
||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
||||
end,
|
||||
})
|
||||
|
||||
-- Enable autocompletion capabilities
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- Configure for language servers
|
||||
-- lua_ls
|
||||
vim.lsp.config("lua_ls", {
|
||||
on_init = function(client)
|
||||
print(client.root_dir)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
print(path)
|
||||
if
|
||||
path ~= vim.fn.stdpath("config")
|
||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||
then
|
||||
print(path)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
-- Tell the language server how to find Lua modules same way as Neovim
|
||||
-- (see `:h lua-module-load`)
|
||||
path = {
|
||||
"lua/?.lua",
|
||||
"lua/?/init.lua",
|
||||
},
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
"${3rd}/luv/library",
|
||||
},
|
||||
},
|
||||
-- Add the default completion capabilities
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
})
|
||||
|
||||
-- ts_ls
|
||||
vim.lsp.config("ts_ls", {
|
||||
on_attach = function(client)
|
||||
-- Disable formatting capability for tsserver
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end,
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
},
|
||||
root_markers = { "tsconfig.json", "jsconfig.json", "package.json" },
|
||||
})
|
||||
|
||||
vim.lsp.config("pylsp", {
|
||||
on_attach = function(client)
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end,
|
||||
filetypes = {
|
||||
"python",
|
||||
},
|
||||
root_markers = { "requirements.txt" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"comfysage/cuddlefish.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("cuddlefish").setup({
|
||||
theme = {
|
||||
@ -18,32 +20,43 @@ return {
|
||||
comment = { "italic" },
|
||||
},
|
||||
})
|
||||
vim.cmd("colorscheme cuddlefish")
|
||||
end,
|
||||
},
|
||||
{ "maxmx03/dracula.nvim" },
|
||||
{ "maxmx03/dracula.nvim", lazy = false, priority = 1000 },
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"2giosangmitom/nightfall.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{ "2giosangmitom/nightfall.nvim" },
|
||||
{
|
||||
"olimorris/onedarkpro.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{ "pauchiner/pastelnight.nvim" },
|
||||
{ "numToStr/Sakura.nvim" },
|
||||
{ "pauchiner/pastelnight.nvim", lazy = false, priority = 1000 },
|
||||
{ "numToStr/Sakura.nvim", lazy = false, priority = 1000 },
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"yorumicolors/yorumi.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"zaldih/themery.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
priority = 999,
|
||||
config = function()
|
||||
vim.cmd("colorscheme deeper-night")
|
||||
local themery = require("themery")
|
||||
|
||||
themery.setup({
|
||||
-- List of swappable colorschemes.
|
||||
themes = {
|
||||
@ -61,7 +74,7 @@ return {
|
||||
livePreview = true, -- Apply theme while picking. Default to true.
|
||||
})
|
||||
|
||||
themery.setThemeByIndex(1, true)
|
||||
--themery.setThemeByName("deeper-night", true)
|
||||
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
local numberOfThemes = #themery.getAvailableThemes()
|
||||
@ -69,6 +82,7 @@ return {
|
||||
local nextThemeIndex = (currentThemeIndex % numberOfThemes) + 1
|
||||
themery.setThemeByIndex(nextThemeIndex, true)
|
||||
end, { noremap = true })
|
||||
vim.keymap.set("n", "<leader>th", "<cmd>Themery<cr>", { noremap = true })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
61
.config/nvim/lua/plugins/ui/barbar.lua
Normal file
61
.config/nvim/lua/plugins/ui/barbar.lua
Normal file
@ -0,0 +1,61 @@
|
||||
return {
|
||||
"romgrk/barbar.nvim",
|
||||
dependencies = {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
init = function()
|
||||
vim.g.barbar_auto_setup = false
|
||||
end,
|
||||
config = function()
|
||||
require("barbar").setup({
|
||||
animation = true,
|
||||
auto_hide = true,
|
||||
clickable = true,
|
||||
})
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
map("n", "<leader>,", "<cmd>BufferPrevious<CR>", opts)
|
||||
map("n", "<leader>.", "<cmd>BufferNext<CR>", opts)
|
||||
map("n", "<leader><S-Tab>", "<cmd>BufferPrevious<CR>", opts)
|
||||
map("n", "<leader><Tab>", "<cmd>BufferNext<CR>", opts)
|
||||
|
||||
-- Re-order to previous/next
|
||||
map("n", "<leader><", "<cmd>BufferMovePrevious<CR>", opts)
|
||||
map("n", "<leader>>", "<cmd>BufferMoveNext<CR>", opts)
|
||||
|
||||
-- Goto buffer in position...
|
||||
map("n", "<leader>1", "<cmd>BufferGoto 1<CR>", opts)
|
||||
map("n", "<leader>2", "<cmd>BufferGoto 2<CR>", opts)
|
||||
map("n", "<leader>3", "<cmd>BufferGoto 3<CR>", opts)
|
||||
map("n", "<leader>4", "<cmd>BufferGoto 4<CR>", opts)
|
||||
map("n", "<leader>5", "<cmd>BufferGoto 5<CR>", opts)
|
||||
map("n", "<leader>6", "<cmd>BufferGoto 6<CR>", opts)
|
||||
map("n", "<leader>7", "<cmd>BufferGoto 7<CR>", opts)
|
||||
map("n", "<leader>8", "<cmd>BufferGoto 8<CR>", opts)
|
||||
map("n", "<leader>9", "<cmd>BufferGoto 9<CR>", opts)
|
||||
map("n", "<leader>0", "<cmd>BufferLast<CR>", opts)
|
||||
|
||||
-- Pin/unpin buffer
|
||||
map("n", "<leader>p", "<cmd>BufferPin<CR>", opts)
|
||||
|
||||
-- Close buffer
|
||||
map("n", "<leader>c", "<cmd>BufferClose<CR>", opts)
|
||||
|
||||
-- Magic buffer-picking mode
|
||||
map("n", "<C-p>", "<cmd>BufferPick<CR>", opts)
|
||||
map("n", "<C-x>", "<cmd>BufferPickDelete<CR>", opts)
|
||||
|
||||
-- Sort automatically by...
|
||||
map("n", "<leader>bb", "<cmd>BufferOrderByBufferNumber<CR>", opts)
|
||||
map("n", "<leader>bn", "<cmd>BufferOrderByName<CR>", opts)
|
||||
map("n", "<leader>bd", "<cmd>BufferOrderByDirectory<CR>", opts)
|
||||
--
|
||||
-- Wipeout buffer
|
||||
map("n", "<leader>bl", "<cmd>BufferOrderByLanguage<CR>", opts)
|
||||
map("n", "<leader>bw", "<cmd>BufferOrderByWindowNumber<CR>", opts)
|
||||
end,
|
||||
}
|
||||
172
.config/nvim/lua/plugins/ui/dressing.lua
Normal file
172
.config/nvim/lua/plugins/ui/dressing.lua
Normal file
@ -0,0 +1,172 @@
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("dressing").setup({
|
||||
input = {
|
||||
-- Set to false to disable the vim.ui.input implementation
|
||||
enabled = true,
|
||||
|
||||
-- Default prompt string
|
||||
default_prompt = "Input",
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Can be 'left', 'right', or 'center'
|
||||
title_pos = "left",
|
||||
|
||||
-- The initial mode when the window opens (insert|normal|visual|select).
|
||||
start_mode = "insert",
|
||||
|
||||
-- These are passed to nvim_open_win
|
||||
border = "rounded",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "cursor",
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
prefer_width = 40,
|
||||
width = nil,
|
||||
-- min_width and max_width can be a list of mixed types.
|
||||
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
|
||||
max_width = { 140, 0.9 },
|
||||
min_width = { 20, 0.2 },
|
||||
|
||||
buf_options = {},
|
||||
win_options = {
|
||||
-- Disable line wrapping
|
||||
wrap = false,
|
||||
-- Indicator for when text exceeds window
|
||||
list = true,
|
||||
listchars = "precedes:…,extends:…",
|
||||
-- Increase this for more context when text scrolls off the window
|
||||
sidescrolloff = 0,
|
||||
},
|
||||
|
||||
-- Set to `false` to disable
|
||||
mappings = {
|
||||
n = {
|
||||
["<Esc>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
},
|
||||
i = {
|
||||
["<C-c>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
["<Up>"] = "HistoryPrev",
|
||||
["<Down>"] = "HistoryNext",
|
||||
},
|
||||
},
|
||||
|
||||
override = function(conf)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
select = {
|
||||
-- Set to false to disable the vim.ui.select implementation
|
||||
enabled = true,
|
||||
|
||||
-- Priority list of preferred vim.select implementations
|
||||
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Options for telescope selector
|
||||
-- These are passed into the telescope picker directly. Can be used like:
|
||||
-- telescope = require('telescope.themes').get_ivy({...})
|
||||
telescope = nil,
|
||||
|
||||
-- Options for fzf selector
|
||||
fzf = {
|
||||
window = {
|
||||
width = 0.5,
|
||||
height = 0.4,
|
||||
},
|
||||
},
|
||||
|
||||
-- Options for fzf-lua
|
||||
fzf_lua = {
|
||||
-- winopts = {
|
||||
-- height = 0.5,
|
||||
-- width = 0.5,
|
||||
-- },
|
||||
},
|
||||
|
||||
-- Options for nui Menu
|
||||
nui = {
|
||||
position = "50%",
|
||||
size = nil,
|
||||
relative = "editor",
|
||||
border = {
|
||||
style = "rounded",
|
||||
},
|
||||
buf_options = {
|
||||
swapfile = false,
|
||||
filetype = "DressingSelect",
|
||||
},
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
max_width = 80,
|
||||
max_height = 40,
|
||||
min_width = 40,
|
||||
min_height = 10,
|
||||
},
|
||||
|
||||
-- Options for built-in selector
|
||||
builtin = {
|
||||
-- Display numbers for options and set up keymaps
|
||||
show_numbers = true,
|
||||
-- These are passed to nvim_open_win
|
||||
border = "rounded",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "editor",
|
||||
|
||||
buf_options = {},
|
||||
win_options = {
|
||||
cursorline = true,
|
||||
cursorlineopt = "both",
|
||||
-- disable highlighting for the brackets around the numbers
|
||||
winhighlight = "MatchParen:",
|
||||
-- adds padding at the left border
|
||||
statuscolumn = " ",
|
||||
},
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- the min_ and max_ options can be a list of mixed types.
|
||||
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
|
||||
width = nil,
|
||||
max_width = { 140, 0.8 },
|
||||
min_width = { 40, 0.2 },
|
||||
height = nil,
|
||||
max_height = 0.9,
|
||||
min_height = { 10, 0.2 },
|
||||
|
||||
-- Set to `false` to disable
|
||||
mappings = {
|
||||
["<Esc>"] = "Close",
|
||||
["<C-c>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
},
|
||||
|
||||
override = function(conf)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
|
||||
-- Used to override format_item. See :help dressing-format
|
||||
format_item_override = {},
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
29
.config/nvim/lua/plugins/ui/lualine.lua
Normal file
29
.config/nvim/lua/plugins/ui/lualine.lua
Normal file
@ -0,0 +1,29 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "deeper-night",
|
||||
section_separators = { left = "", right = "" },
|
||||
component_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype", "lsp_status" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
21
.config/nvim/lua/plugins/util/auto-session.lua
Normal file
21
.config/nvim/lua/plugins/util/auto-session.lua
Normal file
@ -0,0 +1,21 @@
|
||||
return {
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
local auto_session = require("auto-session")
|
||||
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
auto_session_suppress_dirs = { "~/", "~/Code/", "~/Downloads", "~/Documents", "~/Desktop/" },
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd (auto-session)" }) -- restore last workspace session for current directory
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>ws",
|
||||
"<cmd>SessionSave<CR>",
|
||||
{ desc = "Save session for auto session root dir (auto-session)" }
|
||||
) -- save workspace session for current working directory
|
||||
end,
|
||||
}
|
||||
7
.config/nvim/lua/plugins/util/mini.surround.lua
Normal file
7
.config/nvim/lua/plugins/util/mini.surround.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"echasnovski/mini.surround",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("mini.surround").setup()
|
||||
end,
|
||||
}
|
||||
12
.config/nvim/lua/plugins/util/neogit.lua
Normal file
12
.config/nvim/lua/plugins/util/neogit.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
keys = { { "<leader>gg", "<cmd>Neogit<cr>", desc = "Open Neogit (Neogit)" } },
|
||||
config = function()
|
||||
local neogit = require("neogit")
|
||||
end,
|
||||
}
|
||||
7
.config/nvim/lua/plugins/util/nvim-notify.lua
Normal file
7
.config/nvim/lua/plugins/util/nvim-notify.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
-- Replace vim.notify with this nvim-notify popups
|
||||
vim.notify = require("notify")
|
||||
end,
|
||||
}
|
||||
15
.config/nvim/lua/plugins/util/oil.lua
Normal file
15
.config/nvim/lua/plugins/util/oil.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("oil").setup()
|
||||
vim.keymap.set("n", "-", "<CMD>Oil --float<CR>", { desc = "Open parent directory" })
|
||||
end,
|
||||
}
|
||||
21
.config/nvim/lua/plugins/util/todo-comments.lua
Normal file
21
.config/nvim/lua/plugins/util/todo-comments.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- TODO Get todo-comments working
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
|
||||
-- Set keymaps
|
||||
local keymap = vim.keymap
|
||||
keymap.set("n", "]t", function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = "Next todo comment (todo-comments)" })
|
||||
|
||||
keymap.set("n", "[t", function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = "Previous todo comment (todo-comments)" })
|
||||
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
||||
39
.config/nvim/lua/plugins/util/trouble.lua
Normal file
39
.config/nvim/lua/plugins/util/trouble.lua
Normal file
@ -0,0 +1,39 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "folke/todo-comments.nvim", "nvim-tree/nvim-web-devicons" },
|
||||
opts = { focus = true },
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xX",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||
desc = "Buffer Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cs",
|
||||
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP Definitions / references / ... (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xL",
|
||||
"<cmd>Trouble loclist toggle<cr>",
|
||||
desc = "Location List (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xQ",
|
||||
"<cmd>Trouble qflist toggle<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
{ "<leader>xt", "<cmd>Trouble todo toggle<CR>", desc = "Open todos (Trouble)" },
|
||||
},
|
||||
}
|
||||
14
.config/nvim/lua/plugins/util/util.lua
Normal file
14
.config/nvim/lua/plugins/util/util.lua
Normal file
@ -0,0 +1,14 @@
|
||||
-- Other utilities
|
||||
return {
|
||||
{
|
||||
"lambdalisue/vim-suda",
|
||||
config = function()
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>sw",
|
||||
"<cmd>SudaWrite<cr>",
|
||||
{ desc = "Write the current file with sudo (vim-suda)" }
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
6
.config/nvim/lua/plugins/util/vim-maximizer.lua
Normal file
6
.config/nvim/lua/plugins/util/vim-maximizer.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"szw/vim-maximizer",
|
||||
keys = {
|
||||
{ "<leader>sm", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split (vim-maximizer)" },
|
||||
},
|
||||
}
|
||||
27
.config/nvim/lua/plugins/util/which-key.lua
Normal file
27
.config/nvim/lua/plugins/util/which-key.lua
Normal file
@ -0,0 +1,27 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>!",
|
||||
function()
|
||||
require("which-key").show({ global = true })
|
||||
end,
|
||||
desc = "Buffer All Keymaps (which-key)",
|
||||
},
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
-- Set basic options
|
||||
vim.o.number = true -- Show line numbers
|
||||
vim.o.relativenumber = true -- Show relative line numbers
|
||||
vim.o.tabstop = 4 -- Number of spaces tabs count for
|
||||
vim.o.shiftwidth = 4 -- Number of spaces to use for each step of (auto)indent
|
||||
vim.o.expandtab = true -- Convert tabs to spaces
|
||||
vim.o.smartindent = true -- Insert indents automatically
|
||||
vim.o.tabstop = 4 -- Number of spaces that a tab in the file counts for
|
||||
vim.o.shiftwidth = 4 -- Number of spaces to use for each step of (auto)indent
|
||||
vim.o.softtabstop = 4 -- Number of spaces that a tab counts for while performing editing operations
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,7 @@
|
||||
!.config/neofetch/*
|
||||
|
||||
!.config/nvim/init.lua
|
||||
!.config/nvim/lua/*
|
||||
!.config/nvim/lua/**
|
||||
|
||||
!.config/tmux/tmux.conf
|
||||
!.config/tmux/catppuccin.conf
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user