[neovim] Sets up surround, emoji auto-complete, indentation
This commit is contained in:
@@ -10,8 +10,8 @@
|
|||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "markdown" },
|
pattern = { "markdown" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.bo.shiftwidth = 4
|
vim.o.shiftwidth = 2
|
||||||
vim.bo.tabstop = 4
|
vim.o.tabstop = 2
|
||||||
vim.bo.softtabstop = 4
|
vim.o.softtabstop = 2
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ require("lazy").setup({
|
|||||||
spec = {
|
spec = {
|
||||||
-- add LazyVim and import its plugins
|
-- add LazyVim and import its plugins
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
|
-- Integrate ESlint for fixes and prettier for formatting
|
||||||
|
-- See: https://www.lazyvim.org/configuration/recipes
|
||||||
|
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||||
|
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||||
-- import/override with your plugins
|
-- import/override with your plugins
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,29 @@
|
|||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
|
dependencies = {
|
||||||
|
"moyiz/blink-emoji.nvim",
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "buffer", "snippets", "path", "emoji" },
|
||||||
|
providers = {
|
||||||
|
-- https://github.com/moyiz/blink-emoji.nvim
|
||||||
|
emoji = {
|
||||||
|
module = "blink-emoji",
|
||||||
|
name = "Emoji",
|
||||||
|
score_offset = 15, -- Tune by preference
|
||||||
|
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||||
|
should_show_items = function()
|
||||||
|
return vim.tbl_contains(
|
||||||
|
-- Enable emoji completion only for git commits and markdown.
|
||||||
|
-- By default, enabled for all file-types.
|
||||||
|
{ "gitcommit", "markdown" },
|
||||||
|
vim.o.filetype
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
keymap = {
|
keymap = {
|
||||||
preset = "default",
|
preset = "default",
|
||||||
["<C-space>"] = {
|
["<C-space>"] = {
|
||||||
|
|||||||
32
home-manager/features/neovim/config/lua/plugins/surround.lua
Normal file
32
home-manager/features/neovim/config/lua/plugins/surround.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
-- https://www.lazyvim.org/extras/coding/mini-surround#minisurround
|
||||||
|
return {
|
||||||
|
"echasnovski/mini.surround",
|
||||||
|
keys = function(_, keys)
|
||||||
|
-- Populate the keys based on the user's options
|
||||||
|
local opts = LazyVim.opts("mini.surround")
|
||||||
|
local mappings = {
|
||||||
|
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
||||||
|
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
||||||
|
{ opts.mappings.find, desc = "Find Right Surrounding" },
|
||||||
|
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
|
||||||
|
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
|
||||||
|
{ opts.mappings.replace, desc = "Replace Surrounding" },
|
||||||
|
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||||
|
}
|
||||||
|
mappings = vim.tbl_filter(function(m)
|
||||||
|
return m[1] and #m[1] > 0
|
||||||
|
end, mappings)
|
||||||
|
return vim.list_extend(mappings, keys)
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
add = "gsa", -- Add surrounding in Normal and Visual modes
|
||||||
|
delete = "gsd", -- Delete surrounding
|
||||||
|
find = "gsf", -- Find surrounding (to the right)
|
||||||
|
find_left = "gsF", -- Find surrounding (to the left)
|
||||||
|
highlight = "gsh", -- Highlight surrounding
|
||||||
|
replace = "gsr", -- Replace surrounding
|
||||||
|
update_n_lines = "gsn", -- Update `n_lines`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user