Update new config for astronvim V6
This commit is contained in:
@@ -10,21 +10,12 @@ return {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
sessions = {
|
||||
autosave = {
|
||||
last = true,
|
||||
cwd = true,
|
||||
},
|
||||
ignore = {
|
||||
dirs = { "wiki" },
|
||||
},
|
||||
},
|
||||
-- Configure core features of AstroNvim
|
||||
features = {
|
||||
large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
|
||||
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
|
||||
autopairs = false, -- enable autopairs at start
|
||||
cmp = true, -- enable completion at start
|
||||
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
|
||||
diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup
|
||||
highlighturl = true, -- highlight URLs at start
|
||||
notifications = true, -- enable notifications at start
|
||||
},
|
||||
@@ -33,13 +24,26 @@ return {
|
||||
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 = "auto", -- sets vim.opt.signcolumn to auto
|
||||
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
|
||||
wrap = false, -- sets vim.opt.wrap
|
||||
expandtab = false,
|
||||
cursorline = false,
|
||||
@@ -54,11 +58,11 @@ return {
|
||||
-- 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
|
||||
mapleader = " ", -- sets vim.g.mapleader
|
||||
autoformat_enabled = false, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
||||
cmp_enabled = true, -- enable completion at start
|
||||
autopairs_enabled = true, -- enable autopairs at start
|
||||
diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on)
|
||||
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
|
||||
autoformat_enabled = false, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
||||
autopairs_enabled = false, -- enable autopairs at start
|
||||
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
|
||||
c_syntax_for_h = 1,
|
||||
-- Vimtex
|
||||
@@ -90,6 +94,26 @@ return {
|
||||
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,
|
||||
-- navigate buffer tabs with `H` and `L`
|
||||
L = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
||||
H = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
||||
@@ -154,8 +178,6 @@ return {
|
||||
["<Leader>b"] = { desc = "Buffers" },
|
||||
-- quick save
|
||||
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||
n = { utils.better_search "n", desc = "Next search" },
|
||||
N = { utils.better_search "N", desc = "Previous search" },
|
||||
["<Up>"] = { function() require("smart-splits").resize_up(2) end, desc = "Resize split up" },
|
||||
["<Down>"] = { function() require("smart-splits").resize_down(2) end, desc = "Resize split down" },
|
||||
["<Left>"] = { function() require("smart-splits").resize_left(2) end, desc = "Resize split left" },
|
||||
@@ -290,26 +312,6 @@ return {
|
||||
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||
["<C-l>"] = { function() require("luasnip").jump(1) end, desc = "Jump to next snippet" },
|
||||
},
|
||||
v = {
|
||||
["<Leader>s"] = { function() require("spectre").open_visual() end, desc = "Spectre" },
|
||||
},
|
||||
t = {
|
||||
-- setting a mapping to false will disable it
|
||||
-- ["<esc>"] = false,
|
||||
},
|
||||
x = {
|
||||
-- better increment/decrement
|
||||
["+"] = { "g<C-a>", desc = "Increment number" },
|
||||
["-"] = { "g<C-x>", desc = "Descrement number" },
|
||||
-- Easy-Align
|
||||
ga = { "<Plug>(EasyAlign)", desc = "Easy Align" },
|
||||
},
|
||||
o = {
|
||||
-- line text-objects
|
||||
["il"] = { ":normal vil<cr>", desc = "Inside line text object" },
|
||||
["al"] = { ":normal val<cr>", desc = "Around line text object" },
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -10,9 +10,8 @@ return {
|
||||
opts = {
|
||||
-- Configuration table of features provided by AstroLSP
|
||||
features = {
|
||||
autoformat = true, -- enable or disable auto formatting on start
|
||||
codelens = true, -- enable/disable codelens refresh on start
|
||||
-- inlay_hints = true, -- enable/disable inlay hints on start
|
||||
inlay_hints = false, -- enable/disable inlay hints on start
|
||||
semantic_tokens = true, -- enable/disable semantic token highlighting
|
||||
},
|
||||
-- customize lsp formatting options
|
||||
@@ -29,7 +28,7 @@ return {
|
||||
},
|
||||
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",
|
||||
-- "lua_ls",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
@@ -39,12 +38,13 @@ return {
|
||||
-- enable servers that you already have installed without mason
|
||||
servers = {
|
||||
-- "pyright"
|
||||
"clangd",
|
||||
"clangd"
|
||||
},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
-- 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`)
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
|
||||
-- ["*"] = { capabilities = {} }, -- modify default LSP client settings such as capabilities
|
||||
clangd = {
|
||||
cmd = {
|
||||
"clangd",
|
||||
@@ -63,74 +63,65 @@ return {
|
||||
dataSourceName = "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=trabalho sslmode=disable"
|
||||
}
|
||||
},
|
||||
root_dir = function(path)
|
||||
local normal = require("lspconfig.util").root_pattern(".git")(vim.fn.getcwd())
|
||||
if normal then
|
||||
return normal
|
||||
else
|
||||
return vim.fn.getcwd()
|
||||
end
|
||||
end,
|
||||
root_markers = {".git"},
|
||||
single_file_support = true,
|
||||
filetypes = { "cpp", "c" },
|
||||
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
|
||||
-- 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 `lspconfig`
|
||||
-- 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
|
||||
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
|
||||
-- clangd = function(_, opts) require("clangd_extensions").setup { server = opts } end,
|
||||
},
|
||||
-- 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_document_highlight = {
|
||||
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/documentHighlight",
|
||||
cond = "textDocument/codeLens",
|
||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||
-- list of auto commands to set
|
||||
{
|
||||
-- events to trigger
|
||||
event = { "CursorHold", "CursorHoldI" },
|
||||
event = { "InsertLeave", "BufEnter" },
|
||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||
desc = "Document Highlighting",
|
||||
callback = function() vim.lsp.buf.document_highlight() end,
|
||||
},
|
||||
{
|
||||
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
|
||||
desc = "Document Highlighting Clear",
|
||||
callback = function() vim.lsp.buf.clear_references() end,
|
||||
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 = {
|
||||
gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" },
|
||||
-- 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.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens end,
|
||||
-- },
|
||||
gD = {
|
||||
function() vim.lsp.buf.declaration() end,
|
||||
desc = "Declaration of current symbol",
|
||||
cond = "textDocument/declaration",
|
||||
},
|
||||
gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" },
|
||||
["<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`)
|
||||
-- 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
|
||||
|
||||
@@ -8,7 +8,6 @@ return {
|
||||
"AstroNvim/astroui",
|
||||
---@type AstroUIOpts
|
||||
opts = {
|
||||
-- change colorscheme
|
||||
colorscheme = "catppuccin",
|
||||
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
|
||||
highlights = {
|
||||
|
||||
3
lua/plugins/autopairs.lua
Normal file
3
lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs", enabled = false
|
||||
}
|
||||
@@ -6,5 +6,6 @@ return {
|
||||
-- bg_theme = "grape",
|
||||
bg_padding = 0,
|
||||
has_line_number = true,
|
||||
} end
|
||||
} end,
|
||||
enabled = false
|
||||
}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
return {
|
||||
-- customize alpha options
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
opts = function(_, opts)
|
||||
-- customize the dashboard header
|
||||
opts.section.header.val = {
|
||||
" █████ ███████ ████████ ██████ ██████",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"███████ ███████ ██ ██████ ██ ██",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"██ ██ ███████ ██ ██ ██ ██████",
|
||||
" ",
|
||||
" ███ ██ ██ ██ ██ ███ ███",
|
||||
" ████ ██ ██ ██ ██ ████ ████",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||
" ██ ████ ████ ██ ██ ██",
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
-- 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)
|
||||
-- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
|
||||
-- -- add more custom luasnip configuration such as filetype extend or custom snippets
|
||||
-- local luasnip = require "luasnip"
|
||||
-- luasnip.filetype_extend("javascript", { "javascriptreact" })
|
||||
-- end,
|
||||
-- },
|
||||
-- {
|
||||
-- "windwp/nvim-autopairs",
|
||||
-- config = function(plugin, opts)
|
||||
-- require "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,
|
||||
-- },
|
||||
-- By adding to the which-key config and using our helper function you can add more which-key registered bindings
|
||||
-- {
|
||||
-- "folke/which-key.nvim",
|
||||
-- config = function(plugin, opts)
|
||||
-- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call
|
||||
-- -- Add bindings which show up as group name
|
||||
-- local wk = require "which-key"
|
||||
-- wk.register({
|
||||
-- b = { name = "Buffer" },
|
||||
-- }, { mode = "n", prefix = "<leader>" })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
@@ -61,12 +61,12 @@ return {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"arsham/indent-tools.nvim",
|
||||
dependencies = { "arsham/arshlib.nvim" },
|
||||
event = "User AstroFile",
|
||||
config = function() require("indent-tools").config {} end,
|
||||
},
|
||||
-- {
|
||||
-- "arsham/indent-tools.nvim",
|
||||
-- dependencies = { "arsham/arshlib.nvim" },
|
||||
-- event = "User AstroFile",
|
||||
-- config = function() require("indent-tools").config {} end,
|
||||
-- },
|
||||
{
|
||||
"danymat/neogen",
|
||||
cmd = "Neogen",
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = "nvim-lua/plenary.nvim",
|
||||
lazy = false,
|
||||
}
|
||||
@@ -5,18 +5,20 @@ if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, config)
|
||||
-- config variable is the default configuration table for the setup function call
|
||||
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
|
||||
config.sources = {
|
||||
|
||||
-- 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,
|
||||
}
|
||||
return config -- return final config table
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
||||
config = function(plugin, opts)
|
||||
local cmp = require "cmp"
|
||||
|
||||
cmp.setup(opts)
|
||||
|
||||
cmp.setup {
|
||||
experimental = {
|
||||
ghost_text = true
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = false },
|
||||
"nvim-telescope/telescope-fzy-native.nvim",
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
"nvim-telescope/telescope-hop.nvim",
|
||||
"nvim-telescope/telescope-bibtex.nvim",
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
{
|
||||
"jay-babu/project.nvim",
|
||||
name = "project_nvim",
|
||||
event = "VeryLazy",
|
||||
opts = { ignore_lsp = { "lua_ls", "julials" } },
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
local telescope = require "telescope"
|
||||
local actions = require "telescope.actions"
|
||||
local fb_actions = require("telescope").extensions.file_browser.actions
|
||||
local lga_actions = require "telescope-live-grep-args.actions"
|
||||
local hop = telescope.extensions.hop
|
||||
return require("astrocore").extend_tbl(opts, {
|
||||
defaults = {
|
||||
results_title = "",
|
||||
selection_caret = " ",
|
||||
layout_config = {
|
||||
width = 0.90,
|
||||
height = 0.85,
|
||||
preview_cutoff = 120,
|
||||
horizontal = {
|
||||
preview_width = 0.6,
|
||||
},
|
||||
vertical = {
|
||||
width = 0.9,
|
||||
height = 0.95,
|
||||
preview_height = 0.5,
|
||||
},
|
||||
flex = {
|
||||
horizontal = {
|
||||
preview_width = 0.9,
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-h>"] = hop.hop,
|
||||
["<C-space>"] = function(prompt_bufnr)
|
||||
hop._hop_loop(
|
||||
prompt_bufnr,
|
||||
{ callback = actions.toggle_selection, loop_callback = actions.send_selected_to_qflist }
|
||||
)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
bibtex = { context = true, context_fallback = false },
|
||||
file_browser = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-z>"] = fb_actions.toggle_hidden,
|
||||
},
|
||||
n = {
|
||||
z = fb_actions.toggle_hidden,
|
||||
},
|
||||
},
|
||||
},
|
||||
live_grep_args = {
|
||||
auto_quoting = true, -- enable/disable auto-quoting
|
||||
mappings = { -- extend mappings
|
||||
i = {
|
||||
["<C-a>"] = lga_actions.quote_prompt(),
|
||||
["<C-f>"] = lga_actions.quote_prompt { postfix = " --iglob " },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
find_command = function(cfg)
|
||||
local find_command = { "rg", "--files", "--color", "never" }
|
||||
if not cfg.no_ignore then vim.list_extend(find_command, { "--glob", "!**/.git/**" }) end
|
||||
return find_command
|
||||
end,
|
||||
},
|
||||
buffers = {
|
||||
path_display = { "smart" },
|
||||
mappings = {
|
||||
i = { ["<c-d>"] = actions.delete_buffer },
|
||||
n = { ["d"] = actions.delete_buffer },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
config = function(...)
|
||||
-- require "plugins.configs.telescope"(...)
|
||||
local telescope = require "telescope"
|
||||
telescope.load_extension "fzy_native"
|
||||
telescope.load_extension "live_grep_args"
|
||||
telescope.load_extension "bibtex"
|
||||
telescope.load_extension "file_browser"
|
||||
telescope.load_extension "projects"
|
||||
end,
|
||||
}
|
||||
@@ -1,12 +1,20 @@
|
||||
-- Customize Treesitter
|
||||
-- --------------------
|
||||
-- Treesitter customizations are handled with AstroCore
|
||||
-- as nvim-treesitter simply provides a download utility for parsers
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
dependencies = "AstroNvim/astrocore",
|
||||
opts = function(_, opts)
|
||||
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
"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 = {
|
||||
"lua",
|
||||
"vim",
|
||||
"cpp",
|
||||
"c",
|
||||
"bash",
|
||||
@@ -32,43 +40,8 @@ return {
|
||||
"typescript",
|
||||
"vimdoc",
|
||||
"xml"
|
||||
})
|
||||
end,
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
},
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"cpp",
|
||||
"c",
|
||||
"bash",
|
||||
"vim",
|
||||
"markdown",
|
||||
"asm",
|
||||
"cmake",
|
||||
"css",
|
||||
"html",
|
||||
"javascript",
|
||||
"printf",
|
||||
"fish",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"gitattributes",
|
||||
"java",
|
||||
"meson",
|
||||
"ninja",
|
||||
"python",
|
||||
"sql",
|
||||
"typescript",
|
||||
"vimdoc",
|
||||
"xml"
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,12 +1,91 @@
|
||||
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 {
|
||||
-- You can also add new plugins here as well:
|
||||
-- Add plugins, the lazy syntax
|
||||
-- "andweeb/presence.nvim",
|
||||
-- {
|
||||
-- "ray-x/lsp_signature.nvim",
|
||||
-- event = "BufRead",
|
||||
-- config = function()
|
||||
-- require("lsp_signature").setup()
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- == 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,
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user