batman
This commit is contained in:
commit
ca57342a54
14 changed files with 965 additions and 0 deletions
20
.neoconf.json
Normal file
20
.neoconf.json
Normal 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
.stylua.toml
Normal file
7
.stylua.toml
Normal 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"
|
12
lua/community.lua
Normal file
12
lua/community.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- 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/override with your plugins folder
|
||||
}
|
89
lua/core/keymaps.lua
Normal file
89
lua/core/keymaps.lua
Normal file
|
@ -0,0 +1,89 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
-- ─< lua/keymaps.lua >─────────────────────────────────────────────────────────────────
|
||||
local nomap = vim.keymap.set
|
||||
nomap("i", "<C-k>", "")
|
||||
nomap("n", "<C-k>", "")
|
||||
nomap("n", "q", "")
|
||||
nomap("v", "q", "")
|
||||
nomap("v", "<leader>S", "")
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
|
||||
-- ─< Comment >─────────────────────────────────────────────────────────────────────────
|
||||
map("n", "<S-c>", "gcc", { desc = "comment toggle", remap = true })
|
||||
map("v", "<S-c>", "gc", { desc = "comment toggle", remap = true })
|
||||
|
||||
-- ─< Terminal >────────────────────────────────────────────────────────────────────────
|
||||
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
|
||||
|
||||
-- ─< Movement while in "insert"-mode >─────────────────────────────────────────────────
|
||||
map("i", "<C-b>", "<ESC>^i", { desc = "move beginning of line" })
|
||||
map("i", "<C-e>", "<End>", { desc = "move end of line" })
|
||||
map("i", "<C-h>", "<Left>", { desc = "move left" })
|
||||
map("i", "<C-l>", "<Right>", { desc = "move right" })
|
||||
map("i", "<C-j>", "<Down>", { desc = "move down" })
|
||||
map("i", "<C-k>", "<Up>", { desc = "move up" })
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
map("i", "<C-c>", "<ESC>")
|
||||
map("n", "<C-c>", "<ESC>")
|
||||
map("v", "<C-c>", "<ESC>")
|
||||
|
||||
map("n", "<leader>x", "<cmd>bd!<CR>")
|
||||
|
||||
-- ─< Disable arrow keys in normal mode >───────────────────────────────────────────────
|
||||
map("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
map("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
map("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
map("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
map("n", "<leader>l", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
||||
map("n", "<leader>h", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
||||
map("n", "<leader>j", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||
map("n", "<leader>k", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
-- map("n", "<leader>p", vim.cmd.Ex)
|
||||
map("n", "<leader>q", vim.cmd.q)
|
||||
map("n", "<leader>s", vim.cmd.w)
|
||||
map("n", "<C-s>", vim.cmd.w)
|
||||
|
||||
-- ─< rename word under cursor >───────────────────────────────────────────────────────────
|
||||
map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
-- window management
|
||||
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
||||
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||
|
||||
vim.keymap.set({ "n", "i" }, "<leader>tt", function()
|
||||
-- Frage den Shell-Command ab
|
||||
vim.ui.input({ prompt = "Shell Command: " }, function(cmd)
|
||||
if cmd == nil or cmd == "" then
|
||||
return
|
||||
end
|
||||
|
||||
local result = vim.fn.system(cmd)
|
||||
local exit_code = vim.v.shell_error
|
||||
|
||||
if exit_code ~= 0 then
|
||||
vim.notify("Shell Error:\n" .. result, vim.log.levels.ERROR, { title = "Shell Command Failed" })
|
||||
return
|
||||
end
|
||||
|
||||
local lines = vim.split(result, "\n", { trimempty = true })
|
||||
|
||||
-- Insert at cursor position
|
||||
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
if #lines == 1 then
|
||||
-- Insert inline if the result is a single line
|
||||
local current_line = vim.api.nvim_get_current_line()
|
||||
local new_line = current_line:sub(1, col) .. lines[1] .. current_line:sub(col + 1)
|
||||
vim.api.nvim_set_current_line(new_line)
|
||||
else
|
||||
vim.api.nvim_buf_set_lines(0, row, row, false, lines)
|
||||
end
|
||||
end)
|
||||
end, { desc = "Insert Shell Output at Cursor" })
|
85
lua/core/options.lua
Normal file
85
lua/core/options.lua
Normal file
|
@ -0,0 +1,85 @@
|
|||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
|
||||
local o = vim.opt
|
||||
|
||||
o.relativenumber = true
|
||||
o.number = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
o.scrolloff = 8
|
||||
|
||||
-- tabs & indentation
|
||||
o.tabstop = 2 -- 2 spaces for tabs (prettier default)
|
||||
o.shiftwidth = 2 -- 2 spaces for indent width
|
||||
o.softtabstop = 2
|
||||
-- o.tabstop = 4 -- for TitusWorkings
|
||||
-- o.shiftwidth = 4 -- for TitusWorkings
|
||||
-- o.softtabstop = 4 -- for TitusWorkings
|
||||
o.expandtab = true -- expand tab to spaces
|
||||
o.autoindent = true -- copy indent from current line when starting new one
|
||||
|
||||
o.mouse = "a"
|
||||
o.mousemoveevent = true
|
||||
o.wrap = false
|
||||
|
||||
-- search settings
|
||||
o.ignorecase = true -- ignore case when searching
|
||||
o.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive
|
||||
|
||||
o.cursorline = true
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
o.showmode = false
|
||||
|
||||
-- turn on termguicolors for tokyonight colorscheme to work
|
||||
-- (have to use iterm2 or any other true color terminal)
|
||||
o.termguicolors = true
|
||||
o.background = "dark" -- colorschemes that can be light or dark will be made dark
|
||||
o.signcolumn = "yes" -- show sign column so that text doesn't shift
|
||||
|
||||
-- backspace
|
||||
o.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
|
||||
|
||||
-- clipboard
|
||||
o.clipboard:append("unnamedplus") -- use system clipboard as default register
|
||||
|
||||
-- split windows
|
||||
o.splitright = true -- split vertical window to the right
|
||||
o.splitbelow = true -- split horizontal window to the bottom
|
||||
o.splitkeep = "screen"
|
||||
o.laststatus = 3
|
||||
|
||||
-- turn off swapfile
|
||||
o.swapfile = false
|
||||
|
||||
-- Disable the tilde on empty lines
|
||||
o.fillchars = { eob = " " }
|
||||
|
||||
-- SudaRead automatic if file is inaccessible
|
||||
vim.g.suda_smart_edit = 1
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set cursor to beam when entering Neovim
|
||||
vim.cmd([[
|
||||
augroup ChangeCursorShape
|
||||
autocmd!
|
||||
autocmd VimEnter * set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
|
||||
autocmd VimLeave * set guicursor=a:ver25
|
||||
augroup END
|
||||
]])
|
||||
|
||||
if vim.g.neovide then
|
||||
-- vim.g.neovide_transparency = 0.35
|
||||
vim.g.neovide_transparency = 1
|
||||
vim.g.neovide_theme = "dark"
|
||||
vim.g.neovide_refresh_rate = 90
|
||||
vim.g.neovide_cursor_vfx_mode = "torpedo"
|
||||
vim.g.neovide_cursor_smooth_blink = true
|
||||
end
|
32
lua/lazy_setup.lua
Normal file
32
lua/lazy_setup.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
require("lazy").setup({
|
||||
{
|
||||
"AstroNvim/AstroNvim",
|
||||
version = "^5", -- 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]])
|
72
lua/plugins/astrocore.lua
Normal file
72
lua/plugins/astrocore.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
-- 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,
|
||||
},
|
||||
-- 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
105
lua/plugins/astrolsp.lua
Normal file
105
lua/plugins/astrolsp.lua
Normal file
|
@ -0,0 +1,105 @@
|
|||
-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- 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 = {
|
||||
-- "pyright"
|
||||
},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
|
||||
},
|
||||
-- customize how language servers are attached
|
||||
handlers = {
|
||||
-- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server
|
||||
-- function(server, opts) require("lspconfig")[server].setup(opts) end
|
||||
|
||||
-- the key is the server that is being setup with `lspconfig`
|
||||
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
|
||||
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
|
||||
},
|
||||
-- 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.refresh { 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 lspconfig-setup`)
|
||||
on_attach = function(client, bufnr)
|
||||
-- this would disable semanticTokensProvider for all clients
|
||||
-- client.server_capabilities.semanticTokensProvider = nil
|
||||
end,
|
||||
},
|
||||
}
|
39
lua/plugins/astroui.lua
Normal file
39
lua/plugins/astroui.lua
Normal 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 = "⠏",
|
||||
},
|
||||
},
|
||||
}
|
28
lua/plugins/mason.lua
Normal file
28
lua/plugins/mason.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- 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",
|
||||
|
||||
-- install formatters
|
||||
"stylua",
|
||||
|
||||
-- install debuggers
|
||||
"debugpy",
|
||||
|
||||
-- install any other package
|
||||
"tree-sitter-cli",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
24
lua/plugins/none-ls.lua
Normal file
24
lua/plugins/none-ls.lua
Normal 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,
|
||||
}
|
15
lua/plugins/treesitter.lua
Normal file
15
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Treesitter
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
}
|
419
lua/plugins/user.lua
Normal file
419
lua/plugins/user.lua
Normal file
|
@ -0,0 +1,419 @@
|
|||
-- 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,
|
||||
},
|
||||
|
||||
"lambdalisue/vim-suda",
|
||||
"folke/lsp-colors.nvim",
|
||||
"dstein64/nvim-scrollview",
|
||||
|
||||
-- == 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 = true },
|
||||
|
||||
-- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function(plugin, opts)
|
||||
-- include the default astronvim config that calls the setup call
|
||||
require "astronvim.plugins.configs.luasnip"(plugin, opts)
|
||||
-- load snippets paths
|
||||
require("luasnip.loaders.from_vscode").lazy_load {
|
||||
paths = { vim.fn.stdpath "config" .. "/snippets" },
|
||||
}
|
||||
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,
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "saghen/blink.cmp",
|
||||
-- -- -- optional: provides snippets for the snippet source
|
||||
-- -- dependencies = { "rafamadriz/friendly-snippets" },
|
||||
-- --
|
||||
-- -- -- use a release tag to download pre-built binaries
|
||||
-- -- version = "1.*",
|
||||
-- -- -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- -- -- build = "cargo build --release",
|
||||
-- -- -- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- -- -- build = 'nix run .#build-plugin',
|
||||
-- --
|
||||
-- ---@module 'blink.cmp'
|
||||
-- ---@type blink.cmp.Config
|
||||
-- opts = {
|
||||
-- -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- -- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- -- 'enter' for enter to accept
|
||||
-- -- 'none' for no mappings
|
||||
-- keymap = {
|
||||
-- -- set to 'none' to disable the 'default' preset
|
||||
-- preset = "super-tab",
|
||||
--
|
||||
-- ["<C-k>"] = { "select_prev", "fallback" },
|
||||
-- ["<C-j>"] = { "select_next", "fallback" },
|
||||
-- ["<C-q>"] = { "hide", "fallback" },
|
||||
--
|
||||
-- -- disable a keymap from the preset
|
||||
-- ["<C-e>"] = {},
|
||||
-- ["<C-p>"] = {},
|
||||
-- ["<C-n>"] = {},
|
||||
--
|
||||
-- -- show with a list of providers
|
||||
-- -- ["<C-space>"] = {
|
||||
-- -- function(cmp)
|
||||
-- -- cmp.show({ providers = { "snippets" } })
|
||||
-- -- end,
|
||||
-- -- },
|
||||
--
|
||||
-- -- control whether the next command will be run when using a function
|
||||
-- -- ["<C-n>"] = {
|
||||
-- -- function(cmp)
|
||||
-- -- if some_condition then
|
||||
-- -- return
|
||||
-- -- end -- runs the next command
|
||||
-- -- return true -- doesn't run the next command
|
||||
-- -- end,
|
||||
-- -- "select_next",
|
||||
-- -- },
|
||||
-- },
|
||||
--
|
||||
-- -- appearance = {
|
||||
-- -- -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- -- -- Adjusts spacing to ensure icons are aligned
|
||||
-- -- nerd_font_variant = "mono",
|
||||
-- --
|
||||
-- -- -- highlight_ns = vim.api.nvim_create_namespace("nvim-cmp"),
|
||||
-- -- -- Sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||
-- -- -- Useful for when your theme doesn't support blink.cmp
|
||||
-- -- -- Will be removed in a future release
|
||||
-- --
|
||||
-- -- use_nvim_cmp_as_default = true,
|
||||
-- -- },
|
||||
--
|
||||
-- -- (Default) Only show the documentation popup when manually triggered
|
||||
-- completion = {
|
||||
-- keyword = { range = "full" },
|
||||
-- -- trigger = {
|
||||
-- -- When true, will prefetch the completion items when entering insert mode
|
||||
-- -- prefetch_on_insert = false,
|
||||
--
|
||||
-- -- When false, will not show the completion window automatically when in a snippet
|
||||
-- -- show_in_snippet = true,
|
||||
--
|
||||
-- -- When true, will show the completion window after typing any of alphanumerics, `-` or `_`
|
||||
-- -- show_on_keyword = true,
|
||||
--
|
||||
-- -- When true, will show the completion window after typing a trigger character
|
||||
-- -- show_on_trigger_character = true,
|
||||
--
|
||||
-- -- LSPs can indicate when to show the completion window via trigger characters
|
||||
-- -- however, some LSPs (i.e. tsserver) return characters that would essentially
|
||||
-- -- always show the window. We block these by default.
|
||||
-- -- show_on_blocked_trigger_characters = { " ", "\n", "\t" },
|
||||
-- -- You can also block per filetype with a function:
|
||||
-- -- show_on_blocked_trigger_characters = function(ctx)
|
||||
-- -- if vim.bo.filetype == "markdown" then
|
||||
-- -- return { " ", "\n", "\t", ".", "/", "(", "[" }
|
||||
-- -- end
|
||||
-- -- return { " ", "\n", "\t" }
|
||||
-- -- end,
|
||||
--
|
||||
-- -- When both this and show_on_trigger_character are true, will show the completion window
|
||||
-- -- when the cursor comes after a trigger character after accepting an item
|
||||
-- -- show_on_accept_on_trigger_character = true,
|
||||
--
|
||||
-- -- When both this and show_on_trigger_character are true, will show the completion window
|
||||
-- -- when the cursor comes after a trigger character when entering insert mode
|
||||
-- -- show_on_insert_on_trigger_character = true,
|
||||
--
|
||||
-- -- List of trigger characters (on top of `show_on_blocked_trigger_characters`) that won't trigger
|
||||
-- -- the completion window when the cursor comes after a trigger character when
|
||||
-- -- entering insert mode/accepting an item
|
||||
-- -- show_on_x_blocked_trigger_characters = { "'", '"', "(" },
|
||||
-- -- or a function, similar to show_on_blocked_trigger_character
|
||||
-- -- },
|
||||
-- list = {
|
||||
-- -- Maximum number of items to display
|
||||
-- max_items = 128,
|
||||
--
|
||||
-- selection = {
|
||||
-- -- When `true`, will automatically select the first item in the completion list
|
||||
-- preselect = true,
|
||||
-- -- preselect = function(ctx) return vim.bo.filetype ~= 'markdown' end,
|
||||
--
|
||||
-- -- When `true`, inserts the completion item automatically when selecting it
|
||||
-- -- You may want to bind a key to the `cancel` command (default <C-e>) when using this option,
|
||||
-- -- which will both undo the selection and hide the completion menu
|
||||
-- auto_insert = false,
|
||||
-- -- auto_insert = function(ctx) return vim.bo.filetype ~= 'markdown' end
|
||||
-- },
|
||||
--
|
||||
-- cycle = {
|
||||
-- -- When `true`, calling `select_next` at the _bottom_ of the completion list
|
||||
-- -- will select the _first_ completion item.
|
||||
-- from_bottom = true,
|
||||
-- -- When `true`, calling `select_prev` at the _top_ of the completion list
|
||||
-- -- will select the _last_ completion item.
|
||||
-- from_top = true,
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- -- documentation = {
|
||||
-- -- auto_show = false,
|
||||
-- -- auto_show_delay_ms = 230,
|
||||
-- -- update_delay_ms = 50,
|
||||
-- -- treesitter_highlighting = false,
|
||||
-- -- draw = function(opts) opts.default_implementation() end,
|
||||
-- -- window = {
|
||||
-- -- min_width = 16,
|
||||
-- -- max_width = 80,
|
||||
-- -- max_height = 24,
|
||||
-- -- border = "padded", -- Defaults to `vim.o.winborder` on nvim 0.11+ or 'padded' when not defined/<=0.10
|
||||
-- -- winblend = 0,
|
||||
-- -- winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc",
|
||||
-- -- -- Note that the gutter will be disabled when border ~= 'none'
|
||||
-- -- scrollbar = true,
|
||||
-- -- },
|
||||
-- -- },
|
||||
-- -- ghost_text = {
|
||||
-- -- enabled = true,
|
||||
-- -- show_with_selection = true,
|
||||
-- -- show_without_selection = false,
|
||||
-- -- show_with_menu = true,
|
||||
-- -- show_without_menu = false,
|
||||
-- -- },
|
||||
-- -- ─────────────────────────────────< mini-icons config >──────────────────────────────
|
||||
-- -- menu = {
|
||||
-- -- enabled = true,
|
||||
-- -- min_width = 16,
|
||||
-- -- max_height = 10,
|
||||
-- -- border = nil, -- Defaults to `vim.o.winborder` on nvim 0.11+
|
||||
-- -- winblend = 0,
|
||||
-- -- winhighlight = "Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None",
|
||||
-- -- -- Keep the cursor X lines away from the top/bottom of the window
|
||||
-- -- scrolloff = 2,
|
||||
-- -- -- Note that the gutter will be disabled when border ~= 'none'
|
||||
-- -- scrollbar = true,
|
||||
-- -- -- Which directions to show the window,
|
||||
-- -- -- falling back to the next direction when there's not enough space
|
||||
-- -- direction_priority = { "s", "n" },
|
||||
-- --
|
||||
-- -- -- Whether to automatically show the window when new completion items are available
|
||||
-- -- auto_show = true,
|
||||
-- --
|
||||
-- -- draw = {
|
||||
-- -- -- Aligns the keyword you've typed to a component in the menu
|
||||
-- -- align_to = "label", -- or 'none' to disable, or 'cursor' to align to the cursor
|
||||
-- -- -- Left and right padding, optionally { left, right } for different padding on each side
|
||||
-- -- padding = 1,
|
||||
-- -- -- Gap between columns
|
||||
-- -- gap = 2,
|
||||
-- -- -- Use treesitter to highlight the label text for the given list of sources
|
||||
-- -- -- treesitter = {},
|
||||
-- -- treesitter = { "lsp" },
|
||||
-- -- columns = { { "kind_icon" }, { "label", "label_description", gap = 1 } },
|
||||
-- -- components = {
|
||||
-- -- label = {
|
||||
-- -- text = function(ctx) return require("colorful-menu").blink_components_text(ctx) end,
|
||||
-- -- highlight = function(ctx) return require("colorful-menu").blink_components_highlight(ctx) end,
|
||||
-- -- },
|
||||
-- -- kind_icon = {
|
||||
-- -- text = function(ctx)
|
||||
-- -- local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
-- -- return kind_icon
|
||||
-- -- end,
|
||||
-- -- -- (optional) use highlights from mini.icons
|
||||
-- -- highlight = function(ctx)
|
||||
-- -- local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
-- -- return hl
|
||||
-- -- end,
|
||||
-- -- },
|
||||
-- --
|
||||
-- -- -- kind = {
|
||||
-- -- -- -- (optional) use highlights from mini.icons
|
||||
-- -- -- highlight = function(ctx)
|
||||
-- -- -- local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
-- -- -- return hl
|
||||
-- -- -- end,
|
||||
-- -- -- },
|
||||
-- --
|
||||
-- -- label_description = {
|
||||
-- -- width = { max = 30 },
|
||||
-- -- text = function(ctx) return ctx.label_description end,
|
||||
-- -- highlight = "BlinkCmpLabelDescription",
|
||||
-- -- },
|
||||
-- --
|
||||
-- -- source_name = {
|
||||
-- -- width = { max = 30 },
|
||||
-- -- text = function(ctx) return ctx.source_name end,
|
||||
-- -- highlight = "BlinkCmpSource",
|
||||
-- -- },
|
||||
-- --
|
||||
-- -- source_id = {
|
||||
-- -- width = { max = 30 },
|
||||
-- -- text = function(ctx) return ctx.source_id end,
|
||||
-- -- highlight = "BlinkCmpSource",
|
||||
-- -- },
|
||||
-- -- },
|
||||
-- -- },
|
||||
-- -- },
|
||||
-- },
|
||||
--
|
||||
-- -- Default list of enabled providers defined so that you can extend it
|
||||
-- -- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
-- sources = {
|
||||
-- default = { "lsp", "path", "snippets", "buffer" },
|
||||
-- },
|
||||
--
|
||||
-- -- snippets = { preset = "default" | "luasnip" },
|
||||
--
|
||||
-- -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
-- --
|
||||
-- -- See the fuzzy documentation for more information
|
||||
-- fuzzy = {
|
||||
-- implementation = "prefer_rust",
|
||||
--
|
||||
-- -- Frecency tracks the most recently/frequently used items and boosts the score of the item
|
||||
-- -- Note, this does not apply when using the Lua implementation.
|
||||
-- use_frecency = true,
|
||||
--
|
||||
-- -- Proximity bonus boosts the score of items matching nearby words
|
||||
-- -- Note, this does not apply when using the Lua implementation.
|
||||
-- use_proximity = true,
|
||||
--
|
||||
-- -- UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database. This should only be used on unsupported platforms (i.e. alpine termux)
|
||||
-- -- Note, this does not apply when using the Lua implementation.
|
||||
-- use_unsafe_no_lock = false,
|
||||
-- sorts = {
|
||||
-- -- (optionally) always prioritize exact matches
|
||||
-- -- 'exact',
|
||||
--
|
||||
-- -- pass a function for custom behavior
|
||||
-- -- function(item_a, item_b)
|
||||
-- -- return item_a.score > item_b.score
|
||||
-- -- end,
|
||||
--
|
||||
-- "score",
|
||||
-- "sort_text",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- opts_extend = { "sources.default" },
|
||||
-- },
|
||||
|
||||
{
|
||||
{
|
||||
"chrisgrieser/nvim-scissors",
|
||||
lazy = false,
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" },
|
||||
opts = {
|
||||
snippetDir = "~/.config/nvim/snippets", -- <- i have this as a submodule in my neovim config to have a seperate repo https://git.k4li.de/dotfiles/nvim-snippets.git
|
||||
},
|
||||
},
|
||||
-- ──────────────────────────< keybindings for snippets engine >───────────────────────
|
||||
vim.keymap.set("n", "<leader>sm", "<CMD>:ScissorsEditSnippet<cr>"),
|
||||
vim.keymap.set("v", "<leader>sa", "<CMD>:ScissorsAddNewSnippet<cr>"),
|
||||
},
|
||||
-- -@type LazySpec
|
||||
{
|
||||
"mikavilpas/yazi.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
-- 👇 in this section, choose your own keymappings!
|
||||
-- {
|
||||
-- "<leader>lf",
|
||||
-- "<cmd>Yazi<cr>",
|
||||
-- desc = "Open yazi at the current file",
|
||||
-- },
|
||||
{
|
||||
-- Open in the current working directory
|
||||
"<leader>tLf",
|
||||
"<cmd>Yazi cwd<cr>",
|
||||
desc = "Open the file manager in nvim's working directory",
|
||||
},
|
||||
{
|
||||
-- NOTE: this requires a version of yazi that includes
|
||||
-- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
|
||||
"<leader>tlf",
|
||||
"<cmd>Yazi toggle<cr>",
|
||||
desc = "Resume the last yazi session",
|
||||
},
|
||||
},
|
||||
---@type YaziConfig
|
||||
opts = {
|
||||
-- if you want to open yazi instead of netrw, see below for more info
|
||||
open_for_directories = true,
|
||||
keymaps = {
|
||||
show_help = "<f1>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
18
lua/polish.lua
Normal file
18
lua/polish.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- This will run last in the setup process and is a good place to configure
|
||||
-- things like custom filetypes. This is just pure lua so anything that doesn't
|
||||
-- fit in the normal config locations above can go here
|
||||
|
||||
-- Set up custom filetypes
|
||||
vim.filetype.add {
|
||||
extension = {
|
||||
foo = "fooscript",
|
||||
},
|
||||
filename = {
|
||||
["Foofile"] = "fooscript",
|
||||
},
|
||||
pattern = {
|
||||
["~/%.config/foo/.*"] = "fooscript",
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue