update: fish, yazi, nvim

This commit is contained in:
2026-07-29 02:07:13 +02:00
parent 7cd7d746e7
commit 340b955bc5
30 changed files with 1345 additions and 710 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"format.enable": false
}
+20
View File
@@ -0,0 +1,20 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
},
"lspconfig": {
"lua_ls": {
"Lua.format.enable": false
}
}
}
+7
View File
@@ -0,0 +1,7 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"
collapse_simple_statement = "Always"
+34
View File
@@ -0,0 +1,34 @@
# AstroNvim Template
**NOTE:** This is for AstroNvim v6+
A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim)
## 🛠️ Installation
#### Make a backup of your current nvim and shared folder
```shell
mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
mv ~/.local/state/nvim ~/.local/state/nvim.bak
mv ~/.cache/nvim ~/.cache/nvim.bak
```
#### Create a new user repository from this template
Press the "Use this template" button above to create a new repository to store your user configuration.
You can also just clone this repository directly if you do not want to track your user configuration in GitHub.
#### Clone the repository
```shell
git clone https://github.com/<your_user>/<your_repository> ~/.config/nvim
```
#### Start Neovim
```shell
nvim
```
+21 -628
View File
@@ -1,634 +1,27 @@
--- Set Leader Key (Needs to be set before the plugins are loaded/required)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
--- Plugin Manager
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,
})
if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
-- stylua: ignore
local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
if vim.v.shell_error ~= 0 then
-- stylua: ignore
vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end
end
vim.opt.rtp:prepend(lazypath)
-- Add Plugins
require("lazy").setup({
-- Theme
{
"catppuccin/nvim",
name = "catppuccin.vim",
priority = 1000,
config = function()
vim.cmd.colorscheme("catppuccin-macchiato")
end,
},
-- Stats
{ 'wakatime/vim-wakatime', lazy = false },
-- Highlight
{ "RRethy/vim-illuminate" },
-- Comment visual regions/lines
{ "numToStr/Comment.nvim", opts = {} },
-- Autoclose brackets
{ "m4xshen/autoclose.nvim", opts = {} },
{ "windwp/nvim-ts-autotag", opts = {}, lazy = false }, -- Doesn't work?
-- Surround selection
"tpope/vim-surround",
-- Add indentation guides
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
},
-- Status line
{
"nvim-lualine/lualine.nvim",
opts = {
options = {
icons_enabled = true,
theme = "palenight",
component_separators = "|",
section_separators = "",
},
},
},
-- Debug
{
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio"
},
opts = {}
},
{ "theHamsta/nvim-dap-virtual-text", opts = {} },
-- LSP
{
"neovim/nvim-lspconfig",
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
-- Useful status updates for LSP
{ "j-hui/fidget.nvim", tag = "legacy", opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
"folke/neodev.nvim",
},
},
-- Autocomplete
{
"hrsh7th/nvim-cmp",
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
-- Adds LSP completion capabilities
'hrsh7th/cmp-nvim-lsp',
-- Adds a number of user-friendly snippets
'rafamadriz/friendly-snippets',
-- Ai cmp
'tzachar/cmp-ai'
},
},
{ 'tzachar/cmp-ai', dependencies = 'nvim-lua/plenary.nvim' },
-- Show available command
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {}
},
-- Fuzzy Finder (files, lsp, etc)
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
},
},
-- Highlight, edit, and navigate code
{
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
},
-- Git
"tpope/vim-fugitive",
--"tpope/vim-rhubarb",
{
"lewis6991/gitsigns.nvim",
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
on_attach = function(bufnr)
vim.keymap.set("n", "<leader>hp", require("gitsigns").preview_hunk, { buffer = bufnr, desc = "Preview git hunk" })
-- don't override the built-in and fugitive keymaps
local gs = package.loaded.gitsigns
vim.keymap.set({ "n", "v" }, "]c", function()
if vim.wo.diff then return "]c" end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" })
vim.keymap.set({ "n", "v" }, "[c", function()
if vim.wo.diff then return "[c" end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" })
end,
},
},
})
-- Tab
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
--- Show line numbers
vim.opt.number = true
--- Relative line numbers
vim.opt.relativenumber = true
--- Go to next/previous line
vim.opt.whichwrap = "<,>,[,]"
--- Enable mouse
vim.opt.mouse = "a"
--- Sync clipboard with OS
vim.opt.clipboard = "unnamedplus"
--- Enable break indent
vim.opt.breakindent = true
--- Save undo history
vim.opt.undofile = true
--- Case-insensetive search
vim.opt.ignorecase = true
vim.opt.smartcase = true
--- Keep signcolum
vim.wo.signcolumn = "yes"
--- Set completeopt to have a better completion experience
vim.opt.completeopt = "menuone,noselect"
--- [[ Basic Keymaps ]]
-- Center view when jumping have the view
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
-- Center view when search
vim.keymap.set("n", "n", "nzz")
vim.keymap.set("n", "N", "Nzz")
-- Create file or directory
vim.keymap.set('n', '<Leader>cf', [[:e <C-R>=expand("%:h") .. '/'<CR>]],
{ desc = "[f] Create file", noremap = true })
vim.keymap.set('n', '<Leader>cd', [[:!mkdir <C-R>=expand("%:p:h") .. '/'<CR>]],
{ desc = "[d] Create directory", noremap = true })
-- Open explorer
vim.keymap.set("n", "<leader>oe", ":Ex<CR>", { desc = "[e] Open the explorer" })
-- Keymaps for better default experience
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- Change Tab/Window Focus
vim.keymap.set("n", "<C-h>", "<C-W>h")
vim.keymap.set("n", "<C-j>", "<C-W>j")
vim.keymap.set("n", "<C-k>", "<C-W>k")
vim.keymap.set("n", "<C-l>", "<C-W>l")
--- Debug
local dap, dapui, dapvs = require("dap"), require("dapui"), require('dap.ext.vscode')
vim.keymap.set("n", "<Leader>b", dap.toggle_breakpoint, { desc = "[b] Debug toggle breakpoint" })
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "[c] Debug Continue/Start" })
vim.keymap.set("n", "<Leader>n", dap.step_over, { desc = "[n] Debug step over" })
vim.keymap.set("n", "<Leader>N", dap.step_into, { desc = "[N] Debug step into" })
vim.keymap.set("n", "<Leader>m", dap.step_out, { desc = "[m] Debug step out" })
vim.keymap.set("n", "<Leader>dt", dapui.toggle, { desc = "[t] Debug toggle view" })
vim.keymap.set("n", "<Leader>dl", function()
dapvs.load_launchjs("launch.json", { cppdbg = { 'c', 'cpp' } })
end,
{ desc = "[l] Debug load launch config" })
dap.listeners.before.attach.dapui_config = function()
dapui.open()
-- validate that lazy is available
if not pcall(require, "lazy") then
-- stylua: ignore
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
-- dap.listeners.before.event_terminated.dapui_config = function()
-- dapui.close()
-- end
--
-- dap.listeners.before.event_exited.dapui_config = function()
-- dapui.close()
-- end
dap.adapters.cppdbg = {
id = "cppdbg",
type = "executable",
command = "/home/pa/dap/c/extension/debugAdapters/bin/OpenDebugAD7",
}
dap.configurations.c = {
{
name = "Launch file",
type = "cppdbg",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
args = function()
local s = vim.fn.input('Args: ')
local t = {}
for word in s:gmatch("%S+") do
table.insert(t, word)
end
return t
end,
cwd = '${workspaceFolder}',
stopAtEntry = true,
},
-- {
-- name = 'Attach to gdbserver :1234',
-- type = 'cppdbg',
-- request = 'launch',
-- MIMode = 'gdb',
-- miDebuggerServerAddress = 'localhost:1234',
-- miDebuggerPath = '/usr/bin/gdb',
-- cwd = '${workspaceFolder}',
-- program = function()
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- end,
-- },
}
--- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = "*",
})
--- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require("telescope").setup {
defaults = {
mappings = {
i = {
["<C-u>"] = false,
["<C-d>"] = false,
},
},
},
}
-- Enable telescope fzf native, if installed
pcall(require("telescope").load_extension, "fzf")
-- See `:help telescope.builtin`
vim.keymap.set("n", "<leader>?", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" })
vim.keymap.set("n", "<leader><space>", require("telescope.builtin").buffers, { desc = "[ ] Find existing buffers" })
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = "[/] Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>gf", require("telescope.builtin").git_files, { desc = "Search [G]it [F]iles" })
vim.keymap.set("n", "<leader>sf", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>sh", require("telescope.builtin").help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set("n", "<leader>sw", require("telescope.builtin").grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>sr", require("telescope.builtin").resume, { desc = "[S]earch [R]esume" })
--- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
-- Defer Treesitter setup after first render to improve startup time of "nvim {filename}"
vim.defer_fn(function()
require("nvim-treesitter.configs").setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { "c", "cpp", "go", "lua", "python", "rust", "tsx", "javascript", "typescript", "vimdoc", "vim" },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
}
end, 0)
-- Diagnostic keymaps
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
--- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- Sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = "LSP: " .. desc
end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end
nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
nmap("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
nmap("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
nmap("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
nmap("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
-- See `:help K` for why this keymap
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap("<leader>f", vim.lsp.buf.format, "[F]ormat")
nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
-- Auto format on save
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]
-- or vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
end
-- document existing key chains
require("which-key").register({
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
["<leader>d"] = { name = "[D]ocument", _ = "which_key_ignore" },
["<leader>g"] = { name = "[G]it", _ = "which_key_ignore" },
["<leader>h"] = { name = "More git", _ = "which_key_ignore" },
["<leader>r"] = { name = "[R]ename", _ = "which_key_ignore" },
["<leader>s"] = { name = "[S]earch", _ = "which_key_ignore" },
["<leader>w"] = { name = "[W]orkspace", _ = "which_key_ignore" },
})
-- Enable the following language servers
-- If you want to override the default filetypes that your language server will attach to you can
-- define the property "filetypes" to the map in question.
local servers = {
rust_analyzer = {},
lemminx = {},
yamlls = {},
bashls = {},
jsonls = {},
clangd = {},
cssls = {},
jdtls = {
java = {
maven = { downloadSources = true }
}
},
html = {},
lua_ls = {
Lua = {
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false
},
telemetry = { enable = false },
diagnostics = {
globals = { "vim" }
}
},
},
}
-- Setup neovim lua configuration
require("neodev").setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require "mason-lspconfig"
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require("lspconfig")[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end
}
--- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require "cmp"
local luasnip = require "luasnip"
require("luasnip.loaders.from_vscode").lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete {},
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
-- { name = "cmp_ai" },
},
}
-- local cmp_ai = require('cmp_ai.config')
-- cmp_ai:setup({
-- max_lines = 100,
-- provider = 'Ollama',
-- provider_options = {
-- model = 'mistral',
-- },
-- notify = true,
-- notify_callback = function(msg)
-- vim.notify(msg)
-- end,
-- run_on_every_keystroke = true,
-- ignored_file_types = {
-- -- default is not to ignore
-- -- uncomment to ignore in lua:
-- -- lua = true
-- },
-- })
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
-- notify_callback = function(msg)
-- vim.notify(msg)
-- end,
-- run_on_every_keystroke = true,
-- ignored_file_types = {
-- -- default is not to ignore
-- -- uncomment to ignore in lua:
-- -- lua = true
-- },
-- })
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require "lazy_setup"
require "polish"
+16
View File
@@ -0,0 +1,16 @@
-- if true then return {} end
-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.
---@type LazySpec
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.media.vim-wakatime" },
{ import = "astrocommunity.search.grug-far-nvim" },
{ import = "astrocommunity.lsp.nvim-java" },
{ import = "astrocommunity.pack.vue" },
{ import = "astrocommunity.git.diffview-nvim" },
}
+32
View File
@@ -0,0 +1,32 @@
require("lazy").setup({
{
"AstroNvim/AstroNvim",
version = "^6", -- Remove version tracking to elect for nightly AstroNvim
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
},
},
{ import = "community" },
{ import = "plugins" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "astrotheme", "habamax" } },
ui = { backdrop = 100 },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
} --[[@as LazyConfig]])
@@ -0,0 +1,85 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
-- Configuration documentation can be found with `:h astrocore`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = true, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
virtual_text = true,
underline = true,
},
-- passed to `vim.filetype.add`
filetypes = {
-- see `:h vim.filetype.add` for usage
extension = {
foo = "fooscript",
},
filename = {
[".foorc"] = "fooscript",
},
pattern = {
[".*/etc/foo/.*"] = "fooscript",
},
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
wrap = false, -- sets vim.opt.wrap
},
g = { -- vim.g.<key>
-- configure global vim variables (vim.g)
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
-- This can be found in the `lua/lazy_setup.lua` file
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = {
-- first key is the mode
n = {
-- second key is the lefthand side of the map
-- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
-- mappings seen under group name "Buffer"
["<Leader>bd"] = {
function()
require("astroui.status.heirline").buffer_picker(
function(bufnr) require("astrocore.buffer").close(bufnr) end
)
end,
desc = "Close buffer from tabline",
},
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
},
},
},
}
+110
View File
@@ -0,0 +1,110 @@
-- if true then return {} end
-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine
-- Configuration documentation can be found with `:h astrolsp`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
-- Configuration table of features provided by AstroLSP
features = {
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- customize lsp formatting options
formatting = {
-- control auto formatting on save
format_on_save = {
enabled = true, -- enable or disable format on save globally
allow_filetypes = { -- enable format on save for specified filetypes only
-- "go",
},
ignore_filetypes = { -- disable format on save for specified filetypes
-- "python",
},
},
disabled = { -- disable formatting capabilities for the listed language servers
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
-- "lua_ls",
},
timeout_ms = 1000, -- default format timeout
-- filter = function(client) -- fully override the default formatting function
-- return true
-- end
},
-- enable servers that you already have installed without mason
servers = {
"ccls",
},
-- customize language server configuration passed to `vim.lsp.config`
-- client specific configuration can also go in `lsp/` in your configuration root (see `:h lsp-config`)
config = {
clangd = {
enabled = false,
},
ccls = {
cmd = { "ccls" },
filetypes = { "cpp", "c" },
},
},
-- customize how language servers are attached
handlers = {
-- a function with the key `*` modifies the default handler, functions takes the server name as the parameter
-- ["*"] = function(server) vim.lsp.enable(server) end
-- the key is the server that is being setup with `vim.lsp.config`
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
},
-- Configure buffer local auto commands to add when attaching a language server
autocmds = {
-- first key is the `augroup` to add the auto commands to (:h augroup)
lsp_codelens_refresh = {
-- Optional condition to create/delete auto command group
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
-- the auto commands will be deleted for that buffer
cond = "textDocument/codeLens",
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
-- list of auto commands to set
{
-- events to trigger
event = { "InsertLeave", "BufEnter" },
-- the rest of the autocmd options (:h nvim_create_autocmd)
desc = "Refresh codelens (buffer)",
callback = function(args)
if require("astrolsp").config.features.codelens then vim.lsp.codelens.enable(true, { bufnr = args.buf }) end
end,
},
},
},
-- mappings to be set up on attaching of a language server
mappings = {
n = {
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
gD = {
function() vim.lsp.buf.declaration() end,
desc = "Declaration of current symbol",
cond = "textDocument/declaration",
},
["<Leader>uY"] = {
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
desc = "Toggle LSP semantic highlight (buffer)",
cond = function(client)
return client:supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
end,
},
},
},
-- A custom `on_attach` function to be run after the default `on_attach` function
-- takes two parameters `client` and `bufnr` (`:h lsp-attach`)
on_attach = function(client, bufnr)
-- this would disable semanticTokensProvider for all clients
-- client.server_capabilities.semanticTokensProvider = nil
end,
},
}
+39
View File
@@ -0,0 +1,39 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- AstroUI provides the basis for configuring the AstroNvim User Interface
-- Configuration documentation can be found with `:h astroui`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
-- change colorscheme
colorscheme = "astrodark",
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
highlights = {
init = { -- this table overrides highlights in all themes
-- Normal = { bg = "#000000" },
},
astrodark = { -- a table of overrides/changes when applying the astrotheme theme
-- Normal = { bg = "#000000" },
},
},
-- Icons can be configured throughout the interface
icons = {
-- configure the loading of the lsp in the status line
LSPLoading1 = "",
LSPLoading2 = "",
LSPLoading3 = "",
LSPLoading4 = "",
LSPLoading5 = "",
LSPLoading6 = "",
LSPLoading7 = "",
LSPLoading8 = "",
LSPLoading9 = "",
LSPLoading10 = "",
},
},
}
+83
View File
@@ -0,0 +1,83 @@
return {
{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
["<Leader><space>"] = {
function() require("snacks").picker.buffers() end,
desc = "Find buffers",
},
["<Leader>F"] = {
function()
require("snacks").picker.files {
hidden = true,
ignored = true,
}
end,
desc = "Find buffers",
},
["<Leader>ss"] = {
function()
local aerial_avail, aerial = pcall(require, "aerial")
if aerial_avail and aerial.snacks_picker then
aerial.snacks_picker()
else
require("snacks").picker.lsp_symbols()
end
end,
desc = "Search symbols",
},
["<Leader>fj"] = {
"<cmd>%!jq .<CR>",
desc = "Format Json",
},
["<Leader>w"] = {
"<cmd>:noautocmd w<CR>",
desc = "Save Fileeee",
},
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" },
-- Git
["<Leader>vd"] = {
"<cmd>DiffviewOpen<CR>",
desc = "Diffview",
},
["<Leader>vD"] = {
"<cmd>DiffviewOpen HEAD^!<CR>",
desc = "Diffview Last Commit",
},
["<Leader>vl"] = {
function()
require("snacks").picker.git_log {
confirm = function(picker, item)
picker:close()
vim.cmd("DiffviewOpen " .. item.commit .. "^!")
end,
}
end,
silent = true,
desc = "Diff Commit",
},
["<Leader>vh"] = {
"<cmd>DiffviewFileHistory %<CR>",
desc = "File History",
},
["<Leader>vH"] = {
"<cmd>DiffviewFileHistory<CR>",
desc = "Repo History",
},
["<Leader>vr"] = {
"<cmd>DiffviewRefresh<CR>",
desc = "Diffview Refresh",
},
["<Leader>vc"] = {
"<cmd>DiffviewClose<CR>",
desc = "Diffview Close",
},
},
},
},
},
}
+45
View File
@@ -0,0 +1,45 @@
-- if true then return {} end
-- Customize Mason
---@type LazySpec
return {
-- use mason-tool-installer for automatically installing Mason packages
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
-- overrides `require("mason-tool-installer").setup(...)`
opts = {
-- Make sure to use the names found in `:Mason`
ensure_installed = {
-- install language servers
"lua-language-server",
"angular-language-server",
"typescript-language-server",
"gopls",
"html-lsp",
"css-lsp",
"c3-lsp",
"json-lsp",
"shellcheck",
-- "clangd",
-- "cmake-language-server",
"csharp-language-server",
"dockerfile-language-server",
-- "docker-compose-language-service",
"kotlin-language-server",
"postgres-language-server",
"python-lsp-server",
"rust-analyzer",
-- install formatters
"stylua",
-- install debuggers
"debugpy",
-- install any other package
"tree-sitter-cli",
},
},
},
}
+11
View File
@@ -0,0 +1,11 @@
return {
"nvim-neo-tree/neo-tree.nvim",
opts = {
filesystem = {
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
},
},
},
}
+24
View File
@@ -0,0 +1,24 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- Customize None-ls sources
---@type LazySpec
return {
"nvimtools/none-ls.nvim",
opts = function(_, opts)
-- opts variable is the default configuration table for the setup function call
-- local null_ls = require "null-ls"
-- Check supported formatters and linters
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
-- Only insert new sources, do not replace the existing ones
-- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function)
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
-- Set a formatter
-- null_ls.builtins.formatting.stylua,
-- null_ls.builtins.formatting.prettier,
})
end,
}
@@ -0,0 +1,67 @@
-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- Customize Treesitter
-- --------------------
-- Treesitter customizations are handled with AstroCore
-- as nvim-treesitter simply provides a download utility for parsers
-- :TSInstall all
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
treesitter = {
highlight = true, -- enable/disable treesitter based highlighting
indent = true, -- enable/disable treesitter based indentation
auto_install = true, -- enable/disable automatic installation of detected languages
ensure_installed = {
"asm",
"angular",
"arduino",
"bash",
"c",
"c3",
"c_sharp",
"cmake",
"cpp",
"css",
"csv",
"dart",
"dockerfile",
"fish",
"gitignore",
"go",
"graphql",
"html",
"hyprlang",
"java",
"javadoc",
"javascript",
"jq",
"json",
"kitty",
"kotlin",
"latex",
"linkerscript",
"llvm",
"lua",
"luadoc",
"make",
"markdown",
"markdown_inline",
"nasm",
"nginx",
"ninja",
"nix",
"odin",
"pascal",
"perl",
"php",
"pioasm",
"vim",
"vimdoc",
},
},
},
}
+90
View File
@@ -0,0 +1,90 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- You can also add or configure plugins by creating files in this `plugins/` folder
-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE
-- Here are some examples:
---@type LazySpec
return {
-- == Examples of Adding Plugins ==
"andweeb/presence.nvim",
{
"ray-x/lsp_signature.nvim",
event = "BufRead",
config = function() require("lsp_signature").setup() end,
},
-- == Examples of Overriding Plugins ==
-- customize dashboard options
{
"folke/snacks.nvim",
opts = {
dashboard = {
preset = {
header = table.concat({
" █████ ███████ ████████ ██████ ██████ ",
"██ ██ ██ ██ ██ ██ ██ ██",
"███████ ███████ ██ ██████ ██ ██",
"██ ██ ██ ██ ██ ██ ██ ██",
"██ ██ ███████ ██ ██ ██ ██████ ",
"",
"███  ██ ██  ██ ██ ███  ███",
"████  ██ ██  ██ ██ ████  ████",
"██ ██  ██ ██  ██ ██ ██ ████ ██",
"██  ██ ██  ██  ██  ██ ██  ██  ██",
"██   ████   ████   ██ ██      ██",
}, "\n"),
},
},
},
},
-- You can disable default plugins as follows:
{ "max397574/better-escape.nvim", enabled = false },
-- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
{
"L3MON4D3/LuaSnip",
config = function(plugin, opts)
-- add more custom luasnip configuration such as filetype extend or custom snippets
local luasnip = require "luasnip"
luasnip.filetype_extend("javascript", { "javascriptreact" })
-- include the default astronvim config that calls the setup call
require "astronvim.plugins.configs.luasnip"(plugin, opts)
end,
},
{
"windwp/nvim-autopairs",
config = function(plugin, opts)
require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
-- add more custom autopairs configuration such as custom rules
local npairs = require "nvim-autopairs"
local Rule = require "nvim-autopairs.rule"
local cond = require "nvim-autopairs.conds"
npairs.add_rules(
{
Rule("$", "$", { "tex", "latex" })
-- don't add a pair if the next character is %
:with_pair(cond.not_after_regex "%%")
-- don't add a pair if the previous character is xxx
:with_pair(
cond.not_before_regex("xxx", 3)
)
-- don't move right when repeat character
:with_move(cond.none())
-- don't delete if the next character is xx
:with_del(cond.not_after_regex "xx")
-- disable adding a newline when you press <cr>
:with_cr(cond.none()),
},
-- disable for .vim files, but it work for another filetypes
Rule("a", "a", "-vim")
)
end,
},
}
+5
View File
@@ -0,0 +1,5 @@
if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- This will run last in the setup process.
-- This is just pure lua so anything that doesn't
-- fit in the normal config locations above can go here
+6
View File
@@ -0,0 +1,6 @@
---
base: lua51
globals:
vim:
any: true
+8
View File
@@ -0,0 +1,8 @@
std = "neovim"
[rules]
global_usage = "allow"
if_same_then_else = "allow"
incorrect_standard_library_use = "allow"
mixed_table = "allow"
multiple_statements = "allow"