add undotree mapping, format

This commit is contained in:
2023-06-04 12:13:11 +03:00
parent b424ac2685
commit 64d948cdf3
8 changed files with 99 additions and 80 deletions

View File

@@ -61,4 +61,3 @@ vim.cmd("ab thursday Thursday")
vim.cmd("ab friday Friday") vim.cmd("ab friday Friday")
vim.cmd("ab saturday Saturday") vim.cmd("ab saturday Saturday")
vim.cmd("ab sunday Sunday") vim.cmd("ab sunday Sunday")

View File

@@ -8,11 +8,14 @@ M.config = function()
-- we fall back to the various language tools installed with pwnvim using this hack -- we fall back to the various language tools installed with pwnvim using this hack
local initial_path = vim.env.PATH local initial_path = vim.env.PATH
autocmd("User DirenvLoaded", autocmd("User DirenvLoaded",
{ callback = function() {
if not string.find(vim.env.PATH, initial_path, 0, true) then callback = function()
vim.env.PATH = vim.env.PATH .. ":" .. initial_path if not string.find(vim.env.PATH, initial_path, 0, true) then
end vim.env.PATH = vim.env.PATH .. ":" .. initial_path
end, group = filetypes }) end
end,
group = filetypes
})
autocmd("BufRead", { pattern = { "*.markdown", "*.md" }, command = "setlocal filetype=markdown", group = filetypes }) autocmd("BufRead", { pattern = { "*.markdown", "*.md" }, command = "setlocal filetype=markdown", group = filetypes })
autocmd("BufRead", { pattern = { "*.sbt" }, command = "setlocal filetype=scala", group = filetypes }) autocmd("BufRead", { pattern = { "*.sbt" }, command = "setlocal filetype=scala", group = filetypes })
@@ -25,28 +28,39 @@ M.config = function()
autocmd("BufRead", { pattern = { "flake.lock" }, command = "setlocal filetype=json", group = filetypes }) autocmd("BufRead", { pattern = { "flake.lock" }, command = "setlocal filetype=json", group = filetypes })
autocmd("FileType", autocmd("FileType",
{ pattern = { "sql", "mysql", "plsql" }, {
pattern = { "sql", "mysql", "plsql" },
callback = function() require('cmp').setup.buffer({ sources = { { name = 'vim-dadbod-completion' } } }) end, callback = function() require('cmp').setup.buffer({ sources = { { name = 'vim-dadbod-completion' } } }) end,
group = filetypes }) group = filetypes
})
autocmd("FileType", autocmd("FileType",
{ pattern = { "c", "ruby", "php", "php3", "perl", "python", "mason", "vim", "sh", "zsh", "scala", "javascript", {
"javascriptreact", "typescript", "typescriptreact", "html", "svelte", "css", "nix", "terraform" }, pattern = { "c", "ruby", "php", "php3", "perl", "python", "mason", "vim", "sh", "zsh", "scala", "javascript",
callback = function() require('pwnvim.options').programming() end, group = filetypes }) "javascriptreact", "typescript", "typescriptreact", "html", "svelte", "css", "nix", "terraform" },
callback = function() require('pwnvim.options').programming() end,
group = filetypes
})
autocmd("FileType", autocmd("FileType",
{ pattern = { "lua", "xml" }, callback = function() require('pwnvim.filetypes').lua() end, group = filetypes }) { pattern = { "lua", "xml" }, callback = function() require('pwnvim.filetypes').lua() end, group = filetypes })
autocmd("FileType", autocmd("FileType",
{ pattern = { "md", "markdown", "vimwiki" }, callback = function() require('pwnvim.markdown').setup() end, {
group = filetypes }) pattern = { "md", "markdown", "vimwiki" },
-- autocmd("FileType", callback = function() require('pwnvim.markdown').setup() end,
-- { pattern = { "rust" }, callback = function() require('pwnvim.filetypes').rust() end, group = filetypes }) group = filetypes
})
-- autocmd("FileType",
-- { pattern = { "rust" }, callback = function() require('pwnvim.filetypes').rust() end, group = filetypes })
autocmd("FileType", autocmd("FileType",
{ pattern = { "Outline" }, command = "setlocal nospell", group = filetypes }) { pattern = { "Outline" }, command = "setlocal nospell", group = filetypes })
autocmd("TermOpen", { pattern = { "*" }, command = "setlocal nospell", group = filetypes }) autocmd("TermOpen", { pattern = { "*" }, command = "setlocal nospell", group = filetypes })
-- Run when page pager is invoked -- Run when page pager is invoked
autocmd('User', autocmd('User',
{ pattern = { 'PageOpen', 'PageOpenFile' }, group = filetypes, {
callback = function() require('pwnvim.filetypes').page() end }) pattern = { 'PageOpen', 'PageOpenFile' },
group = filetypes,
callback = function() require('pwnvim.filetypes').page() end
})
end end
-- M.rust = function() -- M.rust = function()

View File

@@ -2,51 +2,51 @@
local which_key = require("which-key") local which_key = require("which-key")
which_key.setup({ which_key.setup({
plugins = { plugins = {
marks = true, -- shows a list of your marks on ' and ` marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = { spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20 -- how many suggestions should be shown in the list? suggestions = 20 -- how many suggestions should be shown in the list?
}, },
-- the presets plugin, adds help for a bunch of default keybindings in Neovim -- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created -- No actual key bindings are created
presets = { presets = {
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
motions = false, -- adds help for motions motions = false, -- adds help for motions
text_objects = true, -- help for text objects triggered after entering an operator text_objects = true, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w> windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z z = true, -- bindings for folds, spelling and others prefixed with z
g = true -- bindings for prefixed with g g = true -- bindings for prefixed with g
} }
}, },
icons = { icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "", -- symbol used between a key and it's label separator = "", -- symbol used between a key and it's label
group = "+" -- symbol prepended to a group group = "+" -- symbol prepended to a group
}, },
popup_mappings = { popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>" -- binding to scroll up inside the popup scroll_up = "<c-u>" -- binding to scroll up inside the popup
}, },
window = { window = {
border = "rounded", -- none, single, double, shadow border = "rounded", -- none, single, double, shadow
position = "bottom", -- bottom, top position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0 winblend = 0
}, },
layout = { layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns spacing = 3, -- spacing between columns
align = "left" -- align columns left, center or right align = "left" -- align columns left, center or right
}, },
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
hidden = { hidden = {
"<silent>", "<CMD>", "<cmd>", "<Cmd>", "<cr>", "<CR>", "call", "lua", "<silent>", "<CMD>", "<cmd>", "<Cmd>", "<cr>", "<CR>", "call", "lua",
"^:", "^ " "^:", "^ "
}, -- hide mapping boilerplate }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible show_help = true, -- show help message on the command line when the popup is visible
triggers = "auto" -- automatically setup triggers triggers = "auto" -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually -- triggers = {"<leader>"} -- or specify a list manually
@@ -116,20 +116,20 @@ vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
local global_leader_opts = { local global_leader_opts = {
mode = "n", -- NORMAL mode mode = "n", -- NORMAL mode
prefix = "<leader>", prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps noremap = true, -- use `noremap` when creating keymaps
nowait = true -- use `nowait` when creating keymaps nowait = true -- use `nowait` when creating keymaps
} }
local global_leader_opts_visual = { local global_leader_opts_visual = {
mode = "v", -- VISUAL mode mode = "v", -- VISUAL mode
prefix = "<leader>", prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps noremap = true, -- use `noremap` when creating keymaps
nowait = true -- use `nowait` when creating keymaps nowait = true -- use `nowait` when creating keymaps
} }
local leader_mappings = { local leader_mappings = {
@@ -153,7 +153,8 @@ local leader_mappings = {
l = { "<cmd>lua require('telescope.builtin').loclist()<cr>", "Loclist" }, l = { "<cmd>lua require('telescope.builtin').loclist()<cr>", "Loclist" },
p = { "<cmd>Telescope projects<cr>", "Projects" }, p = { "<cmd>Telescope projects<cr>", "Projects" },
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" }, k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
t = { "<cmd>lua require('telescope.builtin').grep_string{search = \"^\\\\s*[*-] \\\\[ \\\\]\", previewer = false, glob_pattern = \"*.md\", use_regex = true, disable_coordinates=true}<cr>", t = {
"<cmd>lua require('telescope.builtin').grep_string{search = \"^\\\\s*[*-] \\\\[ \\\\]\", previewer = false, glob_pattern = \"*.md\", use_regex = true, disable_coordinates=true}<cr>",
"Todos" }, "Todos" },
n = { "<Cmd>ZkNotes { match = {vim.fn.input('Search: ')} }<CR>", "Find" }, n = { "<Cmd>ZkNotes { match = {vim.fn.input('Search: ')} }<CR>", "Find" },
}, },
@@ -198,10 +199,12 @@ local leader_mappings = {
}, },
h = { "<cmd>edit ~/Notes/Notes/HotSheet.md<CR>", "Open HotSheet" }, h = { "<cmd>edit ~/Notes/Notes/HotSheet.md<CR>", "Open HotSheet" },
i = { i = {
c = { "<cmd>r!/opt/homebrew/bin/icalBuddy --bullet '* ' --timeFormat '\\%H:\\%M' --dateFormat '' --noPropNames --noCalendarNames --excludeAllDayEvents --includeCals 'IC - Work' --includeEventProps datetime,title,attendees,location --propertyOrder datetime,title,attendees,location --propertySeparators '| |\\n * |\\n * | |' eventsToday<cr>", c = {
"<cmd>r!/opt/homebrew/bin/icalBuddy --bullet '* ' --timeFormat '\\%H:\\%M' --dateFormat '' --noPropNames --noCalendarNames --excludeAllDayEvents --includeCals 'IC - Work' --includeEventProps datetime,title,attendees,location --propertyOrder datetime,title,attendees,location --propertySeparators '| |\\n * |\\n * | |' eventsToday<cr>",
"Insert today's calendar" }, "Insert today's calendar" },
o = { "<cmd>r!gtm-okr goals<cr>", "Insert OKRs" }, o = { "<cmd>r!gtm-okr goals<cr>", "Insert OKRs" },
j = { "<cmd>r!( (curl -s https://icanhazdadjoke.com/ | grep '\\\"subtitle\\\"') || curl -s https://icanhazdadjoke.com/ ) | sed 's/<[^>]*>//g' | sed -z 's/\\n/ /'<cr>", j = {
"<cmd>r!( (curl -s https://icanhazdadjoke.com/ | grep '\\\"subtitle\\\"') || curl -s https://icanhazdadjoke.com/ ) | sed 's/<[^>]*>//g' | sed -z 's/\\n/ /'<cr>",
"Insert joke" }, "Insert joke" },
}, },
m = { m = {
@@ -456,6 +459,9 @@ which_key.register({
}, { mode = 'n', silent = true }) }, { mode = 'n', silent = true })
-- Undotree
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- Close buffer -- Close buffer
vim.api.nvim_set_keymap('', '<D-w>', ':Bdelete<CR>', options) vim.api.nvim_set_keymap('', '<D-w>', ':Bdelete<CR>', options)
vim.api.nvim_set_keymap('!', '<D-w>', '<ESC>:Bdelete<CR>', options) vim.api.nvim_set_keymap('!', '<D-w>', '<ESC>:Bdelete<CR>', options)

View File

@@ -1,7 +1,7 @@
local M = {} local M = {}
SimpleUI = (os.getenv("SIMPLEUI") == "1" or os.getenv("TERM_PROGRAM") == SimpleUI = (os.getenv("SIMPLEUI") == "1" or os.getenv("TERM_PROGRAM") ==
"Apple_Terminal" or os.getenv("TERM") == "linux") and "Apple_Terminal" or os.getenv("TERM") == "linux") and
not vim.g.neovide not vim.g.neovide
M.defaults = function() M.defaults = function()
@@ -11,7 +11,7 @@ M.defaults = function()
vim.g.loaded_tarPlugin = 0 vim.g.loaded_tarPlugin = 0
vim.g.loaded_zipPlugin = 0 vim.g.loaded_zipPlugin = 0
vim.g.loaded_2html_plugin = 0 vim.g.loaded_2html_plugin = 0
vim.g.loaded_netrw = 1 -- disable netrw vim.g.loaded_netrw = 1 -- disable netrw
vim.g.loaded_netrwPlugin = 1 -- disable netrw vim.g.loaded_netrwPlugin = 1 -- disable netrw
-- we just use lua plugins here so disable others -- we just use lua plugins here so disable others
vim.g.loaded_perl_provider = 0 vim.g.loaded_perl_provider = 0
@@ -44,26 +44,26 @@ M.defaults = function()
-- ignore completions and menus for the below -- ignore completions and menus for the below
vim.opt.wildignore = vim.opt.wildignore =
"*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,\\~$,*/.log,*/.aux,*/.cls,*/.aux,*/.bbl,*/.blg,*/.fls,*/.fdb*/,*/.toc,*/.out,*/.glo,*/.log,*/.ist,*/.fdb_latexmk,*.bak,*.o,*.a,*.sw?,.git/,*.class,.direnv/,.DS_Store" "*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,\\~$,*/.log,*/.aux,*/.cls,*/.aux,*/.bbl,*/.blg,*/.fls,*/.fdb*/,*/.toc,*/.out,*/.glo,*/.log,*/.ist,*/.fdb_latexmk,*.bak,*.o,*.a,*.sw?,.git/,*.class,.direnv/,.DS_Store"
vim.opt.wildmenu = true -- cmd line completion a-la zsh vim.opt.wildmenu = true -- cmd line completion a-la zsh
vim.opt.wildmode = "list:longest" -- matches mimic that of bash or zsh vim.opt.wildmode = "list:longest" -- matches mimic that of bash or zsh
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.spell = true vim.opt.spell = true
vim.opt.spelllang = "en_us" vim.opt.spelllang = "en_us"
vim.opt.ruler = true -- show the cursor position all the time vim.opt.ruler = true -- show the cursor position all the time
vim.opt.cursorline = true -- add indicator for current line vim.opt.cursorline = true -- add indicator for current line
vim.opt.secure = true -- don't execute shell cmds in .vimrc not owned by me vim.opt.secure = true -- don't execute shell cmds in .vimrc not owned by me
vim.opt.history = 50 -- keep 50 lines of command line history vim.opt.history = 50 -- keep 50 lines of command line history
vim.opt.shell = "zsh" vim.opt.shell = "zsh"
vim.opt.modelines = 0 -- Don't allow vim settings embedded in text files for security reasons vim.opt.modelines = 0 -- Don't allow vim settings embedded in text files for security reasons
vim.opt.showcmd = true -- display incomplete commands vim.opt.showcmd = true -- display incomplete commands
vim.opt.showmode = true -- display current mode vim.opt.showmode = true -- display current mode
-- with backup off and writebackup on: backup current file, deleted afterwards -- with backup off and writebackup on: backup current file, deleted afterwards
vim.opt.backup = false vim.opt.backup = false
vim.opt.writebackup = true vim.opt.writebackup = true
vim.opt.backupcopy = "auto" vim.opt.backupcopy = "auto"
vim.opt.hidden = true vim.opt.hidden = true
vim.opt.cf = true -- jump to errors based on error files vim.opt.cf = true -- jump to errors based on error files
vim.o.listchars = "tab:⇥ ,trail:␣,extends:⇉,precedes:⇇,nbsp:·" vim.o.listchars = "tab:⇥ ,trail:␣,extends:⇉,precedes:⇇,nbsp:·"
vim.opt.list = true -- render special chars (tabs, trails, ...) vim.opt.list = true -- render special chars (tabs, trails, ...)
vim.opt.ttyfast = true vim.opt.ttyfast = true
@@ -75,7 +75,7 @@ M.defaults = function()
vim.opt.complete = vim.opt.complete - { 'i' } vim.opt.complete = vim.opt.complete - { 'i' }
vim.opt.encoding = "utf-8" vim.opt.encoding = "utf-8"
vim.opt.backspace = "indent,eol,start" -- allow backspacing over everything in insert mode vim.opt.backspace = "indent,eol,start" -- allow backspacing over everything in insert mode
vim.opt.joinspaces = false -- don't insert two spaces after sentences on joins vim.opt.joinspaces = false -- don't insert two spaces after sentences on joins
vim.opt.binary = false vim.opt.binary = false
vim.opt.display = "lastline" vim.opt.display = "lastline"
vim.opt.viewoptions = "folds,cursor,unix,slash" -- better unix / windows compatibility vim.opt.viewoptions = "folds,cursor,unix,slash" -- better unix / windows compatibility
@@ -84,8 +84,8 @@ M.defaults = function()
-- wrapping -- wrapping
vim.opt.wrap = true vim.opt.wrap = true
vim.opt.sidescroll = 2 -- min number of columns to scroll from edge vim.opt.sidescroll = 2 -- min number of columns to scroll from edge
vim.opt.scrolloff = 8 -- when 4 away from edge start scrolling vim.opt.scrolloff = 8 -- when 4 away from edge start scrolling
vim.opt.sidescrolloff = 8 -- keep cursor one col from end of line vim.opt.sidescrolloff = 8 -- keep cursor one col from end of line
vim.opt.textwidth = 0 vim.opt.textwidth = 0
vim.opt.breakindent = true vim.opt.breakindent = true
@@ -97,23 +97,23 @@ M.defaults = function()
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
vim.opt.expandtab = true -- turn tabs to spaces by default vim.opt.expandtab = true -- turn tabs to spaces by default
vim.opt.autoindent = true -- autoindent to same level as previous line vim.opt.autoindent = true -- autoindent to same level as previous line
vim.opt.smartindent = true -- indent after { and cinwords words vim.opt.smartindent = true -- indent after { and cinwords words
vim.opt.smartcase = true -- intelligently ignore case in searches vim.opt.smartcase = true -- intelligently ignore case in searches
vim.opt.ignorecase = true -- default to not being case sensitive vim.opt.ignorecase = true -- default to not being case sensitive
vim.opt.smarttab = true vim.opt.smarttab = true
vim.opt.icm = "nosplit" -- show substitutions as you type vim.opt.icm = "nosplit" -- show substitutions as you type
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.opt.updatetime = 250 -- Decrease update time vim.opt.updatetime = 250 -- Decrease update time
vim.wo.signcolumn = 'yes' vim.wo.signcolumn = 'yes'
vim.opt.visualbell = true vim.opt.visualbell = true
vim.opt.autoread = true -- auto reload files changed on disk if not changed in buffer vim.opt.autoread = true -- auto reload files changed on disk if not changed in buffer
vim.opt.cursorline = false vim.opt.cursorline = false
vim.opt.ttyfast = true vim.opt.ttyfast = true
vim.opt.formatoptions = 'jcroqlt' -- t=text, c=comments, q=format with "gq" vim.opt.formatoptions = 'jcroqlt' -- t=text, c=comments, q=format with "gq"
vim.opt.showmatch = true -- auto hilights matching bracket or paren vim.opt.showmatch = true -- auto hilights matching bracket or paren
vim.opt.nrformats = vim.opt.nrformats - { 'octal' } vim.opt.nrformats = vim.opt.nrformats - { 'octal' }
vim.opt.shiftround = true vim.opt.shiftround = true
vim.opt.ttimeout = true vim.opt.ttimeout = true
@@ -283,7 +283,7 @@ M.defaults = function()
TelescopeNormal = { bg = "${telescope_results}" }, TelescopeNormal = { bg = "${telescope_results}" },
TelescopeSelection = { bg = "${telescope_prompt}" } TelescopeSelection = { bg = "${telescope_prompt}" }
}, },
styles = { -- Choose from "bold,italic,underline" styles = { -- Choose from "bold,italic,underline"
virtual_text = "italic" -- Style that is applied to virtual text virtual_text = "italic" -- Style that is applied to virtual text
}, },
plugins = { all = true }, plugins = { all = true },

View File

@@ -351,7 +351,7 @@ M.diagnostics = function()
capabilities = capabilities capabilities = capabilities
} }
lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
require 'lspsaga'.init_lsp_saga({ require 'lspsaga'.init_lsp_saga({
use_saga_diagnostic_sign = not SimpleUI, use_saga_diagnostic_sign = not SimpleUI,

View File

@@ -19,7 +19,7 @@ require('lualine').setup {
sources = { 'nvim_diagnostic' }, sources = { 'nvim_diagnostic' },
-- displays diagnostics from defined severity -- displays diagnostics from defined severity
sections = { 'error', 'warn' }, -- 'info', 'hint'},}} sections = { 'error', 'warn' }, -- 'info', 'hint'},}}
color_error = "#E06C75", -- changes diagnostic's error foreground color color_error = "#E06C75", -- changes diagnostic's error foreground color
color_warn = "#E5C07B" color_warn = "#E5C07B"
} }
} }

View File

@@ -6,8 +6,8 @@ require("todo-comments").setup {
signs = false, -- show icons in the signs column signs = false, -- show icons in the signs column
keywords = { keywords = {
FIX = { FIX = {
icon = "", -- icon used for the sign, and in search results icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below) color = "error", -- can be a hex color, or a named color (see below)
alt = { "ERROR", "FIXME", "BUG", "FIXIT", "ISSUE", "!!!" }, -- a set of other keywords that all map to this FIX keywords alt = { "ERROR", "FIXME", "BUG", "FIXIT", "ISSUE", "!!!" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually -- signs = false, -- configure signs for some keywords individually
}, },
@@ -25,13 +25,13 @@ require("todo-comments").setup {
-- * after: highlights after the keyword (todo text) -- * after: highlights after the keyword (todo text)
highlight = { highlight = {
multiline = false, multiline = false,
before = "", -- "fg" or "bg" or empty before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters) keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
after = "fg", -- "fg" or "bg" or empty after = "fg", -- "fg" or "bg" or empty
pattern = [[<(KEYWORDS)]], -- pattern or table of patterns, used for highlightng (vim regex) pattern = [[<(KEYWORDS)]], -- pattern or table of patterns, used for highlightng (vim regex)
comments_only = false, -- uses treesitter to match keywords in comments only comments_only = false, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting exclude = {}, -- list of file types to exclude highlighting
}, },
-- list of named colors where we try to extract the guifg from the -- list of named colors where we try to extract the guifg from the
-- list of hilight groups or use the hex color if hl not found as a fallback -- list of hilight groups or use the hex color if hl not found as a fallback

View File

@@ -6,9 +6,9 @@ M.hint = SimpleUI and "" or ""
M.info = SimpleUI and "" or "" M.info = SimpleUI and "" or ""
M.signs = { M.signs = {
{ name = "DiagnosticSignError", text = M.error }, { name = "DiagnosticSignError", text = M.error },
{ name = "DiagnosticSignWarn", text = M.warn }, { name = "DiagnosticSignWarn", text = M.warn },
{ name = "DiagnosticSignHint", text = M.hint }, { name = "DiagnosticSignHint", text = M.hint },
{ name = "DiagnosticSignInfo", text = M.info } { name = "DiagnosticSignInfo", text = M.info }
} }
if SimpleUI then if SimpleUI then
M.kind_icons = { M.kind_icons = {