added autopairs, comment, cursor animation, indentation, smooth scrolling, surround and other plugins for neovim
This commit is contained in:
8
.luarc.json
Normal file
8
.luarc.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"diagnostics.globals": [
|
||||||
|
"vim"
|
||||||
|
],
|
||||||
|
"diagnostics.disable": [
|
||||||
|
"undefined-global"
|
||||||
|
]
|
||||||
|
}
|
4
nvim/.config/nvim/.luarc.json
Normal file
4
nvim/.config/nvim/.luarc.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/LuaLS/lua-language-server/master/schema/luarc.json",
|
||||||
|
"diagnostics.globals": ["vim"],
|
||||||
|
}
|
20
nvim/.config/nvim/after/plugin/autopairs.lua
Normal file
20
nvim/.config/nvim/after/plugin/autopairs.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
local npairs = require("nvim-autopairs")
|
||||||
|
local Rule = require("nvim-autopairs.rule")
|
||||||
|
|
||||||
|
npairs.setup({
|
||||||
|
check_ts = true,
|
||||||
|
ts_config = {
|
||||||
|
python = { "string" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
npairs.add_rules({
|
||||||
|
Rule(" ", " "):with_pair(function(opts)
|
||||||
|
return vim.tbl_contains({ "()", "[]", "{}" }, opts.line:sub(opts.col - 1, opts.col))
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
npairs.add_rules({
|
||||||
|
Rule("'''", "'''", "python"),
|
||||||
|
Rule('"""', '"""', "python"),
|
||||||
|
})
|
16
nvim/.config/nvim/after/plugin/comment.lua
Normal file
16
nvim/.config/nvim/after/plugin/comment.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
require("Comment").setup({
|
||||||
|
-- pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||||
|
toggler = {
|
||||||
|
line = "<leader>cc", -- Line-comment toggle keymap
|
||||||
|
block = "<leader>bc",
|
||||||
|
},
|
||||||
|
opleader = {
|
||||||
|
line = "<leader>c",
|
||||||
|
block = "<leader>b",
|
||||||
|
},
|
||||||
|
extra = {
|
||||||
|
above = "<leader>cO",
|
||||||
|
below = "<leader>co",
|
||||||
|
eol = "<leader>cA",
|
||||||
|
},
|
||||||
|
})
|
0
nvim/.config/nvim/after/plugin/cursor.lua
Normal file
0
nvim/.config/nvim/after/plugin/cursor.lua
Normal file
24
nvim/.config/nvim/after/plugin/indent.lua
Normal file
24
nvim/.config/nvim/after/plugin/indent.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
require("ibl").setup({
|
||||||
|
indent = {
|
||||||
|
char = "┊", --"│",
|
||||||
|
tab_char = "┊",
|
||||||
|
},
|
||||||
|
scope = {
|
||||||
|
show_start = false,
|
||||||
|
show_end = false,
|
||||||
|
},
|
||||||
|
exclude = {
|
||||||
|
filetypes = {
|
||||||
|
"help",
|
||||||
|
"alpha",
|
||||||
|
"dashboard",
|
||||||
|
"neo-tree",
|
||||||
|
"Trouble",
|
||||||
|
"lazy",
|
||||||
|
"mason",
|
||||||
|
"notify",
|
||||||
|
"togglerterm",
|
||||||
|
"lazyterm",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
11
nvim/.config/nvim/after/plugin/neoscroll.lua
Normal file
11
nvim/.config/nvim/after/plugin/neoscroll.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
require("neoscroll").setup({
|
||||||
|
mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "zz", "zt", "zb" },
|
||||||
|
hide_cursor = true,
|
||||||
|
stop_eof = true,
|
||||||
|
respect_scrolloff = false,
|
||||||
|
cursor_scrolls_alone = true,
|
||||||
|
easing_function = "quadratic",
|
||||||
|
pre_hook = nil,
|
||||||
|
post_hook = nil,
|
||||||
|
performance_mode = false,
|
||||||
|
})
|
14
nvim/.config/nvim/after/plugin/surround.lua
Normal file
14
nvim/.config/nvim/after/plugin/surround.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
require("nvim-surround").setup({
|
||||||
|
keymaps = {
|
||||||
|
insert = "<C-g>s",
|
||||||
|
insert_line = "<C-g>S",
|
||||||
|
normal = "ys",
|
||||||
|
normal_cur = "yss",
|
||||||
|
normal_line = "yS",
|
||||||
|
normal_cur_line = "ySS",
|
||||||
|
visual = "S",
|
||||||
|
visual_line = "gS",
|
||||||
|
delete = "ds",
|
||||||
|
change = "cs",
|
||||||
|
},
|
||||||
|
})
|
@@ -44,6 +44,14 @@ require("lazy").setup({
|
|||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
-- LSP
|
-- LSP
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
@@ -55,9 +63,6 @@ require("lazy").setup({
|
|||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"nvim-java/nvim-java",
|
|
||||||
},
|
|
||||||
{ -- Autoformat
|
{ -- Autoformat
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufWritePre" },
|
event = { "BufWritePre" },
|
||||||
@@ -90,11 +95,9 @@ require("lazy").setup({
|
|||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
-- Conform can also run multiple formatters sequentially
|
python = { "isort", "black" },
|
||||||
-- python = { "isort", "black" },
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
--
|
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -109,9 +112,6 @@ require("lazy").setup({
|
|||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
version = "2.*",
|
version = "2.*",
|
||||||
build = (function()
|
build = (function()
|
||||||
-- Build Step is needed for regex support in snippets.
|
|
||||||
-- This step is not supported in many windows environments.
|
|
||||||
-- Remove the below condition to re-enable on windows.
|
|
||||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -133,42 +133,14 @@ require("lazy").setup({
|
|||||||
--- @type blink.cmp.Config
|
--- @type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
keymap = {
|
keymap = {
|
||||||
-- 'default' (recommended) for mappings similar to built-in completions
|
|
||||||
-- <c-y> to accept ([y]es) the completion.
|
|
||||||
-- This will auto-import if your LSP supports it.
|
|
||||||
-- This will expand snippets if the LSP sent a snippet.
|
|
||||||
-- 'super-tab' for tab to accept
|
|
||||||
-- 'enter' for enter to accept
|
|
||||||
-- 'none' for no mappings
|
|
||||||
--
|
|
||||||
-- For an understanding of why the 'default' preset is recommended,
|
|
||||||
-- you will need to read `:help ins-completion`
|
|
||||||
--
|
|
||||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
|
||||||
--
|
|
||||||
-- All presets have the following mappings:
|
|
||||||
-- <tab>/<s-tab>: move to right/left of your snippet expansion
|
|
||||||
-- <c-space>: Open menu or open docs if already open
|
|
||||||
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
|
|
||||||
-- <c-e>: Hide menu
|
|
||||||
-- <c-k>: Toggle signature help
|
|
||||||
--
|
|
||||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
|
||||||
preset = "default",
|
preset = "default",
|
||||||
|
|
||||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
|
||||||
},
|
},
|
||||||
|
|
||||||
appearance = {
|
appearance = {
|
||||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
|
||||||
-- Adjusts spacing to ensure icons are aligned
|
|
||||||
nerd_font_variant = "mono",
|
nerd_font_variant = "mono",
|
||||||
},
|
},
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
-- By default, you may press `<c-space>` to show the documentation.
|
|
||||||
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
|
||||||
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -180,17 +152,7 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
snippets = { preset = "luasnip" },
|
snippets = { preset = "luasnip" },
|
||||||
|
|
||||||
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
|
|
||||||
-- which automatically downloads a prebuilt binary when enabled.
|
|
||||||
--
|
|
||||||
-- By default, we use the Lua implementation instead, but you may enable
|
|
||||||
-- the rust implementation via `'prefer_rust_with_warning'`
|
|
||||||
--
|
|
||||||
-- See :h blink-cmp-config-fuzzy for more information
|
|
||||||
fuzzy = { implementation = "lua" },
|
fuzzy = { implementation = "lua" },
|
||||||
|
|
||||||
-- Shows a signature help window while you type arguments for a function
|
|
||||||
signature = { enabled = true },
|
signature = { enabled = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -208,8 +170,6 @@ require("lazy").setup({
|
|||||||
opts = {},
|
opts = {},
|
||||||
-- Optional dependencies
|
-- Optional dependencies
|
||||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
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,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
require("oil").setup({
|
require("oil").setup({
|
||||||
@@ -218,6 +178,23 @@ require("lazy").setup({
|
|||||||
vim.keymap.set("n", "-", "<cmd>Oil<CR>", { desc = "open parent directory" })
|
vim.keymap.set("n", "-", "<cmd>Oil<CR>", { desc = "open parent directory" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{ "numToStr/Comment.nvim", opts = {} },
|
||||||
|
{ "windwp/nvim-autopairs", event = "InsertEnter", opts = {} },
|
||||||
|
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
|
||||||
|
{
|
||||||
|
"karb94/neoscroll.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("neoscroll").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sphamba/smear-cursor.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
smear_between_neighbour_lines = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
@@ -21,16 +21,52 @@ local servers = {
|
|||||||
lua_ls = {
|
lua_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
path = {
|
||||||
|
"?.lua",
|
||||||
|
"?/init.lua",
|
||||||
|
vim.fn.stdpath("data") .. "lazy/?.lua",
|
||||||
|
vim.fn.stdpath("data") .. "lazy/?/init.lua",
|
||||||
|
},
|
||||||
|
},
|
||||||
completion = {
|
completion = {
|
||||||
callSnippet = "Replace",
|
callSnippet = "Replace",
|
||||||
|
keywordSnippet = "Replace",
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
|
useLocalExclude = { "_*" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
vim.api.nvim_get_runtime_file("", true),
|
||||||
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
|
},
|
||||||
|
maxPreload = 2000,
|
||||||
|
preloadFileSize = 50000,
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pyright = {
|
||||||
|
settings = {
|
||||||
|
pyright = {
|
||||||
|
disableOrganizeImports = true,
|
||||||
|
},
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
autoSearchPaths = true,
|
||||||
|
diagnosticMode = "workspace",
|
||||||
|
useLibraryCodeForTypes = true,
|
||||||
|
typeCheckingMode = "basic",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ts_ls = {},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
|
Reference in New Issue
Block a user