a bit sloppy but working

This commit is contained in:
LuKe Tidd 2022-06-17 21:39:40 -04:00
parent 07d85081aa
commit 142017e051
45 changed files with 3521 additions and 9 deletions

View File

@ -1,10 +1,18 @@
require "paq" {
"savq/paq-nvim"; -- this own plugin
-- References to ./lua/
-- Plugin management via Packer
vim.opt.termguicolors=true
require("plugins")
-- Vim mappings, see lua/config/which.lua for more mappings
-- require("mappings")
-- All non plugin related (vim) options
-- require("options")
-- Vim autocommands/autogroups
-- require("autocmd")
"neovim/nvim-lspconfig";
--"hrsh7th/nvim-cmp";
-- {"lervag/vimtex", opt=true}; -- Use braces when passing options
}
require'lspconfig'.gopls.setup{}
-- enable filetype.lua
-- This feature is currently opt-in
-- as it does not yet completely match all of the filetypes covered by filetype.vim
-- status: https://github.com/neovim/neovim/issues/18604
vim.g.do_filetype_lua = 1
-- disable filetype.vim
vim.g.did_load_filetypes = 0

65
lua/autocmd.lua Normal file
View File

@ -0,0 +1,65 @@
local api = vim.api
local settings = require("user-conf")
--- Remove all trailing whitespace on save
--local TrimWhiteSpaceGrp = api.nvim_create_augroup("TrimWhiteSpaceGrp", { clear = true })
--api.nvim_create_autocmd("BufWritePre", {
-- command = [[:%s/\s\+$//e]],
-- group = TrimWhiteSpaceGrp,
--})
-- don't auto comment new line
api.nvim_create_autocmd("BufEnter", { command = [[set formatoptions-=cro]] })
-- Close nvim if NvimTree is only running buffer
api.nvim_create_autocmd(
"BufEnter",
{ command = [[if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]] }
)
-- Highlight on yank
local yankGrp = api.nvim_create_augroup("YankHighlight", { clear = true })
api.nvim_create_autocmd("TextYankPost", {
command = "silent! lua vim.highlight.on_yank()",
group = yankGrp,
})
-- go to last loc when opening a buffer
api.nvim_create_autocmd(
"BufReadPost",
{ command = [[if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g`\"" | endif]] }
)
-- windows to close with "q"
api.nvim_create_autocmd(
"FileType",
{ pattern = { "help", "startuptime", "qf", "lspinfo" }, command = [[nnoremap <buffer><silent> q :close<CR>]] }
)
api.nvim_create_autocmd("FileType", { pattern = "man", command = [[nnoremap <buffer><silent> q :quit<CR>]] })
-- show cursor line only in active window
local cursorGrp = api.nvim_create_augroup("CursorLine", { clear = true })
api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
pattern = "*",
command = "set cursorline",
group = cursorGrp,
})
api.nvim_create_autocmd(
{ "InsertEnter", "WinLeave" },
{ pattern = "*", command = "set nocursorline", group = cursorGrp }
)
-- Enable spell checking for certain file types
api.nvim_create_autocmd(
{ "BufRead", "BufNewFile" },
{ pattern = { "*.txt", "*.md", "*.tex" }, command = "setlocal spell" }
)
if settings.packer_auto_sync then
-- source plugins.lua and run PackerSync on save
local sync_packer = function()
vim.cmd("runtime lua/plugins.lua")
require("packer").sync()
end
api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = { "plugins.lua" },
callback = sync_packer,
})
end

180
lua/config/alpha-nvim.lua Normal file
View File

@ -0,0 +1,180 @@
-- adopted from https://github.com/AdamWhittingham/vim-config/blob/nvim/lua/config/startup_screen.lua
local status_ok, alpha = pcall(require, "alpha")
if not status_ok then
return
end
local path_ok, path = pcall(require, "plenary.path")
if not path_ok then
return
end
local dashboard = require("alpha.themes.dashboard")
local nvim_web_devicons = require("nvim-web-devicons")
local cdir = vim.fn.getcwd()
local function get_extension(fn)
local match = fn:match("^.+(%..+)$")
local ext = ""
if match ~= nil then
ext = match:sub(2)
end
return ext
end
local function icon(fn)
local nwd = require("nvim-web-devicons")
local ext = get_extension(fn)
return nwd.get_icon(fn, ext, { default = true })
end
local function file_button(fn, sc, short_fn)
short_fn = short_fn or fn
local ico_txt
local fb_hl = {}
local ico, hl = icon(fn)
local hl_option_type = type(nvim_web_devicons.highlight)
if hl_option_type == "boolean" then
if hl and nvim_web_devicons.highlight then
table.insert(fb_hl, { hl, 0, 1 })
end
end
if hl_option_type == "string" then
table.insert(fb_hl, { nvim_web_devicons.highlight, 0, 1 })
end
ico_txt = ico .. " "
local file_button_el = dashboard.button(sc, ico_txt .. short_fn, "<cmd>e " .. fn .. " <CR>")
local fn_start = short_fn:match(".*/")
if fn_start ~= nil then
table.insert(fb_hl, { "Comment", #ico_txt - 2, #fn_start + #ico_txt - 2 })
end
file_button_el.opts.hl = fb_hl
return file_button_el
end
local default_mru_ignore = { "gitcommit" }
local mru_opts = {
ignore = function(path, ext)
return (string.find(path, "COMMIT_EDITMSG")) or (vim.tbl_contains(default_mru_ignore, ext))
end,
}
--- @param start number
--- @param cwd string optional
--- @param items_number number optional number of items to generate, default = 10
local function mru(start, cwd, items_number, opts)
opts = opts or mru_opts
items_number = items_number or 9
local oldfiles = {}
for _, v in pairs(vim.v.oldfiles) do
if #oldfiles == items_number then
break
end
local cwd_cond
if not cwd then
cwd_cond = true
else
cwd_cond = vim.startswith(v, cwd)
end
local ignore = (opts.ignore and opts.ignore(v, get_extension(v))) or false
if (vim.fn.filereadable(v) == 1) and cwd_cond and not ignore then
oldfiles[#oldfiles + 1] = v
end
end
local special_shortcuts = { "a", "s", "d" }
local target_width = 35
local tbl = {}
for i, fn in ipairs(oldfiles) do
local short_fn
if cwd then
short_fn = vim.fn.fnamemodify(fn, ":.")
else
short_fn = vim.fn.fnamemodify(fn, ":~")
end
if #short_fn > target_width then
short_fn = path.new(short_fn):shorten(1, { -2, -1 })
if #short_fn > target_width then
short_fn = path.new(short_fn):shorten(1, { -1 })
end
end
local shortcut = ""
if i <= #special_shortcuts then
shortcut = special_shortcuts[i]
else
shortcut = tostring(i + start - 1 - #special_shortcuts)
end
local file_button_el = file_button(fn, " " .. shortcut, short_fn)
tbl[i] = file_button_el
end
return {
type = "group",
val = tbl,
opts = {},
}
end
local section_mru = {
type = "group",
val = {
{
type = "text",
val = "Recent files",
opts = {
hl = "SpecialComment",
shrink_margin = false,
position = "center",
},
},
{ type = "padding", val = 1 },
{
type = "group",
val = function()
return { mru(1, cdir, 9) }
end,
opts = { shrink_margin = false },
},
},
}
local buttons = {
type = "group",
val = {
{ type = "text", val = "Quick links", opts = { hl = "SpecialComment", position = "center" } },
{ type = "padding", val = 1 },
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
dashboard.button("b", " File Browser", ":Telescope file_browser <CR>"),
dashboard.button("F", " Find text", ":Telescope live_grep <CR>"),
dashboard.button("p", " Search projects", ":Telescope projects<CR>"),
dashboard.button("z", " Search Zoxide", ":Telescope zoxide list<CR>"),
dashboard.button("r", " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("g", " NeoGit", ":Neogit <CR>"),
dashboard.button("c", " Configuration", ":e ~/.config/nvim/ <CR>"),
dashboard.button("u", " Update plugins", ":PackerSync<CR>"),
dashboard.button("q", " Quit", ":qa<CR>"),
},
position = "center",
}
local opts = {
layout = {
{ type = "padding", val = 2 },
section_mru,
{ type = "padding", val = 2 },
buttons,
},
opts = {
margin = 5,
},
}
alpha.setup(opts)

75
lua/config/bufferline.lua Normal file
View File

@ -0,0 +1,75 @@
local utils = require("functions")
require("bufferline").setup({
options = {
numbers = function(opts)
return string.format("%s", opts.id) -- :h bufferline-numbers
end,
-- packer.nvim: Error running config for nvim-bufferline.lua: /home/luke/.config/nvim/lua/config/bufferline.lua:7: attempt to index local 'utils' (a boolean value)
-- close_command = utils.bufdelete, -- 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"
indicator_icon = " ",
buffer_close_icon = "",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
tab_size = 18,
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level)
local icon = level:match("error") and "" or ""
return " " .. icon .. count
end,
-- NOTE: this will be called a lot so don't do any heavy processing here
custom_filter = function(buf_number, buf_numbers)
-- filter out filetypes you don't want to see
if vim.bo[buf_number].filetype ~= "qf" then
return true
else
return false
end
-- filter out by buffer name
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
-- return true
-- else
-- return false
-- 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
-- else
-- return false
-- end
-- filter out by it's index number in list (don't show first buffer)
-- if buf_numbers[1] ~= buf_number then
-- return true
-- else
-- return false
-- end
end,
offsets = {
{
filetype = "NvimTree",
text = " File Explorer",
highlight = "Directory",
text_align = "left",
padding = 1,
},
},
show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = false,
show_close_icon = false,
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",
enforce_regular_tabs = false,
always_show_bufferline = false,
sort_by = "id",
},
})

66
lua/config/catppuccin.lua Normal file
View File

@ -0,0 +1,66 @@
local catppuccin = require("catppuccin")
catppuccin.setup({
transparent_background = false,
term_colors = false,
styles = {
comments = "italic",
functions = "italic",
keywords = "italic",
strings = "NONE",
variables = "italic",
},
integrations = {
treesitter = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = "italic",
hints = "italic",
warnings = "italic",
information = "italic",
},
underlines = {
errors = "underline",
hints = "underline",
warnings = "underline",
information = "underline",
},
},
lsp_trouble = false,
cmp = true,
lsp_saga = false,
gitgutter = false,
gitsigns = true,
telescope = true,
nvimtree = {
enabled = true,
show_root = false,
transparent_panel = false,
},
neotree = {
enabled = false,
show_root = false,
transparent_panel = false,
},
which_key = true,
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
dashboard = false,
neogit = true,
vim_sneak = false,
fern = false,
barbar = false,
bufferline = true,
markdown = true,
lightspeed = true,
ts_rainbow = false,
hop = false,
notify = true,
telekasten = true,
symbols_outline = true,
},
})
vim.cmd([[colorscheme catppuccin]])

77
lua/config/cmp.lua Normal file
View File

@ -0,0 +1,77 @@
-- Setup nvim-cmp.
local cmp = require("cmp")
local lspkind = require("lspkind")
cmp.setup({
formatting = {
format = lspkind.cmp_format({
with_text = false,
maxwidth = 50,
mode = "symbol",
menu = {
buffer = "BUF",
rg = "RG",
nvim_lsp = "LSP",
path = "PATH",
luasnip = "SNIP",
calc = "CALC",
spell = "SPELL",
},
}),
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = {
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-u>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
end
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "buffer", keyword_length = 5 },
{ name = "luasnip" },
{ name = "calc" },
{ name = "spell", keyword_length = 5 },
{ name = "path" },
{ name = "rg", keyword_length = 5 },
},
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})

15
lua/config/colorizer.lua Normal file
View File

@ -0,0 +1,15 @@
require'colorizer'.setup()
local status_ok, colorizer = pcall(require, "colorizer")
if not status_ok then
return
end
colorizer.setup({ "*" }, {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
RRGGBBAA = true, -- #RRGGBBAA hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
namess = true, -- "Name" codes like Blue
})

View File

@ -0,0 +1,23 @@
require("comment-box").setup({
box_width = 70, -- width of the boxex
borders = { -- symbols used to draw a box
top = "",
bottom = "",
left = "",
right = "",
top_left = "",
top_right = "",
bottom_left = "",
bottom_right = ""
},
line_width = 70, -- width of the lines
line = { -- symbols used to draw a line
line = "",
line_start = "",
line_end = ""
},
outer_blank_lines = false, -- insert a blank line above and below the box
inner_blank_lines = false, -- insert a blank line above and below the text
line_blank_line_above = false, -- insert a blank line above the line
line_blank_line_below = false -- insert a blank line below the line
})

112
lua/config/diffview.lua Normal file
View File

@ -0,0 +1,112 @@
local cb = require("diffview.config").diffview_callback
require("diffview").setup({
diff_binaries = false, -- Show diffs for binaries
enhanced_diff_hl = false, -- See ':h diffview-config-enhanced_diff_hl'
use_icons = true, -- Requires nvim-web-devicons
icons = { -- Only applies when use_icons is true.
folder_closed = "",
folder_open = "",
},
signs = {
fold_closed = "",
fold_open = "",
},
file_panel = {
listing_style = "tree", -- One of 'list' or 'tree'
tree_options = { -- Only applies when listing_style is 'tree'
flatten_dirs = true, -- Flatten dirs that only contain one single dir
folder_statuses = "only_folded", -- One of 'never', 'only_folded' or 'always'.
},
win_config = { -- See ':h diffview-config-win_config'
position = "left",
width = 35,
},
},
file_history_panel = {
log_options = {
max_count = 256, -- Limit the number of commits
follow = false, -- Follow renames (only for single file)
all = false, -- Include all refs under 'refs/' including HEAD
merges = false, -- List only merge commits
no_merges = false, -- List no merge commits
reverse = false, -- List commits in reverse order
},
win_config = { -- See ':h diffview-config-win_config'
position = "bottom",
height = 16,
},
},
commit_log_panel = {
win_config = {}, -- See ':h diffview-config-win_config'
},
default_args = { -- Default args prepended to the arg-list for the listed commands
DiffviewOpen = {},
DiffviewFileHistory = {},
},
hooks = {}, -- See ':h diffview-config-hooks'
key_bindings = {
disable_defaults = false, -- Disable the default key bindings
-- The `view` bindings are active in the diff buffers, only when the current
-- tabpage is a Diffview.
view = {
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
["gf"] = cb("goto_file"), -- Open the file in a new split in previous tabpage
["<C-w><C-f>"] = cb("goto_file_split"), -- Open the file in a new split
["<C-w>gf"] = cb("goto_file_tab"), -- Open the file in a new tabpage
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
},
file_panel = {
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
["<down>"] = cb("next_entry"),
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
["<up>"] = cb("prev_entry"),
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
["o"] = cb("select_entry"),
["<2-LeftMouse>"] = cb("select_entry"),
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
["S"] = cb("stage_all"), -- Stage all entries.
["U"] = cb("unstage_all"), -- Unstage all entries.
["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
["L"] = cb("open_commit_log"), -- Open the commit log panel.
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["i"] = cb("listing_style"), -- Toggle between 'list' and 'tree' views
["f"] = cb("toggle_flatten_dirs"), -- Flatten empty subdirectories in tree listing style.
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
},
file_history_panel = {
["g!"] = cb("options"), -- Open the option panel
["<C-A-d>"] = cb("open_in_diffview"), -- Open the entry under the cursor in a diffview
["y"] = cb("copy_hash"), -- Copy the commit hash of the entry under the cursor
["L"] = cb("open_commit_log"),
["zR"] = cb("open_all_folds"),
["zM"] = cb("close_all_folds"),
["j"] = cb("next_entry"),
["<down>"] = cb("next_entry"),
["k"] = cb("prev_entry"),
["<up>"] = cb("prev_entry"),
["<cr>"] = cb("select_entry"),
["o"] = cb("select_entry"),
["<2-LeftMouse>"] = cb("select_entry"),
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
},
option_panel = {
["<tab>"] = cb("select"),
["q"] = cb("close"),
},
},
})

2
lua/config/git-blame.lua Normal file
View File

@ -0,0 +1,2 @@
local g = vim.g
g.gitblame_enabled = 0

61
lua/config/gitsigns.lua Normal file
View File

@ -0,0 +1,61 @@
require("gitsigns").setup {
keymaps = {
-- Default keymap options
noremap = false
},
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,
-- git-blame provides also the time in contrast to gitsigns
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
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 = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1
},
diff_opts = {internal = true},
yadm = {enable = false}
}

46
lua/config/go.lua Normal file
View File

@ -0,0 +1,46 @@
-- NOTE: all LSP and formatting related options are disabeld.
-- NOTE: LSP is handled by lsp.lua and formatting is handled by null-ls.lua
require("go").setup({
go = "go", -- go command, can be go[default] or go1.18beta1
goimport = "gopls", -- goimport command, can be gopls[default] or goimport
fillstruct = "gopls", -- can be nil (use fillstruct, slower) and gopls
gofmt = "gofumpt", -- gofmt cmd,
max_line_len = 120, -- max line length in goline format
tag_transform = false, -- tag_transfer check gomodifytags for details
test_template = "", -- default to testify if not set; g:go_nvim_tests_template check gotests for details
test_template_dir = "", -- default to nil if not set; g:go_nvim_tests_template_dir check gotests for details
comment_placeholder = "", -- comment_placeholder your cool placeholder e.g. ﳑ    
icons = { breakpoint = "🧘", currentpos = "🏃" },
verbose = false, -- output loginf in messages
lsp_cfg = true, -- true: use non-default gopls setup specified in go/lsp.lua
-- false: do nothing
-- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g.
-- lsp_cfg = {settings={gopls={matcher='CaseInsensitive', ['local'] = 'your_local_module_path', gofumpt = true }}}
lsp_gofumpt = false, -- true: set default gofmt in gopls format to gofumpt
lsp_on_attach = function(client, bufnr)
require("functions").custom_lsp_attach(client, bufnr)
end, -- nil: use on_attach function defined in go/lsp.lua,
-- when lsp_cfg is true
-- if lsp_on_attach is a function: use this function as on_attach function for gopls
lsp_codelens = true, -- set to false to disable codelens, true by default
lsp_keymaps = false, -- set to false to disable gopls/lsp keymap
lsp_diag_hdlr = true, -- hook lsp diag handler
lsp_diag_virtual_text = { space = 0, prefix = "" }, -- virtual text setup
lsp_diag_signs = true,
lsp_diag_update_in_insert = true,
lsp_document_formatting = false,
-- set to true: use gopls to format
-- false if you want to use other formatter tool(e.g. efm, nulls)
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" }
gopls_remote_auto = true, -- add -remote=auto to gopls
dap_debug = false, -- set to false to disable dap
dap_debug_keymap = false, -- true: use keymap for debugger defined in go/dap.lua
-- false: do not use keymap in go/dap.lua. you must define your own.
dap_debug_gui = true, -- set to true to enable dap gui, highly recommended
dap_debug_vt = true, -- set to true to enable dap virtual text
build_tags = "", -- set default build tags
textobjects = true, -- enable default text jobects through treesittter-text-objects
test_runner = "go", -- richgo, go test, richgo, dlv, ginkgo
run_in_floaterm = false, -- set to true to run in float window.
-- float term recommended if you use richgo/ginkgo with terminal color
})

7
lua/config/harpoon.lua Normal file
View File

@ -0,0 +1,7 @@
require("harpoon").setup({
global_settings = {
save_on_toggle = false,
save_on_change = true,
enter_on_sendcmd = false
}
})

View File

@ -0,0 +1,20 @@
require("indent_blankline").setup {
indentLine_enabled = 1,
char = "",
filetype_exclude = {
"startify", "dashboard", "dotooagenda", "log", "fugitive", "gitcommit",
"packer", "vimwiki", "markdown", "json", "txt", "vista", "help",
"todoist", "NvimTree", "peekaboo", "git", "TelescopePrompt", "undotree",
"flutterToolsOutline", "" -- for all buffers without a file type
},
buftype_exclude = {"terminal", "nofile"},
show_trailing_blankline_indent = false,
show_first_indent_level = true,
show_current_context = true,
char_list = {"|", "¦", "", ""},
space_char = " ",
context_patterns = {
"class", "function", "method", "block", "list_literal", "selector",
"^if", "^table", "if_statement", "while", "for"
}
}

3
lua/config/lf.lua Normal file
View File

@ -0,0 +1,3 @@
local g = vim.g
-- disable default mapping
g.lf_map_keys = 0

64
lua/config/lsp.lua Normal file
View File

@ -0,0 +1,64 @@
local util = require 'lspconfig.util'
local root_files = {
'.luarc.json',
'.luacheckrc',
'.stylua.toml',
'selene.toml',
}
return {
default_config = {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_dir = function(fname)
return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname)
end,
single_file_support = true,
log_level = vim.lsp.protocol.MessageType.Warning,
settings = { Lua = { telemetry = { enable = false } } },
},
docs = {
description = [[
https://github.com/sumneko/lua-language-server
Lua language server.
`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run).
The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`.
If you primarily use `lua-language-server` for Neovim, and want to provide completions,
analysis, and location handling for plugins on runtime path, you can use the following
settings.
Note: that these settings will meaningfully increase the time until `lua-language-server` can service
initial requests (completion, location) upon starting as well as time to first diagnostics.
Completion results will include a workspace indexing progress message until the server has finished indexing.
```lua
require'lspconfig'.sumneko_lua.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
```
See `lua-language-server`'s [documentation](https://github.com/sumneko/lua-language-server/blob/master/locale/en-us/setting.lua) for an explanation of the above fields:
* [Lua.runtime.path](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L5-L13)
* [Lua.workspace.library](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L77-L78)
]],
default_config = {
root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git")]],
},
},
}

62
lua/config/lualine.lua Normal file
View File

@ -0,0 +1,62 @@
local navic = require("nvim-navic")
-- use gitsigns as source info
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
require("lualine").setup({
options = {
theme = "auto",
icons_enabled = true,
disabled_filetypes = {},
always_divide_middle = false,
},
sections = {
lualine_a = { { "b:gitsigns_head", icon = "" }, { "diff", source = diff_source } },
lualine_b = {
{
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn", "info", "hint" },
},
},
lualine_c = {
{
"filetype",
icon_only = true, -- Display only an icon for filetype
},
{
"filename",
file_status = true, -- Displays file status (readonly status, modified status)
path = 1, -- 0: Just the filename 1: Relative path 2: Absolute pathath
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
symbols = { modified = "[]", readonly = "" },
},
{ navic.get_location, cond = navic.is_available },
},
lualine_x = {
"encoding",
"fileformat",
"filesize",
},
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { "nvim-tree", "toggleterm", "quickfix", "symbols-outline" },
})

57
lua/config/luasnip.lua Normal file
View File

@ -0,0 +1,57 @@
local ls = require("luasnip")
local vsc = require("luasnip.loaders.from_vscode")
local lua = require("luasnip.loaders.from_lua")
snip_env = {
s = require("luasnip.nodes.snippet").S,
sn = require("luasnip.nodes.snippet").SN,
t = require("luasnip.nodes.textNode").T,
f = require("luasnip.nodes.functionNode").F,
i = require("luasnip.nodes.insertNode").I,
c = require("luasnip.nodes.choiceNode").C,
d = require("luasnip.nodes.dynamicNode").D,
r = require("luasnip.nodes.restoreNode").R,
l = require("luasnip.extras").lambda,
rep = require("luasnip.extras").rep,
p = require("luasnip.extras").partial,
m = require("luasnip.extras").match,
n = require("luasnip.extras").nonempty,
dl = require("luasnip.extras").dynamic_lambda,
fmt = require("luasnip.extras.fmt").fmt,
fmta = require("luasnip.extras.fmt").fmta,
conds = require("luasnip.extras.expand_conditions"),
types = require("luasnip.util.types"),
events = require("luasnip.util.events"),
parse = require("luasnip.util.parser").parse_snippet,
ai = require("luasnip.nodes.absolute_indexer"),
}
ls.config.set_config({ history = true, updateevents = "TextChanged,TextChangedI" })
-- load friendly-snippets
vsc.lazy_load()
-- load lua snippets
lua.load({ paths = os.getenv("HOME") .. "/.config/nvim/snippets/" })
-- expansion key
-- this will expand the current item or jump to the next item within the snippet.
vim.keymap.set({ "i", "s" }, "<c-j>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
-- jump backwards key.
-- this always moves to the previous item within the snippet
vim.keymap.set({ "i", "s" }, "<c-k>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true })
-- selecting within a list of options.
vim.keymap.set("i", "<c-h>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end)

20
lua/config/mini.lua Normal file
View File

@ -0,0 +1,20 @@
require("mini.surround").setup({
-- Number of lines within which surrounding is searched
n_lines = 50,
-- Duration (in ms) of highlight when calling `MiniSurround.highlight()`
highlight_duration = 500,
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
add = "sa", -- Add surrounding
delete = "sd", -- Delete surrounding
find = "sf", -- Find surrounding (to the right)
find_left = "sF", -- Find surrounding (to the left)
highlight = "sh", -- Highlight surrounding
replace = "sr", -- Replace surrounding
update_n_lines = "sn", -- Update `n_lines`
},
})
require("mini.comment").setup({})

8
lua/config/navigator.lua Normal file
View File

@ -0,0 +1,8 @@
require("Navigator").setup()
local map = vim.api.nvim_set_keymap
local default_options = { noremap = true, silent = true }
-- tmux navigation
map("n", "<C-h>", "<cmd>lua require('Navigator').left()<CR>", default_options)
map("n", "<C-k>", "<cmd>lua require('Navigator').up()<CR>", default_options)
map("n", "<C-l>", "<cmd>lua require('Navigator').right()<CR>", default_options)
map("n", "<C-j>", "<cmd>lua require('Navigator').down()<CR>", default_options)

29
lua/config/neogit.lua Normal file
View File

@ -0,0 +1,29 @@
local neogit = require("neogit")
neogit.setup {
disable_signs = false,
disable_context_highlighting = false,
disable_commit_confirmation = false,
-- customize displayed signs
signs = {
-- { CLOSED, OPENED }
section = {">", "v"},
item = {">", "v"},
hunk = {"", ""}
},
integrations = {diffview = true},
-- override/add mappings
mappings = {
-- modify status buffer mappings
status = {
-- Adds a mapping with "B" as key that does the "BranchPopup" command
-- ["B"] = "BranchPopup",
-- ["C"] = "CommitPopup",
-- ["P"] = "PullPopup",
-- ["S"] = "Stage",
-- ["D"] = "Discard",
-- Removes the default mapping of "s"
-- ["s"] = "",
}
}
}

42
lua/config/nightfox.lua Normal file
View File

@ -0,0 +1,42 @@
-- Default options
require("nightfox").setup({
options = {
-- Compiled file's destination location
compile_path = vim.fn.stdpath("cache") .. "/nightfox",
compile_file_suffix = "_compiled", -- Compiled file suffix
transparent = false, -- Disable setting background
terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
dim_inactive = false, -- Non focused panes set to alternative background
styles = { -- Style to be applied to different syntax groups
comments = "NONE", -- Value is any valid attr-list value `:help attr-list`
functions = "NONE",
keywords = "NONE",
numbers = "NONE",
strings = "NONE",
types = "NONE",
variables = "NONE"
},
inverse = { -- Inverse highlight for different types
match_paren = false,
visual = false,
search = false
},
modules = { -- List of various plugins and additional options
diagnostic = true,
gitsigns = true,
illuminate = true,
lightspeed = true,
native_lsp = true,
neogit = true,
nvimtree = true,
symbol_outline = true,
telescope = true,
treesitter = true,
tsrainbow = true,
whichkey = true
}
}
})
-- setup must be called before loading
vim.cmd("colorscheme nightfox")

26
lua/config/notify.lua Normal file
View File

@ -0,0 +1,26 @@
require("notify").setup({
-- Animation style
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 = 5000,
-- For stages that change opacity this is treated as the highlight behind the window
-- Set this to either a highlight group, an RGB hex value e.g. "#000000" or a function returning an RGB code for dynamic values
background_colour = "#000000",
-- Minimum width for notification windows
minimum_width = 50,
-- Icons for the different levels
icons = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = ""
}
})
vim.notify = require("notify")

27
lua/config/null-ls.lua Normal file
View File

@ -0,0 +1,27 @@
local nls = require("null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
nls.setup({
sources = {
nls.builtins.formatting.stylua,
nls.builtins.diagnostics.eslint,
nls.builtins.formatting.prettier.with({
extra_args = { "--single-quote", "false" },
}),
nls.builtins.formatting.terraform_fmt,
nls.builtins.formatting.black,
nls.builtins.formatting.goimports,
nls.builtins.formatting.gofumpt,
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.formatting({ bufnr = bufnr })
end,
})
end
end,
})

View File

@ -0,0 +1,10 @@
require("nvim-autopairs").setup({
enable_check_bracket_line = false, -- Don't add pairs if it already has a close pair in the same line
ignored_next_char = "[%w%.]", -- will ignore alphanumeric and `.` symbol
check_ts = true, -- use treesitter to check for a pair.
ts_config = {
lua = { "string" }, -- it will not add pair on that treesitter node
javascript = { "template_string" },
java = false, -- don't check treesitter on java
},
})

23
lua/config/nvim-bqf.lua Normal file
View File

@ -0,0 +1,23 @@
require("bqf").setup({
auto_enable = true,
auto_resize_height = true,
preview = {
win_height = 12,
win_vheight = 12,
delay_syntax = 80,
border_chars = { "", "", "", "", "", "", "", "", "" },
should_preview_cb = function(bufnr, qwinid)
local ret = true
local bufname = vim.api.nvim_buf_get_name(bufnr)
local fsize = vim.fn.getfsize(bufname)
if fsize > 100 * 1024 then
-- skip file size greater than 100k
ret = false
elseif bufname:match("^fugitive://") then
-- skip fugitive buffer
ret = false
end
return ret
end,
},
})

165
lua/config/nvim-tree.lua Normal file
View File

@ -0,0 +1,165 @@
local tree_cb = require("nvim-tree.config").nvim_tree_callback
require("nvim-tree").setup({
respect_buf_cwd = true, -- 0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
-- disables netrw completely
disable_netrw = true,
-- hijack netrw window on startup
hijack_netrw = true,
-- open the tree when running this setup function
open_on_setup = false,
-- will not open on setup if the filetype is in this list
ignore_ft_on_setup = {},
-- opens the tree when changing/opening a new tab if the tree wasn't previously opened
open_on_tab = true,
-- hijack the cursor in the tree to put it at the start of the filename
hijack_cursor = true,
-- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually)
update_cwd = true,
filters = {
-- this option hides files and folders starting with a dot `.`
dotfiles = false,
},
-- show lsp diagnostics in the signcolumn
diagnostics = {
enable = true,
show_on_dirs = false,
icons = { hint = "", info = "", warning = "", error = "" },
},
git = { enable = true, ignore = true, timeout = 400 },
-- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file
update_focused_file = {
-- enables the feature
enable = true,
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
-- only relevant when `update_focused_file.enable` is true
update_cwd = true,
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
ignore_list = { ".git", "node_modules", ".cache" },
},
-- configuration options for the system open command (`s` in the tree by default)
system_open = {
-- the command to run this, leaving nil should work in most cases
cmd = nil,
-- the command arguments as a list
args = {},
},
trash = { cmd = "trash-put", require_confirm = true },
actions = {
change_dir = { enable = true, global = false },
open_file = {
quit_on_open = false,
resize_window = false,
window_picker = {
enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = {
"notify",
"packer",
"qf",
"diff",
"fugitive",
"fugitiveblame",
},
buftype = { "nofile", "terminal", "help" },
},
},
},
},
renderer = {
indent_markers = {
enable = true,
icons = {
corner = "",
edge = "",
none = " ",
},
},
icons = {
padding = " ", -- one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font.
symlink_arrow = " >> ", -- defaults to ' ➛ '. used as a separator between symlinks' source and target.
show = {
git = true,
folder = true,
file = true,
folder_arrow = true,
},
glyphs = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
deleted = "",
untracked = "U",
ignored = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
},
},
},
highlight_git = true, -- will enable file highlight for git attributes (can be used without the icons).
highlight_opened_files = "3", -- 0 -> "none" 1 -> "icon" 2 -> "name" 3 -> "all"
add_trailing = true, -- append a trailing slash to folder names
group_empty = true, -- compact folders that only contain a single folder into one node in the file tree
},
view = {
-- show line numbers in tree disabled
number = false,
relativenumber = false,
-- width of the window, can be either a number (columns) or a string in `%`
width = 30,
-- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom'
side = "left",
mappings = {
-- custom only false will merge the list with the default mappings
-- if true, it will only use your list to set the mappings
custom_only = true,
-- list of mappings to set on the tree manually
list = {
{ key = { "<CR>", "o", "<2-LeftMouse>" }, cb = tree_cb("edit") },
{ key = { "<2-RightMouse>", "<C-]>" }, cb = tree_cb("cd") },
{ key = "<C-v>", cb = tree_cb("vsplit") },
{ key = "<C-x>", cb = tree_cb("split") },
{ key = "<C-t>", cb = tree_cb("tabnew") },
{ key = "<", cb = tree_cb("prev_sibling") },
{ key = ">", cb = tree_cb("next_sibling") },
{ key = "P", cb = tree_cb("parent_node") },
{ key = "<BS>", cb = tree_cb("close_node") },
{ key = "<S-CR>", cb = tree_cb("close_node") },
{ key = "<Tab>", cb = tree_cb("preview") },
{ key = "K", cb = tree_cb("first_sibling") },
{ key = "J", cb = tree_cb("last_sibling") },
{ key = "I", cb = tree_cb("toggle_ignored") },
{ key = "H", cb = tree_cb("toggle_dotfiles") },
{ key = "R", cb = tree_cb("refresh") },
{ key = "a", cb = tree_cb("create") },
{ key = "d", cb = tree_cb("remove") },
{ key = "r", cb = tree_cb("rename") },
{ key = "<C-r>", cb = tree_cb("full_rename") },
{ key = "x", cb = tree_cb("cut") },
{ key = "c", cb = tree_cb("copy") },
{ key = "p", cb = tree_cb("paste") },
{ key = "y", cb = tree_cb("copy_name") },
{ key = "Y", cb = tree_cb("copy_path") },
{ key = "gy", cb = tree_cb("copy_absolute_path") },
{ key = "[c", cb = tree_cb("prev_git_item") },
{ key = "]c", cb = tree_cb("next_git_item") },
{ key = "-", cb = tree_cb("dir_up") },
{ key = "s", cb = tree_cb("system_open") },
{ key = "q", cb = tree_cb("close") },
{ key = "g?", cb = tree_cb("toggle_help") },
},
},
},
})

View File

@ -0,0 +1,15 @@
require("nvim-window").setup({
-- The characters available for hinting windows.
chars = {"a", "s", "f", "g", "h", "j", "k", "l"},
-- A group to use for overwriting the Normal highlight group in the floating
-- window. This can be used to change the background color.
normal_hl = "Normal",
-- The highlight group to apply to the line that contains the hint characters.
-- This is used to make them stand out more.
hint_hl = "Bold",
-- The border style to use for the floating window.
border = "single"
})

13
lua/config/project.lua Normal file
View File

@ -0,0 +1,13 @@
require("project_nvim").setup({
patterns = {
".git",
"package.json",
".terraform",
"go.mod",
"requirements.yml",
"pyrightconfig.json",
"pyproject.toml",
},
-- detection_methods = { "lsp", "pattern" },
detection_methods = { "pattern" },
})

20
lua/config/specs.lua Normal file
View File

@ -0,0 +1,20 @@
require("specs").setup({
show_jumps = true,
min_jump = 30,
popup = {
delay_ms = 0, -- delay before popup displays
inc_ms = 10, -- time increments used for fade/resize effects
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
width = 20,
winhl = "PMenu",
fader = require("specs").linear_fader,
resizer = require("specs").shrink_resizer,
},
ignore_filetypes = {},
ignore_buftypes = {
nofile = true,
},
})
-- center and highlight results
vim.keymap.set("n", "n", 'nzz:lua require("specs").show_specs()<CR>', { silent = true })
vim.keymap.set("n", "N", 'Nzz:lua require("specs").show_specs()<CR>', { silent = true })

52
lua/config/symbols.lua Normal file
View File

@ -0,0 +1,52 @@
vim.g.symbols_outline = {
highlight_hovered_item = true,
show_guides = true,
auto_preview = true,
position = "right",
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
relative_width = true,
width = 25,
auto_close = false,
preview_bg_highlight = "Pmenu",
keymaps = {
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 = "", hl = "TSURI"},
Module = {icon = "", hl = "TSNamespace"},
Namespace = {icon = "", hl = "TSNamespace"},
Package = {icon = "", hl = "TSNamespace"},
Class = {icon = "𝓒", hl = "TSType"},
Method = {icon = "ƒ", hl = "TSMethod"},
Property = {icon = "", hl = "TSMethod"},
Field = {icon = "", hl = "TSField"},
Constructor = {icon = "", hl = "TSConstructor"},
Enum = {icon = "", hl = "TSType"},
Interface = {icon = "", hl = "TSType"},
Function = {icon = "", hl = "TSFunction"},
Variable = {icon = "", hl = "TSConstant"},
Constant = {icon = "", hl = "TSConstant"},
String = {icon = "𝓐", hl = "TSString"},
Number = {icon = "#", hl = "TSNumber"},
Boolean = {icon = "", hl = "TSBoolean"},
Array = {icon = "", hl = "TSConstant"},
Object = {icon = "⦿", hl = "TSType"},
Key = {icon = "🔐", hl = "TSType"},
Null = {icon = "NULL", hl = "TSType"},
EnumMember = {icon = "", hl = "TSField"},
Struct = {icon = "𝓢", hl = "TSType"},
Event = {icon = "🗲", hl = "TSType"},
Operator = {icon = "+", hl = "TSOperator"},
TypeParameter = {icon = "𝙏", hl = "TSParameter"}
}
}

122
lua/config/telescope.lua Normal file
View File

@ -0,0 +1,122 @@
local telescope = require("telescope")
local actions = require("telescope.actions")
local action_layout = require("telescope.actions.layout")
local fb_actions = require("telescope").extensions.file_browser.actions
telescope.setup({
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case" or "smart_case"
},
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
file_browser = {
mappings = {
i = {
["<c-n>"] = fb_actions.create,
["<c-r>"] = fb_actions.rename,
-- ["<c-h>"] = actions.which_key,
["<c-h>"] = fb_actions.toggle_hidden,
["<c-x>"] = fb_actions.remove,
["<c-p>"] = fb_actions.move,
["<c-y>"] = fb_actions.copy,
["<c-a>"] = fb_actions.select_all,
},
},
},
},
pickers = {
find_files = {
hidden = true,
},
buffers = {
ignore_current_buffer = true,
sort_lastused = true,
},
-- find_command = { "fd", "--hidden", "--type", "file", "--follow", "--strip-cwd-prefix" },
},
defaults = {
file_ignore_patterns = { "node_modules", ".terraform", "%.jpg", "%.png" },
-- used for grep_string and live_grep
vimgrep_arguments = {
"rg",
"--follow",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--no-ignore",
"--trim",
},
mappings = {
i = {
-- Close on first esc instead of going to normal mode
-- https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/mappings.lua
["<esc>"] = actions.close,
["<C-j>"] = actions.move_selection_next,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.send_selected_to_qflist,
["<C-l>"] = actions.send_to_qflist,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
["<cr>"] = actions.select_default,
["<c-v>"] = actions.select_vertical,
["<c-s>"] = actions.select_horizontal,
["<c-t>"] = actions.select_tab,
["<c-p>"] = action_layout.toggle_preview,
["<c-o>"] = action_layout.toggle_mirror,
["<c-h>"] = actions.which_key,
},
},
prompt_prefix = "> ",
selection_caret = "",
entry_prefix = " ",
multi_icon = "<>",
initial_mode = "insert",
scroll_strategy = "cycle",
selection_strategy = "reset",
sorting_strategy = "descending",
layout_strategy = "horizontal",
layout_config = {
width = 0.95,
height = 0.85,
-- preview_cutoff = 120,
prompt_position = "top",
horizontal = {
preview_width = function(_, cols, _)
if cols > 200 then
return math.floor(cols * 0.4)
else
return math.floor(cols * 0.6)
end
end,
},
vertical = { width = 0.9, height = 0.95, preview_height = 0.5 },
flex = { horizontal = { preview_width = 0.9 } },
},
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
use_less = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
},
})
telescope.load_extension("projects")
telescope.load_extension("fzf")
telescope.load_extension("zoxide")
telescope.load_extension("heading")
telescope.load_extension("file_browser")
telescope.load_extension("packer")
telescope.load_extension("ui-select")

55
lua/config/todo.lua Normal file
View File

@ -0,0 +1,55 @@
require("todo-comments").setup({
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- 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
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- 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 = 1000, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" },
warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" },
info = { "LspDiagnosticsDefaultInformation", "#2563EB" },
hint = { "LspDiagnosticsDefaultHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
},
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
},
})

59
lua/config/toggleterm.lua Normal file
View File

@ -0,0 +1,59 @@
local map = vim.api.nvim_set_keymap
local buf_map = vim.api.nvim_buf_set_keymap
require("toggleterm").setup({
-- size can be a number or function which is passed the current terminal
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = "<C-n>",
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_filetypes = {},
shade_terminals = true,
shading_factor = "1", -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true,
direction = "vertical", -- 'vertical' | 'horizontal' | 'window' | 'float',
close_on_exit = true, -- close the terminal window when the process exits
shell = vim.o.shell, -- change the default shell
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_win_open'
-- see :h nvim_win_open for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
border = "single", -- 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
-- width = <value>,
-- height = <value>,
winblend = 3,
highlights = {
border = "Normal",
background = "Normal",
},
},
})
map("n", "<leader>gt", "<cmd>lua require('functions').gitui_toggle()<CR>i", { noremap = true, silent = true }) -- start gitui
map("t", "<ESC>", "<C-\\><C-n>", { noremap = true, silent = true }) -- back to normal mode in Terminal
-- Better navigation to and from terminal
local set_terminal_keymaps = function()
local opts = { noremap = true }
buf_map(0, "t", "<esc>", [[<C-\><C-n>]], opts)
buf_map(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
buf_map(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
buf_map(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
buf_map(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "term://*",
callback = function()
set_terminal_keymaps()
end,
desc = "Mappings for navigation with a terminal",
})

65
lua/config/treesitter.lua Normal file
View File

@ -0,0 +1,65 @@
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"cmake",
"dockerfile",
"go",
"hcl",
"html",
"java",
"javascript",
"json",
"kotlin",
"latex",
"ledger",
"lua",
"markdown",
"python",
"toml",
"yaml",
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = {}, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = {}, -- list of language that will be disabled
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
scope_incremental = "<CR>",
node_incremental = "<TAB>",
node_decremental = "<S-TAB>",
},
},
endwise = {
enable = true,
},
indent = { enable = true },
autopairs = { 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",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
["ir"] = "@parameter.inner",
["ar"] = "@parameter.outer",
},
},
},
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 2000, -- Do not enable for files with more than specified lines
},
})

16
lua/config/twilight.lua Normal file
View File

@ -0,0 +1,16 @@
require("twilight").setup {
dimming = {
alpha = 0.25, -- amount of dimming
-- we try to get the foreground from the highlight groups or fallback color
color = {"Normal", "#ffffff"},
inactive = false -- when true, other windows will be fully dimmed (unless they contain the same buffer)
},
context = 10, -- amount of lines we will try to show around the current line
treesitter = true, -- use treesitter when available for the filetype
-- treesitter is used to automatically expand the visible text,
-- but you can further control the types of nodes that should always be fully expanded
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
"function", "method", "table", "if_statement"
},
exclude = {} -- exclude these filetypes
}

276
lua/config/which-key.lua Normal file
View File

@ -0,0 +1,276 @@
-- disable v
-- local presets = require("which-key.plugins.presets")
-- presets.operators["v"] = nil
require("which-key").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 = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
motions = true, -- adds help for motions
text_objects = true, -- 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
},
},
-- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
operators = { gc = "Comments" },
key_labels = {
-- override the label used to display some keys. It doesn't effect WK in any other way.
-- For example:
-- ["<space>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
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
},
window = {
border = "single", -- 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]
},
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 = 2, -- spacing between columns
align = "center", -- align columns left, center or right
},
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
hidden = {
"<silent>",
"<cmd>",
"<Cmd>",
"<cr>",
"<CR>",
"call",
"lua",
"require",
"^:",
"^ ",
}, -- hide mapping boilerplate
show_help = false, -- show help message on the command line when the popup is visible
triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
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 wk = require("which-key")
local default_options = { silent = true }
-- register non leader based mappings
wk.register({
ga = { "<Plug>(EasyAlign)", "Align", mode = "x" },
sa = "Add surrounding",
sd = "Delete surrounding",
sh = "Highlight surrounding",
sn = "Surround update n lines",
sr = "Replace surrounding",
sF = "Find left surrounding",
sf = "Replace right surrounding",
ss = { "<Plug>Lightspeed_s", "Search 2-character forward" },
-- SS = {"<Plug>Lightspeed_S", "Search 2-character backward"}
st = { "<cmd>lua require('tsht').nodes()<cr>", "TS hint textobject" },
})
-- Register all leader based mappings
wk.register({
["<Tab>"] = { "<cmd>e#<cr>", "Prev buffer" },
["<leader>"] = {
name = "Leader",
a = { "<cmd>lua print('fasfAS')<cr>", "test" },
},
b = {
name = "Buffers",
b = {
"<cmd>Telescope buffers<cr>",
"Find buffer",
},
a = {
"<cmd>BufferLineCloseLeft<cr><cmd>BufferLineCloseRight<cr>",
"Close all but the current buffer",
},
d = { "<cmd>Bdelete!<CR>", "Close buffer" },
f = { "<cmd>BufferLinePick<cr>", "Pick buffer" },
l = { "<cmd>BufferLineCloseLeft<cr>", "Close all buffers to the left" },
p = { "<cmd>BufferLineMovePrev<cr>", "Move buffer prev" },
n = { "<cmd>BufferLineMoveNext<cr>", "Move buffer next" },
r = {
"<cmd>BufferLineCloseRight<cr>",
"Close all BufferLines to the right",
},
x = {
"<cmd>BufferLineSortByDirectory<cr>",
"Sort BufferLines automatically by directory",
},
L = {
"<cmd>BufferLineSortByExtension<cr>",
"Sort BufferLines automatically by extension",
},
},
f = {
name = "Files",
b = { "<cmd>Telescope file_browser<cr>", "File browser" },
f = {
"<cmd>lua require'telescope.builtin'.find_files()<cr>",
"Find File",
},
l = { "<cmd>Lf<cr>", "Open LF" },
p = { "<cmd>NvimTreeToggle<cr>", "Toggle Tree" },
r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
s = { "<cmd>w<cr>", "Save Buffer" },
T = { "<cmd>NvimTreeFindFile<CR>", "Find in Tree" },
z = { "<cmd>Telescope zoxide list<CR>", "Zoxide" },
},
g = {
name = "Git",
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
l = { "<cmd>Telescope git_commits<cr>", "Log" },
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" },
S = { "<cmd>lua require 'gitsigns'.stage_buffer()<cr>", "Stage Buffer" },
t = "Open Gitui", -- command in toggleterm.lua
n = { "<cmd>Neogit<cr>", "Open Neogit" },
u = {
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
"Undo Stage Hunk",
},
g = { "<cmd>Telescope git_status<cr>", "Open changed file" },
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
B = { "<cmd>GitBlameToggle<cr>", "Toggle Blame" },
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
C = {
"<cmd>Telescope git_bcommits<cr>",
"Checkout commit(current file)",
},
},
h = {
name = "Harpoon",
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "Add file" },
u = {
"<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>",
"Open Menu",
},
["1"] = {
"<cmd>lua require('harpoon.ui').nav_file(1)<cr>",
"Open File 1",
},
["2"] = {
"<cmd>lua require('harpoon.ui').nav_file(1)<cr>",
"Open File 2",
},
["3"] = {
"<cmd>lua require('harpoon.ui').nav_file(1)<cr>",
"Open File 3",
},
["4"] = {
"<cmd>lua require('harpoon.ui').nav_file(1)<cr>",
"Open File 4",
},
},
m = {
name = "Misc",
a = {
"<cmd>lua require'telegraph'.telegraph({cmd='gitui', how='tmux_popup'})<cr>",
"Test Telegraph",
},
d = { "<cmd>lua require('functions').toggle_diagnostics()<cr>", "Toggle Diagnostics" },
l = { "<cmd>source ~/.config/nvim/snippets/*<cr>", "Reload snippets" },
p = { "<cmd>PackerSync<cr>", "PackerSync" },
s = { "<cmd>SymbolsOutline<cr>", "Toggle SymbolsOutline" },
t = { "<cmd>FloatermNew --autoclose=2<cr>", "New Floaterm" },
z = { "<cmd>ZenMode<cr>", "Toggle ZenMode" },
},
q = {
name = "Quickfix",
j = { "<cmd>cnext<cr>", "Next Quickfix Item" },
k = { "<cmd>cprevious<cr>", "Previous Quickfix Item" },
q = { "<cmd>lua require('functions').toggle_qf()<cr>", "Toggle quickfix list" },
t = { "<cmd>TodoQuickFix<cr>", "Show TODOs" },
},
s = {
name = "Search",
C = { "<cmd>CheatSH<cr>", "Cht.sh" },
h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
H = { "<cmd>Telescope heading<cr>", "Find Header" },
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
R = { "<cmd>Telescope registers<cr>", "Registers" },
t = { "<cmd>Telescope live_grep<cr>", "Text" },
s = { "<cmd>Telescope grep_string<cr>", "Text under cursor" },
S = { "<cmd>Telescope symbols<cr>", "Search symbols" },
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
c = { "<cmd>Telescope commands<cr>", "Commands" },
p = { "<cmd>Telescope projects<cr>", "Projects" },
P = { "<cmd>Telescope builtin<cr>", "Builtin pickers" },
z = { "<cmd>Telescope packer<cr>", "Plugins" },
},
w = {
name = "Window",
p = { "<c-w>x", "Swap" },
q = { "<cmd>:q<cr>", "Close" },
s = { "<cmd>:split<cr>", "Horizontal Split" },
t = { "<c-w>t", "Move to new tab" },
["="] = { "<c-w>=", "Equally size" },
v = { "<cmd>:vsplit<cr>", "Verstical Split" },
w = {
"<cmd>lua require('nvim-window').pick()<cr>",
"Choose window to jump",
},
},
x = {
name = "LanguageTool",
c = { "<cmd>GrammarousCheck<cr>", "Grammar check" },
i = { "<Plug>(grammarous-open-info-window)", "Open the info window" },
r = { "<Plug>(grammarous-reset)", "Reset the current check" },
f = { "<Plug>(grammarous-fixit)", "Fix the error under the cursor" },
x = {
"<Plug>(grammarous-close-info-window)",
"Close the information window",
},
e = {
"<Plug>(grammarous-remove-error)",
"Remove the error under the cursor",
},
n = {
"<Plug>(grammarous-move-to-next-error)",
"Move cursor to the next error",
},
p = {
"<Plug>(grammarous-move-to-previous-error)",
"Move cursor to the previous error",
},
d = {
"<Plug>(grammarous-disable-rule)",
"Disable the grammar rule under the cursor",
},
},
z = {
name = "Spelling",
n = { "]s", "Next" },
p = { "[s", "Previous" },
a = { "zg", "Add word" },
f = { "1z=", "Use 1. correction" },
l = { "<cmd>Telescope spell_suggest<cr>", "List corrections" },
},
}, { prefix = "<leader>", mode = "n", default_options })

48
lua/config/zen-mode.lua Normal file
View File

@ -0,0 +1,48 @@
require("zen-mode").setup {
window = {
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 120, -- width of the Zen window
height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = {
-- signcolumn = "no", -- disable signcolumn
-- number = false, -- disable number column
-- relativenumber = false, -- disable relative numbers
-- cursorline = false, -- disable cursorline
-- cursorcolumn = false, -- disable cursor column
-- foldcolumn = "0", -- disable fold column
-- list = false, -- disable whitespace characters
}
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = false, -- disables the ruler text in the cmd line area
showcmd = false -- disables the command in the last line of the screen
},
twilight = {enabled = true}, -- enable to start Twilight when zen mode opens
gitsigns = {enabled = false}, -- disables git signs
tmux = {enabled = true}, -- disables the tmux statusline
-- this will change the font size on kitty when in zen mode
-- to make this work, you need to set the following kitty options:
-- - allow_remote_control socket-only
-- - listen_on unix:/tmp/kitty
kitty = {
enabled = false,
font = "+4" -- font size increment
}
},
-- callback where you can add custom code when the Zen window opens
on_open = function(win)
end,
-- callback where you can add custom code when the Zen window closes
on_close = function()
end
}

172
lua/functions.lua Normal file
View File

@ -0,0 +1,172 @@
local cmd = vim.cmd
local fn = vim.fn
local M = {}
-- check if a variable is not empty nor nil
M.isNotEmpty = function(s)
return s ~= nil and s ~= ""
end
-- toggle quickfixlist
M.toggle_qf = function()
local windows = fn.getwininfo()
local qf_exists = false
for _, win in pairs(windows) do
if win["quickfix"] == 1 then
qf_exists = true
end
end
if qf_exists == true then
cmd("cclose")
return
end
if M.isNotEmpty(fn.getqflist()) then
cmd("copen")
end
end
M.gitui_toggle = function()
local Terminal = require("toggleterm.terminal").Terminal
local gitui = Terminal:new({ cmd = "gitui", direction = "float", hidden = true })
gitui:toggle()
end
-- move over a closing element in insert mode
M.escapePair = function()
local closers = { ")", "]", "}", ">", "'", '"', "`", "," }
local line = vim.api.nvim_get_current_line()
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
local after = line:sub(col + 1, -1)
local closer_col = #after + 1
local closer_i = nil
for i, closer in ipairs(closers) do
local cur_index, _ = after:find(closer)
if cur_index and (cur_index < closer_col) then
closer_col = cur_index
closer_i = i
end
end
if closer_i then
vim.api.nvim_win_set_cursor(0, { row, col + closer_col })
else
vim.api.nvim_win_set_cursor(0, { row, col + 1 })
end
end
diagnostics_active = true -- must be global since this function is called in which.lua
-- toggle diagnostics line
M.toggle_diagnostics = function()
diagnostics_active = not diagnostics_active
if diagnostics_active then
vim.diagnostic.show()
else
vim.diagnostic.hide()
end
end
--@author kikito
---@see https://codereview.stackexchange.com/questions/268130/get-list-of-buffers-from-current-neovim-instance
function M.get_listed_buffers()
local buffers = {}
local len = 0
for buffer = 1, vim.fn.bufnr("$") do
if vim.fn.buflisted(buffer) == 1 then
len = len + 1
buffers[len] = buffer
end
end
return buffers
end
function M.bufdelete(bufnum)
require("bufdelete").bufdelete(bufnum, true)
end
-- when there is no buffer left show Alpha dashboard
vim.api.nvim_create_augroup("alpha_on_empty", { clear = true })
vim.api.nvim_create_autocmd("User", {
pattern = "BDeletePre",
group = "alpha_on_empty",
callback = function(event)
local found_non_empty_buffer = false
local buffers = M.get_listed_buffers()
for _, bufnr in ipairs(buffers) do
if not found_non_empty_buffer then
local name = vim.api.nvim_buf_get_name(bufnr)
local ft = vim.api.nvim_buf_get_option(bufnr, "filetype")
if bufnr ~= event.buf and name ~= "" and ft ~= "Alpha" then
found_non_empty_buffer = true
end
end
end
if not found_non_empty_buffer then
vim.cmd([[:Alpha]])
end
end,
})
function M.custom_lsp_attach(client, bufnr)
-- disable formatting for LSP clients as this is handled by null-ls
client.server_capabilities.document_formatting = false
client.server_capabilities.document_range_formatting = false
-- enable illuminate to intelligently highlight
require("illuminate").on_attach(client)
-- enable navic for displaying current code context
require("nvim-navic").attach(client, bufnr)
-- add lsp-signature TODO: do I need this?
-- require("lsp_signature").on_attach(require("config.lsp-signature").cfg)
-- add LSP specific key mappings to which key
local wk = require("which-key")
local default_options = { silent = true }
wk.register({
l = {
name = "LSP",
D = { "<cmd>lua vim.lsp.buf.declaration()<cr>", "Go To Declaration" },
I = {
"<cmd>lua vim.lsp.buf.implementation()<cr>",
"Show implementations",
},
R = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
d = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Go To Definition" },
e = { "<cmd>Telescope diagnostics bufnr=0<cr>", "Document Diagnostics" },
-- f = { "<cmd>lua vim.lsp.buf.formatting()<cr>", "Format" },
i = { "<cmd>LspInfo<cr>", "Connected Language Servers" },
k = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Hover Commands" },
l = { "<cmd>lua vim.diagnostic.open_float()<CR>", "Line diagnostics" },
n = { "<cmd>lua vim.diagnostic.goto_next()<cr>", "Next Diagnostic" },
p = { "<cmd>lua vim.diagnostic.goto_prev()<cr>", "Prev Diagnostic" },
q = { "<cmd>lua vim.diagnostic.setloclist()<cr>", "Quickfix" },
r = { "<cmd>lua vim.lsp.buf.references()<cr>", "References" },
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
t = { "<cmd>lua vim.lsp.buf.type_definition()<cr>", "Type Definition" },
w = {
name = "workspaces",
a = {
"<cmd>lua vim.lsp.buf.add_workspace_folder()<cr>",
"Add Workspace Folder",
},
d = { "<cmd>Telescope diagnostics<cr>", "Workspace Diagnostics" },
l = {
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<cr>",
"List Workspace Folders",
},
r = {
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<cr>",
"Remove Workspace Folder",
},
s = {
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
"Workspace Symbols",
},
},
},
}, { prefix = "<leader>", mode = "n", default_options })
end
return M

58
lua/mappings.lua Normal file
View File

@ -0,0 +1,58 @@
-- more mappings are defined in `lua/config/which.lua`
local map = vim.keymap.set
local default_options = { silent = true }
local expr_options = { expr = true, silent = true }
--Remap space as leader key
map({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
vim.g.mapleader = " "
--Remap for dealing with visual line wraps
map("n", "k", "v:count == 0 ? 'gk' : 'k'", expr_options)
map("n", "j", "v:count == 0 ? 'gj' : 'j'", expr_options)
-- better indenting
map("v", "<", "<gv", default_options)
map("v", ">", ">gv", default_options)
-- paste over currently selected text without yanking it
map("v", "p", '"_dP', default_options)
-- Tab switch buffer
map("n", "<TAB>", ":BufferLineCycleNext<CR>", default_options)
map("n", "<S-TAB>", ":BufferLineCyclePrev<CR>", default_options)
-- Cancel search highlighting with ESC
map("n", "<ESC>", ":nohlsearch<Bar>:echo<CR>", default_options)
-- Resizing panes
map("n", "<Left>", ":vertical resize +1<CR>", default_options)
map("n", "<Right>", ":vertical resize -1<CR>", default_options)
map("n", "<Up>", ":resize -1<CR>", default_options)
map("n", "<Down>", ":resize +1<CR>", default_options)
-- Autocorrect spelling from previous error
map("i", "<c-f>", "<c-g>u<Esc>[s1z=`]a<c-g>u", default_options)
-- Move selected line / block of text in visual mode
map("x", "K", ":move '<-2<CR>gv-gv", default_options)
map("x", "J", ":move '>+1<CR>gv-gv", default_options)
-- starlite mappings
map("n", "*", function()
return require("starlite").star()
end, default_options)
map("n", "g*", function()
return require("starlite").g_star()
end, default_options)
map("n", "#", function()
return require("starlite").hash()
end, default_options)
map("n", "g#", function()
return require("starlite").g_hash()
end, default_options)
-- move over a closing element in insert mode
map("i", "<C-l>", function()
return require("functions").escapePair()
end, default_options)

16
lua/options.lua Normal file
View File

@ -0,0 +1,16 @@
--require'lspconfig'.gopls.setup{
-- on_attach = function()
-- print("gopls loaded")
-- -- "n" normal mode
-- -- map in normal mode, press K to open buf.hover only in the current buffer
-- vim.keymap.set("n", "K", vim.lsp.buf.hover, {buffer=0})
-- vim.keymap.set("n", "gd", vim.lsp.buf.definition, {buffer=0})
-- -- there is a jump list and tag list
-- -- ctrl+o to go to previous jump entry
-- -- ctrl+t to go to previous tag entry
-- vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, {buffer=0})
-- vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {buffer=0})
-- vim.keymap.set("n", "<leader>df", vim.diagnostic.goto_next, {buffer=0})
--
-- end,
--}

271
lua/plugins.lua Normal file
View File

@ -0,0 +1,271 @@
local settings = require("user-conf")
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
-- returns the require for use in `config` parameter of packer's use
-- expects the name of the config file
local function get_config(name)
return string.format('require("config/%s")', name)
end
-- bootstrap packer if not installed
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({
"git",
"clone",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
print("Installing packer...")
vim.api.nvim_command("packadd packer.nvim")
end
-- initialize and configure packer
local packer = require("packer")
packer.init({
enable = true, -- enable profiling via :PackerCompile profile=true
threshold = 0, -- the amount in ms that a plugins load time must be over for it to be included in the profile
max_jobs = 20, -- Limit the number of simultaneous jobs. nil means no limit. Set to 20 in order to prevent PackerSync form being "stuck" -> https://github.com/wbthomason/packer.nvim/issues/746
-- Have packer use a popup window
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
})
packer.startup(function(use)
-- actual plugins list
use("wbthomason/packer.nvim")
use({
"nvim-telescope/telescope.nvim",
requires = { { "nvim-lua/popup.nvim" }, { "nvim-lua/plenary.nvim" } },
config = get_config("telescope"),
})
use({ "jvgrootveld/telescope-zoxide" })
use({ "crispgm/telescope-heading.nvim" })
use({ "nvim-telescope/telescope-symbols.nvim" })
use({ "nvim-telescope/telescope-file-browser.nvim" })
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
use({ "nvim-telescope/telescope-packer.nvim" })
use({ "nvim-telescope/telescope-ui-select.nvim" })
use({ "kyazdani42/nvim-tree.lua", config = get_config("nvim-tree") })
use({ "numToStr/Navigator.nvim", config = get_config("navigator") })
use({
"nvim-lualine/lualine.nvim",
config = get_config("lualine"),
event = "VimEnter",
requires = { "kyazdani42/nvim-web-devicons", opt = true },
})
use({
"norcalli/nvim-colorizer.lua",
event = "BufReadPre",
config = get_config("colorizer"),
})
use({ "windwp/nvim-autopairs", config = get_config("nvim-autopairs") })
use({
"nvim-treesitter/nvim-treesitter",
config = get_config("treesitter"),
run = ":TSUpdate",
})
-- use("nvim-treesitter/nvim-treesitter-textobjects")
-- use("RRethy/nvim-treesitter-endwise")
use({
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"f3fora/cmp-spell",
"hrsh7th/cmp-calc",
"lukas-reineke/cmp-rg",
"hrsh7th/cmp-nvim-lsp-signature-help",
},
config = get_config("cmp"),
})
use({ "rafamadriz/friendly-snippets" })
use({
"L3MON4D3/LuaSnip",
requires = "saadparwaiz1/cmp_luasnip",
config = get_config("luasnip"),
})
-- requirement for Neogit
use({
"sindrets/diffview.nvim",
cmd = {
"DiffviewOpen",
"DiffviewClose",
"DiffviewToggleFiles",
"DiffviewFocusFiles",
},
config = get_config("diffview"),
})
use({
"TimUntersberger/neogit",
requires = { "nvim-lua/plenary.nvim" },
cmd = "Neogit",
config = get_config("neogit"),
})
use({ "f-person/git-blame.nvim", config = get_config("git-blame") })
use({
"lewis6991/gitsigns.nvim",
requires = { "nvim-lua/plenary.nvim" },
event = "BufReadPre",
config = get_config("gitsigns"),
})
-- use("p00f/nvim-ts-rainbow")
use({
"kevinhwang91/nvim-bqf",
requires = { { "junegunn/fzf", module = "nvim-bqf" }, config = get_config("nvim-bqf") },
})
use({
"akinsho/nvim-bufferline.lua",
requires = "kyazdani42/nvim-web-devicons",
event = "BufReadPre",
config = get_config("bufferline"),
})
use("famiu/bufdelete.nvim")
use({ "neovim/nvim-lspconfig", config = get_config("lsp") })
use({ "onsails/lspkind-nvim", requires = { "famiu/bufdelete.nvim" } })
-- use({
-- "jose-elias-alvarez/null-ls.nvim",
-- requires = { { "nvim-lua/plenary.nvim" } },
-- config = get_config("null-ls"),
-- })
use({
"simrat39/symbols-outline.nvim",
cmd = { "SymbolsOutline" },
config = get_config("symbols"),
})
use({
"lukas-reineke/indent-blankline.nvim",
event = "BufReadPre",
config = [[require("config/indent-blankline")]],
})
use({
"akinsho/nvim-toggleterm.lua",
keys = { "<C-n>", "<leader>fl", "<leader>gt" },
config = get_config("toggleterm"),
})
use({
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = get_config("todo"),
})
use({ "ahmedkhalf/project.nvim", config = get_config("project") })
use("ironhouzi/starlite-nvim")
use({ "folke/which-key.nvim", config = get_config("which-key") })
use("junegunn/vim-easy-align") -- no lua alternative, https://github.com/Vonr/align.nvim not working for me
use({ "rhysd/vim-grammarous", cmd = "GrammarousCheck" })
use({ "RRethy/vim-illuminate" })
use({
"ptzz/lf.vim",
requires = "voldikss/vim-floaterm",
config = get_config("lf"),
})
if settings.theme == "nightfox" then
use({ "EdenEast/nightfox.nvim", config = get_config("nightfox") })
elseif settings.theme == "catppuccino" then
use({ "catppuccin/nvim", as = "catppuccin", config = get_config("catppuccin") })
else
use({ "catppuccin/nvim", as = "catppuccin", config = get_config("catppuccin") })
end
use({
"ThePrimeagen/harpoon",
requires = { "nvim-lua/plenary.nvim" },
config = get_config("harpoon"),
})
use({ "folke/zen-mode.nvim", cmd = "ZenMode", config = get_config("zen-mode") })
use({ "folke/twilight.nvim", config = get_config("twilight") })
use({ "tweekmonster/startuptime.vim" })
use({ "ggandor/lightspeed.nvim" })
use({ "ray-x/go.nvim", config = get_config("go"), ft = { "go" } })
use({ "LudoPinelli/comment-box.nvim", config = get_config("comment-box") })
use({ "rcarriga/nvim-notify", config = get_config("notify") })
use({ "echasnovski/mini.nvim", branch = "stable", config = get_config("mini") })
use({
"https://gitlab.com/yorickpeterse/nvim-window.git",
config = get_config("nvim-window"),
})
use({
"waylonwalker/Telegraph.nvim",
config = function()
require("telegraph").setup({})
end,
})
use({ "rhysd/conflict-marker.vim" })
use({ "edluffy/specs.nvim", config = get_config("specs") })
use({ "mfussenegger/nvim-ts-hint-textobject" })
use({
"goolord/alpha-nvim",
requires = { "kyazdani42/nvim-web-devicons" },
config = get_config("alpha-nvim"),
})
use({ "SmiteshP/nvim-navic" })
use({
"j-hui/fidget.nvim",
config = function()
require("fidget").setup({})
end,
})
end)
-- TODO: ????
-- use {"lukas-reineke/headlines.nvim", config = get_config("headlines")}
-- https://github.com/glepnir/lspsaga.nvim
-- use 'glepnir/lspsaga.nvim'

285
lua/plugins_old Normal file
View File

@ -0,0 +1,285 @@
--require "paq" {
-- "savq/paq-nvim"; -- this own plugin
-- "neovim/nvim-lspconfig";
-- "nvim-lua/plenary.nvim";
-- "nvim-telescope/telescope.nvim";
--
-- --"hrsh7th/nvim-cmp";
-- -- {"lervag/vimtex", opt=true}; -- Use braces when passing options
--}
-- https://github.com/Allaman/nvim/tree/main/lua
local settings = require("user-conf")
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
-- -- returns the require for use in `config` parameter of packer's use
-- -- expects the name of the config file
local function get_config(name)
return string.format('require("config/%s")', name)
end
-- bootstrap packer if not installed
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({
"git",
"clone",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
print("Installing packer...")
vim.api.nvim_command("packadd packer.nvim")
end
-- initialize and configure packer
local packer = require("packer")
packer.init({
enable = true, -- enable profiling via :PackerCompile profile=true
threshold = 0, -- the amount in ms that a plugins load time must be over for it to be included in the profile
max_jobs = 20, -- Limit the number of simultaneous jobs. nil means no limit. Set to 20 in order to prevent PackerSync form being "stuck" -> https://github.com/wbthomason/packer.nvim/issues/746
-- Have packer use a popup window
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
})
--
packer.startup(function(use)
-- actual plugins list
use("wbthomason/packer.nvim")
-- use({ "neovim/nvim-lspconfig", config = get_config("lsp") })
use("neovim/nvim-lspconfig")
-- use({
-- "nvim-telescope/telescope.nvim",
-- requires = { { "nvim-lua/popup.nvim" }, { "nvim-lua/plenary.nvim" } },
-- config = get_config("telescope"),
-- })
end)
--
--
-- use({ "jvgrootveld/telescope-zoxide" })
-- use({ "crispgm/telescope-heading.nvim" })
-- use({ "nvim-telescope/telescope-symbols.nvim" })
-- use({ "nvim-telescope/telescope-file-browser.nvim" })
-- use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
-- use({ "nvim-telescope/telescope-packer.nvim" })
-- use({ "nvim-telescope/telescope-ui-select.nvim" })
--
-- use({ "kyazdani42/nvim-tree.lua", config = get_config("nvim-tree") })
--
-- use({ "numToStr/Navigator.nvim", config = get_config("navigator") })
--
-- use({
-- "nvim-lualine/lualine.nvim",
-- config = get_config("lualine"),
-- event = "VimEnter",
-- requires = { "kyazdani42/nvim-web-devicons", opt = true },
-- })
--
-- use({
-- "norcalli/nvim-colorizer.lua",
-- event = "BufReadPre",
-- config = get_config("colorizer"),
-- })
--
-- use({ "windwp/nvim-autopairs", config = get_config("nvim-autopairs") })
--
-- use({
-- "nvim-treesitter/nvim-treesitter",
-- config = get_config("treesitter"),
-- run = ":TSUpdate",
-- })
--
-- use("nvim-treesitter/nvim-treesitter-textobjects")
--
-- use("RRethy/nvim-treesitter-endwise")
--
-- use({
-- "hrsh7th/nvim-cmp",
-- requires = {
-- "hrsh7th/cmp-nvim-lsp",
-- "hrsh7th/cmp-buffer",
-- "hrsh7th/cmp-path",
-- "hrsh7th/cmp-cmdline",
-- "f3fora/cmp-spell",
-- "hrsh7th/cmp-calc",
-- "lukas-reineke/cmp-rg",
-- "hrsh7th/cmp-nvim-lsp-signature-help",
-- },
-- config = get_config("cmp"),
-- })
--
-- use({ "rafamadriz/friendly-snippets" })
-- use({
-- "L3MON4D3/LuaSnip",
-- requires = "saadparwaiz1/cmp_luasnip",
-- config = get_config("luasnip"),
-- })
--
-- -- requirement for Neogit
-- use({
-- "sindrets/diffview.nvim",
-- cmd = {
-- "DiffviewOpen",
-- "DiffviewClose",
-- "DiffviewToggleFiles",
-- "DiffviewFocusFiles",
-- },
-- config = get_config("diffview"),
-- })
--
-- use({
-- "TimUntersberger/neogit",
-- requires = { "nvim-lua/plenary.nvim" },
-- cmd = "Neogit",
-- config = get_config("neogit"),
-- })
--
-- use({ "f-person/git-blame.nvim", config = get_config("git-blame") })
--
-- use({
-- "lewis6991/gitsigns.nvim",
-- requires = { "nvim-lua/plenary.nvim" },
-- event = "BufReadPre",
-- config = get_config("gitsigns"),
-- })
--
-- use("p00f/nvim-ts-rainbow")
--
-- use({
-- "kevinhwang91/nvim-bqf",
-- requires = { { "junegunn/fzf", module = "nvim-bqf" }, config = get_config("nvim-bqf") },
-- })
--
-- use({
-- "akinsho/nvim-bufferline.lua",
-- requires = "kyazdani42/nvim-web-devicons",
-- event = "BufReadPre",
-- config = get_config("bufferline"),
-- })
--
-- use("famiu/bufdelete.nvim")
--
--
-- use({ "onsails/lspkind-nvim", requires = { "famiu/bufdelete.nvim" } })
--
-- use({
-- "jose-elias-alvarez/null-ls.nvim",
-- requires = { { "nvim-lua/plenary.nvim" } },
-- config = get_config("null-ls"),
-- })
--
-- use({
-- "simrat39/symbols-outline.nvim",
-- cmd = { "SymbolsOutline" },
-- config = get_config("symbols"),
-- })
--
-- use({
-- "lukas-reineke/indent-blankline.nvim",
-- event = "BufReadPre",
-- config = [[require("config/indent-blankline")]],
-- })
--
-- use({
-- "akinsho/nvim-toggleterm.lua",
-- keys = { "<C-n>", "<leader>fl", "<leader>gt" },
-- config = get_config("toggleterm"),
-- })
--
-- use({
-- "folke/todo-comments.nvim",
-- requires = "nvim-lua/plenary.nvim",
-- config = get_config("todo"),
-- })
--
-- use({ "ahmedkhalf/project.nvim", config = get_config("project") })
--
-- use("ironhouzi/starlite-nvim")
--
-- use({ "folke/which-key.nvim", config = get_config("which-key") })
--
-- use("junegunn/vim-easy-align") -- no lua alternative, https://github.com/Vonr/align.nvim not working for me
--
-- use({ "rhysd/vim-grammarous", cmd = "GrammarousCheck" })
--
-- use({ "RRethy/vim-illuminate" })
--
-- use({
-- "ptzz/lf.vim",
-- requires = "voldikss/vim-floaterm",
-- config = get_config("lf"),
-- })
--
-- if settings.theme == "nightfox" then
-- use({ "EdenEast/nightfox.nvim", config = get_config("nightfox") })
-- elseif settings.theme == "catppuccino" then
-- use({ "catppuccin/nvim", as = "catppuccin", config = get_config("catppuccin") })
-- else
-- use({ "catppuccin/nvim", as = "catppuccin", config = get_config("catppuccin") })
-- end
-- --
-- -- use({
-- -- "ThePrimeagen/harpoon",
-- -- requires = { "nvim-lua/plenary.nvim" },
-- -- config = get_config("harpoon"),
-- -- })
--
-- use({ "folke/zen-mode.nvim", cmd = "ZenMode", config = get_config("zen-mode") })
--
-- use({ "folke/twilight.nvim", config = get_config("twilight") })
--
-- use({ "tweekmonster/startuptime.vim" })
--
-- use({ "ggandor/lightspeed.nvim" })
--
-- use({ "ray-x/go.nvim", config = get_config("go"), ft = { "go" } })
--
-- use({ "LudoPinelli/comment-box.nvim", config = get_config("comment-box") })
--
-- use({ "rcarriga/nvim-notify", config = get_config("notify") })
--
-- use({ "echasnovski/mini.nvim", branch = "stable", config = get_config("mini") })
--
-- use({
-- "https://gitlab.com/yorickpeterse/nvim-window.git",
-- config = get_config("nvim-window"),
-- })
--
-- use({
-- "waylonwalker/Telegraph.nvim",
-- config = function()
-- require("telegraph").setup({})
-- end,
-- })
--
-- use({ "rhysd/conflict-marker.vim" })
--
-- use({ "edluffy/specs.nvim", config = get_config("specs") })
--
-- use({ "mfussenegger/nvim-ts-hint-textobject" })
--
-- use({
-- "goolord/alpha-nvim",
-- requires = { "kyazdani42/nvim-web-devicons" },
-- config = get_config("alpha-nvim"),
-- })
--
-- use({ "SmiteshP/nvim-navic" })
--
-- use({
-- "j-hui/fidget.nvim",
-- config = function()
-- require("fidget").setup({})
-- end,
-- })
-- end)
--
-- -- TODO: ????
-- -- use {"lukas-reineke/headlines.nvim", config = get_config("headlines")}
-- -- https://github.com/glepnir/lspsaga.nvim
-- -- use 'glepnir/lspsaga.nvim'

16
lua/user-conf.lua Normal file
View File

@ -0,0 +1,16 @@
local M = {}
-- theme: catppuccino or nightfox; default is catppuccino
M.theme = "catppuccino"
-- Toggle global status line
M.global_statusline = true
-- use rg instead of grep
M.grepprg = "rg --hidden --vimgrep --smart-case --"
-- set numbered lines
M.number = true
-- set relative numbered lines
M.relative_number = true
-- enable PackerSync on plugins.lua save
M.packer_auto_sync = false
return M

660
plugin/packer_compiled.lua Normal file
View File

@ -0,0 +1,660 @@
-- Automatically generated packer.nvim plugin loader code
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
return
end
vim.api.nvim_command('packadd packer.nvim')
local no_errors, error_msg = pcall(function()
local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
end
else
time = function(chunk, start) end
end
local function save_profiles(threshold)
local sorted_times = {}
for chunk_name, time_taken in pairs(profile_info) do
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
end
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
local results = {}
for i, elem in ipairs(sorted_times) do
if not threshold or threshold and elem[2] > threshold then
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
end
end
_G._packer = _G._packer or {}
_G._packer.profile_output = results
end
time([[Luarocks path setup]], true)
local package_path_str = "/home/luke/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/luke/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/luke/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/luke/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/luke/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
package.cpath = package.cpath .. ';' .. install_cpath_pattern
end
time([[Luarocks path setup]], false)
time([[try_loadstring definition]], true)
local function try_loadstring(s, component, name)
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
if not success then
vim.schedule(function()
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
end)
end
return result
end
time([[try_loadstring definition]], false)
time([[Defining packer_plugins]], true)
_G.packer_plugins = {
LuaSnip = {
config = { 'require("config/luasnip")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/LuaSnip",
url = "https://github.com/L3MON4D3/LuaSnip"
},
["Navigator.nvim"] = {
config = { 'require("config/navigator")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/Navigator.nvim",
url = "https://github.com/numToStr/Navigator.nvim"
},
["Telegraph.nvim"] = {
config = { "\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14telegraph\frequire\0" },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/Telegraph.nvim",
url = "https://github.com/waylonwalker/Telegraph.nvim"
},
["alpha-nvim"] = {
config = { 'require("config/alpha-nvim")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/alpha-nvim",
url = "https://github.com/goolord/alpha-nvim"
},
["bufdelete.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/bufdelete.nvim",
url = "https://github.com/famiu/bufdelete.nvim"
},
catppuccin = {
config = { 'require("config/catppuccin")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/catppuccin",
url = "https://github.com/catppuccin/nvim"
},
["cmp-buffer"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-calc"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-calc",
url = "https://github.com/hrsh7th/cmp-calc"
},
["cmp-cmdline"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-nvim-lsp-signature-help"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help",
url = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"
},
["cmp-path"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["cmp-rg"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-rg",
url = "https://github.com/lukas-reineke/cmp-rg"
},
["cmp-spell"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp-spell",
url = "https://github.com/f3fora/cmp-spell"
},
cmp_luasnip = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
url = "https://github.com/saadparwaiz1/cmp_luasnip"
},
["comment-box.nvim"] = {
config = { 'require("config/comment-box")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/comment-box.nvim",
url = "https://github.com/LudoPinelli/comment-box.nvim"
},
["conflict-marker.vim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/conflict-marker.vim",
url = "https://github.com/rhysd/conflict-marker.vim"
},
["diffview.nvim"] = {
commands = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" },
config = { 'require("config/diffview")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/diffview.nvim",
url = "https://github.com/sindrets/diffview.nvim"
},
["fidget.nvim"] = {
config = { "\27LJ\2\n8\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\vfidget\frequire\0" },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/fidget.nvim",
url = "https://github.com/j-hui/fidget.nvim"
},
["friendly-snippets"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/friendly-snippets",
url = "https://github.com/rafamadriz/friendly-snippets"
},
fzf = {
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/fzf",
url = "https://github.com/junegunn/fzf"
},
["git-blame.nvim"] = {
config = { 'require("config/git-blame")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/git-blame.nvim",
url = "https://github.com/f-person/git-blame.nvim"
},
["gitsigns.nvim"] = {
config = { 'require("config/gitsigns")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim",
url = "https://github.com/lewis6991/gitsigns.nvim"
},
["go.nvim"] = {
config = { 'require("config/go")' },
loaded = false,
needs_bufread = true,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/go.nvim",
url = "https://github.com/ray-x/go.nvim"
},
harpoon = {
config = { 'require("config/harpoon")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/harpoon",
url = "https://github.com/ThePrimeagen/harpoon"
},
["indent-blankline.nvim"] = {
config = { 'require("config/indent-blankline")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim",
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
},
["lf.vim"] = {
config = { 'require("config/lf")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/lf.vim",
url = "https://github.com/ptzz/lf.vim"
},
["lightspeed.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/lightspeed.nvim",
url = "https://github.com/ggandor/lightspeed.nvim"
},
["lspkind-nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/lspkind-nvim",
url = "https://github.com/onsails/lspkind-nvim"
},
["lualine.nvim"] = {
config = { 'require("config/lualine")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/lualine.nvim",
url = "https://github.com/nvim-lualine/lualine.nvim"
},
["mini.nvim"] = {
config = { 'require("config/mini")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/mini.nvim",
url = "https://github.com/echasnovski/mini.nvim"
},
neogit = {
commands = { "Neogit" },
config = { 'require("config/neogit")' },
loaded = false,
needs_bufread = true,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/neogit",
url = "https://github.com/TimUntersberger/neogit"
},
["nvim-autopairs"] = {
config = { 'require("config/nvim-autopairs")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
url = "https://github.com/windwp/nvim-autopairs"
},
["nvim-bqf"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-bqf",
url = "https://github.com/kevinhwang91/nvim-bqf"
},
["nvim-bufferline.lua"] = {
config = { 'require("config/bufferline")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/nvim-bufferline.lua",
url = "https://github.com/akinsho/nvim-bufferline.lua"
},
["nvim-cmp"] = {
config = { 'require("config/cmp")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-colorizer.lua"] = {
config = { 'require("config/colorizer")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua",
url = "https://github.com/norcalli/nvim-colorizer.lua"
},
["nvim-lspconfig"] = {
config = { 'require("config/lsp")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-navic"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-navic",
url = "https://github.com/SmiteshP/nvim-navic"
},
["nvim-notify"] = {
config = { 'require("config/notify")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-notify",
url = "https://github.com/rcarriga/nvim-notify"
},
["nvim-toggleterm.lua"] = {
config = { 'require("config/toggleterm")' },
keys = { { "", "<C-n>" }, { "", "<leader>fl" }, { "", "<leader>gt" } },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/nvim-toggleterm.lua",
url = "https://github.com/akinsho/nvim-toggleterm.lua"
},
["nvim-tree.lua"] = {
config = { 'require("config/nvim-tree")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
url = "https://github.com/kyazdani42/nvim-tree.lua"
},
["nvim-treesitter"] = {
config = { 'require("config/treesitter")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["nvim-ts-hint-textobject"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-ts-hint-textobject",
url = "https://github.com/mfussenegger/nvim-ts-hint-textobject"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
url = "https://github.com/kyazdani42/nvim-web-devicons"
},
["nvim-window.git"] = {
config = { 'require("config/nvim-window")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/nvim-window.git",
url = "https://gitlab.com/yorickpeterse/nvim-window"
},
["packer.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["popup.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/popup.nvim",
url = "https://github.com/nvim-lua/popup.nvim"
},
["project.nvim"] = {
config = { 'require("config/project")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/project.nvim",
url = "https://github.com/ahmedkhalf/project.nvim"
},
["specs.nvim"] = {
config = { 'require("config/specs")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/specs.nvim",
url = "https://github.com/edluffy/specs.nvim"
},
["starlite-nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/starlite-nvim",
url = "https://github.com/ironhouzi/starlite-nvim"
},
["startuptime.vim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/startuptime.vim",
url = "https://github.com/tweekmonster/startuptime.vim"
},
["symbols-outline.nvim"] = {
commands = { "SymbolsOutline" },
config = { 'require("config/symbols")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/symbols-outline.nvim",
url = "https://github.com/simrat39/symbols-outline.nvim"
},
["telescope-file-browser.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-file-browser.nvim",
url = "https://github.com/nvim-telescope/telescope-file-browser.nvim"
},
["telescope-fzf-native.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim",
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
},
["telescope-heading.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-heading.nvim",
url = "https://github.com/crispgm/telescope-heading.nvim"
},
["telescope-packer.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-packer.nvim",
url = "https://github.com/nvim-telescope/telescope-packer.nvim"
},
["telescope-symbols.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-symbols.nvim",
url = "https://github.com/nvim-telescope/telescope-symbols.nvim"
},
["telescope-ui-select.nvim"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-ui-select.nvim",
url = "https://github.com/nvim-telescope/telescope-ui-select.nvim"
},
["telescope-zoxide"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope-zoxide",
url = "https://github.com/jvgrootveld/telescope-zoxide"
},
["telescope.nvim"] = {
config = { 'require("config/telescope")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
["todo-comments.nvim"] = {
config = { 'require("config/todo")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
url = "https://github.com/folke/todo-comments.nvim"
},
["twilight.nvim"] = {
config = { 'require("config/twilight")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/twilight.nvim",
url = "https://github.com/folke/twilight.nvim"
},
["vim-easy-align"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/vim-easy-align",
url = "https://github.com/junegunn/vim-easy-align"
},
["vim-floaterm"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/vim-floaterm",
url = "https://github.com/voldikss/vim-floaterm"
},
["vim-grammarous"] = {
commands = { "GrammarousCheck" },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/vim-grammarous",
url = "https://github.com/rhysd/vim-grammarous"
},
["vim-illuminate"] = {
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/vim-illuminate",
url = "https://github.com/RRethy/vim-illuminate"
},
["which-key.nvim"] = {
config = { 'require("config/which-key")' },
loaded = true,
path = "/home/luke/.local/share/nvim/site/pack/packer/start/which-key.nvim",
url = "https://github.com/folke/which-key.nvim"
},
["zen-mode.nvim"] = {
commands = { "ZenMode" },
config = { 'require("config/zen-mode")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/luke/.local/share/nvim/site/pack/packer/opt/zen-mode.nvim",
url = "https://github.com/folke/zen-mode.nvim"
}
}
time([[Defining packer_plugins]], false)
local module_lazy_loads = {
["^nvim%-bqf"] = "fzf"
}
local lazy_load_called = {['packer.load'] = true}
local function lazy_load_module(module_name)
local to_load = {}
if lazy_load_called[module_name] then return nil end
lazy_load_called[module_name] = true
for module_pat, plugin_name in pairs(module_lazy_loads) do
if not _G.packer_plugins[plugin_name].loaded and string.match(module_name, module_pat) then
to_load[#to_load + 1] = plugin_name
end
end
if #to_load > 0 then
require('packer.load')(to_load, {module = module_name}, _G.packer_plugins)
local loaded_mod = package.loaded[module_name]
if loaded_mod then
return function(modname) return loaded_mod end
end
end
end
if not vim.g.packer_custom_loader_enabled then
table.insert(package.loaders, 1, lazy_load_module)
vim.g.packer_custom_loader_enabled = true
end
-- Config for: nvim-tree.lua
time([[Config for nvim-tree.lua]], true)
require("config/nvim-tree")
time([[Config for nvim-tree.lua]], false)
-- Config for: nvim-treesitter
time([[Config for nvim-treesitter]], true)
require("config/treesitter")
time([[Config for nvim-treesitter]], false)
-- Config for: git-blame.nvim
time([[Config for git-blame.nvim]], true)
require("config/git-blame")
time([[Config for git-blame.nvim]], false)
-- Config for: fidget.nvim
time([[Config for fidget.nvim]], true)
try_loadstring("\27LJ\2\n8\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\vfidget\frequire\0", "config", "fidget.nvim")
time([[Config for fidget.nvim]], false)
-- Config for: catppuccin
time([[Config for catppuccin]], true)
require("config/catppuccin")
time([[Config for catppuccin]], false)
-- Config for: which-key.nvim
time([[Config for which-key.nvim]], true)
require("config/which-key")
time([[Config for which-key.nvim]], false)
-- Config for: LuaSnip
time([[Config for LuaSnip]], true)
require("config/luasnip")
time([[Config for LuaSnip]], false)
-- Config for: nvim-cmp
time([[Config for nvim-cmp]], true)
require("config/cmp")
time([[Config for nvim-cmp]], false)
-- Config for: nvim-autopairs
time([[Config for nvim-autopairs]], true)
require("config/nvim-autopairs")
time([[Config for nvim-autopairs]], false)
-- Config for: Navigator.nvim
time([[Config for Navigator.nvim]], true)
require("config/navigator")
time([[Config for Navigator.nvim]], false)
-- Config for: todo-comments.nvim
time([[Config for todo-comments.nvim]], true)
require("config/todo")
time([[Config for todo-comments.nvim]], false)
-- Config for: project.nvim
time([[Config for project.nvim]], true)
require("config/project")
time([[Config for project.nvim]], false)
-- Config for: Telegraph.nvim
time([[Config for Telegraph.nvim]], true)
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14telegraph\frequire\0", "config", "Telegraph.nvim")
time([[Config for Telegraph.nvim]], false)
-- Config for: nvim-lspconfig
time([[Config for nvim-lspconfig]], true)
require("config/lsp")
time([[Config for nvim-lspconfig]], false)
-- Config for: specs.nvim
time([[Config for specs.nvim]], true)
require("config/specs")
time([[Config for specs.nvim]], false)
-- Config for: telescope.nvim
time([[Config for telescope.nvim]], true)
require("config/telescope")
time([[Config for telescope.nvim]], false)
-- Config for: harpoon
time([[Config for harpoon]], true)
require("config/harpoon")
time([[Config for harpoon]], false)
-- Config for: lf.vim
time([[Config for lf.vim]], true)
require("config/lf")
time([[Config for lf.vim]], false)
-- Config for: comment-box.nvim
time([[Config for comment-box.nvim]], true)
require("config/comment-box")
time([[Config for comment-box.nvim]], false)
-- Config for: nvim-notify
time([[Config for nvim-notify]], true)
require("config/notify")
time([[Config for nvim-notify]], false)
-- Config for: alpha-nvim
time([[Config for alpha-nvim]], true)
require("config/alpha-nvim")
time([[Config for alpha-nvim]], false)
-- Config for: twilight.nvim
time([[Config for twilight.nvim]], true)
require("config/twilight")
time([[Config for twilight.nvim]], false)
-- Config for: nvim-window.git
time([[Config for nvim-window.git]], true)
require("config/nvim-window")
time([[Config for nvim-window.git]], false)
-- Config for: mini.nvim
time([[Config for mini.nvim]], true)
require("config/mini")
time([[Config for mini.nvim]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewClose lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewClose", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewToggleFiles lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewToggleFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewFocusFiles lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewFocusFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewOpen lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewOpen", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SymbolsOutline lua require("packer.load")({'symbols-outline.nvim'}, { cmd = "SymbolsOutline", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file ZenMode lua require("packer.load")({'zen-mode.nvim'}, { cmd = "ZenMode", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file GrammarousCheck lua require("packer.load")({'vim-grammarous'}, { cmd = "GrammarousCheck", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
time([[Defining lazy-load commands]], false)
-- Keymap lazy-loads
time([[Defining lazy-load keymaps]], true)
vim.cmd [[noremap <silent> <leader>gt <cmd>lua require("packer.load")({'nvim-toggleterm.lua'}, { keys = "<lt>leader>gt", prefix = "" }, _G.packer_plugins)<cr>]]
vim.cmd [[noremap <silent> <C-n> <cmd>lua require("packer.load")({'nvim-toggleterm.lua'}, { keys = "<lt>C-n>", prefix = "" }, _G.packer_plugins)<cr>]]
vim.cmd [[noremap <silent> <leader>fl <cmd>lua require("packer.load")({'nvim-toggleterm.lua'}, { keys = "<lt>leader>fl", prefix = "" }, _G.packer_plugins)<cr>]]
time([[Defining lazy-load keymaps]], false)
vim.cmd [[augroup packer_load_aucmds]]
vim.cmd [[au!]]
-- Filetype lazy-loads
time([[Defining lazy-load filetype autocommands]], true)
vim.cmd [[au FileType go ++once lua require("packer.load")({'go.nvim'}, { ft = "go" }, _G.packer_plugins)]]
time([[Defining lazy-load filetype autocommands]], false)
-- Event lazy-loads
time([[Defining lazy-load event autocommands]], true)
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'lualine.nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
vim.cmd [[au BufReadPre * ++once lua require("packer.load")({'indent-blankline.nvim', 'nvim-colorizer.lua', 'nvim-bufferline.lua', 'gitsigns.nvim'}, { event = "BufReadPre *" }, _G.packer_plugins)]]
time([[Defining lazy-load event autocommands]], false)
vim.cmd("augroup END")
vim.cmd [[augroup filetypedetect]]
time([[Sourcing ftdetect script at: /home/luke/.local/share/nvim/site/pack/packer/opt/go.nvim/ftdetect/go.vim]], true)
vim.cmd [[source /home/luke/.local/share/nvim/site/pack/packer/opt/go.nvim/ftdetect/go.vim]]
time([[Sourcing ftdetect script at: /home/luke/.local/share/nvim/site/pack/packer/opt/go.nvim/ftdetect/go.vim]], false)
vim.cmd("augroup END")
if should_profile then save_profiles() end
end)
if not no_errors then
error_msg = error_msg:gsub('"', '\\"')
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
end