bye bye old config
This commit is contained in:
parent
3b64f82e21
commit
1b189d0b0a
@ -1,45 +0,0 @@
|
||||
local s_ok, alpha = pcall(require, "alpha")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require"alpha.themes.dashboard"
|
||||
|
||||
local function button(sc, txt, key, key_opts)
|
||||
local b = dashboard.button(sc, txt, key, key_opts)
|
||||
b.opts.hl_shortcut = "Macro"
|
||||
return b
|
||||
end
|
||||
|
||||
local icons = require"chris.icons"
|
||||
|
||||
dashboard.section.header.val = {
|
||||
[[ , __ ___ __. _ __ ` , _ , _ ]],
|
||||
[[ |' `. .' ` .' \ | / | |' `|' `.]],
|
||||
[[ | | |----' | | ` / | | | |]],
|
||||
[[ / | `.___, `._.' \/ / / ' /]],
|
||||
}
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
button("f", icons.documents.Files .. " Find file", ":Telescope find_files <CR>"),
|
||||
button("e", icons.ui.NewFile .. " New file", ":ene <BAR> startinsert <CR>"),
|
||||
button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||
button("t", icons.ui.List .. " Find text", ":Telescope live_grep <CR>"),
|
||||
button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua <CR>"),
|
||||
button("u", icons.ui.CloudDownload .. " Update", ":PackerSync<CR>"),
|
||||
button("q", icons.ui.SignOut .. " Quit", ":qa<CR>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val = {
|
||||
[[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]],
|
||||
[[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]],
|
||||
[[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]],
|
||||
}
|
||||
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Macro"
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
@ -1,72 +0,0 @@
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd([[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
pattern = { "term://*" },
|
||||
callback = function()
|
||||
vim.cmd("startinsert!")
|
||||
vim.cmd("set cmdheight=1")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
callback = function()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd("quit")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd("set formatoptions-=cro")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd("hi link illuminatedWord LspReferenceText")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Prevent auto comment on next line
|
||||
vim.cmd([[autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o]])
|
||||
|
||||
-- Set filetype to tex for .tex files?
|
||||
vim.cmd([[autocmd BufRead,BufNewFile *.tex set filetype=tex]])
|
||||
|
||||
-- Trim whitespace from files on save
|
||||
vim.cmd [[
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
]]
|
||||
|
||||
-- Recompile and restart Xmonad on save of config file for Xmonad or Xmobar
|
||||
vim.cmd([[autocmd BufWritePost ~/.xmonad/xmonad.hs,~/.config/xmobar/xmobar-main.hs,~/.config/xmobar/xmobar-sub.hs,~/.config/xmobar/xmobar-single.hs !xmonad --recompile && xmonad --restart]])
|
||||
|
||||
-- Run custom textclear command when exiting a .tex file (cleanup files)
|
||||
vim.cmd([[autocmd VimLeave *.tex !texclear %]])
|
||||
|
||||
-- Run install when editing my scripts
|
||||
vim.cmd([[
|
||||
autocmd BufWritePost ~/repos/inks-scripts/scripts/** !~/repos/inks-scripts/install
|
||||
]])
|
||||
@ -1,17 +0,0 @@
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
npairs.setup {
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
ignored_next_char = "[%w%.*]", -- don't place autopairs when cursor sits infront of any character.
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
@ -1,77 +0,0 @@
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
-- NOTE: this plugin is designed with this icon in mind,
|
||||
-- and so changing this is NOT recommended, this is intended
|
||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||
indicator = {
|
||||
icon = " ﯦ",
|
||||
},
|
||||
-- indicator_icon = "▎",
|
||||
buffer_close_icon = "",
|
||||
-- buffer_close_icon = '',
|
||||
modified_icon = "●",
|
||||
close_icon = "",
|
||||
-- close_icon = '',
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||
--- Please note some names can/will break the
|
||||
--- bufferline so use this at your discretion knowing that it has
|
||||
--- some limitations that will *NOT* be fixed.
|
||||
-- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- -- remove extension from markdown files for example
|
||||
-- if buf.name:match('%.md') then
|
||||
-- return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
-- end
|
||||
-- end,
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 21,
|
||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||
diagnostics_update_in_insert = false,
|
||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
-- return "("..count..")"
|
||||
-- end,
|
||||
-- NOTE: this will be called a lot so don't do any heavy processing here
|
||||
-- custom_filter = function(buf_number)
|
||||
-- -- filter out filetypes you don't want to see
|
||||
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out by buffer name
|
||||
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out based on arbitrary rules
|
||||
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||
-- -- add custom logic
|
||||
-- return buffer_a.modified > buffer_b.modified
|
||||
-- end
|
||||
},
|
||||
}
|
||||
@ -1,200 +0,0 @@
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local buffer_fts = {
|
||||
"markdown",
|
||||
"toml",
|
||||
"yaml",
|
||||
"json",
|
||||
}
|
||||
|
||||
local function contains(t, value)
|
||||
for _, v in pairs(t) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local compare = require("cmp.config.compare")
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local icons = require("chris.icons")
|
||||
|
||||
local kind_icons = icons.kind
|
||||
|
||||
-- I don't have most of the following but they can serve as future examples
|
||||
vim.g.cmp_active = true
|
||||
|
||||
cmp.setup({
|
||||
enabled = function()
|
||||
local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
||||
if buftype == "prompt" then
|
||||
return false
|
||||
end
|
||||
return vim.g.cmp_active
|
||||
end,
|
||||
preselect = cmp.PreselectMode.None,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
|
||||
["<C-j>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
-- ["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-c>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
["<m-j>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
["<m-k>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
["<m-c>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
["<S-CR>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<Right>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif check_backspace() then
|
||||
-- cmp.complete()
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
}),
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = kind_icons[vim_item.kind]
|
||||
|
||||
if entry.source.name == "lab.quick_data" then
|
||||
vim_item.kind = icons.misc.CircuitBoard
|
||||
vim_item.kind_hl_group = "CmpItemKindConstant"
|
||||
end
|
||||
|
||||
-- NOTE: order matters
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[LUA]",
|
||||
luasnip = "[SNP]",
|
||||
buffer = "[BUF]",
|
||||
path = "[PTH]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{
|
||||
name = "nvim_lsp",
|
||||
filter = function(entry, ctx)
|
||||
local kind = require("cmp.types.lsp").CompletionItemKind[entry:get_kind()]
|
||||
if kind == "Snippet" and ctx.prev_context.filetype == "java" then
|
||||
return true
|
||||
end
|
||||
|
||||
if kind == "Text" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
group_index = 2,
|
||||
},
|
||||
{ name = "nvim_lua", group_index = 2 },
|
||||
{ name = "luasnip", group_index = 2 },
|
||||
{
|
||||
name = "buffer",
|
||||
group_index = 2,
|
||||
filter = function(entry, ctx)
|
||||
if not contains(buffer_fts, ctx.prev_context.filetype) then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ name = "path", group_index = 2 },
|
||||
{ name = "lab.quick_data", keyword_length = 4, group_index = 2 },
|
||||
},
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
compare.offset,
|
||||
compare.exact,
|
||||
-- compare.scopes,
|
||||
compare.score,
|
||||
compare.recently_used,
|
||||
compare.locality,
|
||||
-- compare.kind,
|
||||
compare.sort_text,
|
||||
compare.length,
|
||||
compare.order,
|
||||
},
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
documentation = false,
|
||||
completion = {
|
||||
border = "rounded",
|
||||
winhighlight = "NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None",
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
})
|
||||
@ -1,6 +0,0 @@
|
||||
local status_ok, colorizer = pcall(require, "colorizer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
colorizer.setup()
|
||||
@ -1,12 +0,0 @@
|
||||
local colorscheme = "base16-gruvbox-dark-medium"
|
||||
|
||||
local s_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
|
||||
if not s_ok then
|
||||
vim.notify("Colorscheme" .. colorscheme .. " not found!")
|
||||
return
|
||||
end
|
||||
|
||||
-- For transperant background
|
||||
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none"})
|
||||
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none"})
|
||||
@ -1,6 +0,0 @@
|
||||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup {}
|
||||
@ -1,28 +0,0 @@
|
||||
local ok, cybu = pcall(require, "cybu")
|
||||
if not ok then
|
||||
return
|
||||
end
|
||||
cybu.setup {
|
||||
position = {
|
||||
relative_to = "win", -- win, editor, cursor
|
||||
anchor = "topright", -- topleft, topcenter, topright,
|
||||
-- centerleft, center, centerright,
|
||||
-- bottomleft, bottomcenter, bottomright
|
||||
-- vertical_offset = 10, -- vertical offset from anchor in lines
|
||||
-- horizontal_offset = 0, -- vertical offset from anchor in columns
|
||||
-- max_win_height = 5, -- height of cybu window in lines
|
||||
-- max_win_width = 0.5, -- integer for absolute in columns
|
||||
-- float for relative to win/editor width
|
||||
},
|
||||
display_time = 1750, -- time the cybu window is displayed
|
||||
style = {
|
||||
separator = " ", -- string used as separator
|
||||
prefix = "…", -- string used as prefix for truncated paths
|
||||
padding = 1, -- left & right padding in number of spaces
|
||||
hide_buffer_id = true,
|
||||
devicons = {
|
||||
enabled = true, -- enable or disable web dev icons
|
||||
colored = true, -- enable color for web dev icons
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,133 +0,0 @@
|
||||
local dap_status_ok, dap = pcall(require, "dap")
|
||||
if not dap_status_ok then
|
||||
print("error requiring dap")
|
||||
return
|
||||
end
|
||||
|
||||
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||
if not dap_ui_status_ok then
|
||||
print("error requiring dapui")
|
||||
return
|
||||
end
|
||||
|
||||
-- dapui.setup()
|
||||
dapui.setup({
|
||||
icons = { expanded = "▾", collapsed = "▸" },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
-- Expand lines larger than the window
|
||||
-- Requires >= 0.7
|
||||
expand_lines = vim.fn.has("nvim-0.7"),
|
||||
-- Layouts define sections of the screen to place windows.
|
||||
-- The position can be "left", "right", "top" or "bottom".
|
||||
-- The size specifies the height/width depending on position. It can be an Int
|
||||
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||
-- Elements are the elements shown in the layout (in order).
|
||||
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
-- Elements can be strings or table with id and size keys.
|
||||
{ id = "scopes", size = 0.25 },
|
||||
"breakpoints",
|
||||
-- "stacks",
|
||||
-- "watches",
|
||||
},
|
||||
size = 40, -- 40 columns
|
||||
position = "right",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 0.25, -- 25% of total lines
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1 },
|
||||
render = {
|
||||
max_type_length = nil, -- Can be integer or nil.
|
||||
},
|
||||
})
|
||||
|
||||
local icons = require("chris.icons")
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = icons.ui.Bug, texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
||||
-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#Dotnet
|
||||
dap.adapters.coreclr = {
|
||||
type = 'executable',
|
||||
command = 'netcoredbg',
|
||||
args = {'--interpreter=vscode'}
|
||||
}
|
||||
|
||||
dap.configurations.cs = {
|
||||
{
|
||||
type = "coreclr",
|
||||
name = "launch - netcoredbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#Javascript-chrome
|
||||
dap.adapters.chrome = {
|
||||
type = "executable",
|
||||
command = "node",
|
||||
args = {"/home/solomon/repos/vscode-chrome-debug/out/src/chromeDebug.js"}
|
||||
}
|
||||
|
||||
dap.configurations.javascript = { -- change this to javascriptreact if needed
|
||||
{
|
||||
type = "chrome",
|
||||
request = "attach",
|
||||
program = "${file}",
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
protocol = "inspector",
|
||||
port = 9222,
|
||||
webRoot = "${workspaceFolder}"
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.typescript = { -- change to typescriptreact if needed
|
||||
{
|
||||
type = "chrome",
|
||||
request = "attach",
|
||||
program = "${file}",
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
protocol = "inspector",
|
||||
port = 9222,
|
||||
webRoot = "${workspaceFolder}"
|
||||
}
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
local status_ok, dial_config = pcall(require, "dial.config")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local y = "2024/05/29"
|
||||
|
||||
local augend = require "dial.augend"
|
||||
dial_config.augends:register_group {
|
||||
default = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.constant.new { elements = { "let", "const" } },
|
||||
},
|
||||
visual = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
augend.constant.alias.alpha,
|
||||
augend.constant.alias.Alpha,
|
||||
},
|
||||
mygroup = {
|
||||
augend.constant.new {
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "True", "False" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "public", "private" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "&&", "||" },
|
||||
word = false,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.)
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.semver.alias.semver
|
||||
},
|
||||
}
|
||||
|
||||
local map = require "dial.map"
|
||||
|
||||
-- change augends in VISUAL mode
|
||||
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal "visual", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal "visual", { noremap = true })
|
||||
|
||||
vim.cmd [[
|
||||
" enable only for specific FileType
|
||||
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
|
||||
]]
|
||||
@ -1,105 +0,0 @@
|
||||
local status_ok, dressing = pcall(require, "dressing")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
dressing.setup {
|
||||
input = {
|
||||
-- Set to false to disable the vim.ui.input implementation
|
||||
enabled = true,
|
||||
|
||||
-- Default prompt string
|
||||
default_prompt = "Input:",
|
||||
|
||||
-- Can be 'left', 'right', or 'center'
|
||||
prompt_align = "left",
|
||||
|
||||
-- When true, <Esc> will close the modal
|
||||
insert_only = true,
|
||||
|
||||
-- These are passed to nvim_open_win
|
||||
anchor = "SW",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "cursor",
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
prefer_width = 40,
|
||||
width = nil,
|
||||
-- min_width and max_width can be a list of mixed types.
|
||||
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
|
||||
max_width = { 140, 0.9 },
|
||||
min_width = { 20, 0.2 },
|
||||
|
||||
override = function(conf)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
select = {
|
||||
-- Set to false to disable the vim.ui.select implementation
|
||||
enabled = true,
|
||||
|
||||
-- Priority list of preferred vim.select implementations
|
||||
-- backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
|
||||
backend = { "builtin", "telescope", "nui" },
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Options for telescope selector
|
||||
-- These are passed into the telescope picker directly. Can be used like:
|
||||
-- telescope = require('telescope.themes').get_ivy({...})
|
||||
telescope = nil,
|
||||
|
||||
-- Options for nui Menu
|
||||
nui = {
|
||||
position = "50%",
|
||||
size = nil,
|
||||
relative = "editor",
|
||||
border = {
|
||||
},
|
||||
buf_options = {
|
||||
swapfile = false,
|
||||
filetype = "DressingSelect",
|
||||
},
|
||||
max_width = 80,
|
||||
max_height = 40,
|
||||
min_width = 40,
|
||||
min_height = 10,
|
||||
},
|
||||
|
||||
-- Options for built-in selector
|
||||
builtin = {
|
||||
-- These are passed to nvim_open_win
|
||||
anchor = "NW",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "editor",
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- the min_ and max_ options can be a list of mixed types.
|
||||
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
|
||||
width = nil,
|
||||
max_width = { 140, 0.8 },
|
||||
min_width = { 40, 0.2 },
|
||||
height = nil,
|
||||
max_height = 0.9,
|
||||
min_height = { 10, 0.2 },
|
||||
|
||||
override = function(conf)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
|
||||
-- Used to override format_item. See :help dressing-format
|
||||
format_item_override = {},
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
local status_ok, fidget = pcall(require, "fidget")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
fidget.setup()
|
||||
@ -1,67 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
function M.get_word_length()
|
||||
local word = vim.fn.expand "<cword>"
|
||||
return #word
|
||||
end
|
||||
|
||||
function M.toggle_option(option)
|
||||
local value = not vim.api.nvim_get_option_value(option, {})
|
||||
vim.opt[option] = value
|
||||
vim.notify(option .. " set to " .. tostring(value))
|
||||
end
|
||||
|
||||
function M.toggle_tabline()
|
||||
local value = vim.api.nvim_get_option_value("showtabline", {})
|
||||
|
||||
if value == 2 then
|
||||
value = 0
|
||||
else
|
||||
value = 2
|
||||
end
|
||||
|
||||
vim.opt.showtabline = value
|
||||
|
||||
vim.notify("showtabline" .. " set to " .. tostring(value))
|
||||
end
|
||||
|
||||
local diagnostics_active = true
|
||||
function M.toggle_diagnostics()
|
||||
diagnostics_active = not diagnostics_active
|
||||
if diagnostics_active then
|
||||
vim.diagnostic.show()
|
||||
else
|
||||
vim.diagnostic.hide()
|
||||
end
|
||||
end
|
||||
|
||||
function M.isempty(s)
|
||||
return s == nil or s == ""
|
||||
end
|
||||
|
||||
function M.get_buf_option(opt)
|
||||
local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt)
|
||||
if not status_ok then
|
||||
return nil
|
||||
else
|
||||
return buf_option
|
||||
end
|
||||
end
|
||||
|
||||
function M.smart_quit()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local modified = vim.api.nvim_buf_get_option(bufnr, "modified")
|
||||
if modified then
|
||||
vim.ui.input({
|
||||
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
|
||||
}, function(input)
|
||||
if input == "y" then
|
||||
vim.cmd "q!"
|
||||
end
|
||||
end)
|
||||
else
|
||||
vim.cmd "q!"
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
@ -1,48 +0,0 @@
|
||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "rounded",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local h_status_ok, harpoon = pcall(require, "harpoon")
|
||||
if not h_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension "harpoon"
|
||||
@ -1,116 +0,0 @@
|
||||
-- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts
|
||||
-- go to the above and then enter <c-v>u<unicode> and the symbold should appear
|
||||
-- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
return {
|
||||
kind = {
|
||||
Text = "",
|
||||
-- Method = "m",
|
||||
Function = "",
|
||||
-- Constructor = "",
|
||||
Method = "",
|
||||
-- Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
-- Variable = "",
|
||||
Variable = "",
|
||||
Namespace = "פּ",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
-- Module = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Key = "k",
|
||||
-- Keyword = "",
|
||||
Keyword = "",
|
||||
-- Snippet = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
},
|
||||
type = {
|
||||
Array = "",
|
||||
Number = "",
|
||||
String = "",
|
||||
Boolean = "蘒",
|
||||
Null = "ﳠ",
|
||||
Object = "",
|
||||
},
|
||||
documents = {
|
||||
File = "",
|
||||
Files = "",
|
||||
Folder = "",
|
||||
OpenFolder = "",
|
||||
},
|
||||
git = {
|
||||
Add = "",
|
||||
Mod = "",
|
||||
Remove = "",
|
||||
Ignore = "",
|
||||
Rename = "",
|
||||
Diff = "",
|
||||
Repo = "",
|
||||
Octoface = "",
|
||||
},
|
||||
ui = {
|
||||
ArrowClosed = "",
|
||||
ArrowOpen = "",
|
||||
Lock = "",
|
||||
Circle = "",
|
||||
BigCircle = "",
|
||||
BigUnfilledCircle = "",
|
||||
Close = "",
|
||||
NewFile = "",
|
||||
Search = "",
|
||||
Lightbulb = "",
|
||||
Project = "",
|
||||
Dashboard = "",
|
||||
History = "",
|
||||
Comment = "",
|
||||
Bug = "",
|
||||
Code = "",
|
||||
Telescope = "",
|
||||
Gear = "",
|
||||
Package = "",
|
||||
List = "",
|
||||
SignIn = "",
|
||||
SignOut = "",
|
||||
Check = "",
|
||||
Fire = "",
|
||||
Note = "",
|
||||
BookMark = "",
|
||||
Pencil = "",
|
||||
-- ChevronRight = "",
|
||||
ChevronRight = ">",
|
||||
Table = "",
|
||||
Calendar = "",
|
||||
CloudDownload = "",
|
||||
},
|
||||
diagnostics = {
|
||||
Error = "",
|
||||
Warning = "",
|
||||
Information = "",
|
||||
Question = "",
|
||||
Hint = "",
|
||||
},
|
||||
misc = {
|
||||
Robot = "ﮧ",
|
||||
Squirrel = "",
|
||||
Tag = "",
|
||||
Watch = "",
|
||||
Smiley = "ﲃ",
|
||||
Package = "",
|
||||
CircuitBoard = "",
|
||||
},
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
||||
@ -1,27 +0,0 @@
|
||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"text"
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = true
|
||||
vim.g.indent_blankline_use_treesitter = false
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
|
||||
indent_blankline.setup {
|
||||
show_current_context = true,
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
-- require "chris.bufferline" -- unused
|
||||
-- require "chris.noice" -- unused
|
||||
-- require "chris.winbar" -- top bar, unused
|
||||
|
||||
require "chris.impatient" -- good leading
|
||||
require "chris.options" -- my options
|
||||
require "chris.keymaps" -- misc keymaps not part of whichkey
|
||||
require "chris.plugins" -- plugins configuration (packer)
|
||||
require "chris.colorscheme" -- my choice of colorscheme
|
||||
require "chris.lsp" -- lsp configuration
|
||||
require "chris.alpha" -- start/home page for nvim
|
||||
require "chris.autocmd" -- custom autocmds
|
||||
require "chris.autopairs" -- automatically add parirs for brackens quotes etc
|
||||
require "chris.cmp" -- completion configuration
|
||||
require "chris.colorizer" -- highlight colors hexcodes etc
|
||||
require "chris.comment" -- better commenting
|
||||
require "chris.dressing" -- better ui
|
||||
require "chris.dial" -- better incrementing/decrementing
|
||||
require "chris.fidget" -- display lsp server progress
|
||||
require "chris.functions" -- custom functions
|
||||
require "chris.gitsigns" -- gitsigns integration
|
||||
require "chris.harpoon" -- mark files in project and pull them too you
|
||||
require "chris.indentline" -- show indentation levels for code blocks
|
||||
require "chris.lualine" -- pretty and nice statusline plugin
|
||||
require "chris.navic" -- lsp integrated location in code finder/printer
|
||||
require "chris.notify" -- display notifications nicer
|
||||
require "chris.numb" -- peek before you move :10 etc.
|
||||
require "chris.nvim-tree" -- file tree, when needed.
|
||||
require "chris.symbols-outline" -- navigate code symbols
|
||||
require "chris.telescope" -- nice.
|
||||
require "chris.todo-comments" -- highlight TODO and other related comments
|
||||
require "chris.treesitter" -- magic
|
||||
require "chris.whichkey" -- keymaps
|
||||
require "chris.spectre" -- renaming but better
|
||||
require "chris.cybu" -- cycle through current buffers
|
||||
require "chris.dap" -- debugging
|
||||
require "chris.lspsaga" -- bit overkill, using for code action menu
|
||||
require "chris.neogen" -- annotation/doc generator
|
||||
@ -1,50 +0,0 @@
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
-- set Space as leader key
|
||||
map("n", "<Space>", "", opts)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- NORMAL
|
||||
-- Move text up and down
|
||||
map("n", "<C-k>", "<ESC>:m .-2<CR>==", opts)
|
||||
map("n", "<C-j>", "<ESC>:m .+1<CR>==", opts)
|
||||
|
||||
-- Copy/Paste
|
||||
map("n", "<C-y>", '"+y', opts)
|
||||
map("n", "<C-p>", '"+y', opts)
|
||||
|
||||
-- Save
|
||||
map("n", "<C-s>", ":w<CR>", opts)
|
||||
|
||||
-- Switch between buffers
|
||||
map("n", "<S-l>", ":CybuNext<CR>", opts)
|
||||
map("n", "<S-h>", ":CybuPrev<CR>", opts)
|
||||
|
||||
-- center after up and down movements
|
||||
map("n", "<C-u>", "<C-u>zz", opts)
|
||||
map("n", "<C-d>", "<C-d>zz", opts)
|
||||
|
||||
-- INSERT
|
||||
-- Easy exit insert mode
|
||||
map("i", "jk", "<ESC>", opts)
|
||||
|
||||
-- Paste
|
||||
map("i", "<C-p>", '"+y', opts)
|
||||
|
||||
-- Save
|
||||
map("i", "<C-s>", "<ESC>:w<CR>a", opts)
|
||||
|
||||
-- VISUAL
|
||||
-- Indenting
|
||||
map("v", "<", "<gv", opts)
|
||||
map("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
map("v", "<C-j>", ":m .+1<CR>==<ESC>V", opts)
|
||||
map("v", "<C-k>", ":m .-2<CR>==<ESC>V", opts)
|
||||
|
||||
-- Copy
|
||||
map("v", "<C-y>", '"+y', opts)
|
||||
@ -1,126 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not status_cmp_ok then
|
||||
print("cmp_nvim_lsp error!")
|
||||
return
|
||||
end
|
||||
|
||||
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
|
||||
|
||||
M.setup = function()
|
||||
local icons = require("chris.icons")
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = icons.diagnostics.Error },
|
||||
{ name = "DiagnosticSignWarn", text = icons.diagnostics.Warning },
|
||||
{ name = "DiagnosticSignHint", text = icons.diagnostics.Hint },
|
||||
{ name = "DiagnosticSignInfo", text = icons.diagnostics.Information },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, {
|
||||
texthl = sign.name,
|
||||
text = sign.text,
|
||||
numhl = "",
|
||||
})
|
||||
end
|
||||
|
||||
local config = {
|
||||
-- disable virtual text
|
||||
virtual_lines = false,
|
||||
virtual_text = false,
|
||||
-- show signs
|
||||
signs = {
|
||||
active = signs,
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = true,
|
||||
style = "minimal",
|
||||
source = "if_many", -- Or "always"
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
end
|
||||
|
||||
local function attach_navic(client, bufnr)
|
||||
vim.g.navic_silence = false
|
||||
local status_ok, navic = pcall(require, "nvim-navic")
|
||||
if not status_ok then
|
||||
print("nvim-navic error!")
|
||||
return
|
||||
end
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
local function disable_deno_formatting(client)
|
||||
if client.name == "denols" then
|
||||
require("null-ls").disable({ "prettier" })
|
||||
end
|
||||
end
|
||||
|
||||
local function resolve_tsserver_deno(client)
|
||||
local active_clients = vim.lsp.get_active_clients()
|
||||
if client.name == "denols" then
|
||||
for _, client_ in pairs(active_clients) do
|
||||
-- stop tsserver if denols is already active
|
||||
if client_.name == "tsserver" then
|
||||
client_.stop()
|
||||
end
|
||||
end
|
||||
elseif client.name == "tsserver" then
|
||||
for _, client_ in pairs(active_clients) do
|
||||
-- prevent tsserver from starting if denols is already active
|
||||
if client_.name == "denols" then
|
||||
client.stop()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
attach_navic(client, bufnr)
|
||||
disable_deno_formatting(client)
|
||||
resolve_tsserver_deno(client)
|
||||
end
|
||||
|
||||
function M.enable_format_on_save()
|
||||
vim.cmd([[
|
||||
augroup format_on_save
|
||||
autocmd!
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format({ async = false })
|
||||
augroup end
|
||||
]])
|
||||
vim.notify("Enabled format on save")
|
||||
end
|
||||
|
||||
function M.disable_format_on_save()
|
||||
M.remove_augroup("format_on_save")
|
||||
vim.notify("Disabled format on save")
|
||||
end
|
||||
|
||||
function M.toggle_format_on_save()
|
||||
if vim.fn.exists("#format_on_save#BufWritePre") == 0 then
|
||||
M.enable_format_on_save()
|
||||
else
|
||||
M.disable_format_on_save()
|
||||
end
|
||||
end
|
||||
|
||||
function M.remove_augroup(name)
|
||||
if vim.fn.exists("#" .. name) == 1 then
|
||||
vim.cmd("au! " .. name)
|
||||
end
|
||||
end
|
||||
|
||||
vim.cmd([[ command! LspToggleAutoFormat execute 'lua require("chris.lsp.handlers").toggle_format_on_save()' ]])
|
||||
|
||||
return M
|
||||
@ -1,22 +0,0 @@
|
||||
M = {}
|
||||
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
if not status_ok then
|
||||
print "lspconfig error!"
|
||||
return
|
||||
end
|
||||
|
||||
-- may add signature in future.
|
||||
-- require "chris.lsp.lsp-signature"
|
||||
require "chris.lsp.mason"
|
||||
require "chris.lsp.handlers".setup()
|
||||
require "chris.lsp.null-ls"
|
||||
|
||||
local l_status_ok, lsp_lines = pcall(require, "lsp_lines")
|
||||
if not l_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
lsp_lines.setup()
|
||||
|
||||
return M
|
||||
@ -1,121 +0,0 @@
|
||||
local status_ok, mason = pcall(require, "mason")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local status_ok_1, mason_lspconfig = pcall(require, "mason-lspconfig")
|
||||
if not status_ok_1 then
|
||||
return
|
||||
end
|
||||
|
||||
local servers = {
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"emmet_ls",
|
||||
"html",
|
||||
"sumneko_lua",
|
||||
"omnisharp",
|
||||
"tflint",
|
||||
"denols",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"yamlls",
|
||||
"texlab",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"taplo",
|
||||
"lemminx",
|
||||
"clangd",
|
||||
}
|
||||
|
||||
local settings = {
|
||||
ui = {
|
||||
border = "rounded",
|
||||
icons = {
|
||||
package_installed = "i",
|
||||
package_pending = "p",
|
||||
package_uninstalled = "u",
|
||||
},
|
||||
},
|
||||
log_level = vim.log.levels.INFO,
|
||||
max_concurrent_installers = 4,
|
||||
}
|
||||
|
||||
mason.setup(settings)
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = servers,
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
-- New way of setting up neodev, formally lua-dev by folke
|
||||
local l_status_ok, neodev = pcall(require, "neodev")
|
||||
if not l_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
neodev.setup({})
|
||||
|
||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||
if not lspconfig_status_ok then
|
||||
print("lspconfig error!")
|
||||
return
|
||||
end
|
||||
|
||||
local opts = {}
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
opts = {
|
||||
on_attach = require("chris.lsp.handlers").on_attach,
|
||||
capabilities = require("chris.lsp.handlers").capabilities,
|
||||
}
|
||||
|
||||
server = vim.split(server, "@", {})[1]
|
||||
|
||||
if server == "yamlls" then
|
||||
local yamlls_opts = require("chris.lsp.settings.yamlls")
|
||||
opts = vim.tbl_deep_extend("force", yamlls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "sumneko_lua" then
|
||||
lspconfig.sumneko_lua.setup({
|
||||
on_attach = require("chris.lsp.handlers").on_attach,
|
||||
})
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "tsserver" then
|
||||
local tsserver_opts = require("chris.lsp.settings.tsserver")
|
||||
opts = vim.tbl_deep_extend("force", tsserver_opts, opts)
|
||||
end
|
||||
|
||||
if server == "clangd" then
|
||||
local clangd_opts = require("chris.lsp.settings.clangd")
|
||||
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
|
||||
end
|
||||
|
||||
if server == "emmet_ls" then
|
||||
local emmet_ls_opts = require("chris.lsp.settings.emmet_ls")
|
||||
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "rust_analyzer" then
|
||||
local rust_opts = require("chris.lsp.settings.rust")
|
||||
-- opts = vim.tbl_deep_extend("force", rust_opts, opts)
|
||||
local rust_tools_status_ok, rust_tools = pcall(require, "rust-tools")
|
||||
if not rust_tools_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
rust_tools.setup(rust_opts)
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "omnisharp" then
|
||||
local omnisharp_opts = require("chris.lsp.settings.omnisharp")
|
||||
opts = vim.tbl_deep_extend("force", omnisharp_opts, opts)
|
||||
end
|
||||
|
||||
lspconfig[server].setup(opts)
|
||||
::continue::
|
||||
end
|
||||
@ -1,64 +0,0 @@
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
sources = {
|
||||
formatting.prettier.with({
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"css",
|
||||
"scss",
|
||||
"html",
|
||||
"json",
|
||||
"yaml",
|
||||
},
|
||||
}),
|
||||
formatting.black.with({ extra_args = { "--fast" } }),
|
||||
formatting.stylua,
|
||||
-- formatting.shfmt,
|
||||
formatting.google_java_format,
|
||||
formatting.bibclean,
|
||||
formatting.beautysh,
|
||||
-- diagnostics.flake8,
|
||||
diagnostics.shellcheck,
|
||||
},
|
||||
})
|
||||
|
||||
local unwrap = {
|
||||
method = null_ls.methods.DIAGNOSTICS,
|
||||
filetypes = { "rust" },
|
||||
generator = {
|
||||
fn = function(params)
|
||||
local diagnostics = {}
|
||||
-- sources have access to a params object
|
||||
-- containing info about the current file and editor state
|
||||
for i, line in ipairs(params.content) do
|
||||
local col, end_col = line:find("unwrap()")
|
||||
if col and end_col then
|
||||
-- null-ls fills in undefined positions
|
||||
-- and converts source diagnostics into the required format
|
||||
table.insert(diagnostics, {
|
||||
row = i,
|
||||
col = col,
|
||||
end_col = end_col,
|
||||
source = "unwrap",
|
||||
message = "hey " .. os.getenv("USER") .. ", don't forget to handle this",
|
||||
severity = 2,
|
||||
})
|
||||
end
|
||||
end
|
||||
return diagnostics
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
null_ls.register(unwrap)
|
||||
@ -1,3 +0,0 @@
|
||||
return {
|
||||
cmd = { "clangd" }
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
-- https://github.com/pedro757/emmet
|
||||
-- npm i -g ls_emmet
|
||||
return {
|
||||
cmd = { "ls_emmet", "--stdio" },
|
||||
filetypes = {
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"haml",
|
||||
"xml",
|
||||
"xsl",
|
||||
"pug",
|
||||
"slim",
|
||||
"sass",
|
||||
"stylus",
|
||||
"less",
|
||||
"sss",
|
||||
"hbs",
|
||||
"handlebars",
|
||||
},
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
return {
|
||||
cmd = { "omnisharp" },
|
||||
|
||||
-- Enables support for reading code style, naming convention and analyzer
|
||||
-- settings from .editorconfig.
|
||||
enable_editorconfig_support = true,
|
||||
|
||||
-- If true, MSBuild project system will only load projects for files that
|
||||
-- were opened in the editor. This setting is useful for big C# codebases
|
||||
-- and allows for faster initialization of code navigation features only
|
||||
-- for projects that are relevant to code that is being edited. With this
|
||||
-- setting enabled OmniSharp may load fewer projects and may thus display
|
||||
-- incomplete reference lists for symbols.
|
||||
enable_ms_build_load_projects_on_demand = false,
|
||||
|
||||
-- Enables support for roslyn analyzers, code fixes and rulesets.
|
||||
enable_roslyn_analyzers = true,
|
||||
|
||||
-- Specifies whether 'using' directives should be grouped and sorted during
|
||||
-- document formatting.
|
||||
organize_imports_on_format = false,
|
||||
|
||||
-- Enables support for showing unimported types and unimported extension
|
||||
-- methods in completion lists. When committed, the appropriate using
|
||||
-- directive will be added at the top of the current file. This option can
|
||||
-- have a negative impact on initial completion responsiveness,
|
||||
-- particularly for the first few completion sessions after opening a
|
||||
-- solution.
|
||||
enable_import_completion = false,
|
||||
|
||||
-- Specifies whether to include preview versions of the .NET SDK when
|
||||
-- determining which version to use for project loading.
|
||||
sdk_include_prereleases = true,
|
||||
|
||||
-- Only run analyzers against open files when 'enableRoslynAnalyzers' is
|
||||
-- true
|
||||
analyze_open_documents_only = false,
|
||||
}
|
||||
@ -1,126 +0,0 @@
|
||||
return {
|
||||
tools = {
|
||||
-- autoSetHints = false,
|
||||
on_initialized = function()
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||
pattern = { "*.rs" },
|
||||
callback = function()
|
||||
vim.lsp.codelens.refresh()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
auto = false,
|
||||
inlay_hints = {
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
auto = false,
|
||||
|
||||
-- Event which triggers a refersh of the inlay hints.
|
||||
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
|
||||
-- not that this may cause higher CPU usage.
|
||||
-- This option is only respected when only_current_line and
|
||||
-- autoSetHints both are true.
|
||||
only_current_line_autocmd = "CursorHold",
|
||||
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = false,
|
||||
|
||||
-- whether to show variable name before type hints with the inlay hints or not
|
||||
-- default: false
|
||||
show_variable_name = false,
|
||||
|
||||
-- prefix for parameter hints
|
||||
-- default: "<-"
|
||||
-- parameter_hints_prefix = "<- ",
|
||||
parameter_hints_prefix = " ",
|
||||
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
-- default: "=>"
|
||||
-- other_hints_prefix = "=> ",
|
||||
other_hints_prefix = " ",
|
||||
|
||||
-- whether to align to the lenght of the longest line in the file
|
||||
max_len_align = false,
|
||||
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
},
|
||||
hover_actions = {
|
||||
auto_focus = false,
|
||||
border = "rounded",
|
||||
width = 60,
|
||||
-- height = 30,
|
||||
},
|
||||
},
|
||||
server = {
|
||||
--[[
|
||||
$ mkdir -p ~/.local/bin
|
||||
$ curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
|
||||
$ chmod +x ~/.local/bin/rust-analyzer
|
||||
--]]
|
||||
-- cmd = { os.getenv "HOME" .. "/.local/bin/rust-analyzer" },
|
||||
cmd = { "rustup", "run", "nightly", os.getenv "HOME" .. "/.local/bin/rust-analyzer" },
|
||||
on_attach = require("chris.lsp.handlers").on_attach,
|
||||
capabilities = require("chris.lsp.handlers").capabilities,
|
||||
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
lens = {
|
||||
enable = true,
|
||||
},
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
-- return {
|
||||
-- settings = {
|
||||
-- rust_analyzer = {
|
||||
-- inlayHints = {
|
||||
-- bindingModeHints = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- typeHints = {
|
||||
-- enable = true,
|
||||
-- hideClosureInitialization = false,
|
||||
-- hideNamedConstructor = false,
|
||||
-- },
|
||||
-- chainingHints = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- closingBraceHints = {
|
||||
-- enable = true,
|
||||
-- minLines = 25,
|
||||
-- },
|
||||
-- closureReturnTypeHints = {
|
||||
-- enable = "never",
|
||||
-- },
|
||||
-- lifetimeElisionHints = {
|
||||
-- enable = "never",
|
||||
-- useParameterNames = false,
|
||||
-- maxLength = 25,
|
||||
-- },
|
||||
-- parameterHints = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- reborrowHints = {
|
||||
-- enable = "never",
|
||||
-- },
|
||||
-- renderColons = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
@ -1 +0,0 @@
|
||||
return {}
|
||||
@ -1,43 +0,0 @@
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
type = {
|
||||
-- weakUnionCheck = true,
|
||||
-- weakNilCheck = true,
|
||||
-- castNumberToInteger = true,
|
||||
},
|
||||
format = {
|
||||
enable = false,
|
||||
},
|
||||
hint = {
|
||||
enable = true,
|
||||
arrayIndex = "Disable", -- "Enable", "Auto", "Disable"
|
||||
await = true,
|
||||
paramName = "Disable", -- "All", "Literal", "Disable"
|
||||
paramType = false,
|
||||
semicolon = "Disable", -- "All", "SameLine", "Disable"
|
||||
setType = true,
|
||||
},
|
||||
-- spell = {"the"}
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
special = {
|
||||
reload = "require",
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||
[vim.fn.stdpath "config" .. "/lua"] = true,
|
||||
-- [vim.fn.datapath "config" .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
return {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all';
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
|
||||
return {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
local status_ok, lspsaga = pcall(require, "lspsaga")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "chris.icons"
|
||||
|
||||
lspsaga.init_lsp_saga({
|
||||
code_action_icon = icons.diagnostics.Hint
|
||||
})
|
||||
@ -1,113 +0,0 @@
|
||||
local colors = {
|
||||
red = "#ca1243",
|
||||
grey = "#a0a1a7",
|
||||
black = "#383a42",
|
||||
white = "#f3f3f3",
|
||||
light_green = "#83a598",
|
||||
orange = "#fe8019",
|
||||
green = "#8ec07c",
|
||||
}
|
||||
|
||||
-- Put proper separators and gaps between components in sections
|
||||
local function process_sections(sections)
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < "x"
|
||||
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= "table" then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = "" } or { left = "" }
|
||||
end
|
||||
end
|
||||
return sections
|
||||
end
|
||||
|
||||
local function search_result()
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ''
|
||||
end
|
||||
local last_search = vim.fn.getreg('/')
|
||||
if not last_search or last_search == '' then
|
||||
return ''
|
||||
end
|
||||
local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
||||
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
||||
-- return ""
|
||||
end
|
||||
|
||||
local function modified()
|
||||
if vim.bo.modified then
|
||||
return "+"
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return "-"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
local status_ok, navic = pcall(require, "nvim-navic")
|
||||
if not status_ok then
|
||||
print("navic error!")
|
||||
return
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "gruvbox",
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = process_sections({
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
"branch",
|
||||
"diff",
|
||||
{
|
||||
"diagnostics",
|
||||
source = { "nvim" },
|
||||
sections = { "error" },
|
||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
source = { "nvim" },
|
||||
sections = { "warn" },
|
||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||
},
|
||||
{ "filename", file_status = false, path = 1 },
|
||||
{ modified, color = { bg = colors.red } },
|
||||
{
|
||||
"%w",
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
"%r",
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
"%q",
|
||||
cond = function()
|
||||
return vim.bo.buftype == "quickfix"
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{ navic.get_location, cond = navic.is_available },
|
||||
},
|
||||
lualine_x = {},
|
||||
-- lualine_y = { search_result, 'filetype' },
|
||||
lualine_y = { "filetype " },
|
||||
lualine_z = { "%l:%c", "%p%%/%L" },
|
||||
}),
|
||||
inactive_sections = {
|
||||
lualine_c = { "%f %y %m" },
|
||||
lualine_x = {},
|
||||
},
|
||||
})
|
||||
@ -1,43 +0,0 @@
|
||||
local status_ok, navic = pcall(require, "nvim-navic")
|
||||
if not status_ok then
|
||||
print("navic error!")
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("chris.icons")
|
||||
|
||||
navic.setup({
|
||||
icons = {
|
||||
File = icons.kind.File .. " ",
|
||||
Module = icons.kind.Module .. " ",
|
||||
Namespace = icons.kind.Namespace .. " ",
|
||||
Package = icons.ui.Package .. " ",
|
||||
Class = icons.kind.Class .. " ",
|
||||
Method = icons.kind.Method .. " ",
|
||||
Property = icons.kind.Property .. " ",
|
||||
Field = icons.kind.Field .. " ",
|
||||
Constructor = icons.kind.Constructor .. " ",
|
||||
Enum = icons.kind.Enum .. " ",
|
||||
Interface = icons.kind.Interface .. " ",
|
||||
Function = icons.kind.Function .. " ",
|
||||
Variable = icons.kind.Variable .. " ",
|
||||
Constant = icons.kind.Constant .. " ",
|
||||
String = icons.type.String .. " ",
|
||||
Number = icons.type.Number .. " ",
|
||||
Boolean = icons.type.Boolean .. " ",
|
||||
Array = icons.type.Array .. " ",
|
||||
Object = icons.type.Object .. " ",
|
||||
Key = icons.kind.Key .. " ",
|
||||
Null = icons.type.Null .. " ",
|
||||
EnumMember = icons.kind.EnumMember .. " ",
|
||||
Struct = icons.kind.Struct .. " ",
|
||||
Event = icons.kind.Event .. " ",
|
||||
Operator = icons.kind.Operator .. " ",
|
||||
TypeParameter = icons.kind.TypeParameter .. " ",
|
||||
},
|
||||
highlight = false,
|
||||
separator = " > ",
|
||||
depth_limit = 0,
|
||||
depth_limit_indicator = "..",
|
||||
safe_output = true,
|
||||
})
|
||||
@ -1,10 +0,0 @@
|
||||
local s_ok, neogen = pcall(require, "neogen")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
neogen.setup {
|
||||
enabled = true, --if you want to disable Neogen
|
||||
input_after_comment = true, -- (default: true) automatic jump (with insert mode) on inserted annotation
|
||||
-- jump_map = "<C-e>" -- (DROPPED SUPPORT, see [here](#cycle-between-annotations) !) The keymap in order to jump in the annotation fields (in insert mode)
|
||||
}
|
||||
@ -1,195 +0,0 @@
|
||||
local s_ok, noice = pcall(require, "noice")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
noice.setup({
|
||||
cmdline = {
|
||||
enabled = false, -- enables the Noice cmdline UI
|
||||
view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
|
||||
opts = {}, -- global options for the cmdline. See section on views
|
||||
---@type table<string, CmdlineFormat>
|
||||
format = {
|
||||
-- conceal: (default=true) This will hide the text in the cmdline that matches the pattern.
|
||||
-- view: (default is cmdline view)
|
||||
-- opts: any options passed to the view
|
||||
-- icon_hl_group: optional hl_group for the icon
|
||||
-- title: set to anything or empty string to hide
|
||||
cmdline = { pattern = "^:", icon = ":", lang = "vim" },
|
||||
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
|
||||
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
|
||||
filter = { pattern = "^:%s*!", icon = "$", lang = "bash" },
|
||||
lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" },
|
||||
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
|
||||
input = {}, -- Used by input()
|
||||
-- lua = false, -- to disable a format, set to `false`
|
||||
},
|
||||
},
|
||||
messages = {
|
||||
-- NOTE: If you enable messages, then the cmdline is enabled automatically.
|
||||
-- This is a current Neovim limitation.
|
||||
enabled = false, -- enables the Noice messages UI
|
||||
view = "notify", -- default view for messages
|
||||
view_error = "notify", -- view for errors
|
||||
view_warn = "notify", -- view for warnings
|
||||
view_history = "messages", -- view for :messages
|
||||
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
|
||||
},
|
||||
popupmenu = {
|
||||
enabled = true, -- enables the Noice popupmenu UI
|
||||
---@type 'nui'|'cmp'
|
||||
backend = "nui", -- backend to use to show regular cmdline completions
|
||||
---@type NoicePopupmenuItemKind|false
|
||||
-- Icons for completion item kinds (see defaults at noice.config.icons.kinds)
|
||||
kind_icons = {}, -- set to `false` to disable icons
|
||||
},
|
||||
-- You can add any custom commands below that will be available with `:Noice command`
|
||||
---@type table<string, NoiceCommand>
|
||||
commands = {
|
||||
history = {
|
||||
-- options for the message history that you get with `:Noice`
|
||||
view = "split",
|
||||
opts = { enter = true, format = "details" },
|
||||
filter = {
|
||||
any = {
|
||||
{ event = "notify" },
|
||||
{ error = true },
|
||||
{ warning = true },
|
||||
{ event = "msg_show", kind = { "" } },
|
||||
{ event = "lsp", kind = "message" },
|
||||
},
|
||||
},
|
||||
},
|
||||
-- :Noice last
|
||||
last = {
|
||||
view = "popup",
|
||||
opts = { enter = true, format = "details" },
|
||||
filter = {
|
||||
any = {
|
||||
{ event = "notify" },
|
||||
{ error = true },
|
||||
{ warning = true },
|
||||
{ event = "msg_show", kind = { "" } },
|
||||
{ event = "lsp", kind = "message" },
|
||||
},
|
||||
},
|
||||
filter_opts = { count = 1 },
|
||||
},
|
||||
-- :Noice errors
|
||||
errors = {
|
||||
-- options for the message history that you get with `:Noice`
|
||||
view = "popup",
|
||||
opts = { enter = true, format = "details" },
|
||||
filter = { error = true },
|
||||
filter_opts = { reverse = true },
|
||||
},
|
||||
},
|
||||
notify = {
|
||||
-- Noice can be used as `vim.notify` so you can route any notification like other messages
|
||||
-- Notification messages have their level and other properties set.
|
||||
-- event is always "notify" and kind can be any log level as a string
|
||||
-- The default routes will forward notifications to nvim-notify
|
||||
-- Benefit of using Noice for this is the routing and consistent history view
|
||||
enabled = true,
|
||||
view = "notify",
|
||||
},
|
||||
lsp = {
|
||||
progress = {
|
||||
enabled = true,
|
||||
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
|
||||
-- See the section on formatting for more details on how to customize.
|
||||
--- @type NoiceFormat|string
|
||||
format = "lsp_progress",
|
||||
--- @type NoiceFormat|string
|
||||
format_done = "lsp_progress_done",
|
||||
throttle = 1000 / 30, -- frequency to update lsp progress message
|
||||
view = "mini",
|
||||
},
|
||||
override = {
|
||||
-- override the default lsp markdown formatter with Noice
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
-- override the lsp markdown formatter with Noice
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
-- override cmp documentation with Noice (needs the other options to work)
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
hover = {
|
||||
enabled = true,
|
||||
view = nil, -- when nil, use defaults from documentation
|
||||
---@type NoiceViewOptions
|
||||
opts = {}, -- merged with defaults from documentation
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
auto_open = {
|
||||
enabled = true,
|
||||
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
|
||||
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
|
||||
throttle = 50, -- Debounce lsp signature help request by 50ms
|
||||
},
|
||||
view = nil, -- when nil, use defaults from documentation
|
||||
---@type NoiceViewOptions
|
||||
opts = {}, -- merged with defaults from documentation
|
||||
},
|
||||
message = {
|
||||
-- Messages shown by lsp servers
|
||||
enabled = true,
|
||||
view = "notify",
|
||||
opts = {},
|
||||
},
|
||||
-- defaults for hover and signature help
|
||||
documentation = {
|
||||
view = "hover",
|
||||
---@type NoiceViewOptions
|
||||
opts = {
|
||||
lang = "markdown",
|
||||
replace = true,
|
||||
render = "plain",
|
||||
format = { "{message}" },
|
||||
win_options = { concealcursor = "n", conceallevel = 3 },
|
||||
},
|
||||
},
|
||||
},
|
||||
markdown = {
|
||||
hover = {
|
||||
["|(%S-)|"] = vim.cmd.help, -- vim help links
|
||||
["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links
|
||||
},
|
||||
highlights = {
|
||||
["|%S-|"] = "@text.reference",
|
||||
["@%S+"] = "@parameter",
|
||||
["^%s*(Parameters:)"] = "@text.title",
|
||||
["^%s*(Return:)"] = "@text.title",
|
||||
["^%s*(See also:)"] = "@text.title",
|
||||
["{%S-}"] = "@parameter",
|
||||
},
|
||||
},
|
||||
health = {
|
||||
checker = true, -- Disable if you don't want health checks to run
|
||||
},
|
||||
smart_move = {
|
||||
-- noice tries to move out of the way of existing floating windows.
|
||||
enabled = true, -- you can disable this behaviour here
|
||||
-- add any filetypes here, that shouldn't trigger smart move.
|
||||
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
|
||||
},
|
||||
---@type NoicePresets
|
||||
presets = {
|
||||
-- you can enable a preset by setting it to true, or a table that will override the preset config
|
||||
-- you can also add custom presets that you can enable/disable with enabled=true
|
||||
bottom_search = false, -- use a classic bottom cmdline for search
|
||||
command_palette = false, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = false, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode.
|
||||
---@type NoiceConfigViews
|
||||
views = {}, ---@see section on views
|
||||
---@type NoiceRouteConfig[]
|
||||
routes = {}, --- @see section on routes
|
||||
---@type table<string, NoiceFilter>
|
||||
status = {}, --- @see section on statusline components
|
||||
---@type NoiceFormatOptions
|
||||
format = {}, --- @see section on formatting
|
||||
})
|
||||
@ -1,53 +0,0 @@
|
||||
local status_ok, notify = pcall(require, "notify")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "chris.icons"
|
||||
|
||||
notify.setup {
|
||||
-- Animation style (see below for details)
|
||||
stages = "fade_in_slide_out",
|
||||
|
||||
-- Function called when a new window is opened, use for changing win settings/config
|
||||
on_open = nil,
|
||||
|
||||
-- Function called when a window is closed
|
||||
on_close = nil,
|
||||
|
||||
-- Render function for notifications. See notify-render()
|
||||
render = "default",
|
||||
|
||||
-- Default timeout for notifications
|
||||
timeout = 2000,
|
||||
|
||||
-- For stages that change opacity this is treated as the highlight behind the window
|
||||
-- Set this to either a highlight group or an RGB hex value e.g. "#000000"
|
||||
background_colour = "Normal",
|
||||
|
||||
-- Minimum width for notification windows
|
||||
minimum_width = 10,
|
||||
|
||||
-- Icons for the different levels
|
||||
icons = {
|
||||
ERROR = icons.diagnostics.Error,
|
||||
WARN = icons.diagnostics.Warning,
|
||||
INFO = icons.diagnostics.Information,
|
||||
DEBUG = icons.ui.Bug,
|
||||
TRACE = icons.ui.Pencil,
|
||||
},
|
||||
}
|
||||
|
||||
vim.notify = notify
|
||||
|
||||
local notify_filter = vim.notify
|
||||
vim.notify = function(msg, ...)
|
||||
if msg:match "character_offset must be called" then
|
||||
return
|
||||
end
|
||||
if msg:match "method textDocument" then
|
||||
return
|
||||
end
|
||||
|
||||
notify_filter(msg, ...)
|
||||
end
|
||||
@ -1,8 +0,0 @@
|
||||
local status_ok, numb = pcall(require, "numb")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
numb.setup({
|
||||
show_numbers = true, -- Enable 'number' for the window while peeking
|
||||
show_cursorline = true, -- Enable 'cursorline' for the window while peeking
|
||||
})
|
||||
@ -1,117 +0,0 @@
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||
if not config_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("chris.icons")
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup({
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
ignore_ft_on_setup = {
|
||||
"alpha",
|
||||
},
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = icons.ui.ArrowOpen,
|
||||
arrow_closed = icons.ui.ArrowClosed,
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Information,
|
||||
warning = icons.diagnostics.Warning,
|
||||
error = icons.diagnostics.Error,
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
|
||||
{ key = "h", cb = tree_cb("close_node") },
|
||||
{ key = "v", cb = tree_cb("vsplit") },
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,60 +0,0 @@
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
-- clipboard = "unnamedplus", -- gives nvim access to clipboard
|
||||
cmdheight = 1, -- more space in nvim cmd line
|
||||
completeopt = { "menuone", "noselect" }, -- cmp related
|
||||
conceallevel = 0, -- don't hide `` in md
|
||||
fileencoding = "utf-8",
|
||||
hlsearch = false,
|
||||
ignorecase = true,
|
||||
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
|
||||
pumheight = 10, -- popup menu height
|
||||
showmode = true,
|
||||
smartcase = true,
|
||||
smartindent = true,
|
||||
splitbelow = true,
|
||||
splitright = true,
|
||||
swapfile = false,
|
||||
termguicolors = true,
|
||||
timeoutlen = 500,
|
||||
ttimeoutlen = 10,
|
||||
undofile = true,
|
||||
updatetime = 100,
|
||||
writebackup = false,
|
||||
expandtab = true, -- use spaces instead of tab
|
||||
shiftwidth = 4, -- insert 4 spaces for indentation
|
||||
tabstop = 4, -- insert 4 spaces for tab
|
||||
cursorline = false,
|
||||
number = true,
|
||||
laststatus = 3,
|
||||
showcmd = false,
|
||||
ruler = false,
|
||||
relativenumber = true,
|
||||
numberwidth = 2,
|
||||
signcolumn = "yes",
|
||||
wrap = false,
|
||||
scrolloff = 8,
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17",
|
||||
title = true,
|
||||
spelllang = "en_us",
|
||||
}
|
||||
|
||||
vim.opt.fillchars = vim.opt.fillchars + 'eob: '
|
||||
|
||||
vim.opt.shortmess:append "c"
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
||||
vim.cmd "set colorcolumn=80"
|
||||
vim.cmd [[set iskeyword+=-]]
|
||||
|
||||
-- Disable snipmate plugins to avoid duplicate snippets
|
||||
vim.g.UltiSnipsEnableSnipMate = 0
|
||||
vim.g.UltiSnipsRemoveSelectModeMappings = 0
|
||||
vim.g.UltiSnipsExpandTrigger = "<Tab>"
|
||||
vim.g.UltiSnipsJumpForwardTrigger = "<Tab>"
|
||||
vim.g.UltiSnipsJumpBackwardTrigger = "<S-Tab>"
|
||||
@ -1,165 +0,0 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
})
|
||||
print("Installing packer, please close and reopen Neovim...")
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
end
|
||||
|
||||
-- Autocommand to reload neovime whenever this file is saved.
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]])
|
||||
|
||||
-- use a protected call so there's no error on first use
|
||||
local s_ok, packer = pcall(require, "packer")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup
|
||||
packer.init({
|
||||
max_jobs = 50,
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float({ border = "rounded" })
|
||||
end,
|
||||
prompt_border = "rounded",
|
||||
},
|
||||
})
|
||||
|
||||
-- Add plugins from here
|
||||
return packer.startup(function(use)
|
||||
-- Plugin manager
|
||||
use("wbthomason/packer.nvim") -- Have packer manage inself
|
||||
|
||||
-- Lua Development
|
||||
--use("nvim-lua/plenary.nvim") -- useful lua functions
|
||||
--use("nvim-lua/popup.nvim")
|
||||
--use("folke/neodev.nvim")
|
||||
|
||||
-- LSP
|
||||
use("neovim/nvim-lspconfig") -- enable LSP
|
||||
use("williamboman/mason.nvim") -- language server manager/installer
|
||||
use("williamboman/mason-lspconfig.nvim")
|
||||
use("j-hui/fidget.nvim") -- displays lsp progress in bottom right
|
||||
use("SmiteshP/nvim-navic") -- integrates with winbar to show location in program e.g.: MyClass > MyFunc > MyProperty
|
||||
use("simrat39/symbols-outline.nvim") -- class explorer for nvim
|
||||
use("folke/trouble.nvim") -- view lsp diagnostics
|
||||
use("https://git.sr.ht/~whynothugo/lsp_lines.nvim")
|
||||
use({ -- I'm currently just using this for a functional code action menu for omnisharp, I want to look further into its functions though.
|
||||
"glepnir/lspsaga.nvim",
|
||||
branch = "main",
|
||||
})
|
||||
use("jose-elias-alvarez/null-ls.nvim")
|
||||
|
||||
-- Completion
|
||||
use("hrsh7th/nvim-cmp") -- completion engine
|
||||
use("hrsh7th/cmp-buffer") -- buffer completions
|
||||
use("hrsh7th/cmp-path") -- path completions
|
||||
use("saadparwaiz1/cmp_luasnip") -- snippet completions
|
||||
use("hrsh7th/cmp-nvim-lsp") -- lsp completions
|
||||
use("hrsh7th/cmp-nvim-lua")
|
||||
|
||||
-- Snippet {
|
||||
--use("L3MON4D3/LuaSnip") -- snippet engine
|
||||
--use("rafamadriz/friendly-snippets") -- a collection of useful snippets
|
||||
|
||||
-- Syntax/Treesitter
|
||||
use("nvim-treesitter/nvim-treesitter")
|
||||
use("nvim-treesitter/playground")
|
||||
|
||||
-- CEO of The Startup
|
||||
use("ThePrimeagen/harpoon")
|
||||
|
||||
-- Telescopic Johnston
|
||||
use("nvim-telescope/telescope.nvim")
|
||||
use("nvim-telescope/telescope-media-files.nvim")
|
||||
|
||||
-- Colour
|
||||
use("NvChad/nvim-colorizer.lua")
|
||||
|
||||
-- Colorschemes
|
||||
use("sainnhe/gruvbox-material")
|
||||
use("sainnhe/sonokai")
|
||||
use("dracula/vim")
|
||||
use("RRethy/nvim-base16")
|
||||
|
||||
-- Utility
|
||||
--use("rcarriga/nvim-notify")
|
||||
use("stevearc/dressing.nvim")
|
||||
--use("moll/vim-bbye")
|
||||
--use("lewis6991/impatient.nvim")
|
||||
--use("ghillb/cybu.nvim")
|
||||
--use("mbbill/undotree")
|
||||
--use("MunifTanjim/nui.nvim")
|
||||
-- noice
|
||||
|
||||
-- Icons
|
||||
--use("kyazdani42/nvim-web-devicons")
|
||||
|
||||
-- Debugging
|
||||
use("mfussenegger/nvim-dap")
|
||||
use("rcarriga/nvim-dap-ui")
|
||||
|
||||
-- Tabline
|
||||
-- use("fgheng/winbar.nvim")
|
||||
-- bufferline
|
||||
|
||||
-- Statusline
|
||||
--use("nvim-lualine/lualine.nvim")
|
||||
|
||||
-- Startup
|
||||
--use("goolord/alpha-nvim")
|
||||
|
||||
-- Indent
|
||||
use("lukas-reineke/indent-blankline.nvim")
|
||||
|
||||
-- File Explorer
|
||||
use("kyazdani42/nvim-tree.lua")
|
||||
|
||||
-- Comments
|
||||
use("numToStr/Comment.nvim")
|
||||
use("folke/todo-comments.nvim")
|
||||
|
||||
-- Git
|
||||
use("lewis6991/gitsigns.nvim")
|
||||
use("f-person/git-blame.nvim")
|
||||
use("tpope/vim-fugitive")
|
||||
|
||||
-- Editing Support
|
||||
use("windwp/nvim-autopairs")
|
||||
use("preservim/vim-markdown")
|
||||
use("folke/zen-mode.nvim")
|
||||
use("junegunn/vim-slash")
|
||||
use("andymass/vim-matchup")
|
||||
use("nacro90/numb.nvim")
|
||||
use("monaqa/dial.nvim")
|
||||
use({
|
||||
"abecodes/tabout.nvim",
|
||||
wants = { "nvim-treesitter" },
|
||||
})
|
||||
use("windwp/nvim-spectre")
|
||||
use("tpope/vim-surround")
|
||||
use("danymat/neogen")
|
||||
|
||||
-- Keybinding
|
||||
use("folke/which-key.nvim")
|
||||
|
||||
-- Automatically setup after cloning packer.nvim
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
@ -1,135 +0,0 @@
|
||||
local status_ok, spectre = pcall(require, "spectre")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
spectre.setup({
|
||||
|
||||
color_devicons = true,
|
||||
highlight = {
|
||||
ui = "String",
|
||||
search = "DiffChange",
|
||||
replace = "DiffDelete",
|
||||
},
|
||||
mapping = {
|
||||
["toggle_line"] = {
|
||||
map = "t",
|
||||
cmd = "<cmd>lua require('spectre').toggle_line()<CR>",
|
||||
desc = "toggle current item",
|
||||
},
|
||||
["enter_file"] = {
|
||||
map = "<cr>",
|
||||
cmd = "<cmd>lua require('spectre.actions').select_entry()<CR>",
|
||||
desc = "goto current file",
|
||||
},
|
||||
["send_to_qf"] = {
|
||||
map = "Q",
|
||||
cmd = "<cmd>lua require('spectre.actions').send_to_qf()<CR>",
|
||||
desc = "send all item to quickfix",
|
||||
},
|
||||
["replace_cmd"] = {
|
||||
map = "c",
|
||||
cmd = "<cmd>lua require('spectre.actions').replace_cmd()<CR>",
|
||||
desc = "input replace vim command",
|
||||
},
|
||||
["show_option_menu"] = {
|
||||
map = "o",
|
||||
cmd = "<cmd>lua require('spectre').show_options()<CR>",
|
||||
desc = "show option",
|
||||
},
|
||||
["run_replace"] = {
|
||||
map = "R",
|
||||
cmd = "<cmd>lua require('spectre.actions').run_replace()<CR>",
|
||||
desc = "replace all",
|
||||
},
|
||||
["change_view_mode"] = {
|
||||
map = "m",
|
||||
cmd = "<cmd>lua require('spectre').change_view()<CR>",
|
||||
desc = "change result view mode",
|
||||
},
|
||||
["toggle_ignore_case"] = {
|
||||
map = "I",
|
||||
cmd = "<cmd>lua require('spectre').change_options('ignore-case')<CR>",
|
||||
desc = "toggle ignore case",
|
||||
},
|
||||
["toggle_ignore_hidden"] = {
|
||||
map = "H",
|
||||
cmd = "<cmd>lua require('spectre').change_options('hidden')<CR>",
|
||||
desc = "toggle search hidden",
|
||||
},
|
||||
-- you can put your mapping here it only use normal mode
|
||||
},
|
||||
find_engine = {
|
||||
-- rg is map with finder_cmd
|
||||
["rg"] = {
|
||||
cmd = "rg",
|
||||
-- default args
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
options = {
|
||||
["ignore-case"] = {
|
||||
value = "--ignore-case",
|
||||
icon = "[I]",
|
||||
desc = "ignore case",
|
||||
},
|
||||
["hidden"] = {
|
||||
value = "--hidden",
|
||||
desc = "hidden file",
|
||||
icon = "[H]",
|
||||
},
|
||||
-- you can put any option you want here it can toggle with
|
||||
-- show_option function
|
||||
},
|
||||
},
|
||||
["ag"] = {
|
||||
cmd = "ag",
|
||||
args = {
|
||||
"--vimgrep",
|
||||
"-s",
|
||||
},
|
||||
options = {
|
||||
["ignore-case"] = {
|
||||
value = "-i",
|
||||
icon = "[I]",
|
||||
desc = "ignore case",
|
||||
},
|
||||
["hidden"] = {
|
||||
value = "--hidden",
|
||||
desc = "hidden file",
|
||||
icon = "[H]",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
replace_engine = {
|
||||
["sed"] = {
|
||||
cmd = "sed",
|
||||
args = nil,
|
||||
},
|
||||
options = {
|
||||
["ignore-case"] = {
|
||||
value = "--ignore-case",
|
||||
icon = "[I]",
|
||||
desc = "ignore case",
|
||||
},
|
||||
},
|
||||
},
|
||||
default = {
|
||||
find = {
|
||||
--pick one of item in find_engine
|
||||
cmd = "rg",
|
||||
options = { "ignore-case" },
|
||||
},
|
||||
replace = {
|
||||
--pick one of item in replace_engine
|
||||
cmd = "sed",
|
||||
},
|
||||
},
|
||||
replace_vim_cmd = "cdo",
|
||||
is_open_target_win = true, --open file on opener window
|
||||
is_insert_mode = false, -- start open panel on is_insert_mode
|
||||
})
|
||||
@ -1,50 +0,0 @@
|
||||
local icons = require "chris.icons"
|
||||
vim.g.symbols_outline = {
|
||||
highlight_hovered_item = true,
|
||||
show_guides = true,
|
||||
auto_preview = false,
|
||||
position = "right",
|
||||
width = 40,
|
||||
show_numbers = false,
|
||||
show_relative_numbers = false,
|
||||
show_symbol_details = true,
|
||||
keymaps = { -- These keymaps can be a string or a table for multiple keys
|
||||
close = { "<Esc>", "q" },
|
||||
goto_location = "<Cr>",
|
||||
focus_location = "o",
|
||||
hover_symbol = "<C-space>",
|
||||
toggle_preview = "K",
|
||||
rename_symbol = "r",
|
||||
code_actions = "a",
|
||||
},
|
||||
lsp_blacklist = {},
|
||||
symbol_blacklist = {},
|
||||
symbols = {
|
||||
File = { icon = icons.documents.File, hl = "CmpItemKindFile" },
|
||||
Module = { icon = icons.kind.Module, hl = "CmpItemKindModule" },
|
||||
Namespace = { icon = icons.kind.Module, hl = "CmpItemKindModule" },
|
||||
Package = { icon = icons.kind.Module, hl = "CmpItemKindModule" },
|
||||
Class = { icon = icons.kind.Class, hl = "CmpItemKindClass" },
|
||||
Method = { icon = icons.kind.Method, hl = "CmpItemKindMethod" },
|
||||
Property = { icon = icons.kind.Property, hl = "CmpItemKindProperty" },
|
||||
Field = { icon = icons.kind.Field, hl = "CmpItemKindField" },
|
||||
Constructor = { icon = icons.kind.Constructor, hl = "CmpItemKindConstructor" },
|
||||
Enum = { icon = icons.kind.Enum, hl = "CmpItemKindEnum" },
|
||||
Interface = { icon = icons.kind.Interface, hl = "CmpItemKindInterface" },
|
||||
Function = { icon = icons.kind.Function, hl = "CmpItemKindFunction" },
|
||||
Variable = { icon = icons.kind.Variable, hl = "CmpItemKindVariable" },
|
||||
Constant = { icon = icons.kind.Constant, hl = "CmpItemKindConstant" },
|
||||
String = { icon = icons.type.String, hl = "TSString" },
|
||||
Number = { icon = icons.type.Number, hl = "TSNumber" },
|
||||
Boolean = { icon = icons.type.Boolean, hl = "TSBoolean" },
|
||||
Array = { icon = icons.type.Array, hl = "TSKeyword" },
|
||||
Object = { icon = icons.type.Object, hl = "TSKeyword" },
|
||||
Key = { icon = icons.kind.Keyword, hl = "CmpItemKeyword" },
|
||||
Null = { icon = "NULL", hl = "TSKeyword" },
|
||||
EnumMember = { icon = icons.kind.EnumMember, hl = "CmpItemKindEnumMember" },
|
||||
Struct = { icon = icons.kind.Struct, hl = "CmpItemKindStruct" },
|
||||
Event = { icon = icons.kind.Event, hl = "CmpItemKindEvent" },
|
||||
Operator = { icon = icons.kind.Operator, hl = "CmpItemKindOperator" },
|
||||
TypeParameter = { icon = icons.kind.TypeParameter, hl = "CmpItemKindTypeParameter" },
|
||||
},
|
||||
}
|
||||
@ -1,128 +0,0 @@
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
local icons = require("chris.icons")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
|
||||
prompt_prefix = icons.ui.Telescope .. " > ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
"target/",
|
||||
"docs/",
|
||||
"vendor/*",
|
||||
"%.lock",
|
||||
"__pycache__/*",
|
||||
"%.sqlite3",
|
||||
"%.ipynb",
|
||||
"node_modules/*",
|
||||
"%.svg",
|
||||
"%.otf",
|
||||
"%.ttf",
|
||||
"%.webp",
|
||||
".dart_tool/",
|
||||
".github/",
|
||||
".gradle/",
|
||||
".idea/",
|
||||
".settings/",
|
||||
".vscode/",
|
||||
"__pycache__/",
|
||||
"build/",
|
||||
"env/",
|
||||
"gradle/",
|
||||
"node_modules/",
|
||||
"%.pdb",
|
||||
"%.dll",
|
||||
"%.class",
|
||||
"%.exe",
|
||||
"%.cache",
|
||||
"%.ico",
|
||||
"%.pdf",
|
||||
"%.dylib",
|
||||
"%.jar",
|
||||
"%.docx",
|
||||
"%.met",
|
||||
"smalljre_*/*",
|
||||
".vale/",
|
||||
"%.burp",
|
||||
"%.mp4",
|
||||
"%.mkv",
|
||||
"%.rar",
|
||||
"%.zip",
|
||||
"%.7z",
|
||||
"%.tar",
|
||||
"%.bz2",
|
||||
"%.epub",
|
||||
"%.flac",
|
||||
"%.tar.gz",
|
||||
},
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-s>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<c-d>"] = require("telescope.actions").delete_buffer,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-h>"] = actions.which_key, -- keys from pressing <C-h>
|
||||
["<esc>"] = actions.close,
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
["q"] = actions.close,
|
||||
["dd"] = require("telescope.actions").delete_buffer,
|
||||
["s"] = actions.select_horizontal,
|
||||
["v"] = actions.select_vertical,
|
||||
["t"] = actions.select_tab,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,58 +0,0 @@
|
||||
local status_ok, todo_comments = pcall(require, "todo-comments")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "chris.icons"
|
||||
|
||||
local error_red = "#F44747"
|
||||
local warning_orange = "#ff8800"
|
||||
local info_yellow = "#FFCC66"
|
||||
local hint_blue = "#4FC1FF"
|
||||
local perf_purple = "#7C3AED"
|
||||
local note_green = '#10B981'
|
||||
|
||||
todo_comments.setup {
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
keywords = {
|
||||
FIX = {
|
||||
icon = icons.ui.Bug, -- icon used for the sign, and in search results
|
||||
color = error_red, -- can be a hex color, or a named color (see below)
|
||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||
},
|
||||
TODO = { icon = icons.ui.Check, color = hint_blue, alt = { "TIP" } },
|
||||
HACK = { icon = icons.ui.Fire, color = warning_orange },
|
||||
WARN = { icon = icons.diagnostics.Warning, color = warning_orange },
|
||||
PERF = { icon = icons.ui.Dashboard, color = perf_purple },
|
||||
NOTE = { icon = icons.ui.Note, color = note_green, alt = { "INFO" } },
|
||||
},
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
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)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = { "markdown" }, -- list of file types to exclude highlighting
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (keywords) placeholder
|
||||
pattern = [[\b(keywords):]], -- ripgrep regex
|
||||
-- pattern = [[\b(keywords)\b]], -- match without the extra colon. you'll likely get false positives
|
||||
},
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = "all", -- one of "all" or a list of languages
|
||||
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
|
||||
ignore_install = { "phpdoc" }, -- List of parsers to ignore installing
|
||||
matchup = {
|
||||
enable = true, -- mandatory, false will disable the whole extension
|
||||
disable_virtual_text = true,
|
||||
disable = { "html" }, -- optional, list of language that will be disabled
|
||||
},
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "markdown" }, -- list of language that will be disabled
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "python", "css", "rust" } },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
disable = { "xml", "markdown" },
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = false,
|
||||
colors = {
|
||||
-- "#68a0b0",
|
||||
-- "#946EaD",
|
||||
-- "#c7aA6D",
|
||||
"Gold",
|
||||
"Orchid",
|
||||
"DodgerBlue",
|
||||
-- "Cornsilk",
|
||||
-- "Salmon",
|
||||
-- "LawnGreen",
|
||||
},
|
||||
disable = { "html" },
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["at"] = "@class.outer",
|
||||
["it"] = "@class.inner",
|
||||
["ac"] = "@call.outer",
|
||||
["ic"] = "@call.inner",
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ai"] = "@conditional.outer",
|
||||
["ii"] = "@conditional.inner",
|
||||
["a/"] = "@comment.outer",
|
||||
["i/"] = "@comment.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ib"] = "@block.inner",
|
||||
["as"] = "@statement.outer",
|
||||
["is"] = "@scopename.inner",
|
||||
["aA"] = "@attribute.outer",
|
||||
["iA"] = "@attribute.inner",
|
||||
["aF"] = "@frame.outer",
|
||||
["iF"] = "@frame.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>."] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>,"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,246 +0,0 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local setup = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
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?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
["<leader>"] = "SPC",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<C-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<C-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "center", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = false, -- show help message on the command line when the popup is visible
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local m_opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "m",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local m_mappings = {
|
||||
m = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
|
||||
l = { '<cmd>lua require("harpoon.ui").nav_next()<cr>', "Harpoon Next" },
|
||||
h = { '<cmd>lua require("harpoon.ui").nav_prev()<cr>', "Harpoon Prev" },
|
||||
s = { "<cmd>Telescope harpoon marks<cr>", "Search Files" },
|
||||
u = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
|
||||
|
||||
["1"] = { '<cmd> lua require("harpoon.ui").nav_file(1)<cr>', "Goto 1" },
|
||||
["2"] = { '<cmd> lua require("harpoon.ui").nav_file(2)<cr>', "Goto 2" },
|
||||
["3"] = { '<cmd> lua require("harpoon.ui").nav_file(3)<cr>', "Goto 3" },
|
||||
["4"] = { '<cmd> lua require("harpoon.ui").nav_file(4)<cr>', "Goto 4" },
|
||||
}
|
||||
|
||||
local mappings = {
|
||||
a = { "<cmd>Lspsaga code_action<cr>", "Action" },
|
||||
c = { "<cmd>Bdelete<cr>", "Close Buffer" },
|
||||
H = { "<cmd>split<cr>", "split" },
|
||||
h = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Hover" },
|
||||
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||
O = { "<cmd>setlocal spell! spelllang=en_us<CR>", "Toggle Spelling" },
|
||||
P = { "<cmd>!opout %<cr><cr>", "Preview Document" },
|
||||
q = { '<cmd>lua require("user.functions").smart_quit()<CR>', "Quit" },
|
||||
V = { "<cmd>vsplit<cr>", "vsplit" },
|
||||
w = { "<cmd>w<CR>", "Write" },
|
||||
z = { "<cmd>ZenMode<cr>", "Zen" },
|
||||
["/"] = { '<cmd>lua require("Comment.api").toggle.linewise.current()<CR>', "Comment" },
|
||||
["'"] = { "<cmd>close<CR>", "Close split" },
|
||||
u = { "<cmd>UndoTreeToggle", "Undo Tree" },
|
||||
|
||||
C = {
|
||||
name = "Compiler",
|
||||
c = { "<cmd>w! | !compiler %<cr>", "Compile File" },
|
||||
b = { "<cmd>w! | !pandoc % -t beamer -o presentation.pdf<cr>", "Beamer Presentation" },
|
||||
},
|
||||
|
||||
b = {
|
||||
name = "Buffer",
|
||||
b = { "<cmd>Telescope buffers<cr>", "Telescope" },
|
||||
c = { "<cmd>Bdelete!<cr>", "Close Buffer" },
|
||||
h = { "<cmd>BufferLineCyclePrev<cr>", "Cycle Previous" },
|
||||
l = { "<cmd>BufferLineCycleNext<cr>", "Cycle Next" },
|
||||
p = { "<cmd>BufferLinePickClose", "Pick Close" },
|
||||
},
|
||||
|
||||
p = {
|
||||
name = "Packer",
|
||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
||||
S = { "<cmd>PackerStatus<cr>", "Status" },
|
||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
||||
},
|
||||
|
||||
o = {
|
||||
name = "Options",
|
||||
c = { "<cmd>lua vim.g.cmp_active=false<cr>", "Completion off" },
|
||||
C = { "<cmd>lua vim.g.cmp_active=true<cr>", "Completion on" },
|
||||
w = { '<cmd>lua require("user.functions").toggle_option("wrap")<cr>', "Wrap" },
|
||||
r = { '<cmd>lua require("user.functions").toggle_option("relativenumber")<cr>', "Relative" },
|
||||
l = { '<cmd>lua require("user.functions").toggle_option("cursorline")<cr>', "Cursorline" },
|
||||
s = { '<cmd>lua require("user.functions").toggle_option("spell")<cr>', "Spell" },
|
||||
t = { '<cmd>lua require("user.functions").toggle_tabline()<cr>', "Tabline" },
|
||||
},
|
||||
|
||||
r = {
|
||||
name = "Replace",
|
||||
r = { "<cmd>lua require('spectre').open()<cr>", "Replace" },
|
||||
w = { "<cmd>lua require('spectre').open_visual({select_word=true})<cr>", "Replace Word" },
|
||||
f = { "<cmd>lua require('spectre').open_file_search()<cr>", "Replace Buffer" },
|
||||
},
|
||||
|
||||
d = {
|
||||
name = "Debug",
|
||||
b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Breakpoint" },
|
||||
c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
|
||||
i = { "<cmd>lua require'dap'.step_into()<cr>", "Into" },
|
||||
o = { "<cmd>lua require'dap'.step_over()<cr>", "Over" },
|
||||
O = { "<cmd>lua require'dap'.step_out()<cr>", "Out" },
|
||||
r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Repl" },
|
||||
l = { "<cmd>lua require'dap'.run_last()<cr>", "Last" },
|
||||
u = { "<cmd>lua require'dapui'.toggle()<cr>", "UI" },
|
||||
x = { "<cmd>lua require'dap'.terminate()<cr>", "Exit" },
|
||||
},
|
||||
|
||||
f = {
|
||||
name = "Find",
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find files" },
|
||||
t = { "<cmd>Telescope live_grep<cr>", "Find Text" },
|
||||
s = { "<cmd>Telescope grep_string<cr>", "Find String" },
|
||||
h = { "<cmd>Telescope help_tags<cr>", "Help" },
|
||||
H = { "<cmd>Telescope highlights<cr>", "Highlights" },
|
||||
l = { "<cmd>Telescope resume<cr>", "Last Search" },
|
||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||
r = { "<cmd>Telescope oldfiles<cr>", "Recent File" },
|
||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
|
||||
C = { "<cmd>Telescope commands<cr>", "Commands" },
|
||||
},
|
||||
|
||||
g = {
|
||||
name = "Git",
|
||||
g = { "<cmd>Git<CR>", "Git" },
|
||||
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
|
||||
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
|
||||
l = { "<cmd>GitBlameToggle<cr>", "Blame" },
|
||||
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
|
||||
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
|
||||
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
|
||||
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
|
||||
u = {
|
||||
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
|
||||
"Undo Stage Hunk",
|
||||
},
|
||||
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
|
||||
d = {
|
||||
"<cmd>Gitsigns diffthis HEAD<cr>",
|
||||
"Diff",
|
||||
},
|
||||
},
|
||||
|
||||
l = {
|
||||
name = "LSP",
|
||||
a = { "<cmd>Lspsaga code_action<cr>", "Code Action" },
|
||||
t = { "<cmd>TroubleToggle document_diagnostics<cr>", "Diagnostics" },
|
||||
d = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Definition" },
|
||||
w = {
|
||||
"<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||
"Workspace Diagnostics",
|
||||
},
|
||||
f = { "<cmd>lua vim.lsp.buf.format({ async = true })<cr>", "Format" },
|
||||
F = { "<cmd>LspToggleAutoFormat<cr>", "Toggle Autoformat" },
|
||||
h = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Hover" },
|
||||
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Implementation" },
|
||||
I = { "<cmd>LspInfo<cr>", "Info" },
|
||||
j = {
|
||||
"<cmd>lua vim.diagnostic.goto_next({buffer=0})<CR>",
|
||||
"Next Diagnostic",
|
||||
},
|
||||
k = {
|
||||
"<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>",
|
||||
"Prev Diagnostic",
|
||||
},
|
||||
v = { "<cmd>lua require('lsp_lines').toggle()<cr>", "Virtual Text" },
|
||||
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
|
||||
o = { "<cmd>SymbolsOutline<cr>", "Outline" },
|
||||
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
|
||||
R = { "<cmd>TroubleToggle lsp_references<cr>", "References" },
|
||||
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
|
||||
S = {
|
||||
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
|
||||
"Workspace Symbols",
|
||||
},
|
||||
T = { '<cmd>lua require("user.functions").toggle_diagnostics()<cr>', "Toggle Diagnostics" },
|
||||
u = { "<cmd>LuaSnipUnlinkCurrent<cr>", "Unlink Snippet" },
|
||||
M = { "<cmd>Mason<cr>", "Open Mason UI" },
|
||||
},
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
which_key.register(mappings, opts)
|
||||
which_key.register(m_mappings, m_opts)
|
||||
@ -1,40 +0,0 @@
|
||||
local status_ok, winbar = pcall(require, "winbar")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
winbar.setup({
|
||||
enabled = true,
|
||||
|
||||
show_file_path = false,
|
||||
show_symbols = true,
|
||||
|
||||
colors = {
|
||||
path = '', -- You can customize colors like #c946fd
|
||||
file_name = '',
|
||||
symbols = '',
|
||||
},
|
||||
|
||||
icons = {
|
||||
file_icon_default = '',
|
||||
seperator = '>',
|
||||
editor_state = '●',
|
||||
lock_icon = '',
|
||||
},
|
||||
|
||||
exclude_filetype = {
|
||||
'help',
|
||||
'startify',
|
||||
'dashboard',
|
||||
'packer',
|
||||
'neogitstatus',
|
||||
'NvimTree',
|
||||
'Trouble',
|
||||
'alpha',
|
||||
'lir',
|
||||
'Outline',
|
||||
'spectre_panel',
|
||||
'toggleterm',
|
||||
'qf',
|
||||
}
|
||||
})
|
||||
@ -1,40 +0,0 @@
|
||||
local status_ok, zen_mode = pcall(require, "zen-mode")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
zen_mode.setup {
|
||||
window = {
|
||||
backdrop = 1,
|
||||
height = 0.9,
|
||||
width = 80,
|
||||
options = {
|
||||
signcolumn = "no",
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
cursorline = true,
|
||||
cursorcolumn = false, -- disable cursor column
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
gitsigns = { enabled = false },
|
||||
tmux = { enabled = false },
|
||||
twilight = { enabled = false },
|
||||
},
|
||||
on_open = function()
|
||||
vim.g.cmp_active = false
|
||||
vim.cmd [[LspStop]]
|
||||
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
if vim.fn.exists("#" .. "_winbar") == 1 then
|
||||
vim.cmd("au! " .. "_winbar")
|
||||
end
|
||||
end,
|
||||
on_close = function()
|
||||
vim.g.cmp_active = true
|
||||
vim.cmd [[LspStart]]
|
||||
require("user.winbar").create_winbar()
|
||||
end,
|
||||
}
|
||||
@ -5,7 +5,6 @@ return {
|
||||
event = "BufReadPre",
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||
{ "folke/neodev.nvim", config = true },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
|
||||
@ -19,9 +19,6 @@ return {
|
||||
{
|
||||
"nvim-lua/popup.nvim",
|
||||
},
|
||||
{
|
||||
"folke/neodev.nvim",
|
||||
},
|
||||
-- {
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- opts = {
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
return {
|
||||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
picker = "telescope",
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("zk").setup(opts)
|
||||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
picker = "telescope",
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("zk").setup(opts)
|
||||
|
||||
local function yankName(options, picker_options)
|
||||
require("zk").pick_notes(options, picker_options, function(notes)
|
||||
local pos = vim.api.nvim_win_get_cursor(0)[2]
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local function yankName(options, picker_options)
|
||||
require("zk").pick_notes(options, picker_options, function(notes)
|
||||
local pos = vim.api.nvim_win_get_cursor(0)[2]
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
|
||||
if picker_options.multi_select == false then
|
||||
notes = { notes }
|
||||
end
|
||||
for _, note in ipairs(notes) do
|
||||
if picker_options.multi_select == false then
|
||||
notes = { notes }
|
||||
end
|
||||
for _, note in ipairs(notes) do
|
||||
-- stylua: ignore
|
||||
local nline = line:sub(0, pos) .. note.title .. " - " .. note.path .. line:sub(pos + 1)
|
||||
vim.api.nvim_set_current_line(nline)
|
||||
end
|
||||
end)
|
||||
end
|
||||
local nline = line:sub(0, pos) .. note.title .. " - " .. note.path .. line:sub(pos + 1)
|
||||
vim.api.nvim_set_current_line(nline)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
require("zk.commands").add("ZkInsertLink", function(options)
|
||||
yankName(options, { title = "Zk Yank" })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
require("zk.commands").add("ZkInsertLink", function(options)
|
||||
yankName(options, { title = "Zk Yank" })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user