Compare commits
10 Commits
ff99797242
...
3fc6fde51c
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fc6fde51c | |||
| bf3c2c8003 | |||
| 2230159029 | |||
| 97cf8dedbc | |||
| 9e694b6608 | |||
| 4dd73953f5 | |||
| b16dc0991b | |||
| fb4b0a7261 | |||
|
|
c8777040fb | ||
|
|
9d37797e6f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
plugin
|
plugin
|
||||||
custom
|
# custom
|
||||||
spell
|
spell
|
||||||
ftplugin
|
ftplugin
|
||||||
syntax
|
syntax
|
||||||
@@ -8,3 +8,4 @@ coc-settings.json
|
|||||||
lazy-lock.json
|
lazy-lock.json
|
||||||
after
|
after
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
|
.elixir-tools/
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ M.ui = {
|
|||||||
theme = "default", -- default/vscode/vscode_colored/minimal
|
theme = "default", -- default/vscode/vscode_colored/minimal
|
||||||
-- default/round/block/arrow separators work only for default statusline theme
|
-- default/round/block/arrow separators work only for default statusline theme
|
||||||
-- round and block will work for minimal theme only
|
-- round and block will work for minimal theme only
|
||||||
separator_style = "default",
|
separator_style = "block",
|
||||||
overriden_modules = nil,
|
overriden_modules = nil,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -44,6 +44,9 @@ M.ui = {
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
lazyload = true,
|
lazyload = true,
|
||||||
overriden_modules = nil,
|
overriden_modules = nil,
|
||||||
|
buttons = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- nvdash (dashboard)
|
-- nvdash (dashboard)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ M.general = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
t = {
|
t = {
|
||||||
["<C-x>"] = { vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true), "Escape terminal mode" },
|
["<C-n>"] = { vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true), "Escape terminal mode" },
|
||||||
},
|
},
|
||||||
|
|
||||||
v = {
|
v = {
|
||||||
|
|||||||
3
lua/custom/README.md
Normal file
3
lua/custom/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Example_config
|
||||||
|
|
||||||
|
This can be used as an example custom config for NvChad. Do check the https://github.com/NvChad/nvcommunity
|
||||||
20
lua/custom/chadrc.lua
Normal file
20
lua/custom/chadrc.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- Path to overriding theme and highlights files
|
||||||
|
local highlights = require "custom.highlights"
|
||||||
|
|
||||||
|
M.ui = {
|
||||||
|
theme = "everblush",
|
||||||
|
theme_toggle = { "everblush", "one_light" },
|
||||||
|
|
||||||
|
hl_override = highlights.override,
|
||||||
|
hl_add = highlights.add,
|
||||||
|
}
|
||||||
|
|
||||||
|
M.plugins = "custom.plugins"
|
||||||
|
|
||||||
|
-- check core.mappings for table structure
|
||||||
|
M.mappings = require "custom.mappings"
|
||||||
|
|
||||||
|
return M
|
||||||
54
lua/custom/configs/lspconfig.lua
Normal file
54
lua/custom/configs/lspconfig.lua
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||||
|
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||||
|
local lspconfig = require "lspconfig"
|
||||||
|
local util = require "lspconfig/util"
|
||||||
|
|
||||||
|
-- if you just want default config for the servers then put them in a table
|
||||||
|
local servers = { "html", "cssls", "ts_ls", "clangd" }
|
||||||
|
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
lspconfig[lsp].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig.gopls.setup {
|
||||||
|
cmd = { "gopls" },
|
||||||
|
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||||
|
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
completeUnimported = true,
|
||||||
|
usePlaceholders = true,
|
||||||
|
analyses = {
|
||||||
|
unusedParameters = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.ts_ls.setup {
|
||||||
|
filetypes = { "javascript", "typescript", "typescriptreact", "typescript.tsx" },
|
||||||
|
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.lsp.buf.format()<CR>", opts)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- lspconfig.rust_analyzer.setup({
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- capabilities = capabilities,
|
||||||
|
-- filetypes = {"rust"},
|
||||||
|
-- root_dir = util.root_pattern("Cargo.toml"),
|
||||||
|
-- settings = {},
|
||||||
|
-- ['rust-analyzer'] = {
|
||||||
|
-- cargo = {
|
||||||
|
-- allFeatures = true,
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
--
|
||||||
|
-- lspconfig.pyright.setup { blabla}
|
||||||
21
lua/custom/configs/null-ls.lua
Normal file
21
lua/custom/configs/null-ls.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
local null_ls = require "null-ls"
|
||||||
|
|
||||||
|
local b = null_ls.builtins
|
||||||
|
|
||||||
|
local sources = {
|
||||||
|
|
||||||
|
-- webdev stuff
|
||||||
|
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
|
||||||
|
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
|
||||||
|
|
||||||
|
-- Lua
|
||||||
|
b.formatting.stylua,
|
||||||
|
|
||||||
|
-- cpp
|
||||||
|
b.formatting.clang_format,
|
||||||
|
}
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
debug = true,
|
||||||
|
sources = sources,
|
||||||
|
}
|
||||||
28
lua/custom/configs/nvterm.lua
Normal file
28
lua/custom/configs/nvterm.lua
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
local options = {
|
||||||
|
terminals = {
|
||||||
|
-- shell = vim.o.shell,
|
||||||
|
-- list = {},
|
||||||
|
type_opts = {
|
||||||
|
float = {
|
||||||
|
-- relative = "editor",
|
||||||
|
row = 0,
|
||||||
|
col = 0,
|
||||||
|
width = 0.9,
|
||||||
|
height = 0.9,
|
||||||
|
-- border = "single",
|
||||||
|
},
|
||||||
|
-- horizontal = { location = "rightbelow", split_ratio = 0.3 },
|
||||||
|
-- vertical = { location = "rightbelow", split_ratio = 0.5 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- behavior = {
|
||||||
|
-- autoclose_on_quit = {
|
||||||
|
-- enabled = false,
|
||||||
|
-- confirm = true,
|
||||||
|
-- },
|
||||||
|
-- close_on_exit = true,
|
||||||
|
-- auto_insert = true,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
67
lua/custom/configs/overrides.lua
Normal file
67
lua/custom/configs/overrides.lua
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
local cmp = require "cmp"
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.treesitter = {
|
||||||
|
ensure_installed = {
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"tsx",
|
||||||
|
"c",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
-- disable = {
|
||||||
|
-- "python"
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.mason = {
|
||||||
|
ensure_installed = {
|
||||||
|
-- lua stuff
|
||||||
|
"lua-language-server",
|
||||||
|
"stylua",
|
||||||
|
|
||||||
|
-- web dev stuff
|
||||||
|
"css-lsp",
|
||||||
|
"html-lsp",
|
||||||
|
"typescript-language-server",
|
||||||
|
"deno",
|
||||||
|
"prettier",
|
||||||
|
|
||||||
|
-- c/cpp stuff
|
||||||
|
"clangd",
|
||||||
|
"clang-format",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- git support in nvimtree
|
||||||
|
M.nvimtree = {
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
renderer = {
|
||||||
|
highlight_git = true,
|
||||||
|
icons = {
|
||||||
|
show = {
|
||||||
|
git = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- M.cmp = {
|
||||||
|
-- mapping = {
|
||||||
|
-- ["<A-Space>"] = cmp.mapping.complete(),
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
|
||||||
|
return M
|
||||||
13
lua/custom/configs/rust-tools.lua
Normal file
13
lua/custom/configs/rust-tools.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||||
|
-- local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||||
|
--
|
||||||
|
local options = {
|
||||||
|
-- server = {
|
||||||
|
-- on_attach = vim.tbl_deep_extend("force", on_attach, {
|
||||||
|
-- vim.keymap.set("n", "<leader>H", rt)
|
||||||
|
-- },
|
||||||
|
-- capabilities = capabilities,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
19
lua/custom/highlights.lua
Normal file
19
lua/custom/highlights.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- To find any highlight groups: "<cmd> Telescope highlights"
|
||||||
|
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
|
||||||
|
-- base30 variable names can also be used as colors
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
---@type Base46HLGroupsList
|
||||||
|
M.override = {
|
||||||
|
Comment = {
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
---@type HLTable
|
||||||
|
M.add = {
|
||||||
|
NvimTreeOpenedFolderName = { fg = "green", bold = true },
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
||||||
14
lua/custom/init.lua
Normal file
14
lua/custom/init.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
-- local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
-- Auto resize panes when resizing nvim window
|
||||||
|
-- autocmd("VimResized", {
|
||||||
|
-- pattern = "*",
|
||||||
|
-- command = "tabdo wincmd =",
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
local opt = vim.opt
|
||||||
|
|
||||||
|
opt.laststatus = 3
|
||||||
|
opt.swapfile = false
|
||||||
|
|
||||||
|
vim.g.lua_snippets_path = { vim.fn.stdpath "config" .. "/snippets" }
|
||||||
100
lua/custom/mappings.lua
Normal file
100
lua/custom/mappings.lua
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
---@type MappingsTable
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.general = {
|
||||||
|
i = {
|
||||||
|
["<c-r>"] = { "<c-v>", "paste from OS without autopairing" },
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
-- [";"] = { ":", "enter command mode", opts = { nowait = true } },
|
||||||
|
["go"] = {
|
||||||
|
function()
|
||||||
|
vim.lsp.buf.format { async = true }
|
||||||
|
end,
|
||||||
|
"LSP formatting",
|
||||||
|
},
|
||||||
|
|
||||||
|
["<leader>wv"] = { "<C-w>v", "Split vertical" },
|
||||||
|
["<leader>ws"] = { "<C-w>s", "Split horizontal" },
|
||||||
|
["<leader>wo"] = { "<C-w>o", "Maximize split" },
|
||||||
|
["<leader>wc"] = { "<C-w>c", "Close split" },
|
||||||
|
["<leader>wx"] = { "<C-w>c", "Close split" },
|
||||||
|
["<leader>w="] = { "<C-w>=", "Even splits" },
|
||||||
|
["<leader>h"] = { "<C-w>h", "Focus left split" },
|
||||||
|
["<leader>j"] = { "<C-w>j", "Focus lower split" },
|
||||||
|
["<leader>k"] = { "<C-w>k", "Focus upper split" },
|
||||||
|
["<leader>l"] = { "<C-w>l", "Focus right split" },
|
||||||
|
["<leader>ee"] = { ':e <C-R>=expand("%:p:h" . "/" <CR><CR>)', "Copy relative path to file" },
|
||||||
|
["<leader>er"] = { ":!echo -n % | pbcopy<CR>", "Copy absolute path to file" },
|
||||||
|
["<leader>gn"] = { ":Telescope resume<CR>", "Resume telescope" },
|
||||||
|
["<leader>eu"] = { '!!python -c "import uuid; print(uuid.uuid4())"<CR>', "Drop fresh uuid4" },
|
||||||
|
["<c-c>"] = { '"+y', "Copy to OS clipboard" },
|
||||||
|
|
||||||
|
[",,"] = { ":w<CR>", "save" },
|
||||||
|
["<leader> "] = { ":w<CR>", "save" },
|
||||||
|
|
||||||
|
["<leader>n"] = { "<cmd> NvimTreeToggle <CR>", "Toggle nvimtree" },
|
||||||
|
["<leader>N"] = { "<cmd> set nu! <CR>", "Toggle line number" },
|
||||||
|
|
||||||
|
["<leader>x"] = { "<cmd>bdelete<CR>", "Close Buffer and window" },
|
||||||
|
["<leader>X"] = { "<cmd>bdelete!<CR>", "Close Buffer and window!" },
|
||||||
|
["<leader>c"] = { "<cmd>Bdelete<CR>", "Close Buffer" },
|
||||||
|
["<leader>b"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
|
||||||
|
|
||||||
|
-- ["<A-Space>"] = cmp.mapping.complete(),
|
||||||
|
|
||||||
|
["gb"] = { "<cmd>Gitsigns blame<CR>", "Git blame" },
|
||||||
|
["gB"] = { "<cmd>Gitsigns blame_line<CR>", "Git blame line" },
|
||||||
|
|
||||||
|
["gu"] = { "<cmd>diffget //2<CR>", "Select left in conflict" },
|
||||||
|
["gh"] = { "<cmd>diffget //3<CR>", "Select right in conflict" },
|
||||||
|
|
||||||
|
["ge"] = {
|
||||||
|
function()
|
||||||
|
vim.diagnostic.open_float { border = "rounded" }
|
||||||
|
end,
|
||||||
|
"Floating diagnostic",
|
||||||
|
},
|
||||||
|
|
||||||
|
[",z"] = { ":bnext<CR>", "Next buffer" },
|
||||||
|
[",v"] = { ":bprevious<CR>", "Previous buffer" },
|
||||||
|
|
||||||
|
["<leader>z"] = {
|
||||||
|
function()
|
||||||
|
require("nvchad.tabufline").tabuflineNext()
|
||||||
|
end,
|
||||||
|
"Goto next buffer",
|
||||||
|
},
|
||||||
|
|
||||||
|
["<leader>v"] = {
|
||||||
|
function()
|
||||||
|
require("nvchad.tabufline").tabuflinePrev()
|
||||||
|
end,
|
||||||
|
"Goto prev buffer",
|
||||||
|
},
|
||||||
|
|
||||||
|
["<leader>tl"] = { ":Neotest run last<CR>", "Neotest Run Last" },
|
||||||
|
["<leader>ts"] = { ":Neotest summary<CR>", "Neotest Summary" },
|
||||||
|
["<leader>to"] = { ":Neotest output<CR>", "Neotest Output" },
|
||||||
|
["<leader>ta"] = { ":Neotest output-panel<CR>", "Neotest Output Panel" },
|
||||||
|
},
|
||||||
|
v = {
|
||||||
|
[">"] = { ">gv", "indent" },
|
||||||
|
["<c-c>"] = { '"+y', "Copy to OS clipboard" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.crates = {
|
||||||
|
n = {
|
||||||
|
["<leader>rcu"] = {
|
||||||
|
function()
|
||||||
|
require("crates").upgrade_all_crates()
|
||||||
|
end,
|
||||||
|
"Update crates",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- more keybinds!
|
||||||
|
|
||||||
|
return M
|
||||||
273
lua/custom/plugins.lua
Normal file
273
lua/custom/plugins.lua
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
local overrides = require "custom.configs.overrides"
|
||||||
|
|
||||||
|
---@type NvPluginSpec[]
|
||||||
|
local plugins = {
|
||||||
|
|
||||||
|
-- Override plugin definition options
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
-- format & linting
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
config = function()
|
||||||
|
require "custom.configs.null-ls"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require "plugins.configs.lspconfig"
|
||||||
|
require "custom.configs.lspconfig"
|
||||||
|
end, -- Override to setup mason-lspconfig
|
||||||
|
},
|
||||||
|
|
||||||
|
-- override plugin configs
|
||||||
|
{
|
||||||
|
"NvChad/nvterm",
|
||||||
|
opts = function()
|
||||||
|
return require "custom.configs.nvterm"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = vim.tbl_deep_extend("force", overrides.mason, {
|
||||||
|
ensure_installed = {
|
||||||
|
"rust-analyzer",
|
||||||
|
"gopls",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = overrides.treesitter,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
opts = overrides.nvimtree,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Install a plugin
|
||||||
|
{
|
||||||
|
"max397574/better-escape.nvim",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = function()
|
||||||
|
require("better_escape").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"elixir-tools/elixir-tools.nvim",
|
||||||
|
version = "*",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
config = function()
|
||||||
|
local elixir = require "elixir"
|
||||||
|
local elixirls = require "elixir.elixirls"
|
||||||
|
|
||||||
|
elixir.setup {
|
||||||
|
nextls = { enable = true },
|
||||||
|
credo = {},
|
||||||
|
elixirls = {
|
||||||
|
enable = true,
|
||||||
|
settings = elixirls.settings {
|
||||||
|
dialyzerEnabled = false,
|
||||||
|
enableTestLenses = false,
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
||||||
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"rust-lang/rust.vim",
|
||||||
|
ft = "rust",
|
||||||
|
init = function()
|
||||||
|
vim.g.rustfmt_autosave = 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"mrcjkb/rustaceanvim",
|
||||||
|
version = "^3",
|
||||||
|
ft = { "rust" },
|
||||||
|
-- dependencies = "neovim/nvim-lspconfig",
|
||||||
|
-- opts = function()
|
||||||
|
-- return require "custom.configs.rust-tools"
|
||||||
|
-- end,
|
||||||
|
-- config = function(, opts)
|
||||||
|
-- require('rust-tools').setup(opts)
|
||||||
|
-- end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "mfussenegger/nvim-dap",
|
||||||
|
-- },
|
||||||
|
|
||||||
|
{
|
||||||
|
"saecki/crates.nvim",
|
||||||
|
dependencies = "hrsh7th/nvim-cmp",
|
||||||
|
ft = { "rust", "toml" },
|
||||||
|
config = function(_, opts)
|
||||||
|
local crates = require "crates"
|
||||||
|
crates.setup(opts)
|
||||||
|
crates.show()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
opts = function()
|
||||||
|
local M = require "plugins.configs.cmp"
|
||||||
|
table.insert(M.sources, { name = "cartes" })
|
||||||
|
return M
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
lazy = false,
|
||||||
|
opts = { max_lines = 6 },
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "tpope/vim-surround", lazy = false },
|
||||||
|
|
||||||
|
{ "famiu/bufdelete.nvim", lazy = false },
|
||||||
|
|
||||||
|
{ "fladson/vim-kitty", ft = { "kitty" } },
|
||||||
|
|
||||||
|
-- { "tpope/vim-fugitive", lazy = false },
|
||||||
|
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function(_, opts)
|
||||||
|
require("gitsigns").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "rouge8/neotest-rust" },
|
||||||
|
{ "jfpedroza/neotest-elixir" },
|
||||||
|
{ "lewis6991/fileline.nvim", lazy = false },
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neotest").setup {
|
||||||
|
adapters = {
|
||||||
|
require "neotest-rust",
|
||||||
|
require "neotest-elixir" {
|
||||||
|
-- -- The Mix task to use to run the tests
|
||||||
|
-- -- Can be a function to return a dynamic value.
|
||||||
|
-- -- Default: "test"
|
||||||
|
-- mix_task = { "my_custom_task" },
|
||||||
|
-- -- Other formatters to pass to the test command as the formatters are overridden
|
||||||
|
-- -- Can be a function to return a dynamic value.
|
||||||
|
-- -- Default: {"ExUnit.CLIFormatter"}
|
||||||
|
-- extra_formatters = { "ExUnit.CLIFormatter", "ExUnitNotifier" },
|
||||||
|
-- -- Extra test block identifiers
|
||||||
|
-- -- Can be a function to return a dynamic value.
|
||||||
|
-- -- Block identifiers "test", "feature" and "property" are always supported by default.
|
||||||
|
-- -- Default: {}
|
||||||
|
-- extra_block_identifiers = { "test_with_mock" },
|
||||||
|
-- -- Extra arguments to pass to mix test
|
||||||
|
-- -- Can be a function that receives the position, to return a dynamic value
|
||||||
|
-- -- Default: {}
|
||||||
|
-- args = { "--trace" },
|
||||||
|
-- -- Command wrapper
|
||||||
|
-- -- Must be a function that receives the mix command as a table, to return a dynamic value
|
||||||
|
-- -- Default: function(cmd) return cmd end
|
||||||
|
-- post_process_command = function(cmd)
|
||||||
|
-- return vim.tbl_flatten { { "env", "FOO=bar" }, cmd }
|
||||||
|
-- end,
|
||||||
|
-- -- Delays writes so that results are updated at most every given milliseconds
|
||||||
|
-- -- Decreasing this number improves snappiness at the cost of performance
|
||||||
|
-- -- Can be a function to return a dynamic value.
|
||||||
|
-- -- Default: 1000
|
||||||
|
-- write_delay = 1000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"ray-x/go.nvim",
|
||||||
|
dependencies = { -- optional packages
|
||||||
|
"ray-x/guihua.lua",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("go").setup()
|
||||||
|
end,
|
||||||
|
event = { "CmdlineEnter" },
|
||||||
|
ft = { "go", "gomod" },
|
||||||
|
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
config = function()
|
||||||
|
require("conform").setup {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
python = { "isort", "black" },
|
||||||
|
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||||
|
rust = { "rustfmt", lsp_format = "fallback" },
|
||||||
|
-- Conform will run the first available formatter
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
go = { { "gofmt" } },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "rouge8/neotest-rust",
|
||||||
|
-- config = function() end,
|
||||||
|
-- },
|
||||||
|
--
|
||||||
|
-- {
|
||||||
|
-- "jfpedroza/neotest-elixir",
|
||||||
|
-- config = function() end,
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- To make a plugin not be loaded
|
||||||
|
-- {
|
||||||
|
-- "NvChad/nvim-colorizer.lua",
|
||||||
|
-- enabled = false
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- All NvChad plugins are lazy-loaded by default
|
||||||
|
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
|
||||||
|
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
|
||||||
|
-- {
|
||||||
|
-- "mg979/vim-visual-multi",
|
||||||
|
-- lazy = false,
|
||||||
|
-- }
|
||||||
|
}
|
||||||
|
|
||||||
|
return plugins
|
||||||
@@ -52,7 +52,7 @@ local options = {
|
|||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
||||||
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel",
|
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None",
|
||||||
scrollbar = false,
|
scrollbar = false,
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
|
|||||||
@@ -49,18 +49,69 @@ M.luasnip = function(opts)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- M.gitsigns = {
|
||||||
|
-- signs = {
|
||||||
|
-- add = { text = "│" },
|
||||||
|
-- change = { text = "│" },
|
||||||
|
-- delete = { text = "" },
|
||||||
|
-- topdelete = { text = "‾" },
|
||||||
|
-- changedelete = { text = "~" },
|
||||||
|
-- untracked = { text = "│" },
|
||||||
|
-- },
|
||||||
|
-- on_attach = function(bufnr)
|
||||||
|
-- utils.load_mappings("gitsigns", { buffer = bufnr })
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
|
|
||||||
M.gitsigns = {
|
M.gitsigns = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "│" },
|
add = { text = '┃' },
|
||||||
change = { text = "│" },
|
change = { text = '┃' },
|
||||||
delete = { text = "" },
|
delete = { text = '_' },
|
||||||
topdelete = { text = "‾" },
|
topdelete = { text = '‾' },
|
||||||
changedelete = { text = "~" },
|
changedelete = { text = '~' },
|
||||||
untracked = { text = "│" },
|
untracked = { text = '┆' },
|
||||||
|
},
|
||||||
|
signs_staged = {
|
||||||
|
add = { text = '┃' },
|
||||||
|
change = { text = '┃' },
|
||||||
|
delete = { text = '_' },
|
||||||
|
topdelete = { text = '‾' },
|
||||||
|
changedelete = { text = '~' },
|
||||||
|
untracked = { text = '┆' },
|
||||||
|
},
|
||||||
|
signs_staged_enable = true,
|
||||||
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
|
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
|
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||||
|
watch_gitdir = {
|
||||||
|
follow_files = true
|
||||||
|
},
|
||||||
|
auto_attach = true,
|
||||||
|
attach_to_untracked = false,
|
||||||
|
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||||
|
current_line_blame_opts = {
|
||||||
|
virt_text = true,
|
||||||
|
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||||
|
delay = 1000,
|
||||||
|
ignore_whitespace = false,
|
||||||
|
virt_text_priority = 100,
|
||||||
|
},
|
||||||
|
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
||||||
|
sign_priority = 6,
|
||||||
|
update_debounce = 100,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||||
|
preview_config = {
|
||||||
|
-- Options passed to nvim_open_win
|
||||||
|
border = 'single',
|
||||||
|
style = 'minimal',
|
||||||
|
relative = 'cursor',
|
||||||
|
row = 0,
|
||||||
|
col = 1
|
||||||
},
|
},
|
||||||
on_attach = function(bufnr)
|
|
||||||
utils.load_mappings("gitsigns", { buffer = bufnr })
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -90,22 +90,26 @@ local default_plugins = {
|
|||||||
-- git stuff
|
-- git stuff
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
|
lazy = false,
|
||||||
ft = { "gitcommit", "diff" },
|
ft = { "gitcommit", "diff" },
|
||||||
init = function()
|
-- init = function()
|
||||||
-- load gitsigns only when a git file is opened
|
-- -- load gitsigns only when a git file is opened
|
||||||
vim.api.nvim_create_autocmd({ "BufRead" }, {
|
-- vim.api.nvim_create_autocmd({ "BufRead" }, {
|
||||||
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
|
-- group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
|
||||||
callback = function()
|
-- callback = function()
|
||||||
vim.fn.system("git -C " .. '"' .. vim.fn.expand "%:p:h" .. '"' .. " rev-parse")
|
-- vim.fn.jobstart({ "git", "-C", vim.loop.cwd(), "rev-parse" }, {
|
||||||
if vim.v.shell_error == 0 then
|
-- on_exit = function(_, return_code)
|
||||||
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
|
-- if return_code == 0 then
|
||||||
vim.schedule(function()
|
-- vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
|
||||||
require("lazy").load { plugins = { "gitsigns.nvim" } }
|
-- vim.schedule(function()
|
||||||
end)
|
-- require("lazy").load { plugins = { "gitsigns.nvim" } }
|
||||||
end
|
-- end)
|
||||||
end,
|
-- end
|
||||||
})
|
-- end,
|
||||||
end,
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
opts = function()
|
opts = function()
|
||||||
return require("plugins.configs.others").gitsigns
|
return require("plugins.configs.others").gitsigns
|
||||||
end,
|
end,
|
||||||
|
|||||||
13
snippets/elixir.lua
Normal file
13
snippets/elixir.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md
|
||||||
|
local ls = require "luasnip"
|
||||||
|
local s = ls.snippet
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
return {
|
||||||
|
s("iip", {
|
||||||
|
t '|> IO.inspect(label: "',
|
||||||
|
i(1, "label"),
|
||||||
|
t '")',
|
||||||
|
}),
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user