nvim
This commit is contained in:
parent
46797f10b5
commit
ef380f5329
13 changed files with 239 additions and 52 deletions
|
@ -2,3 +2,4 @@ require("options")
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
require("keymaps")
|
require("keymaps")
|
||||||
require("autocmd")
|
require("autocmd")
|
||||||
|
require("snippets")
|
||||||
|
|
|
@ -1,24 +1,29 @@
|
||||||
{
|
{
|
||||||
"blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" },
|
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
|
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
"hardtime.nvim": { "branch": "main", "commit": "145b930954a3146cfb5b8a73cdcad42eb7d2740c" },
|
||||||
"js-i18n.nvim": { "branch": "main", "commit": "124f22f91d51e85641ba10e9a32f3b858394c2dd" },
|
"js-i18n.nvim": { "branch": "main", "commit": "124f22f91d51e85641ba10e9a32f3b858394c2dd" },
|
||||||
"lackluster.nvim": { "branch": "main", "commit": "d2519d14b2b6e9eef05752d5d4486ed5c48d6178" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
|
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "67da97f8c2fd12d05427bb485ce07ee6418e0a51" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||||
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
|
"mentor.nvim": { "branch": "main", "commit": "c89148673b56e96fab5d201594457828be5dae96" },
|
||||||
|
"neotest": { "branch": "master", "commit": "ef492755730e59e1d8122c461abbd086bee4c76b" },
|
||||||
|
"neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" },
|
"nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" },
|
"nvim-surround": { "branch": "main", "commit": "8dd9150ca7eae5683660ea20cec86edcd5ca4046" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"smear-cursor.nvim": { "branch": "main", "commit": "8820b313e49a018c7d56fc309c51363c0e9ae653" },
|
"smear-cursor.nvim": { "branch": "main", "commit": "162703638203060b1d3412e73429d232bbd2627e" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
|
|
|
@ -1,25 +1,23 @@
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system {
|
local out = vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"--branch=stable",
|
"--branch=stable",
|
||||||
lazyrepo,
|
lazyrepo,
|
||||||
lazypath
|
lazypath,
|
||||||
}
|
})
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
error("Error cloning lazy.nvim:\n" .. out)
|
error("Error cloning lazy.nvim:\n" .. out)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup(
|
require("lazy").setup({ import = "plugins" }, { install = { colorscheme = { "tokyonight-storm" } } })
|
||||||
{ import = "plugins" },
|
|
||||||
{ install = { colorscheme = { "tokyonight-storm" } } }
|
|
||||||
)
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ vim.keymap.set("v", ";", ":", { desc = "command with ;" })
|
||||||
vim.keymap.set("n", "q", ":bd<cr>", { desc = "close buffer" })
|
vim.keymap.set("n", "q", ":bd<cr>", { desc = "close buffer" })
|
||||||
vim.keymap.set("n", "Q", ":%bd<cr>", { desc = "close all buffers" })
|
vim.keymap.set("n", "Q", ":%bd<cr>", { desc = "close all buffers" })
|
||||||
vim.keymap.set({ "n", "v" }, "d", '"_d', { desc = "delete without cut" })
|
vim.keymap.set({ "n", "v" }, "d", '"_d', { desc = "delete without cut" })
|
||||||
vim.keymap.set({ "n", "v" }, "c", '"_c', { desc = "ddelete without cutelete without cut" })
|
vim.keymap.set({ "n", "v" }, "c", '"_c', { desc = "delete without cut" })
|
||||||
vim.keymap.set({ "v", "n" }, "vv", "<C-v>", { desc = "vv for visual block" })
|
vim.keymap.set({ "v", "n" }, "vv", "<C-v>", { desc = "vv for visual block" })
|
||||||
vim.keymap.set("i", "jj", "<ESC>", { silent = true, desc = "back to normal with jj" })
|
vim.keymap.set("i", "jj", "<ESC>", { silent = true, desc = "back to normal with jj" })
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
|
@ -32,6 +32,9 @@ vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right win
|
||||||
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<S-h>", ":bprevious<CR>", { desc = "Previous buffer" })
|
||||||
|
vim.keymap.set("n", "<S-l>", ":bnext<CR>", { desc = "Next buffer" })
|
||||||
|
|
||||||
vim.keymap.set("v", "<C-r>", function()
|
vim.keymap.set("v", "<C-r>", function()
|
||||||
-- get contents of visual selection
|
-- get contents of visual selection
|
||||||
-- handle unpack deprecation
|
-- handle unpack deprecation
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
dependencies = { "rafamadriz/friendly-snippets" },
|
dependencies = {
|
||||||
|
{ "L3MON4D3/LuaSnip", version = "v2.*" },
|
||||||
|
},
|
||||||
version = "1.*",
|
version = "1.*",
|
||||||
opts = {
|
opts = {
|
||||||
fuzzy = {
|
fuzzy = {
|
||||||
|
@ -15,11 +17,7 @@ return {
|
||||||
"sort_text",
|
"sort_text",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keymap = {
|
keymap = { preset = "enter" },
|
||||||
preset = "super-tab",
|
|
||||||
["<C-CR>"] = { "show", "show_documentation", "hide_documentation" },
|
|
||||||
["<C-space>"] = {},
|
|
||||||
},
|
|
||||||
completion = {
|
completion = {
|
||||||
-- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger
|
-- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger
|
||||||
-- characters.
|
-- characters.
|
||||||
|
@ -39,9 +37,10 @@ return {
|
||||||
scrollbar = false,
|
scrollbar = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
snippets = { preset = "luasnip" },
|
||||||
sources = {
|
sources = {
|
||||||
-- add lazydev to your completion providers
|
-- add lazydev to your completion providers
|
||||||
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
|
default = { "lazydev", "snippets", "lsp", "path", "buffer" },
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = {
|
lazydev = {
|
||||||
name = "LazyDev",
|
name = "LazyDev",
|
||||||
|
|
13
.config/nvim/lua/plugins/hardtime.lua
Normal file
13
.config/nvim/lua/plugins/hardtime.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
"m4xshen/hardtime.nvim",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
|
opts = {
|
||||||
|
disabled_keys = {
|
||||||
|
["<Up>"] = false,
|
||||||
|
["<Down>"] = false,
|
||||||
|
["<Left>"] = false,
|
||||||
|
["<Right>"] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
54
.config/nvim/lua/plugins/luasnip.lua
Normal file
54
.config/nvim/lua/plugins/luasnip.lua
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
return {
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
-- follow latest release.
|
||||||
|
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||||
|
-- install jsregexp (optional!).
|
||||||
|
build = "make install_jsregexp",
|
||||||
|
dependencies = {
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("luasnip").setup({
|
||||||
|
update_events = "TextChanged,TextChangedI",
|
||||||
|
})
|
||||||
|
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>rs",
|
||||||
|
":source ~/.config/nvim/lua/snippets.lua<CR>",
|
||||||
|
desc = "[R]eload [s]nippets",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Tab>",
|
||||||
|
function()
|
||||||
|
if require("luasnip").locally_jumpable(1) then
|
||||||
|
require("luasnip").jump(1)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
mode = { "i", "s" },
|
||||||
|
desc = "next snippet placeholder",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<S-Tab>",
|
||||||
|
function()
|
||||||
|
if require("luasnip").locally_jumpable(-1) then
|
||||||
|
require("luasnip").jump(-1)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
mode = { "i", "s" },
|
||||||
|
desc = "prev snippet placeholder",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<C-E>",
|
||||||
|
function()
|
||||||
|
if require("luasnip").choice_active() then
|
||||||
|
require("luasnip").change_choice(1)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
mode = { "i", "s" },
|
||||||
|
desc = "prev snippet placeholder",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
9
.config/nvim/lua/plugins/mentor.lua
Normal file
9
.config/nvim/lua/plugins/mentor.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
"cksidharthan/mentor.nvim",
|
||||||
|
opts = {
|
||||||
|
tips = {
|
||||||
|
"You can use shift+a to jump to end of line in insert mode.",
|
||||||
|
"Shift+p to paste in visual mode multiple times",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
58
.config/nvim/lua/plugins/neotest.lua
Normal file
58
.config/nvim/lua/plugins/neotest.lua
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
return {
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-neotest/neotest-jest",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>tt",
|
||||||
|
function()
|
||||||
|
require("neotest").run.run()
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "[T]est run under cursor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ts",
|
||||||
|
function()
|
||||||
|
require("neotest").summary.toggle()
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "[T]est [s]tatus",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tf",
|
||||||
|
function()
|
||||||
|
require("neotest").run.run(vim.fn.expand("%"))
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "[T]est [f]ile",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tw",
|
||||||
|
function()
|
||||||
|
require("neotest").watch.watch()
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "[T]est [w]atch under cursor",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neotest").setup({
|
||||||
|
discovery = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
adapters = {
|
||||||
|
require("neotest-jest")({
|
||||||
|
cwd = function(path)
|
||||||
|
return vim.fn.getcwd()
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
|
@ -10,7 +10,9 @@ return {
|
||||||
input = { enabled = true },
|
input = { enabled = true },
|
||||||
notifier = {
|
notifier = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
timeout = 3000,
|
timeout = 10000,
|
||||||
|
width = { min = 40, max = 1000 },
|
||||||
|
height = { min = 1, max = 1000 },
|
||||||
},
|
},
|
||||||
picker = {
|
picker = {
|
||||||
matcher = {
|
matcher = {
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
return {
|
|
||||||
-- "pmizio/typescript-tools.nvim",
|
|
||||||
-- dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
|
||||||
-- opts = {
|
|
||||||
-- settings = {
|
|
||||||
-- jsx_close_tag = {
|
|
||||||
-- enable = true,
|
|
||||||
-- filetypes = { "javascriptreact", "typescriptreact" },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
}
|
|
57
.config/nvim/lua/snippets.lua
Normal file
57
.config/nvim/lua/snippets.lua
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
|
||||||
|
-- lua snippets
|
||||||
|
ls.add_snippets("lua", {
|
||||||
|
s(
|
||||||
|
"lreq",
|
||||||
|
fmt('local {name} = require("{mod}{rep}")', {
|
||||||
|
name = i(1, "name"),
|
||||||
|
rep = rep(1),
|
||||||
|
mod = i(2),
|
||||||
|
})
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- js/ts/sx snippets
|
||||||
|
|
||||||
|
local import = s(
|
||||||
|
"im",
|
||||||
|
fmt("import {name} from '{module}';", {
|
||||||
|
module = i(1),
|
||||||
|
name = c(2, { i(nil), fmt("{{{}}}", { i(1) }) }),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
ls.add_snippets("typescript", {
|
||||||
|
import,
|
||||||
|
})
|
||||||
|
|
||||||
|
ls.add_snippets("typescriptreact", {
|
||||||
|
import,
|
||||||
|
})
|
|
@ -235,7 +235,7 @@ exec udiskie -t
|
||||||
exec syncthing serve
|
exec syncthing serve
|
||||||
exec swaylock
|
exec swaylock
|
||||||
exec tuxedo-control-center --tray
|
exec tuxedo-control-center --tray
|
||||||
|
exec swaykbdd
|
||||||
|
|
||||||
### Idle configuration
|
### Idle configuration
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue