trying out nix
This commit is contained in:
commit
65bd68a260
18 changed files with 1217 additions and 0 deletions
15
lua/plugins/alpha.lua
Normal file
15
lua/plugins/alpha.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"goolord/alpha-nvim",
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local theta = require("alpha.themes.theta")
|
||||
theta.config.layout[1].val = math.floor(vim.fn.winheight(0) * 0.2)
|
||||
theta.header.opts.hl = "Normal"
|
||||
require("alpha").setup(
|
||||
theta.config
|
||||
)
|
||||
end,
|
||||
}
|
||||
46
lua/plugins/main.lua
Normal file
46
lua/plugins/main.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
"Pocco81/auto-save.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
},
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts={
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"RRethy/vim-illuminate",
|
||||
{
|
||||
"gelguy/wilder.nvim",
|
||||
opts = function()
|
||||
local wilder = require("wilder")
|
||||
wilder.set_option("renderer", wilder.popupmenu_renderer({
|
||||
pumblend = 20,
|
||||
}))
|
||||
return {
|
||||
modes = { ':', '/', '?' }
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"zaldih/themery.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("themery").setup({
|
||||
themes = vim.fn.getcompletion("", "color"),
|
||||
livePreview = true,
|
||||
})
|
||||
end
|
||||
},
|
||||
{ "junegunn/vim-easy-align" },
|
||||
{ "sindrets/diffview.nvim" },
|
||||
}
|
||||
61
lua/plugins/multicursor.lua
Normal file
61
lua/plugins/multicursor.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
return {
|
||||
"jake-stewart/multicursor.nvim",
|
||||
branch = "1.0",
|
||||
config = function()
|
||||
local mc = require("multicursor-nvim")
|
||||
mc.setup()
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
-- Add or skip cursor above/below the main cursor.
|
||||
set({"n", "x"}, "<c-k>", function() mc.lineAddCursor(-1) end)
|
||||
set({"n", "x"}, "<c-j>", function() mc.lineAddCursor(1) end)
|
||||
set({"n", "x"}, "<leader>k", function() mc.lineSkipCursor(-1) end)
|
||||
set({"n", "x"}, "<leader>j", function() mc.lineSkipCursor(1) end)
|
||||
|
||||
-- Add or skip adding a new cursor by matching word/selection
|
||||
set({"n", "x"}, "<leader>n", function() mc.matchAddCursor(1) end)
|
||||
set({"n", "x"}, "<leader>s", function() mc.matchSkipCursor(1) end)
|
||||
set({"n", "x"}, "<leader>N", function() mc.matchAddCursor(-1) end)
|
||||
set({"n", "x"}, "<leader>S", function() mc.matchSkipCursor(-1) end)
|
||||
|
||||
-- Add and remove cursors with control + left click.
|
||||
set("n", "<c-leftmouse>", mc.handleMouse)
|
||||
set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||
set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||
|
||||
-- Disable and enable cursors.
|
||||
set({"n", "x"}, "<c-q>", mc.toggleCursor)
|
||||
|
||||
-- Mappings defined in a keymap layer only apply when there are
|
||||
-- multiple cursors. This lets you have overlapping mappings.
|
||||
mc.addKeymapLayer(function(layerSet)
|
||||
|
||||
-- Select a different cursor as the main one.
|
||||
layerSet({"n", "x"}, "<left>", mc.prevCursor)
|
||||
layerSet({"n", "x"}, "<right>", mc.nextCursor)
|
||||
|
||||
-- Delete the main cursor.
|
||||
layerSet({"n", "x"}, "<leader>x", mc.deleteCursor)
|
||||
|
||||
-- Enable and clear cursors using escape.
|
||||
layerSet("n", "<esc>", function()
|
||||
if not mc.cursorsEnabled() then
|
||||
mc.enableCursors()
|
||||
else
|
||||
mc.clearCursors()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Customize how cursors look.
|
||||
local hl = vim.api.nvim_set_hl
|
||||
hl(0, "MultiCursorCursor", { reverse = true })
|
||||
hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorSign", { link = "SignColumn"})
|
||||
hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||
hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||
hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorDisabledSign", { link = "SignColumn"})
|
||||
end
|
||||
}
|
||||
60
lua/plugins/nvim-cmp.lua
Normal file
60
lua/plugins/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
version = false, -- last release is way too old
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
opts = function()
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
local auto_select = true
|
||||
return {
|
||||
auto_brackets = {},
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"),
|
||||
},
|
||||
preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.none,
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = auto_select }),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<S-CR>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
["<tab>"] = function(fallback)
|
||||
local luasnip = require("luasnip")
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources(
|
||||
{
|
||||
{ name = "lazydev" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
},
|
||||
{
|
||||
{ name = "buffer" },
|
||||
{ name = "cmdline" },
|
||||
}
|
||||
),
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
22
lua/plugins/oil.lua
Normal file
22
lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
float = {
|
||||
max_width = 80,
|
||||
max_height = 20,
|
||||
border = "rounded",
|
||||
},
|
||||
preview_win = {
|
||||
update_on_cursor_moved = true,
|
||||
preview_method = "fast_scratch",
|
||||
},
|
||||
delete_to_trash = true,
|
||||
watch_for_changes = true,
|
||||
},
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>do", "<cmd>Oil --float<CR>", desc = "Open floating Oil" },
|
||||
},
|
||||
}
|
||||
|
||||
26
lua/plugins/telescope.lua
Normal file
26
lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = false,
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {
|
||||
defaults = {
|
||||
path_display = { "smart" },
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
path_display = "short",
|
||||
sort_mru = true,
|
||||
ignore_current_buffer = true,
|
||||
previewer = false,
|
||||
layout_config = {
|
||||
width = 80,
|
||||
height = 10,
|
||||
prompt_position = "top",
|
||||
},
|
||||
prompt_title = false,
|
||||
results_title = false,
|
||||
preview_title = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
15
lua/plugins/toggleterm.lua
Normal file
15
lua/plugins/toggleterm.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opts = {
|
||||
direction = "float",
|
||||
open_mapping = [[<c-\>]],
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
width = 80,
|
||||
height = 20,
|
||||
},
|
||||
hide_numbers = true,
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
14
lua/plugins/treesitter.lua
Normal file
14
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
branch = 'main',
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
ensure_installed = { "lua", "vim", "json" },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue