save
This commit is contained in:
3
nvim/bak.config/nvim/init.lua
Normal file
3
nvim/bak.config/nvim/init.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
require("vxclutch")
|
||||
|
||||
-- greetings
|
||||
32
nvim/bak.config/nvim/lazy-lock.json
Normal file
32
nvim/bak.config/nvim/lazy-lock.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-tw2css": { "branch": "main", "commit": "1abe0eebcb57fcbd5538d054f0db61f4e4a1302b" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6dc21d4ce050c2e592d9635b7983d67baf216e3d" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "a0abbf18084b77d28bc70e24752e4f4fd54aea17" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "0797734e2bf229cc67b05e82a17e22a18f191913" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "44a3ab2bc6b40edeb7a76359826c9779d5c70cb5" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
||||
"oil.nvim": { "branch": "master", "commit": "09fa1d22f5edf0730824d2b222d726c8c81bbdc9" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||
"rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "706b1abc1697ca050314dc667e0900d53cad8aa4" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
|
||||
}
|
||||
3
nvim/bak.config/nvim/lua/vxclutch/init.lua
Normal file
3
nvim/bak.config/nvim/lua/vxclutch/init.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
require("vxclutch.set")
|
||||
require("vxclutch.remap")
|
||||
require("vxclutch.lazy_init")
|
||||
33
nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua
Normal file
33
nvim/bak.config/nvim/lua/vxclutch/lazy/colors.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
config = function()
|
||||
require("tokyonight").setup({
|
||||
style = "storm",
|
||||
transparent = true,
|
||||
terminal_colors = true,
|
||||
styles = {
|
||||
comments = { italic = false },
|
||||
keywords = { italic = false },
|
||||
sidebars = "dark",
|
||||
floats = "dark",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
require("rose-pine").setup({ disable_background = true })
|
||||
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
ColorMyPencils()
|
||||
end,
|
||||
},
|
||||
}
|
||||
42
nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua
Normal file
42
nvim/bak.config/nvim/lua/vxclutch/lazy/format.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
dependencies = {
|
||||
"tpope/vim-sleuth",
|
||||
},
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
require("conform").format { async = true, lsp_fallback = true }
|
||||
end,
|
||||
mode = "",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
},
|
||||
hooks = {
|
||||
pre_format = function(lines, _)
|
||||
-- Strip comments
|
||||
local no_comments = {}
|
||||
for _, line in ipairs(lines) do
|
||||
if not line:match "%s*//" and not line:match "%s*/%*.*%*/" then
|
||||
table.insert(no_comments, line)
|
||||
end
|
||||
end
|
||||
return no_comments
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
18
nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua
Normal file
18
nvim/bak.config/nvim/lua/vxclutch/lazy/git.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
},
|
||||
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
32
nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua
Normal file
32
nvim/bak.config/nvim/lua/vxclutch/lazy/harpoon.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function()
|
||||
harpoon:list():add()
|
||||
end)
|
||||
vim.keymap.set("n", "<C-e>", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<C-1>", function()
|
||||
harpoon:list():select(1)
|
||||
end)
|
||||
vim.keymap.set("n", "<C-2>", function()
|
||||
harpoon:list():select(2)
|
||||
end)
|
||||
vim.keymap.set("n", "<C-3>", function()
|
||||
harpoon:list():select(3)
|
||||
end)
|
||||
vim.keymap.set("n", "<C-4>", function()
|
||||
harpoon:list():select(4)
|
||||
end)
|
||||
end,
|
||||
}
|
||||
166
nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua
Normal file
166
nvim/bak.config/nvim/lua/vxclutch/lazy/lsp.lua
Normal file
@@ -0,0 +1,166 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
||||
"j-hui/fidget.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"jcha0713/cmp-tw2css",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
|
||||
config = function()
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = "rounded" },
|
||||
})
|
||||
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local cmp_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
cmp_lsp.default_capabilities()
|
||||
)
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpNormal", {})
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-e>"] = vim.NIL,
|
||||
}),
|
||||
window = {
|
||||
completion = {
|
||||
scrollbar = false,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
documentation = {
|
||||
scrollbar = false,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{
|
||||
name = "nvim_lsp",
|
||||
max_item_count = 5,
|
||||
entry_filter = function(entry, _)
|
||||
return cmp.lsp.CompletionItemKind.Snippet ~= entry:get_kind()
|
||||
end,
|
||||
},
|
||||
{ name = "cmp-tw2css" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {},
|
||||
})
|
||||
|
||||
require("fidget").setup({})
|
||||
require("mason").setup()
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
automatic_installation = false,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"tinymist",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
|
||||
["lua_ls"] = function()
|
||||
require("lspconfig").lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
["clangd"] = function()
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = { "clangd", "--header-insertion=iwyu" },
|
||||
})
|
||||
end,
|
||||
|
||||
["tinymist"] = function()
|
||||
require("lspconfig").tinymist.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
formatterMode = "typstyle",
|
||||
exportPdf = "never",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local l = vim.lsp
|
||||
l.handlers["textDocument/hover"] = function(_, result, ctx, config)
|
||||
config = config or { border = "rounded", focusable = true }
|
||||
config.focus_id = ctx.method
|
||||
if not (result and result.contents) then
|
||||
return
|
||||
end
|
||||
local markdown_lines = l.util.convert_input_to_markdown_lines(result.contents)
|
||||
markdown_lines = vim.tbl_filter(function(line)
|
||||
return line ~= ""
|
||||
end, markdown_lines)
|
||||
if vim.tbl_isempty(markdown_lines) then
|
||||
return
|
||||
end
|
||||
return l.util.open_floating_preview(markdown_lines, "markdown", config)
|
||||
end
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
pattern = { "*.vert", "*.frag" },
|
||||
callback = function()
|
||||
vim.cmd("set filetype=glsl")
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("LspAttach", {
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
25
nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua
Normal file
25
nvim/bak.config/nvim/lua/vxclutch/lazy/luasnip.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/vxclutch/snippets/" })
|
||||
|
||||
local ls = require("luasnip")
|
||||
vim.keymap.set({ "i" }, "<C-e>", function()
|
||||
ls.expand()
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-J>", function()
|
||||
ls.jump(1)
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-K>", function()
|
||||
ls.jump(-1)
|
||||
end, { silent = true })
|
||||
|
||||
ls.config.setup({
|
||||
enable_autosnippets = true,
|
||||
region_check_events = "InsertEnter",
|
||||
delete_check_events = "InsertLeave",
|
||||
})
|
||||
end,
|
||||
}
|
||||
23
nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua
Normal file
23
nvim/bak.config/nvim/lua/vxclutch/lazy/mini.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = false,
|
||||
config = function()
|
||||
require("mini.ai").setup()
|
||||
require("mini.surround").setup()
|
||||
require("mini.pick").setup {
|
||||
window = {
|
||||
config = {
|
||||
anchor = "NW",
|
||||
row = 0,
|
||||
col = 0,
|
||||
width = 30,
|
||||
},
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
},
|
||||
options = {
|
||||
use_cache = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
37
nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua
Normal file
37
nvim/bak.config/nvim/lua/vxclutch/lazy/oil.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
require("oil").setup({
|
||||
default_file_explorer = true,
|
||||
delete_to_trash = true,
|
||||
skip_confirm_for_simple_edits = true,
|
||||
use_default_keymaps = true,
|
||||
keymaps = {
|
||||
["g?"] = { "actions.show_help", mode = "n" },
|
||||
["<CR>"] = { "actions.select" },
|
||||
["<C-s>"] = false,
|
||||
["<C-h>"] = false,
|
||||
["<C-t>"] = false,
|
||||
["<C-p>"] = false,
|
||||
["<C-c>"] = false,
|
||||
["<C-r>"] = { "actions.refresh" },
|
||||
["-"] = { "actions.parent", mode = "n" },
|
||||
["_"] = { "actions.open_cwd", mode = "n" },
|
||||
["<leader>d"] = { "actions.cd", mode = "n" },
|
||||
["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
|
||||
["gs"] = false,
|
||||
["gx"] = { "actions.open_external" },
|
||||
["g."] = { "actions.toggle_hidden", mode = "n" },
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
natural_order = true,
|
||||
is_always_hidden = function(name, _)
|
||||
return name == ".." or name == ".git"
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
37
nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua
Normal file
37
nvim/bak.config/nvim/lua/vxclutch/lazy/snacks.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
return {
|
||||
{
|
||||
-- this is a sort of related
|
||||
"stevearc/dressing.nvim",
|
||||
},
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>t",
|
||||
function()
|
||||
Snacks.terminal.toggle()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<leader>lg",
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
49
nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua
Normal file
49
nvim/bak.config/nvim/lua/vxclutch/lazy/telescope.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local data = assert(vim.fn.stdpath "data") --[[@as string]]
|
||||
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
wrap_results = true,
|
||||
|
||||
fzf = {},
|
||||
history = {
|
||||
path = vim.fs.joinpath(data, "telescope_history.sqlite3"),
|
||||
limit = 100,
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "smart_history")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
local builtin = require "telescope.builtin"
|
||||
|
||||
vim.keymap.set("n", "<space>pf", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files)
|
||||
vim.keymap.set("n", "<space>fh", builtin.help_tags)
|
||||
vim.keymap.set("n", "<space>fg", builtin.git_files)
|
||||
vim.keymap.set("n", "<space>/", builtin.current_buffer_fuzzy_find)
|
||||
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string { search = vim.fn.input "Grep > " }
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>en", function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath "config" }
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
61
nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua
Normal file
61
nvim/bak.config/nvim/lua/vxclutch/lazy/treesitter.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"c",
|
||||
"lua",
|
||||
"bash",
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = false,
|
||||
}
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
if lang == "html" then
|
||||
print "disabled"
|
||||
return true
|
||||
end
|
||||
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
vim.notify(
|
||||
"File larger than 100KB treesitter disabled for performance",
|
||||
vim.log.levels.WARN,
|
||||
{ title = "Treesitter" }
|
||||
)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = { "markdown" },
|
||||
},
|
||||
}
|
||||
|
||||
end,
|
||||
}
|
||||
12
nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua
Normal file
12
nvim/bak.config/nvim/lua/vxclutch/lazy/trouble.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
},
|
||||
}
|
||||
17
nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua
Normal file
17
nvim/bak.config/nvim/lua/vxclutch/lazy_init.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = "vxclutch.lazy",
|
||||
change_detection = { notify = false },
|
||||
})
|
||||
36
nvim/bak.config/nvim/lua/vxclutch/remap.lua
Normal file
36
nvim/bak.config/nvim/lua/vxclutch/remap.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend("force", options, opts)
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
-- Remove search highlight --
|
||||
map("n", "<Esc>", ":nohlsearch<CR>")
|
||||
|
||||
-- Move lines --
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- Scrolling --
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
map("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- File navigation --
|
||||
map("n", "<leader>o", ":Oil<CR>")
|
||||
|
||||
-- LSP
|
||||
map("n", "gd", vim.lsp.buf.definition)
|
||||
map("n", "<leader>r", vim.lsp.buf.rename, { noremap = true, silent = true })
|
||||
|
||||
-- Window Controls
|
||||
map("n", "<C-h>", "<C-w><C-h>")
|
||||
map("n", "<C-l>", "<C-w><C-l>")
|
||||
map("n", "<C-j>", "<C-w><C-j>")
|
||||
map("n", "<C-k>", "<C-w><C-k>")
|
||||
|
||||
-- Typst
|
||||
map("n", "<leader>p", "tinymist preview " .. vim.fn.expand("%:t"))
|
||||
40
nvim/bak.config/nvim/lua/vxclutch/set.lua
Normal file
40
nvim/bak.config/nvim/lua/vxclutch/set.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local opt = vim.opt
|
||||
|
||||
-- command mode --
|
||||
opt.inccommand = "split"
|
||||
opt.smartcase = true
|
||||
opt.ignorecase = true
|
||||
|
||||
-- line numbers --
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
-- splits --
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
|
||||
-- tabs --
|
||||
opt.shiftwidth = 2
|
||||
opt.tabstop = 2
|
||||
opt.expandtab = true
|
||||
|
||||
-- cursor --
|
||||
opt.guicursor = ""
|
||||
opt.scrolloff = 8
|
||||
|
||||
-- format --
|
||||
vim.cmd('autocmd BufEnter * set formatoptions-=cro')
|
||||
vim.cmd('autocmd BufEnter * setlocal formatoptions-=cro')
|
||||
opt.signcolumn = "yes"
|
||||
opt.termguicolors = true
|
||||
opt.colorcolumn = "80"
|
||||
opt.wrap = false
|
||||
|
||||
-- Changes --
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Statusline --
|
||||
vim.o.statusline = "%f %m"
|
||||
3
nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua
Normal file
3
nvim/bak.config/nvim/lua/vxclutch/snippets/all.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
s("date", t(os.date("%Y/%m/%d")))
|
||||
}
|
||||
33
nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua
Normal file
33
nvim/bak.config/nvim/lua/vxclutch/snippets/c.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
|
||||
return {
|
||||
s(
|
||||
{ trig = "main" },
|
||||
fmta(
|
||||
[[
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
<>
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
{ i(1), i(2), i(3) }
|
||||
)
|
||||
),
|
||||
|
||||
s(
|
||||
{ trig = "for" },
|
||||
fmta(
|
||||
[[
|
||||
for (int i = <>; i <>; i++) {
|
||||
<>
|
||||
}
|
||||
]],
|
||||
{ i(1), i(2), i(3) }
|
||||
)
|
||||
),
|
||||
}
|
||||
26
nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua
Normal file
26
nvim/bak.config/nvim/lua/vxclutch/snippets/typst.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
return {
|
||||
s(
|
||||
{ trig = "mla" },
|
||||
fmta(
|
||||
[[
|
||||
Owen Westness
|
||||
|
||||
#datetime.today().display("d MMMM yyyy")
|
||||
|
||||
<>
|
||||
]],
|
||||
{ i(1) }
|
||||
)
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user