mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 12:10:42 +00:00
Initial commit
This commit is contained in:
parent
b912871070
commit
a3e01caebf
157 changed files with 9696 additions and 0 deletions
43
home/.config/lvim/.luacheckrc
Normal file
43
home/.config/lvim/.luacheckrc
Normal file
|
@ -0,0 +1,43 @@
|
|||
-- vim: ft=lua tw=80
|
||||
|
||||
stds.nvim = {
|
||||
globals = {
|
||||
"lvim",
|
||||
vim = { fields = { "g" } },
|
||||
"TERMINAL",
|
||||
"USER",
|
||||
"C",
|
||||
"Config",
|
||||
"WORKSPACE_PATH",
|
||||
"JAVA_LS_EXECUTABLE",
|
||||
"MUtils",
|
||||
"USER_CONFIG_PATH",
|
||||
os = { fields = { "capture" } },
|
||||
},
|
||||
read_globals = {
|
||||
"jit",
|
||||
"os",
|
||||
"vim",
|
||||
"join_paths",
|
||||
"get_runtime_dir",
|
||||
"get_config_dir",
|
||||
"get_cache_dir",
|
||||
"get_lvim_base_dir",
|
||||
"require_clean",
|
||||
},
|
||||
}
|
||||
|
||||
std = "lua51+nvim"
|
||||
|
||||
files["tests/*_spec.lua"].std = "lua51+nvim+busted"
|
||||
|
||||
-- Don't report unused self arguments of methods.
|
||||
self = false
|
||||
|
||||
-- Rerun tests only if their modification time changed.
|
||||
cache = true
|
||||
|
||||
ignore = {
|
||||
"631", -- max_line_length
|
||||
"212/_.*", -- unused argument, for vars with "_" prefix
|
||||
}
|
6
home/.config/lvim/.stylua.toml
Normal file
6
home/.config/lvim/.stylua.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
no_call_parentheses = true
|
2
home/.config/lvim/after/ftplugin/python.lua
Normal file
2
home/.config/lvim/after/ftplugin/python.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
local dap_install = require "dap-install"
|
||||
dap_install.config("python", {})
|
43
home/.config/lvim/config.lua
Normal file
43
home/.config/lvim/config.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
require "user.keys"
|
||||
require "user.abbreviations"
|
||||
require "user.lsp"
|
||||
require "user.autocmds"
|
||||
require "user.plugins"
|
||||
require "user.options"
|
||||
require "user.lualine"
|
||||
require "user.treesitter"
|
||||
|
||||
-- TEMPORARY; Learn vim, the hard way
|
||||
-- vim.opt.mouse = {}
|
||||
-- lvim.keys.normal_mode["<Up>"] = ""
|
||||
-- lvim.keys.normal_mode["<Down>"] = ""
|
||||
-- lvim.keys.normal_mode["<Left>"] = ""
|
||||
-- lvim.keys.normal_mode["<Right>"] = ""
|
||||
-- lvim.keys.visual_mode["<Up>"] = ""
|
||||
-- lvim.keys.visual_mode["<Down>"] = ""
|
||||
-- lvim.keys.visual_mode["<Left>"] = ""
|
||||
-- lvim.keys.visual_mode["<Right>"] = ""
|
||||
-- lvim.keys.insert_mode["<Up>"] = ""
|
||||
-- lvim.keys.insert_mode["<Down>"] = ""
|
||||
-- lvim.keys.insert_mode["<Left>"] = ""
|
||||
-- lvim.keys.insert_mode["<Right>"] = ""
|
||||
|
||||
|
||||
-- general
|
||||
lvim.log.level = "warn"
|
||||
lvim.format_on_save = false
|
||||
lvim.colorscheme = "onedarker"
|
||||
-- to disable icons and use a minimalist setup, uncomment the following
|
||||
-- lvim.use_icons = false
|
||||
|
||||
-- TODO: User Config for predefined plugins
|
||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||
lvim.builtin.dap.active = true
|
||||
lvim.builtin.notify.active = true
|
||||
lvim.builtin.terminal.active = true
|
||||
lvim.builtin.alpha.active = true
|
||||
lvim.builtin.alpha.mode = "dashboard"
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
lvim.builtin.project.patterns = { ".git", ".svn" }
|
||||
lvim.builtin.bufferline.options.always_show_bufferline = true
|
||||
-- lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
11
home/.config/lvim/ftdetect/apparmor.lua
Normal file
11
home/.config/lvim/ftdetect/apparmor.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd({ "BufNewFile", "BufRead" }, {
|
||||
pattern = { "/etc/apparmor.d/*" },
|
||||
command = "setfiletype apparmor"
|
||||
})
|
||||
|
||||
autocmd({ "BufNewFile", "BufRead" }, {
|
||||
pattern = { "/usr/share/apparmor/extra-profiles/*" },
|
||||
command = "setfiletype apparmor"
|
||||
})
|
6
home/.config/lvim/ftdetect/axaml.lua
Normal file
6
home/.config/lvim/ftdetect/axaml.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd({ "BufNewFile", "BufRead" }, {
|
||||
pattern = { "*.axaml" },
|
||||
command = "setfiletype xml"
|
||||
})
|
30
home/.config/lvim/lua/user/abbreviations.lua
Normal file
30
home/.config/lvim/lua/user/abbreviations.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- Define an abbreviation
|
||||
local function abbrev(mode, input, result, reabbrev)
|
||||
reabbrev = reabbrev or false
|
||||
local command
|
||||
if reabbrev then
|
||||
command = mode .. "abbrev"
|
||||
else
|
||||
command = mode .. "noreabbrev"
|
||||
end
|
||||
vim.cmd(command .. " " .. input .. " " .. result)
|
||||
end
|
||||
|
||||
-- In case I have caps on (don't judge me for using caps)
|
||||
abbrev("c", "Wq", "wq")
|
||||
abbrev("c", "wQ", "wq")
|
||||
abbrev("c", "WQ", "wq")
|
||||
abbrev("c", "WQ!", "wq")
|
||||
abbrev("c", "wQ!", "wq")
|
||||
abbrev("c", "Wq!", "wq")
|
||||
abbrev("c", "W", "w")
|
||||
abbrev("c", "W!", "w!")
|
||||
abbrev("c", "Q", "q!")
|
||||
abbrev("c", "Q!", "q!")
|
||||
abbrev("c", "Qall", "qall")
|
||||
abbrev("c", "Qall!", "qall")
|
||||
abbrev("c", "QALL", "qall")
|
||||
abbrev("c", "QALL!", "qall")
|
||||
|
||||
-- Save file with sudo
|
||||
abbrev("c", "w!!", "w !sudo tee > /dev/null %")
|
19
home/.config/lvim/lua/user/autocmds.lua
Normal file
19
home/.config/lvim/lua/user/autocmds.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
|
||||
|
||||
-- Delete all trailing whitespace on saving
|
||||
vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*.py", command = [[%s/\s\+$//e]] })
|
||||
-- Set text wrap to 119 characters
|
||||
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.md", command = "setlocal tw=119" })
|
||||
-- Jump to last position when opening a file
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
pattern = "*",
|
||||
command = [[if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif]],
|
||||
})
|
||||
-- Highlight current line number
|
||||
vim.api.nvim_create_autocmd("ColorScheme", { pattern = "*", command = "highlight CursorLine guibg=#2b2b2b" })
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "*",
|
||||
command = "highlight CursorLineNr guifg=#1f85de ctermfg=LightBlue",
|
||||
})
|
||||
-- Custom syntax definitions based on file extensions
|
||||
vim.api.nvim_create_autocmd("BufRead", { pattern = "*.axml", command = "set ft=xml" })
|
118
home/.config/lvim/lua/user/keys.lua
Normal file
118
home/.config/lvim/lua/user/keys.lua
Normal file
|
@ -0,0 +1,118 @@
|
|||
-- keymappings [view all the defaults by pressing <leader>Lk]
|
||||
lvim.leader = "space"
|
||||
|
||||
-- Common shortcuts
|
||||
lvim.keys.normal_mode["<C-s>"] = ":w<CR>"
|
||||
lvim.keys.insert_mode["<C-s>"] = "<Esc>:w<CR>i"
|
||||
lvim.keys.normal_mode["<C-z>"] = ":undo<CR>"
|
||||
lvim.keys.normal_mode["<C-y>"] = ":redo<CR>"
|
||||
|
||||
-- Moevements
|
||||
lvim.keys.normal_mode["H"] = "^"
|
||||
lvim.keys.normal_mode["L"] = "$"
|
||||
|
||||
-- Moving through buffers
|
||||
lvim.keys.normal_mode["<A-l>"] = ":BufferLineCycleNext<CR>"
|
||||
lvim.keys.normal_mode["<A-h>"] = ":BufferLineCyclePrev<CR>"
|
||||
lvim.keys.normal_mode["<A-L>"] = ":BufferLineMoveNext<CR>"
|
||||
lvim.keys.normal_mode["<A-H>"] = ":BufferLineMovePrev<CR>"
|
||||
|
||||
-- Opening various menus
|
||||
lvim.keys.normal_mode["<C-n>"] = ":NvimTreeFindFileToggle<CR>"
|
||||
lvim.keys.normal_mode["<C-f>"] = ":Lf<CR>"
|
||||
lvim.keys.normal_mode["<A-m>"] = ":MinimapToggle<CR>"
|
||||
lvim.keys.normal_mode["<A-s>"] = ":SymbolsOutline<CR>"
|
||||
|
||||
-- Delete to void register
|
||||
lvim.keys.visual_mode["<A-d>"] = '"_d'
|
||||
lvim.keys.normal_mode["<A-d>"] = '"_d'
|
||||
lvim.keys.visual_mode["<A-p>"] = '"_dP'
|
||||
lvim.keys.visual_mode["p"] = '"_dP'
|
||||
|
||||
-- Remove highlight
|
||||
lvim.keys.normal_mode["<esc><esc>"] = ":nohlsearch<cr>"
|
||||
|
||||
-- Debugger
|
||||
lvim.keys.normal_mode["<F9>"] = ":DapToggleBreakpoint<CR>"
|
||||
lvim.keys.normal_mode["<F5>"] = ":DapContinue<CR>"
|
||||
lvim.keys.normal_mode["<F6>"] = ":DapToggleRepl<CR>"
|
||||
lvim.keys.normal_mode["<S-F5>"] = ":DapTerminate<CR>"
|
||||
lvim.keys.normal_mode["<F10>"] = ":DapStepOver<CR>"
|
||||
lvim.keys.normal_mode["<F11>"] = ":DapStepInto<CR>"
|
||||
lvim.keys.normal_mode["<S-F11>"] = ":DapStepOut<CR>"
|
||||
|
||||
lvim.builtin.which_key.mappings["h"] = {
|
||||
name = "+Hop",
|
||||
w = { "<cmd>HopWord<CR>", "Word" },
|
||||
p = { "<cmd>HopPattern<CR>", "Pattern" },
|
||||
a = { "<cmd>HopAnywhere<CR>", "Anywhere" },
|
||||
v = { "<cmd>HopVertical<CR>", "Vertical" },
|
||||
}
|
||||
|
||||
-- Quick word replacing (use . for next word)
|
||||
lvim.keys.normal_mode["cn"] = "*``cgn"
|
||||
lvim.keys.normal_mode["cN"] = "*``cgN"
|
||||
|
||||
-- Quick replace all
|
||||
vim.api.nvim_set_keymap("n", "<A-r>", "", {
|
||||
noremap = true,
|
||||
callback = function()
|
||||
vim.fn.inputsave()
|
||||
local query = vim.fn.input "To replace: "
|
||||
|
||||
vim.fn.inputsave()
|
||||
local answer = vim.fn.input("Replace text: ", query)
|
||||
vim.api.nvim_command("%s/\\V" .. query:gsub("/", "\\/") .. "/" .. answer:gsub("/", "\\/") .. "/")
|
||||
vim.fn.inputrestore()
|
||||
vim.api.nvim_feedkeys("v", "n", false)
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_set_keymap("v", "<A-r>", "", {
|
||||
noremap = true,
|
||||
callback = function()
|
||||
local getselection = function()
|
||||
return vim.fn.strcharpart(vim.fn.getline(vim.fn.line "."), vim.fn.min {
|
||||
vim.fn.charcol ".",
|
||||
vim.fn.charcol "v",
|
||||
} - 1, vim.fn.abs(vim.fn.charcol "." - vim.fn.charcol "v") + 1)
|
||||
end
|
||||
|
||||
local query = getselection()
|
||||
|
||||
vim.fn.inputsave()
|
||||
local answer = vim.fn.input("Replace text: ", query)
|
||||
vim.api.nvim_command("%s/\\V" .. query:gsub("/", "\\/") .. "/" .. answer:gsub("/", "\\/") .. "/")
|
||||
vim.fn.inputrestore()
|
||||
vim.api.nvim_feedkeys("v", "n", false)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
|
||||
-- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
|
||||
-- local _, actions = pcall(require, "telescope.actions")
|
||||
-- lvim.builtin.telescope.defaults.mappings = {
|
||||
-- -- for input mode
|
||||
-- i = {
|
||||
-- ["<C-j>"] = actions.move_selection_next,
|
||||
-- ["<C-k>"] = actions.move_selection_previous,
|
||||
-- ["<C-n>"] = actions.cycle_history_next,
|
||||
-- ["<C-p>"] = actions.cycle_history_prev,
|
||||
-- },
|
||||
-- -- for normal mode
|
||||
-- n = {
|
||||
-- ["<C-j>"] = actions.move_selection_next,
|
||||
-- ["<C-k>"] = actions.move_selection_previous,
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- Use which-key to add extra bindings with the leader-key prefix
|
||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
||||
-- lvim.builtin.which_key.mappings["t"] = {
|
||||
-- name = "+Trouble",
|
||||
-- r = { "<cmd>Trouble lsp_references<cr>", "References" },
|
||||
-- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
|
||||
-- d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
|
||||
-- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
|
||||
-- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
|
||||
-- w = { "<cmd>Trouble workspace_diagnostics<cr>", "Workspace Diagnostics" },
|
||||
-- }
|
68
home/.config/lvim/lua/user/lsp.lua
Normal file
68
home/.config/lvim/lua/user/lsp.lua
Normal file
|
@ -0,0 +1,68 @@
|
|||
-- generic LSP settings
|
||||
|
||||
-- -- make sure server will always be installed even if the server is in skipped_servers list
|
||||
-- lvim.lsp.installer.setup.ensure_installed = {
|
||||
-- "sumeko_lua",
|
||||
-- "jsonls",
|
||||
-- }
|
||||
-- -- change UI setting of `LspInstallInfo`
|
||||
-- -- see <https://github.com/williamboman/nvim-lsp-installer#default-configuration>
|
||||
-- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false
|
||||
-- lvim.lsp.installer.setup.ui.border = "rounded"
|
||||
-- lvim.lsp.installer.setup.ui.keymaps = {
|
||||
-- uninstall_server = "d",
|
||||
-- toggle_server_expand = "o",
|
||||
-- }
|
||||
|
||||
-- ---@usage disable automatic installation of servers
|
||||
lvim.lsp.installer.setup.automatic_installation = false
|
||||
|
||||
-- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
|
||||
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
|
||||
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
||||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
||||
|
||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
|
||||
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
|
||||
-- return server ~= "emmet_ls"
|
||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
||||
|
||||
-- -- you can set a custom on_attach function that will be used for all the language servers
|
||||
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
||||
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
||||
-- local function buf_set_option(...)
|
||||
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
-- end
|
||||
-- --Enable completion triggered by <c-x><c-o>
|
||||
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
-- end
|
||||
|
||||
-- set a formatter, this will override the language server formatting capabilities (if it exists)
|
||||
lvim.format_on_save = false
|
||||
local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
formatters.setup {
|
||||
-- each formatter accepts a list of options identical to
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
||||
{ command = "black", filetypes = { "python" } },
|
||||
{ command = "isort", filetypes = { "python" } },
|
||||
{
|
||||
command = "prettier",
|
||||
extra_args = { "--print-width", "100" },
|
||||
filetypes = { "typescript", "typescriptreact" },
|
||||
},
|
||||
{ command = "stylua", filetypes = { "lua" } },
|
||||
-- { command = "rustfmt", filetypes = { "rust" } },
|
||||
}
|
||||
|
||||
-- set additional linters
|
||||
local linters = require "lvim.lsp.null-ls.linters"
|
||||
linters.setup {
|
||||
-- Each linter accepts a list of options identical to
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
||||
{ command = "flake8", filetypes = { "python" } },
|
||||
{ command = "shellcheck", extra_args = { "--severity", "warning" } },
|
||||
{ command = "codespell", filetypes = { "javascript", "python" } },
|
||||
{ command = "luacheck", filetypes = { "lua" } },
|
||||
}
|
3
home/.config/lvim/lua/user/lualine.lua
Normal file
3
home/.config/lvim/lua/user/lualine.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- Add location (row:col) to lualine
|
||||
local components = require "lvim.core.lualine.components"
|
||||
lvim.builtin.lualine.sections.lualine_z = { components.location }
|
24
home/.config/lvim/lua/user/options.lua
Normal file
24
home/.config/lvim/lua/user/options.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
-- Show whitespaces
|
||||
vim.opt.list = true -- Enable showing characters like <Tab>, <EOL>
|
||||
vim.opt.listchars = { tab = " ", trail = "·" } -- Specify which characters to show
|
||||
|
||||
-- Theme options
|
||||
vim.opt.cursorline = true -- Highlight cursor line
|
||||
vim.opt.laststatus = 2 -- Always show status line
|
||||
vim.opt.relativenumber = true -- Use relative line numbers
|
||||
vim.opt.wrap = true -- Allow line wrapping
|
||||
|
||||
-- Tab/Indent settings
|
||||
-- vim.opt.autoindent = true -- Enable automatic indenting
|
||||
-- vim.opt.expandtab = true -- Expand tabs into spaces
|
||||
-- vim.opt.tabstop = 2 -- Number of spaces a tab in file accounts for
|
||||
-- vim.opt.shiftwidth = 4 -- Indentation size for Tab
|
||||
-- vim.opt.softtabstop = 4 -- Tabs/Spaces interlop
|
||||
-- vim.opt.tabpagemax = 50 -- More tabs
|
||||
-- vim.opt.shiftround = true -- Always round indent to multiple of shiftwidth
|
||||
|
||||
-- Enable syntax highlighting in fenced markdown code-blocks
|
||||
vim.g.markdown_fenced_languages = {"html", "javascript", "typescript", "css", "scss", "lua", "vim", "python"}
|
||||
|
||||
-- Other
|
||||
vim.opt.shell = "/bin/sh"
|
101
home/.config/lvim/lua/user/plugins.lua
Normal file
101
home/.config/lvim/lua/user/plugins.lua
Normal file
|
@ -0,0 +1,101 @@
|
|||
-- Additional Plugins
|
||||
lvim.plugins = {
|
||||
{ "wakatime/vim-wakatime" },
|
||||
|
||||
-- LSP
|
||||
{
|
||||
-- Tree-like view for symbols in current file using LSP
|
||||
"simrat39/symbols-outline.nvim",
|
||||
config = function()
|
||||
require("symbols-outline").setup {
|
||||
width = 18,
|
||||
autofold_depth = 1,
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
-- Show function signature while typing
|
||||
"ray-x/lsp_signature.nvim",
|
||||
config = function()
|
||||
require("lsp_signature").on_attach()
|
||||
end,
|
||||
event = "BufRead",
|
||||
},
|
||||
|
||||
-- User interface
|
||||
{
|
||||
-- Code minimap for easy orientation in a longer file
|
||||
"wfxr/minimap.vim",
|
||||
run = "cargo install --locked code-minimap",
|
||||
config = function()
|
||||
vim.cmd "let g:minimap_width = 10"
|
||||
end,
|
||||
},
|
||||
{
|
||||
-- Integrated lf file manager
|
||||
"ptzz/lf.vim",
|
||||
config = function()
|
||||
vim.g.lf_map_keys = 0
|
||||
end,
|
||||
requires = "voldikss/vim-floaterm",
|
||||
},
|
||||
|
||||
-- Github copilot for code completion
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = { "VimEnter" },
|
||||
config = function()
|
||||
vim.defer_fn(function()
|
||||
require("copilot").setup()
|
||||
end, 100)
|
||||
end,
|
||||
},
|
||||
{ "zbirenbaum/copilot-cmp", after = { "copilot.lua", "nvim-cmp" } },
|
||||
|
||||
--
|
||||
{ "jasonccox/vim-wayland-clipboard" },
|
||||
|
||||
-- Yuck.vim (eww configuration language support)
|
||||
{ "elkowar/yuck.vim" },
|
||||
|
||||
-- Treesitter
|
||||
-- {
|
||||
-- -- Colorize matching parenthesis using treesitter
|
||||
-- "p00f/nvim-ts-rainbow",
|
||||
-- },
|
||||
{
|
||||
-- Treesitter information shown directly in neovim
|
||||
"nvim-treesitter/playground",
|
||||
},
|
||||
{
|
||||
-- Alwats show class/function name we're in
|
||||
"romgrk/nvim-treesitter-context",
|
||||
config = function()
|
||||
require("treesitter-context").setup {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
throttle = true, -- Throttles plugin updates (may improve performance)
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
||||
-- For all filetypes
|
||||
-- Note that setting an entry here replaces all other patterns for this entry.
|
||||
-- By setting the 'default' entry below, you can control which nodes you want to
|
||||
-- appear in the context window.
|
||||
default = {
|
||||
"class",
|
||||
"function",
|
||||
"method",
|
||||
"while",
|
||||
"for",
|
||||
"if",
|
||||
"switch",
|
||||
"case",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- Register copilot as cmp source
|
||||
lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)"
|
||||
table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" })
|
42
home/.config/lvim/lua/user/treesitter.lua
Normal file
42
home/.config/lvim/lua/user/treesitter.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
-- if you don't want all the parsers change this to a table of the ones you want
|
||||
lvim.builtin.treesitter.ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"python",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"css",
|
||||
"rust",
|
||||
"java",
|
||||
"yaml",
|
||||
}
|
||||
|
||||
lvim.builtin.treesitter.ignore_install = {}
|
||||
lvim.builtin.treesitter.highlight.enabled = true
|
||||
-- lvim.builtin.treesitter.rainbow.enable = true
|
||||
|
||||
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
||||
parser_config.apparmor = {
|
||||
install_info = {
|
||||
url = "~/Personal/Programming/GitHub/Other/tree-sitter-apparmor", -- local path or git repo
|
||||
files = {"src/parser.c"},
|
||||
-- optional entries:
|
||||
branch = "main", -- default branch in case of git repo if different from master
|
||||
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||
},
|
||||
filetype = "apparmor", -- if filetype does not match the parser name
|
||||
}
|
||||
|
||||
local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
|
||||
ft_to_parser.apparmor = "apparmor"
|
||||
|
||||
-- Temporary treesitter
|
||||
lvim.keys.normal_mode["gu"] = ":TSUpdate apparmor<CR>"
|
||||
lvim.keys.normal_mode["gU"] = ":TSToggle apparmor<CR>"
|
||||
lvim.keys.normal_mode["gt"] = ":TSPlaygroundToggle<CR>"
|
||||
lvim.keys.normal_mode["gh"] = ":TSNodeUnderCursor<CR>"
|
||||
lvim.keys.normal_mode["gH"] = ":TSHighlightCapturesUnderCursor<CR>"
|
499
home/.config/lvim/plugin/packer_compiled.lua
Normal file
499
home/.config/lvim/plugin/packer_compiled.lua
Normal file
|
@ -0,0 +1,499 @@
|
|||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/itsdrike/.cache/lvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/itsdrike/.cache/lvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/itsdrike/.cache/lvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/itsdrike/.cache/lvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/itsdrike/.cache/lvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["Comment.nvim"] = {
|
||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.comment\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/Comment.nvim",
|
||||
url = "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
["FixCursorHold.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/FixCursorHold.nvim",
|
||||
url = "https://github.com/antoinemadec/FixCursorHold.nvim"
|
||||
},
|
||||
LuaSnip = {
|
||||
config = { "\27LJ\2\nñ\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f€\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3€\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["alpha-nvim"] = {
|
||||
config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/alpha-nvim",
|
||||
url = "https://github.com/goolord/alpha-nvim"
|
||||
},
|
||||
["bufferline.nvim"] = {
|
||||
config = { "\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.bufferline\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim",
|
||||
url = "https://github.com/akinsho/bufferline.nvim"
|
||||
},
|
||||
["cmp-buffer"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/cmp-buffer",
|
||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
["cmp-path"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/cmp-path",
|
||||
url = "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["copilot-cmp"] = {
|
||||
load_after = {
|
||||
["copilot.lua"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/copilot-cmp",
|
||||
url = "https://github.com/zbirenbaum/copilot-cmp"
|
||||
},
|
||||
["copilot.lua"] = {
|
||||
after = { "copilot-cmp" },
|
||||
config = { "\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fcopilot\frequire-\1\0\4\0\3\0\0066\0\0\0009\0\1\0003\2\2\0)\3d\0B\0\3\1K\0\1\0\0\rdefer_fn\bvim\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/copilot.lua",
|
||||
url = "https://github.com/zbirenbaum/copilot.lua"
|
||||
},
|
||||
["dap-buddy.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/dap-buddy.nvim",
|
||||
url = "https://github.com/Pocco81/dap-buddy.nvim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.gitsigns\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/gitsigns.nvim",
|
||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
["lf.vim"] = {
|
||||
config = { "\27LJ\2\n-\0\0\2\0\3\0\0056\0\0\0009\0\1\0)\1\0\0=\1\2\0K\0\1\0\16lf_map_keys\6g\bvim\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/lf.vim",
|
||||
url = "https://github.com/ptzz/lf.vim"
|
||||
},
|
||||
["lsp_signature.nvim"] = {
|
||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14on_attach\18lsp_signature\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/lsp_signature.nvim",
|
||||
url = "https://github.com/ray-x/lsp_signature.nvim"
|
||||
},
|
||||
["lua-dev.nvim"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/lua-dev.nvim",
|
||||
url = "https://github.com/folke/lua-dev.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.mason\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["minimap.vim"] = {
|
||||
config = { "\27LJ\2\n<\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\29let g:minimap_width = 10\bcmd\bvim\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/minimap.vim",
|
||||
url = "https://github.com/wfxr/minimap.vim"
|
||||
},
|
||||
["nlsp-settings.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nlsp-settings.nvim",
|
||||
url = "https://github.com/tamago324/nlsp-settings.nvim"
|
||||
},
|
||||
["null-ls.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/null-ls.nvim",
|
||||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||
},
|
||||
["nvim-autopairs"] = {
|
||||
config = { "\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.autopairs\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-autopairs",
|
||||
url = "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
after = { "copilot-cmp" },
|
||||
config = { "\27LJ\2\n`\0\0\3\0\6\0\v6\0\0\0009\0\1\0009\0\2\0\15\0\0\0X\1\5€6\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\18lvim.core.cmp\frequire\bcmp\fbuiltin\tlvim\0" },
|
||||
loaded = true,
|
||||
only_config = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-dap"] = {
|
||||
config = { "\27LJ\2\n;\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\18lvim.core.dap\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-dap",
|
||||
url = "https://github.com/mfussenegger/nvim-dap"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-notify"] = {
|
||||
config = { "\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\21lvim.core.notify\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-notify",
|
||||
url = "https://github.com/rcarriga/nvim-notify"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.nvimtree\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/kyazdani42/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
config = { "\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.treesitter\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-treesitter-context"] = {
|
||||
config = { "\27LJ\2\n¼\1\0\0\5\0\b\0\v6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\5\0005\4\4\0=\4\6\3=\3\a\2B\0\2\1K\0\1\0\rpatterns\fdefault\1\0\0\1\t\0\0\nclass\rfunction\vmethod\nwhile\bfor\aif\vswitch\tcase\1\0\3\rthrottle\2\venable\2\14max_lines\3\0\nsetup\23treesitter-context\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter-context",
|
||||
url = "https://github.com/romgrk/nvim-treesitter-context"
|
||||
},
|
||||
["nvim-ts-context-commentstring"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/nvim-ts-context-commentstring",
|
||||
url = "https://github.com/JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
["onedarker.nvim"] = {
|
||||
config = { "\27LJ\2\nš\1\0\0\3\0\t\0\0196\0\0\0\15\0\0\0X\1\15€6\0\0\0009\0\1\0\a\0\2\0X\0\v€6\0\3\0'\2\2\0B\0\2\0029\0\4\0B\0\1\0016\0\0\0009\0\5\0009\0\6\0009\0\a\0'\1\2\0=\1\b\0K\0\1\0\ntheme\foptions\flualine\fbuiltin\nsetup\frequire\14onedarker\16colorscheme\tlvim\30\1\0\3\0\2\0\0046\0\0\0003\2\1\0B\0\2\1K\0\1\0\0\npcall\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/onedarker.nvim",
|
||||
url = "https://github.com/lunarvim/onedarker.nvim"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
playground = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/playground",
|
||||
url = "https://github.com/nvim-treesitter/playground"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["popup.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/popup.nvim",
|
||||
url = "https://github.com/nvim-lua/popup.nvim"
|
||||
},
|
||||
["project.nvim"] = {
|
||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.project\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/project.nvim",
|
||||
url = "https://github.com/ahmedkhalf/project.nvim"
|
||||
},
|
||||
["schemastore.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/schemastore.nvim",
|
||||
url = "https://github.com/b0o/schemastore.nvim"
|
||||
},
|
||||
["structlog.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/structlog.nvim",
|
||||
url = "https://github.com/Tastyep/structlog.nvim"
|
||||
},
|
||||
["symbols-outline.nvim"] = {
|
||||
config = { "\27LJ\2\n]\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\2\nwidth\3\18\19autofold_depth\3\1\nsetup\20symbols-outline\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/symbols-outline.nvim",
|
||||
url = "https://github.com/simrat39/symbols-outline.nvim"
|
||||
},
|
||||
["telescope-fzf-native.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/telescope-fzf-native.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
config = { "\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.telescope\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["toggleterm.nvim"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.terminal\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/toggleterm.nvim",
|
||||
url = "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
["vim-floaterm"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/vim-floaterm",
|
||||
url = "https://github.com/voldikss/vim-floaterm"
|
||||
},
|
||||
["vim-wakatime"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/vim-wakatime",
|
||||
url = "https://github.com/wakatime/vim-wakatime"
|
||||
},
|
||||
["vim-wayland-clipboard"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/vim-wayland-clipboard",
|
||||
url = "https://github.com/jasonccox/vim-wayland-clipboard"
|
||||
},
|
||||
["which-key.nvim"] = {
|
||||
config = { "\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.which-key\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/opt/which-key.nvim",
|
||||
url = "https://github.com/folke/which-key.nvim"
|
||||
},
|
||||
["yuck.vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/itsdrike/.local/share/lunarvim/site/pack/packer/start/yuck.vim",
|
||||
url = "https://github.com/elkowar/yuck.vim"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
local module_lazy_loads = {
|
||||
["^lua%-dev"] = "lua-dev.nvim"
|
||||
}
|
||||
local lazy_load_called = {['packer.load'] = true}
|
||||
local function lazy_load_module(module_name)
|
||||
local to_load = {}
|
||||
if lazy_load_called[module_name] then return nil end
|
||||
lazy_load_called[module_name] = true
|
||||
for module_pat, plugin_name in pairs(module_lazy_loads) do
|
||||
if not _G.packer_plugins[plugin_name].loaded and string.match(module_name, module_pat) then
|
||||
to_load[#to_load + 1] = plugin_name
|
||||
end
|
||||
end
|
||||
|
||||
if #to_load > 0 then
|
||||
require('packer.load')(to_load, {module = module_name}, _G.packer_plugins)
|
||||
local loaded_mod = package.loaded[module_name]
|
||||
if loaded_mod then
|
||||
return function(modname) return loaded_mod end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not vim.g.packer_custom_loader_enabled then
|
||||
table.insert(package.loaders, 1, lazy_load_module)
|
||||
vim.g.packer_custom_loader_enabled = true
|
||||
end
|
||||
|
||||
-- Config for: telescope.nvim
|
||||
time([[Config for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.telescope\frequire\0", "config", "telescope.nvim")
|
||||
time([[Config for telescope.nvim]], false)
|
||||
-- Config for: nvim-cmp
|
||||
time([[Config for nvim-cmp]], true)
|
||||
try_loadstring("\27LJ\2\n`\0\0\3\0\6\0\v6\0\0\0009\0\1\0009\0\2\0\15\0\0\0X\1\5€6\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\18lvim.core.cmp\frequire\bcmp\fbuiltin\tlvim\0", "config", "nvim-cmp")
|
||||
time([[Config for nvim-cmp]], false)
|
||||
-- Config for: minimap.vim
|
||||
time([[Config for minimap.vim]], true)
|
||||
try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\29let g:minimap_width = 10\bcmd\bvim\0", "config", "minimap.vim")
|
||||
time([[Config for minimap.vim]], false)
|
||||
-- Config for: onedarker.nvim
|
||||
time([[Config for onedarker.nvim]], true)
|
||||
try_loadstring("\27LJ\2\nš\1\0\0\3\0\t\0\0196\0\0\0\15\0\0\0X\1\15€6\0\0\0009\0\1\0\a\0\2\0X\0\v€6\0\3\0'\2\2\0B\0\2\0029\0\4\0B\0\1\0016\0\0\0009\0\5\0009\0\6\0009\0\a\0'\1\2\0=\1\b\0K\0\1\0\ntheme\foptions\flualine\fbuiltin\nsetup\frequire\14onedarker\16colorscheme\tlvim\30\1\0\3\0\2\0\0046\0\0\0003\2\1\0B\0\2\1K\0\1\0\0\npcall\0", "config", "onedarker.nvim")
|
||||
time([[Config for onedarker.nvim]], false)
|
||||
-- Config for: nvim-dap
|
||||
time([[Config for nvim-dap]], true)
|
||||
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\18lvim.core.dap\frequire\0", "config", "nvim-dap")
|
||||
time([[Config for nvim-dap]], false)
|
||||
-- Config for: nvim-treesitter
|
||||
time([[Config for nvim-treesitter]], true)
|
||||
try_loadstring("\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.treesitter\frequire\0", "config", "nvim-treesitter")
|
||||
time([[Config for nvim-treesitter]], false)
|
||||
-- Config for: nvim-treesitter-context
|
||||
time([[Config for nvim-treesitter-context]], true)
|
||||
try_loadstring("\27LJ\2\n¼\1\0\0\5\0\b\0\v6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\5\0005\4\4\0=\4\6\3=\3\a\2B\0\2\1K\0\1\0\rpatterns\fdefault\1\0\0\1\t\0\0\nclass\rfunction\vmethod\nwhile\bfor\aif\vswitch\tcase\1\0\3\rthrottle\2\venable\2\14max_lines\3\0\nsetup\23treesitter-context\frequire\0", "config", "nvim-treesitter-context")
|
||||
time([[Config for nvim-treesitter-context]], false)
|
||||
-- Config for: lf.vim
|
||||
time([[Config for lf.vim]], true)
|
||||
try_loadstring("\27LJ\2\n-\0\0\2\0\3\0\0056\0\0\0009\0\1\0)\1\0\0=\1\2\0K\0\1\0\16lf_map_keys\6g\bvim\0", "config", "lf.vim")
|
||||
time([[Config for lf.vim]], false)
|
||||
-- Config for: alpha-nvim
|
||||
time([[Config for alpha-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0", "config", "alpha-nvim")
|
||||
time([[Config for alpha-nvim]], false)
|
||||
-- Config for: nvim-notify
|
||||
time([[Config for nvim-notify]], true)
|
||||
try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\21lvim.core.notify\frequire\0", "config", "nvim-notify")
|
||||
time([[Config for nvim-notify]], false)
|
||||
-- Config for: lualine.nvim
|
||||
time([[Config for lualine.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0", "config", "lualine.nvim")
|
||||
time([[Config for lualine.nvim]], false)
|
||||
-- Config for: project.nvim
|
||||
time([[Config for project.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.project\frequire\0", "config", "project.nvim")
|
||||
time([[Config for project.nvim]], false)
|
||||
-- Config for: nvim-tree.lua
|
||||
time([[Config for nvim-tree.lua]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23lvim.core.nvimtree\frequire\0", "config", "nvim-tree.lua")
|
||||
time([[Config for nvim-tree.lua]], false)
|
||||
-- Config for: LuaSnip
|
||||
time([[Config for LuaSnip]], true)
|
||||
try_loadstring("\27LJ\2\nñ\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f€\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3€\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0", "config", "LuaSnip")
|
||||
time([[Config for LuaSnip]], false)
|
||||
-- Config for: mason.nvim
|
||||
time([[Config for mason.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.mason\frequire\0", "config", "mason.nvim")
|
||||
time([[Config for mason.nvim]], false)
|
||||
-- Config for: nvim-autopairs
|
||||
time([[Config for nvim-autopairs]], true)
|
||||
try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.autopairs\frequire\0", "config", "nvim-autopairs")
|
||||
time([[Config for nvim-autopairs]], false)
|
||||
-- Config for: symbols-outline.nvim
|
||||
time([[Config for symbols-outline.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n]\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\2\nwidth\3\18\19autofold_depth\3\1\nsetup\20symbols-outline\frequire\0", "config", "symbols-outline.nvim")
|
||||
time([[Config for symbols-outline.nvim]], false)
|
||||
vim.cmd [[augroup packer_load_aucmds]]
|
||||
vim.cmd [[au!]]
|
||||
-- Event lazy-loads
|
||||
time([[Defining lazy-load event autocommands]], true)
|
||||
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'copilot.lua'}, { event = "VimEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufWinEnter * ++once lua require("packer.load")({'which-key.nvim', 'bufferline.nvim', 'toggleterm.nvim'}, { event = "BufWinEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufReadPost * ++once lua require("packer.load")({'nvim-ts-context-commentstring'}, { event = "BufReadPost *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'gitsigns.nvim', 'lsp_signature.nvim', 'Comment.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load event autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
15
home/.config/lvim/snippets/package.json
Normal file
15
home/.config/lvim/snippets/package.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "nvim-snippets",
|
||||
"author": "ItsDrike",
|
||||
"engines": {
|
||||
"vscode": "^1.11.0"
|
||||
},
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "python",
|
||||
"path": "./python.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
21
home/.config/lvim/snippets/python.json
Normal file
21
home/.config/lvim/snippets/python.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"future.__annotations__": {
|
||||
"prefix": "futann",
|
||||
"body": "from __future__ import annotations\n",
|
||||
"description": "Add __future__.annoations import."
|
||||
},
|
||||
"script": {
|
||||
"prefix": "script",
|
||||
"body": [
|
||||
"#!/usr/bin/env python3",
|
||||
"",
|
||||
"def main() -> None:",
|
||||
"\t${1:...}",
|
||||
"",
|
||||
"",
|
||||
"if __name__ == \"__main__\":",
|
||||
"\tmain()"
|
||||
],
|
||||
"description": "print Hello, World!"
|
||||
}
|
||||
}
|
24
home/.config/lvim/spell/en.utf-8.add
Normal file
24
home/.config/lvim/spell/en.utf-8.add
Normal file
|
@ -0,0 +1,24 @@
|
|||
Flake8
|
||||
Isort
|
||||
linter
|
||||
flake8
|
||||
isort
|
||||
TOML
|
||||
YAML
|
||||
linters
|
||||
MyPy
|
||||
Pyright
|
||||
pyright
|
||||
VSCode
|
||||
Pylance
|
||||
Docstrings
|
||||
Docstring
|
||||
docstrings
|
||||
docstring
|
||||
BSPWM
|
||||
Xmonad
|
||||
deserialized
|
||||
serializable
|
||||
ItsDrike
|
||||
itsdrike
|
||||
protonmail
|
BIN
home/.config/lvim/spell/en.utf-8.add.spl
Normal file
BIN
home/.config/lvim/spell/en.utf-8.add.spl
Normal file
Binary file not shown.
283
home/.config/lvim/syntax/apparmor.vim
Normal file
283
home/.config/lvim/syntax/apparmor.vim
Normal file
|
@ -0,0 +1,283 @@
|
|||
" generated from apparmor.vim.in by create-apparmor.vim.py
|
||||
" do not edit this file - edit apparmor.vim.in or create-apparmor.vim.py instead
|
||||
|
||||
" ----------------------------------------------------------------------
|
||||
" Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||
" Copyright (c) 2006-2012 Christian Boltz. All Rights Reserved.
|
||||
"
|
||||
" This program is free software; you can redistribute it and/or
|
||||
" modify it under the terms of version 2 of the GNU General Public
|
||||
" License as published by the Free Software Foundation.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program; if not, contact Novell, Inc.
|
||||
"
|
||||
" To contact Novell about this file by physical or electronic mail,
|
||||
" you may find current contact information at www.novell.com.
|
||||
"
|
||||
" To contact Christian Boltz about this file by physical or electronic
|
||||
" mail, you may find current contact information at www.cboltz.de/en/kontakt.
|
||||
"
|
||||
" If you want to report a bug via bugzilla.novell.com, please assign it
|
||||
" to suse-beta[AT]cboltz.de (replace [AT] with @).
|
||||
" ----------------------------------------------------------------------
|
||||
"
|
||||
" stick this file into ~/.vim/syntax/ and add these commands into your .vimrc
|
||||
" to have vim automagically use this syntax file for these directories:
|
||||
"
|
||||
" autocmd BufNewFile,BufRead /etc/apparmor.d/* set syntax=apparmor
|
||||
" autocmd BufNewFile,BufRead /usr/share/apparmor/extra-profiles/* set syntax=apparmor
|
||||
|
||||
" profiles are case sensitive
|
||||
syntax case match
|
||||
|
||||
" color setup...
|
||||
|
||||
" adjust colors according to the background
|
||||
|
||||
" switching colors depending on the background color doesn't work
|
||||
" unfortunately, so we use colors that work with light and dark background.
|
||||
" Patches welcome ;-)
|
||||
|
||||
"if &background == "light"
|
||||
" light background
|
||||
hi sdProfileName ctermfg=lightblue
|
||||
hi sdHatName ctermfg=darkblue
|
||||
hi sdExtHat ctermfg=darkblue
|
||||
" hi sdComment2 ctermfg=darkblue
|
||||
hi sdGlob ctermfg=darkmagenta
|
||||
hi sdAlias ctermfg=darkmagenta
|
||||
hi sdEntryWriteExec ctermfg=black ctermbg=yellow
|
||||
hi sdEntryUX ctermfg=darkred cterm=underline
|
||||
hi sdEntryUXe ctermfg=darkred
|
||||
hi sdEntryIX ctermfg=darkcyan
|
||||
hi sdEntryM ctermfg=darkcyan
|
||||
hi sdEntryPX ctermfg=darkgreen cterm=underline
|
||||
hi sdEntryPXe ctermfg=darkgreen
|
||||
hi sdEntryW ctermfg=darkyellow
|
||||
hi sdCap ctermfg=lightblue
|
||||
hi sdSetCap ctermfg=black ctermbg=yellow
|
||||
hi sdNetwork ctermfg=lightblue
|
||||
hi sdNetworkDanger ctermfg=darkred
|
||||
hi sdCapKey cterm=underline ctermfg=lightblue
|
||||
hi sdCapDanger ctermfg=darkred
|
||||
hi sdRLimit ctermfg=lightblue
|
||||
hi def link sdEntryR Normal
|
||||
hi def link sdEntryK Normal
|
||||
hi def link sdFlags Normal
|
||||
hi sdEntryChangeProfile ctermfg=darkgreen cterm=underline
|
||||
"else
|
||||
" dark background
|
||||
" hi sdProfileName ctermfg=white
|
||||
" hi sdHatName ctermfg=white
|
||||
" hi sdGlob ctermfg=magenta
|
||||
" hi sdEntryWriteExec ctermfg=black ctermbg=yellow
|
||||
" hi sdEntryUX ctermfg=red cterm=underline
|
||||
" hi sdEntryUXe ctermfg=red
|
||||
" hi sdEntryIX ctermfg=cyan
|
||||
" hi sdEntryM ctermfg=cyan
|
||||
" hi sdEntryPX ctermfg=green cterm=underline
|
||||
" hi sdEntryPXe ctermfg=green
|
||||
" hi sdEntryW ctermfg=yellow
|
||||
" hi sdCap ctermfg=lightblue
|
||||
" hi sdCapKey cterm=underline ctermfg=lightblue
|
||||
" hi def link sdEntryR Normal
|
||||
" hi def link sdFlags Normal
|
||||
" hi sdCapDanger ctermfg=red
|
||||
"endif
|
||||
|
||||
hi def link sdInclude Include
|
||||
high def link sdComment Comment
|
||||
"high def link sdComment2 Comment
|
||||
high def link sdFlagKey TODO
|
||||
high def link sdError ErrorMsg
|
||||
|
||||
|
||||
" always sync from the start. should be relatively quick since we don't have
|
||||
" that many rules and profiles shouldn't be _extremely_ large...
|
||||
syn sync fromstart
|
||||
|
||||
syn keyword sdFlagKey complain debug
|
||||
|
||||
" highlight invalid syntax
|
||||
syn match sdError /{/ contained
|
||||
syn match sdError /}/
|
||||
syn match sdError /^.*$/ contains=sdComment "highlight all non-valid lines as error
|
||||
" TODO: do not mark lines containing only whitespace as error
|
||||
|
||||
" TODO: the sdGlob pattern is not anchored with ^ and $, so it matches all lines matching ^@{...}.*
|
||||
" This allows incorrect lines also and should be checked better.
|
||||
" This also (accidently ;-) includes variable definitions (@{FOO}=/bar)
|
||||
" TODO: make a separate pattern for variable definitions, then mark sdGlob as contained
|
||||
syn match sdGlob /\v\?|\*|\{.*,.*\}|[[^\]]\+\]|\@\{[a-zA-Z][a-zA-Z0-9_]*\}/
|
||||
|
||||
syn match sdAlias /\v^alias\s+(\/|\@\{\S*\})\S*\s+-\>\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob
|
||||
|
||||
" syn match sdComment /#.*/
|
||||
|
||||
syn cluster sdEntry contains=sdEntryWriteExec,sdEntryR,sdEntryW,sdEntryIX,sdEntryPX,sdEntryPXe,sdEntryUX,sdEntryUXe,sdEntryM,sdCap,sdSetCap,sdExtHat,sdRLimit,sdNetwork,sdNetworkDanger,sdEntryChangeProfile
|
||||
|
||||
|
||||
" TODO: support audit and deny keywords for all rules (not only for files)
|
||||
" TODO: higlight audit and deny keywords everywhere
|
||||
|
||||
" Capability line
|
||||
|
||||
" normal capabilities - really keep this list? syn match sdCap should be enough... (difference: sdCapKey words would loose underlining)
|
||||
syn keyword sdCapKey audit_read block_suspend chown dac_override dac_read_search fowner fsetid ipc_lock ipc_owner kill lease linux_immutable mknod net_admin net_bind_service net_broadcast net_raw setfcap setgid setpcap setuid syslog sys_boot sys_chroot sys_nice sys_pacct sys_ptrace sys_resource sys_time sys_tty_config wake_alarm
|
||||
|
||||
" dangerous capabilities - highlighted separately
|
||||
syn keyword sdCapDanger audit_control audit_write mac_override mac_admin set_fcap sys_admin sys_module sys_rawio
|
||||
|
||||
" full line. Keywords are from sdCapKey + sdCapDanger
|
||||
syn match sdCap /\v^\s*(audit\s+)?(deny\s+|allow\s+)?capability\s+((audit_control|audit_read|audit_write|block_suspend|chown|dac_override|dac_read_search|fowner|fsetid|ipc_lock|ipc_owner|kill|lease|linux_immutable|mac_admin|mac_override|mknod|net_admin|net_bind_service|net_broadcast|net_raw|setfcap|setgid|setpcap|setuid|syslog|sys_admin|sys_boot|sys_chroot|sys_module|sys_nice|sys_pacct|sys_ptrace|sys_rawio|sys_resource|sys_time|sys_tty_config|wake_alarm)\s+)*(audit_control|audit_read|audit_write|block_suspend|chown|dac_override|dac_read_search|fowner|fsetid|ipc_lock|ipc_owner|kill|lease|linux_immutable|mac_admin|mac_override|mknod|net_admin|net_bind_service|net_broadcast|net_raw|setfcap|setgid|setpcap|setuid|syslog|sys_admin|sys_boot|sys_chroot|sys_module|sys_nice|sys_pacct|sys_ptrace|sys_rawio|sys_resource|sys_time|sys_tty_config|wake_alarm)\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdCapKey,sdCapDanger,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
" all capabilities ('capability' without any keyword)
|
||||
syn match sdCapDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?capability\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" Network line
|
||||
" Syntax: network domain (inet, ...) type (stream, ...) protocol (tcp, ...)
|
||||
" TODO: 'owner' isn't supported, but will be (JJ, 2011-01-11)
|
||||
syn match sdNetwork /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network(\s+(unix|inet|ax25|ipx|appletalk|netrom|bridge|atmpvc|x25|inet6|rose|netbeui|security|key|netlink|packet|ash|econet|atmsvc|rds|sna|irda|pppox|wanpipe|llc|can|tipc|bluetooth|iucv|rxrpc|isdn|phonet|ieee802154|caif|alg|nfc|vsock))?(\s+(stream|dgram|seqpacket|rdm|packet))?(\s+tcp|\s+udp|\s+icmp)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
" network rules containing 'raw'
|
||||
syn match sdNetworkDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network(\s+(unix|inet|ax25|ipx|appletalk|netrom|bridge|atmpvc|x25|inet6|rose|netbeui|security|key|netlink|packet|ash|econet|atmsvc|rds|sna|irda|pppox|wanpipe|llc|can|tipc|bluetooth|iucv|rxrpc|isdn|phonet|ieee802154|caif|alg|nfc|vsock))?(\s+(raw))(\s+tcp|\s+udp|\s+icmp)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
" 'all networking' includes raw -> mark as dangerous
|
||||
syn match sdNetworkDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
|
||||
" Change Profile
|
||||
" TODO: audit and deny support will be added (JJ, 2011-01-11)
|
||||
syn match sdEntryChangeProfile /\v^\s*change_profile\s+-\>\s+\S+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
|
||||
" rlimit
|
||||
" TODO: audit and deny support will be added (JJ, 2011-01-11)
|
||||
"
|
||||
"syn match sdRLimit /\v^\s*rlimit\s+()\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+(nofile|ofile|nproc|rtprio)\s+\<\=\s+[0-9]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+(locks|sigpending)\s+\<\=\s+[0-9]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+(fsize|data|stack|core|rss|as|memlock|msgqueue)\s+\<\=\s+[0-9]+([KMG]B)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+nice\s+\<\=\s+(-1?[0-9]|-20|1?[0-9])\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+cpu\s+\<\=\s+[0-9]+(seconds|minutes|hours|days)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+rttime\s+\<\=\s+[0-9]+(ms|seconds|minutes)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
syn match sdRLimit /\v^\s*set\s+rlimit\s+(cpu|rttime|nofile|nproc|rtprio|locks|sigpending|fsize|data|stack|core|rss|as|memlock|msgqueue|nice)\s+\<\=\s+infinity\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
||||
|
||||
" link rules
|
||||
syn match sdEntryW /\v^\s+(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?link\s+(subset\s+)?(\/|\@\{\S*\})\S*\s+-\>\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob
|
||||
|
||||
|
||||
syn match sdExtHat /\v^\s+(\^|profile\s+)\S+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment " hat without {...}
|
||||
|
||||
|
||||
|
||||
|
||||
syn match sdProfileName /\v^((profile\s+)?\/\S+|profile\s+([a-zA-Z0-9]\S*\s)?\S+)\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ contains=sdProfileStart,sdHatName,sdFlags,sdComment,sdGlob
|
||||
syn match sdProfileStart /{/ contained
|
||||
syn match sdProfileEnd /^}\s*(#.*)?$/ contained " TODO: syn region does not (yet?) allow usage of comment in end=
|
||||
" TODO: Removing the $ mark from end= will allow non-comments also :-(
|
||||
syn match sdHatName /\v^\s+(\^|profile\s+)\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ contains=sdProfileStart,sdFlags,sdComment
|
||||
syn match sdHatStart /{/ contained
|
||||
syn match sdHatEnd /}/ contained " TODO: allow comments + [same as for syn match sdProfileEnd]
|
||||
syn match sdFlags /\v((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)/ contained contains=sdFlagKey
|
||||
|
||||
syn match sdComment /\s*#.*$/
|
||||
" NOTE: contains=sdComment changes #include highlighting to comment color.
|
||||
" NOTE: Comment highlighting still works without contains=sdComment.
|
||||
syn match sdInclude /\s*#include\s<\S*>/ " TODO: doesn't check until $
|
||||
syn match sdInclude /\s*include\s<\S*>/ " TODO: doesn't check until $
|
||||
|
||||
" basic profile block...
|
||||
" \s+ does not work in end=, therefore using \s\s*
|
||||
syn region Normal start=/\v^(profile\s+)?\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ matchgroup=sdProfileEnd end=/^}\s*$/ contains=sdProfileName,Hat,@sdEntry,sdComment,sdError,sdInclude
|
||||
syn region Hat start=/\v^\s+(\^|profile\s+)\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ matchgroup=sdHatEnd end=/^\s\s*}\s*$/ contains=sdHatName,@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" file permissions
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" file rules added with create_file_rule()
|
||||
|
||||
" write + exec/mmap - danger! (known bug: accepts aw to keep things simple)
|
||||
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" ux(mr) - unconstrained entry, flag the line red. also includes pux which is unconstrained if no profile exists
|
||||
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" Ux(mr) and PUx(mr) - like ux + clean environment
|
||||
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" px/cx/pix/cix(mrk) - standard exec entry, flag the line blue
|
||||
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" Px/Cx/Pix/Cix(mrk) - like px/cx + clean environment
|
||||
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" ix(mr) - standard exec entry, flag the line green
|
||||
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|ix)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|ix)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ix)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ix)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" mr - mmap with PROT_EXEC
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" special case: deny x is allowed (does not need to be ix, px, ux or cx)
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|x)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|x)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(r|m|k|x)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(r|m|k|x)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" write + append is an error
|
||||
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+\S*(w\S*a|a\S*w)\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+\S*(w\S*a|a\S*w)\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?\S*(w\S*a|a\S*w)\S*\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?\S*(w\S*a|a\S*w)\S*\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" write entry, flag the line yellow
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|w|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|w|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" append entry, flag the line yellow
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|a|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|a|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|a|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|a|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" read entry + locking, currently no highlighting
|
||||
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+[rlk]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+[rlk]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rlk]+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rlk]+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
||||
" read entry, no highlighting
|
||||
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+[rl]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+[rl]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rl]+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rl]+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
||||
|
1
home/.config/lvim/syntax/apparmor.vim.bak
Symbolic link
1
home/.config/lvim/syntax/apparmor.vim.bak
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/share/vim/vimfiles/syntax/apparmor.vim
|
Loading…
Add table
Add a link
Reference in a new issue