Muh dotfiles
This commit is contained in:
18
.config/nvim/lua/plugins/cmp.lua
Normal file
18
.config/nvim/lua/plugins/cmp.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter", -- , "CmdlineEnter"
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
|
||||
{
|
||||
"L3MON4D3/LuaSnip", -- jsregexp is optional
|
||||
dependencies = "rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip", -- TODO
|
||||
},
|
||||
config = function() require "configs.cmp" end
|
||||
}
|
23
.config/nvim/lua/plugins/colorschemes.lua
Normal file
23
.config/nvim/lua/plugins/colorschemes.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local function config(test, opts)
|
||||
opts.transparent = true
|
||||
|
||||
require("tokyonight").setup(opts)
|
||||
vim.cmd.colorscheme "tokyonight"
|
||||
end
|
||||
|
||||
return {
|
||||
"navarasu/onedark.nvim",
|
||||
{
|
||||
"scottmckendry/cyberdream.nvim",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
config = config,
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false, -- for priority to work
|
||||
priority = 1000, -- load before all other start plugins
|
||||
config = config,
|
||||
opts = { style = "moon" },
|
||||
}
|
||||
}
|
10
.config/nvim/lua/plugins/comment.lua
Normal file
10
.config/nvim/lua/plugins/comment.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
keys = {
|
||||
{ "gc", mode = { "n", "x" } },
|
||||
{ "gb", mode = { "n", "x" } },
|
||||
{ "gp", "yy<Plug>(comment_toggle_linewise_current)p" },
|
||||
{ "gp", "ygv<Plug>(comment_toggle_blockwise_visual)'>o<CR>p==", mode = "x" },
|
||||
},
|
||||
opts = {}
|
||||
}
|
5
.config/nvim/lua/plugins/gitsigns.lua
Normal file
5
.config/nvim/lua/plugins/gitsigns.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "User VeryLazyFile",
|
||||
config = function() require "configs.gitsigns" end
|
||||
}
|
31
.config/nvim/lua/plugins/harpoon.lua
Normal file
31
.config/nvim/lua/plugins/harpoon.lua
Normal file
@ -0,0 +1,31 @@
|
||||
return {
|
||||
"ThePrimeagen/harpoon", branch = "harpoon2",
|
||||
dependencies = "nvim-lua/plenary.nvim",
|
||||
keys = {
|
||||
{ "<Leader>a", desc = "Append harpoon" },
|
||||
{ "<Leader>A", desc = "Prepend harpoon" },
|
||||
{ "<Leader>m", desc = "Harpoon menu" },
|
||||
{ "<Leader>M", desc = "Harpoon clear" },
|
||||
"<C-n>", "<C-p>", "]m", "[m",
|
||||
"ñ", "é", "í", "ó", -- AltGr Colemak layer
|
||||
},
|
||||
config = function()
|
||||
local harpoon = require "harpoon"
|
||||
harpoon:setup()
|
||||
|
||||
Lmap("a", function() harpoon:list():append() end)
|
||||
Lmap("A", function() harpoon:list():prepend() end)
|
||||
Lmap("m", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
Lmap("M", function() harpoon:list():clear() end)
|
||||
MakePair("m", "harpoon", function() harpoon:list():next() end, function() harpoon:list():prev() end)
|
||||
|
||||
local map = vim.keymap.set
|
||||
map("n", "<C-p>", function() harpoon:list():prev() end)
|
||||
map("n", "<C-n>", function() harpoon:list():next() end)
|
||||
-- TODO ._.
|
||||
map("n", "ñ", function() harpoon:list():select(1) end)
|
||||
map("n", "é", function() harpoon:list():select(2) end)
|
||||
map("n", "í", function() harpoon:list():select(3) end)
|
||||
map("n", "ó", function() harpoon:list():select(4) end)
|
||||
end
|
||||
}
|
22
.config/nvim/lua/plugins/langmapper.lua
Normal file
22
.config/nvim/lua/plugins/langmapper.lua
Normal file
@ -0,0 +1,22 @@
|
||||
return {} -- can't really make this to work normally
|
||||
-- 'Wansmer/langmapper.nvim',
|
||||
-- lazy = false,
|
||||
-- priority = 1,
|
||||
-- opts = {},
|
||||
-- init = function()
|
||||
-- local ua = [['йцукенгшщзхїґфівапролджєячсмитьбю.]]
|
||||
-- local UA = [[ʼЙЦУКЕНГШЩЗХЇҐФІВАПРОЛДЖЄЯЧСМИТЬБЮ,]]
|
||||
-- local en = [[`qwfpgjluy;[]\arstdhneio'zxcvbkm,./]]
|
||||
-- local EN = [[~QWFPGJLUY:{}|ARSTDHNEIO"ZXCVBKM<>?]]
|
||||
--
|
||||
-- local function escape(str)
|
||||
-- local escape_chars = [[;,."|\]]
|
||||
-- return vim.fn.escape(str, escape_chars)
|
||||
-- end
|
||||
--
|
||||
-- vim.opt.langmap = vim.fn.join({
|
||||
-- escape(UA) .. ';' .. escape(EN),
|
||||
-- escape(ua) .. ';' .. escape(en),
|
||||
-- }, ',')
|
||||
-- end
|
||||
-- }
|
144
.config/nvim/lua/plugins/mason-lspconfig.lua
Normal file
144
.config/nvim/lua/plugins/mason-lspconfig.lua
Normal file
@ -0,0 +1,144 @@
|
||||
local M = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
event = "BufReadPre",
|
||||
dependencies = { -- load those first
|
||||
"mason.nvim",
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function() require "configs.lspconfig" end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.opts = {
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"bashls",
|
||||
"tinymist",
|
||||
"rust_analyzer",
|
||||
"yamlls",
|
||||
"clangd",
|
||||
"jdtls",
|
||||
"hyprls",
|
||||
-- "sqls",
|
||||
-- "arduino_language_server",
|
||||
-- "cmake",
|
||||
--"csharp_ls", -- piece of
|
||||
-- "hls", -- Haskell
|
||||
-- "taplo", -- toml
|
||||
-- "jsonls",
|
||||
-- "ruff_lsp", -- Python
|
||||
},
|
||||
|
||||
handlers = { -- automatic server setup
|
||||
function(server_name) -- default handler
|
||||
package.loaded.lspconfig[server_name].setup {}
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
M.opts.handlers.lua_ls = function()
|
||||
package.loaded.lspconfig.lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
M.opts.handlers.harper_ls = function()
|
||||
package.loaded.lspconfig.harper_ls.setup {
|
||||
settings = { -- https://writewithharper.com/docs/integrations/neovim
|
||||
["harper-ls"] = {
|
||||
isolateEnglish = true, -- highly experimental
|
||||
fileDictPath = vim.fn.stdpath("config") .. "/spell/spell/",
|
||||
userDictPath = vim.fn.stdpath("config") .. "/spell/en.utf-8.add",
|
||||
codeActions = {
|
||||
forceStable = true -- preserve the order of actions
|
||||
},
|
||||
diagnosticSeverity = "information" -- "hint", "information", "warning", "error"
|
||||
-- markdown = { ignore_link_title = true }
|
||||
-- linters = { -- turned off by default
|
||||
-- spelled_numbers = false, wrong_quotes = false, linking_verbs = false,
|
||||
-- boring_words = false, use_genitive = false, plural_conjugate = false,
|
||||
-- no_oxford_comma = false,
|
||||
-- }
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
-- https://myriad-dreamin.github.io/tinymist//frontend/neovim.html
|
||||
M.opts.handlers.tinymist = function()
|
||||
package.loaded.lspconfig.tinymist.setup {
|
||||
settings = {
|
||||
formatterPrintWidth = 100, -- can't stand 120
|
||||
formatterMode = "typstyle", -- or typstfmt
|
||||
-- exportPdf = "onDocumentHasTitle", -- default: never
|
||||
semanticTokens = "enable"
|
||||
},
|
||||
single_file_support = true,
|
||||
root_dir = function(_, bufnr)
|
||||
return vim.fs.root(bufnr, { ".git" }) or vim.fn.expand "%:p:h"
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
M.opts.handlers.yamlls = function()
|
||||
package.loaded.lspconfig.yamlls.setup {
|
||||
settings = {
|
||||
yaml = {
|
||||
format = { enable = true },
|
||||
schemaStore = { enable = true },
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
M.opts.handlers.rust_analyzer = function() -- TODO
|
||||
package.loaded.lspconfig.rust_analyzer.setup {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
loadOutDirsFromCheck = true,
|
||||
runBuildScripts = true,
|
||||
},
|
||||
-- Add clippy lints for Rust.
|
||||
checkOnSave = true,
|
||||
check = {
|
||||
-- allFeatures = true,
|
||||
command = "clippy",
|
||||
extraArgs = {
|
||||
"--",
|
||||
"--no-deps", -- run Clippy only on the given crate
|
||||
-- Deny, Warn, Allow, Forbid
|
||||
"-Wclippy::correctness", -- code that is outright wrong or useless
|
||||
"-Wclippy::complexity", -- code that does something simple but in a complex way
|
||||
"-Wclippy::suspicious", -- code that is most likely wrong or useless
|
||||
"-Wclippy::style", -- code that should be written in a more idiomatic way
|
||||
"-Wclippy::perf", -- code that can be written to run faster
|
||||
"-Wclippy::pedantic", -- lints which are rather strict or have occasional false positives
|
||||
"-Wclippy::nursery", -- new lints that are still under development
|
||||
"-Wclippy::cargo", -- lints for the cargo manifest
|
||||
-- Use in production
|
||||
"-Aclippy::restriction", -- lints which prevent the use of language and library features
|
||||
-- Other
|
||||
"-Aclippy::must_use_candidate", -- must_use is rather annoing
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
-- ignored = {
|
||||
-- ["async-trait"] = { "async_trait" },
|
||||
-- ["napi-derive"] = { "napi" },
|
||||
-- ["async-recursion"] = { "async_recursion" },
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
14
.config/nvim/lua/plugins/mason.lua
Normal file
14
.config/nvim/lua/plugins/mason.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ui = {
|
||||
height = 0.8,
|
||||
border = vim.g.border,
|
||||
icons = {
|
||||
package_pending = "",
|
||||
package_installed = "",
|
||||
package_uninstalled = "⤫"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
.config/nvim/lua/plugins/telescope.lua
Normal file
16
.config/nvim/lua/plugins/telescope.lua
Normal file
@ -0,0 +1,16 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim", branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }
|
||||
},
|
||||
keys = { -- so lazy 🥱
|
||||
{ "<Leader>s", desc = "Load Telescope", mode = { "n", "x" } },
|
||||
-- { "<Leader>o", desc = "Find old files" },
|
||||
{ "<Leader>.", desc = "Find files in ." },
|
||||
{ "<Leader>/", desc = "Telescope /" },
|
||||
{ "<Leader>f", desc = "Find files" },
|
||||
},
|
||||
config = function() require "configs.telescope" end
|
||||
}
|
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = "User LazyFile",
|
||||
-- lazy = false, --TODO
|
||||
build = ":TSUpdate",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter-textobjects",
|
||||
init = function()
|
||||
vim.o.foldenable = true
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldmethod = "expr"
|
||||
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
end,
|
||||
config = function() require "configs.treesitter" end
|
||||
}
|
6
.config/nvim/lua/plugins/vim-startuptime.lua
Normal file
6
.config/nvim/lua/plugins/vim-startuptime.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"dstein64/vim-startuptime",
|
||||
cmd = "StartupTime", -- lazy-load on a command
|
||||
keys = { { "<Leader>us", "<Cmd>StartupTime<CR>", desc = "StartupTime" } },
|
||||
init = function() vim.g.startuptime_tries = 25 end
|
||||
}
|
64
.config/nvim/lua/plugins/which-key.lua
Normal file
64
.config/nvim/lua/plugins/which-key.lua
Normal file
@ -0,0 +1,64 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
win = {
|
||||
border = vim.g.border,
|
||||
padding = { 0, 1, 0, 1 } -- ^, <, _, >
|
||||
},
|
||||
layout = {
|
||||
spacing = 4,
|
||||
align = "center",
|
||||
width = { min = 1 },
|
||||
height = { min = 1, max = 15 }
|
||||
},
|
||||
replace = { ["<leader>"] = "L" },
|
||||
plugins = { spelling = { suggestions = 40 } },
|
||||
},
|
||||
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 400 -- before opening WhichKey
|
||||
end,
|
||||
|
||||
config = function(_, opts)
|
||||
require("which-key").setup(opts)
|
||||
require("which-key").add({ -- Naming groups here
|
||||
{ "<Leader>C", group = "Loclist" },
|
||||
{ "<Leader>b", group = "Buffer" },
|
||||
{ "<Leader>c", group = "Quickfix" },
|
||||
{ "<Leader>h", group = "Gitsigns" },
|
||||
{ "<Leader>hc", group = "Control" },
|
||||
{ "<Leader>ht", group = "Toggle" },
|
||||
{ "<Leader>hv", group = "View" },
|
||||
{ "<Leader>l", group = "LSP" },
|
||||
{ "<Leader>lc", group = "Control" },
|
||||
{ "<Leader>ll", group = "List" },
|
||||
{ "<Leader>lp", group = "Peek definiton" },
|
||||
{ "<Leader>lw", group = "Workspace" },
|
||||
{ "<Leader>t", group = "Toggle" },
|
||||
{ "<Leader>u", group = "Utils" },
|
||||
{ "<Leader>w", group = "Window" },
|
||||
|
||||
-- c = { name = "Quickfix" },
|
||||
-- C = { name = "Loclist" },
|
||||
-- u = { name = "Utils" },
|
||||
-- t = { name = "Toggle" },
|
||||
-- b = { name = "Buffer" },
|
||||
-- w = { name = "Window" },
|
||||
-- h = { name = "Gitsigns",
|
||||
-- v = { name = "View" },
|
||||
-- t = { name = "Toggle" },
|
||||
-- c = { name = "Control" },
|
||||
-- },
|
||||
-- l = {
|
||||
-- name = "LSP",
|
||||
-- l = { name = "List" },
|
||||
-- c = { name = "Control" },
|
||||
-- w = { name = "Workspace" },
|
||||
-- p = { name = "Peek definiton" },
|
||||
-- },
|
||||
-- }, { prefix = "<Leader>" })
|
||||
})
|
||||
end
|
||||
}
|
Reference in New Issue
Block a user