add and apply stylua

This commit is contained in:
Michael Peters 2023-01-10 10:21:09 -08:00
parent 736d583dc7
commit 98658d1c8c
28 changed files with 786 additions and 756 deletions

4
.stylua.toml Normal file
View File

@ -0,0 +1,4 @@
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferSingle"
call_parentheses = "Always"

View File

@ -1,8 +1,6 @@
require('plugins')
require('settings')
require('keybinds')
require('commands')
require('cmds')
require('highlights')
require("plugins")
require("settings")
require("keybinds")
require("commands")
require("cmds")
require("highlights")

View File

@ -1,3 +1,2 @@
-- Set colorscheme
vim.cmd [[ colorscheme darkplus ]]
vim.cmd([[ colorscheme darkplus ]])

View File

@ -5,13 +5,13 @@ vim.api.nvim_create_user_command('Black', 'call Black()', {})
vim.api.nvim_create_user_command('IPDB', 'norm oimport ipdb; ipdb.set_trace() # fmt:skip', {})
local function gitblame_toggle_summary()
local normal = '<author> • <date>'
local with_summary = '<summary> • <author> • <date>'
if vim.g.gitblame_message_template == normal then
vim.g.gitblame_message_template = with_summary
else
vim.g.gitblame_message_template = normal
end
local normal = '<author> • <date>'
local with_summary = '<summary> • <author> • <date>'
if vim.g.gitblame_message_template == normal then
vim.g.gitblame_message_template = with_summary
else
vim.g.gitblame_message_template = normal
end
end
vim.api.nvim_create_user_command('GitBlameToggleSummary', gitblame_toggle_summary, {})

View File

@ -1,25 +1,24 @@
local M = {}
function M.config()
local status_ok, alpha = pcall(require, "alpha")
local status_ok, alpha = pcall(require, 'alpha')
if not status_ok then
return
end
local dashboard = require'alpha.themes.dashboard'
local dashboard = require('alpha.themes.dashboard')
dashboard.section.header.val = { "NeoVim", }
dashboard.section.buttons.val = {
dashboard.button("f", "Find File", ":Telescope find_files<cr>"),
dashboard.button("w", "Find Word", ":Telescope live_grep<cr>"),
dashboard.button("o", "Recent Files", ":Telescope oldfiles<cr>"),
dashboard.button("e", "Open Tree", ":NvimTreeToggle<cr>"),
dashboard.button("s", "Load Session", ":SessionManager load_current_dir_session<cr>"),
dashboard.button("q", "Quit", ":qa<cr>"),
}
dashboard.section.header.val = { 'NeoVim' }
dashboard.section.buttons.val = {
dashboard.button('f', 'Find File', ':Telescope find_files<cr>'),
dashboard.button('w', 'Find Word', ':Telescope live_grep<cr>'),
dashboard.button('o', 'Recent Files', ':Telescope oldfiles<cr>'),
dashboard.button('e', 'Open Tree', ':NvimTreeToggle<cr>'),
dashboard.button('s', 'Load Session', ':SessionManager load_current_dir_session<cr>'),
dashboard.button('q', 'Quit', ':qa<cr>'),
}
alpha.setup(dashboard.config)
alpha.setup(dashboard.config)
end
return M

View File

@ -1,31 +1,31 @@
local M = {}
function M.config()
local status_ok, npairs = pcall(require, "nvim-autopairs")
local status_ok, npairs = pcall(require, 'nvim-autopairs')
if not status_ok then
return
end
npairs.setup {
npairs.setup({
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
lua = { 'string', 'source' },
javascript = { 'string', 'template_string' },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
map = '<M-e>',
chars = { '{', '[', '(', '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], '%s+', ''),
offset = 0,
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
end_key = '$',
keys = 'qwertyuiopzxcvbnmasdfghjkl',
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
highlight = 'PmenuSel',
highlight_grey = 'LineNr',
},
}
})
--Rule = require "nvim-autopairs.rule"
-- local cmp_autopairs = require "nvim-autopairs.completion.cmp"
@ -37,4 +37,3 @@ function M.config()
end
return M

View File

@ -1,8 +1,8 @@
local M = {}
function M.config()
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
local status_ok, bufferline = pcall(require, 'bufferline')
if not status_ok then
return
end
@ -21,35 +21,35 @@ function M.config()
none = 'NONE',
}
bufferline.setup {
bufferline.setup({
options = {
close_command = "Bdelete! %d", -- use vim-bbye
right_mouse_command = "Bdelete! %d", -- use vim-bbye
close_command = 'Bdelete! %d', -- use vim-bbye
right_mouse_command = 'Bdelete! %d', -- use vim-bbye
offsets = {
{
filetype = "NvimTree",
text = "",
padding = 1
}
filetype = 'NvimTree',
text = '',
padding = 1,
},
},
indicator = {
icon = '',
style = 'icon'
style = 'icon',
},
modified_icon = "",
modified_icon = '',
--buffer_close_icon = "",
show_buffer_close_icons = false,
--close_icon = "",
show_close_icon = false,
left_trunc_marker = "",
right_trunc_marker = "",
left_trunc_marker = '',
right_trunc_marker = '',
tab_size = 12, -- minimum size
max_name_length = 40,
max_prefix_length = 13,
show_tab_indicators = true,
enforce_regular_tabs = false,
view = "multiwindow",
separator_style = "thick",
view = 'multiwindow',
separator_style = 'thick',
always_show_bufferline = true,
diagnostics = false,
},
@ -75,8 +75,8 @@ function M.config()
bg = scolors.tab_visible_bg,
},
-- de-duplicate text
duplicate = {
-- de-duplicate text
duplicate = {
fg = scolors.gray_fg,
bg = scolors.tab_bg,
--gui = colors.none,
@ -164,9 +164,8 @@ function M.config()
fg = scolors.white_fg,
bg = scolors.tab_visible_bg,
},
}
}
},
})
end
return M

View File

@ -1,54 +1,54 @@
local M = {}
function M.config()
local cmp_status_ok, cmp = pcall(require, "cmp")
local cmp_status_ok, cmp = pcall(require, 'cmp')
if not cmp_status_ok then
return
end
local snip_status_ok, luasnip = pcall(require, "luasnip")
local snip_status_ok, luasnip = pcall(require, 'luasnip')
if not snip_status_ok then
return
end
local check_backspace = function()
local col = vim.fn.col "." - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s')
end
local kind_icons = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
cmp.setup {
cmp.setup({
formatting = {
fields = { "kind", "abbr", "menu" },
fields = { 'kind', 'abbr', 'menu' },
format = function(_, vim_item)
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
vim_item.kind = string.format('%s', kind_icons[vim_item.kind])
return vim_item
end,
},
@ -68,9 +68,9 @@ function M.config()
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
documentation = cmp.config.window.bordered(),
},
window = {
documentation = cmp.config.window.bordered(),
},
-- documentation = {
-- border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
-- },
@ -82,24 +82,24 @@ function M.config()
keyword_length = 1,
},
sources = {
{ name = "nvim_lsp" },
{ name = 'nvim_lsp' },
--{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{ name = 'buffer' },
{ name = 'path' },
},
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable,
["<C-e>"] = cmp.mapping {
['<C-k>'] = cmp.mapping.select_prev_item(),
['<C-j>'] = cmp.mapping.select_next_item(),
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-1), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(1), { 'i', 'c' }),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
},
["<CR>"] = cmp.mapping.confirm { select = false },
["<Tab>"] = cmp.mapping(function(fallback)
}),
['<CR>'] = cmp.mapping.confirm({ select = false }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
@ -112,10 +112,10 @@ function M.config()
fallback()
end
end, {
"i",
"s",
'i',
's',
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
@ -124,12 +124,11 @@ function M.config()
fallback()
end
end, {
"i",
"s",
'i',
's',
}),
},
}
})
end
return M

View File

@ -1,26 +1,25 @@
local M = {}
function M.config()
local present, colorizer = pcall(require, "colorizer")
local present, colorizer = pcall(require, 'colorizer')
if not present then
return
end
colorizer.setup(
{ "*" }, -- Highlight all files, but customize some others
{ '*' }, -- Highlight all files, but customize some others
{
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue
RRGGBBAA = false, -- #RRGGBBAA hex codes
rgb_fn = false, -- CSS rgb() and rgba() functions
hsl_fn = false, -- CSS hsl() and hsla() functions
css = false, -- Enable all css features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
mode = "foreground", -- Set the display mode
rgb_fn = false, -- CSS rgb() and rgba() functions
hsl_fn = false, -- CSS hsl() and hsla() functions
css = false, -- Enable all css features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
mode = 'foreground', -- Set the display mode
}
)
end
return M

View File

@ -1,24 +1,23 @@
local M = {}
function M.config()
local status_ok, comment = pcall(require, "Comment")
local status_ok, comment = pcall(require, 'Comment')
if not status_ok then
return
end
comment.setup {
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
padding = true,
sticky = true,
ignore = '^$', -- Don't comment empty lines
toggler = {
line = '<leader>/',
},
opleader = {
line = '<leader>/',
},
}
comment.setup({
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
padding = true,
sticky = true,
ignore = '^$', -- Don't comment empty lines
toggler = {
line = '<leader>/',
},
opleader = {
line = '<leader>/',
},
})
end
return M

View File

@ -1,9 +1,9 @@
local M = {}
function M.config()
vim.g.gitblame_display_virtual_text = 0
vim.g.gitblame_message_template = '<author> • <date>'
vim.g.gitblame_date_format = '%r'
vim.g.gitblame_display_virtual_text = 0
vim.g.gitblame_message_template = '<author> • <date>'
vim.g.gitblame_date_format = '%r'
end
return M

View File

@ -1,27 +1,27 @@
local M = {}
function M.config()
local status_ok, gitsigns = pcall(require, "gitsigns")
local status_ok, gitsigns = pcall(require, 'gitsigns')
if not status_ok then
return
end
gitsigns.setup {
gitsigns.setup({
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
delete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
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",
hl = 'GitSignsDelete',
text = '',
numhl = 'GitSignsDeleteNr',
linehl = 'GitSignsDeleteLn',
},
changedelete = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
hl = 'GitSignsChange',
text = '',
numhl = 'GitSignsChangeNr',
linehl = 'GitSignsChangeLn',
},
},
signcolumn = true,
@ -36,7 +36,7 @@ function M.config()
current_line_blame = false,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol",
virt_text_pos = 'eol',
delay = 1000,
ignore_whitespace = false,
},
@ -48,16 +48,16 @@ function M.config()
status_formatter = nil,
max_file_length = 40000,
preview_config = {
border = "single",
style = "minimal",
relative = "cursor",
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1,
},
yadm = {
enable = false,
},
}
})
end
return M

View File

@ -1,192 +1,191 @@
local M = {}
function M.config()
local status_ok, icons = pcall(require, "nvim-web-devicons")
local status_ok, icons = pcall(require, 'nvim-web-devicons')
if not status_ok then
return
end
local colors = {
c = "#519aba",
css = "#61afef",
deb = "#a1b7ee",
docker = "#384d54",
html = "#de8c92",
js = "#ebcb8b",
kt = "#7bc99c",
lock = "#c4c720",
lua = "#51a0cf",
mp3 = "#d39ede",
mp4 = "#9ea3de",
out = "#abb2bf",
py = "#a3b8ef",
robot = "#abb2bf",
toml = "#39bf39",
ts = "#519aba",
ttf = "#abb2bf",
rb = "#ff75a0",
rpm = "#fca2aa",
woff = "#abb2bf",
woff2 = "#abb2bf",
zip = "#f9d71c",
jsx = "#519ab8",
vue = "#7bc99c",
rs = "#dea584",
png = "#c882e7",
jpeg = "#c882e7",
jpg = "#c882e7",
c = '#519aba',
css = '#61afef',
deb = '#a1b7ee',
docker = '#384d54',
html = '#de8c92',
js = '#ebcb8b',
kt = '#7bc99c',
lock = '#c4c720',
lua = '#51a0cf',
mp3 = '#d39ede',
mp4 = '#9ea3de',
out = '#abb2bf',
py = '#a3b8ef',
robot = '#abb2bf',
toml = '#39bf39',
ts = '#519aba',
ttf = '#abb2bf',
rb = '#ff75a0',
rpm = '#fca2aa',
woff = '#abb2bf',
woff2 = '#abb2bf',
zip = '#f9d71c',
jsx = '#519ab8',
vue = '#7bc99c',
rs = '#dea584',
png = '#c882e7',
jpeg = '#c882e7',
jpg = '#c882e7',
}
icons.setup {
icons.setup({
override = {
c = {
icon = "",
icon = '',
color = colors.c,
name = "c",
name = 'c',
},
css = {
icon = "",
icon = '',
color = colors.css,
name = "css",
name = 'css',
},
deb = {
icon = "",
icon = '',
color = colors.deb,
name = "deb",
name = 'deb',
},
Dockerfile = {
icon = "",
icon = '',
color = colors.docker,
name = "Dockerfile",
name = 'Dockerfile',
},
html = {
icon = "",
icon = '',
color = colors.html,
name = "html",
name = 'html',
},
js = {
icon = "",
icon = '',
color = colors.js,
name = "js",
name = 'js',
},
kt = {
icon = "󱈙",
icon = '󱈙',
color = colors.kt,
name = "kt",
name = 'kt',
},
lock = {
icon = "",
icon = '',
color = colors.lock,
name = "lock",
name = 'lock',
},
lua = {
icon = "",
icon = '',
color = colors.lua,
name = "lua",
name = 'lua',
},
mp3 = {
icon = "",
icon = '',
color = colors.mp3,
name = "mp3",
name = 'mp3',
},
mp4 = {
icon = "",
icon = '',
color = colors.mp4,
name = "mp4",
name = 'mp4',
},
out = {
icon = "",
icon = '',
color = colors.out,
name = "out",
name = 'out',
},
py = {
icon = "",
icon = '',
color = colors.py,
name = "py",
name = 'py',
},
["robots.txt"] = {
icon = "",
['robots.txt'] = {
icon = '',
color = colors.robot,
name = "robots",
name = 'robots',
},
toml = {
icon = "",
icon = '',
color = colors.toml,
name = "toml",
name = 'toml',
},
ts = {
icon = "",
icon = '',
color = colors.ts,
name = "ts",
name = 'ts',
},
ttf = {
icon = "",
icon = '',
color = colors.ttf,
name = "TrueTypeFont",
name = 'TrueTypeFont',
},
rb = {
icon = "",
icon = '',
color = colors.rb,
name = "rb",
name = 'rb',
},
rpm = {
icon = "",
icon = '',
color = colors.rpm,
name = "rpm",
name = 'rpm',
},
vue = {
icon = "",
icon = '',
color = colors.vue,
name = "vue",
name = 'vue',
},
woff = {
icon = "",
icon = '',
color = colors.woff,
name = "WebOpenFontFormat",
name = 'WebOpenFontFormat',
},
woff2 = {
icon = "",
icon = '',
color = colors.woff2,
name = "WebOpenFontFormat2",
name = 'WebOpenFontFormat2',
},
xz = {
icon = "",
icon = '',
color = colors.zip,
name = "xz",
name = 'xz',
},
zip = {
icon = "",
icon = '',
color = colors.zip,
name = "zip",
name = 'zip',
},
jsx = {
icon = "",
icon = '',
color = colors.jsx,
name = "jsx",
name = 'jsx',
},
rust = {
icon = "",
icon = '',
color = colors.rs,
name = "rs",
name = 'rs',
},
jpg = {
icon = "",
icon = '',
color = colors.jpg,
name = "jpg",
name = 'jpg',
},
png = {
icon = "",
icon = '',
color = colors.png,
name = "png",
name = 'png',
},
jpeg = {
icon = "",
icon = '',
color = colors.jpeg,
name = "jpeg",
name = 'jpeg',
},
}
}
},
})
end
return M

View File

@ -6,20 +6,19 @@ function M.config()
return
end
illuminate.configure({
providers = {
'lsp',
'treesitter',
'regex',
},
delay = 200,
filetypes_denylist = {
'alpha',
'NvimTree',
'TelescopePrompt',
},
})
illuminate.configure({
providers = {
'lsp',
'treesitter',
'regex',
},
delay = 200,
filetypes_denylist = {
'alpha',
'NvimTree',
'TelescopePrompt',
},
})
end
return M

View File

@ -1,22 +1,21 @@
local M = {}
function M.config()
local status_ok, indent_blankline = pcall(require, "indent_blankline")
local status_ok, indent_blankline = pcall(require, 'indent_blankline')
if not status_ok then
return
end
-- vim.opt.list = true
-- vim.opt.listchars:append "space:⋅"
-- vim.opt.listchars:append "eol:↴"
-- vim.opt.list = true
-- vim.opt.listchars:append "space:⋅"
-- vim.opt.listchars:append "eol:↴"
indent_blankline.setup {
indent_blankline.setup({
show_current_context = false,
show_current_context_start = false,
-- show_end_of_line = true,
-- space_char_blankline = " ",
}
-- show_end_of_line = true,
-- space_char_blankline = " ",
})
end
return M

View File

@ -2,14 +2,14 @@ local M = {}
function M.config()
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
{ name = 'DiagnosticSignError', text = '' },
{ name = 'DiagnosticSignWarn', text = '' },
{ name = 'DiagnosticSignHint', text = '' },
{ name = 'DiagnosticSignInfo', text = '' },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = '' })
end
local config = {
@ -22,141 +22,114 @@ function M.config()
severity_sort = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
}
vim.diagnostic.config(config)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {
border = 'rounded',
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = 'rounded',
})
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false,
})
local status_ok, lspconfig = pcall(require, "lspconfig")
local status_ok, lspconfig = pcall(require, 'lspconfig')
if not status_ok then
return
end
-- Highlight under current selection
-- local function lsp_highlight_document(client)
-- if client.resolved_capabilities.document_highlight then
-- vim.api.nvim_exec(
-- [[
-- augroup lsp_document_highlight
-- autocmd! * <buffer>
-- autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
-- autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
-- augroup END
-- ]],
-- false
-- )
-- end
-- end
local function lsp_keymaps(bufnr)
local opts = { noremap = true, silent = true }
vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float({ source = false, prefix = function(d, i, ttl) return string.rep(' ', #tostring(ttl) - #tostring(i)) .. tostring(i) .. ': ', nil end })<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "go", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ll", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting_sync()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(
bufnr,
'n',
'gl',
"<cmd>lua vim.diagnostic.open_float({ source = false, prefix = function(d, i, ttl) return string.rep(' ', #tostring(ttl) - #tostring(i)) .. tostring(i) .. ': ', nil end })<CR>",
opts
)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'go', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
vim.api.nvim_buf_set_keymap(
bufnr,
'n',
'[d',
'<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>',
opts
)
vim.api.nvim_buf_set_keymap(
bufnr,
'n',
']d',
'<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>',
opts
)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ll', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>lf', '<cmd>lua vim.lsp.buf.formatting_sync()<CR>', opts)
--vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
end
local on_attach = function(client, bufnr)
lsp_keymaps(bufnr)
end
local on_attach = function(client, bufnr)
lsp_keymaps(bufnr)
end
local sumneko_root_path = '/home/peters/builds/lua-language-server'
local sumneko_binary = sumneko_root_path.."/bin/lua-language-server"
-- lua-language-server
-- pacman -S lua-language-server
lspconfig.sumneko_lua.setup {
cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" },
on_attach = on_attach,
settings = {
Lua = {
format = {
enable = false
},
diagnostics = {
globals = { 'vim' },
},
workspace = {
library = {
-- include neovim runtime files
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
checkThirdParty = false, -- disable "do you want to set up the workspace"
},
telemetry = {
enable = false,
}
},
},
}
-- lua-language-server
-- pacman -S lua-language-server
lspconfig.sumneko_lua.setup({
on_attach = on_attach,
settings = {
Lua = {
format = {
enable = false,
},
diagnostics = {
globals = { 'vim' },
},
workspace = {
library = {
-- include neovim runtime files
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
checkThirdParty = false, -- disable "do you want to set up the workspace"
},
telemetry = {
enable = false,
},
},
},
})
-- TODO: python-language-server (pip install pylsp)
-- lspconfig.pylsp.setup {
-- -- cmd = { '/home/peters/.env38/bin/pylsp' },
-- on_attach = on_attach,
-- settings = {
-- pylsp = {
-- plugins = {
-- -- pylint = {
-- -- enabled = false,
-- -- },
-- }
-- }
-- }
-- }
-- pyright
-- pip install pyright
lspconfig.pyright.setup({
on_attach = on_attach,
})
-- pyright
-- pip install pyright
lspconfig.pyright.setup {
on_attach = on_attach,
-- settings = {
-- https://github.com/microsoft/pyright/blob/main/docs/settings.md
-- python = {
-- autoSearchPaths = true,
-- autoImportCompletion = true,
-- diagnosticMode = 'openFilesOnly', -- workspace | openFilesOnly
-- useLibraryCodeForTypes = true,
-- typeCheckingMode = '...' -- off | basic | strict
-- venvPath = '...'
-- }
-- }
}
-- vscode-json-language-server
-- npm i -g vscode-langservers-extracted
lspconfig.jsonls.setup({
on_attach = on_attach,
})
-- vscode-json-language-server
-- npm i -g vscode-langservers-extracted
lspconfig.jsonls.setup {
on_attach = on_attach,
}
-- typescript-language-server
-- npm i -g typescript-language-server
lspconfig.tsserver.setup {
on_attach = on_attach,
}
-- typescript-language-server
-- npm i -g typescript-language-server
lspconfig.tsserver.setup({
on_attach = on_attach,
})
end
return M

View File

@ -1,54 +1,53 @@
local M = {}
function M.config()
local status_ok, lspsaga = pcall(require, "lspsaga")
local status_ok, lspsaga = pcall(require, 'lspsaga')
if not status_ok then
return
end
lspsaga.setup {
lspsaga.setup({
debug = false,
use_saga_diagnostic_sign = false,
-- Diagnostics
error_sign = "",
warn_sign = "",
hint_sign = "",
infor_sign = "",
diagnostic_header_icon = "",
error_sign = '',
warn_sign = '',
hint_sign = '',
infor_sign = '',
diagnostic_header_icon = '',
-- Code actions
code_action_icon = "",
code_action_icon = '',
code_action_prompt = {
enable = false,
--sign = false, -- this thing is ultra annoying
--sign_priority = 40,
--virtual_text = false,
},
finder_definition_icon = "",
finder_reference_icon = "",
finder_definition_icon = '',
finder_reference_icon = '',
max_preview_lines = 40,
finder_action_keys = {
open = "o",
vsplit = "s",
split = "i",
quit = "q",
scroll_down = "<C-f>",
scroll_up = "<C-b>",
open = 'o',
vsplit = 's',
split = 'i',
quit = 'q',
scroll_down = '<C-f>',
scroll_up = '<C-b>',
},
code_action_keys = {
quit = "q",
exec = "<CR>",
quit = 'q',
exec = '<CR>',
},
rename_action_keys = {
quit = "<C-c>",
exec = "<CR>",
quit = '<C-c>',
exec = '<CR>',
},
definition_preview_icon = "",
border_style = "round",
rename_prompt_prefix = "",
definition_preview_icon = '',
border_style = 'round',
rename_prompt_prefix = '',
server_filetype_map = {},
diagnostic_prefix_format = "%d. ",
}
diagnostic_prefix_format = '%d. ',
})
end
return M

View File

@ -1,12 +1,12 @@
local M = {}
function M.config()
local status_lualine_ok, lualine = pcall(require, "lualine")
local status_lualine_ok, lualine = pcall(require, 'lualine')
if not status_lualine_ok then
return
end
local status_gitblame_ok, gitblame = pcall(require, "gitblame")
local status_gitblame_ok, gitblame = pcall(require, 'gitblame')
if not status_gitblame_ok then
return
end
@ -36,23 +36,24 @@ function M.config()
}
local conditions = {
buffer_not_empty = function() return vim.fn.empty(vim.fn.expand "%:t") ~= 1
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand "%:p:h"
local gitdir = vim.fn.finddir(".git", filepath .. ";")
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
local config = {
options = {
disabled_filetypes = { "NvimTree", "dashboard", "Outline" },
component_separators = "",
section_separators = "",
disabled_filetypes = { 'NvimTree', 'dashboard', 'Outline' },
component_separators = '',
section_separators = '',
theme = {
normal = { c = { fg = scolors.fg, bg = scolors.bg } },
inactive = { c = { fg = scolors.fg, bg = scolors.bg } },
@ -63,21 +64,21 @@ function M.config()
lualine_b = {},
lualine_c = {
{ -- working dir
function ()
local cwd = vim.fn.getcwd()
-- substr the cwd starting at the last "/" character
local cwd_name = string.sub(cwd,-cwd:reverse():find("/")+1)
return cwd_name
end,
color = { fg = scolors.working_dir, gui = "bold" },
icon="",
function()
local cwd = vim.fn.getcwd()
-- substr the cwd starting at the last "/" character
local cwd_name = string.sub(cwd, -cwd:reverse():find('/') + 1)
return cwd_name
end,
color = { fg = scolors.working_dir, gui = 'bold' },
icon = '',
padding = { left = 2, right = 1 },
},
{ -- file name
"filename",
path = 1,
icon="",
color = { fg = scolors.filename, gui = "bold" },
'filename',
path = 1,
icon = '',
color = { fg = scolors.filename, gui = 'bold' },
padding = { left = 1, right = 1 },
},
-- { -- git branch
@ -87,15 +88,15 @@ function M.config()
-- padding = { left = 1, right = 1 },
-- },
{ -- filetype
"filetype",
'filetype',
colored = false,
color = { fg = scolors.filetype, gui = "bold" },
color = { fg = scolors.filetype, gui = 'bold' },
cond = conditions.buffer_not_empty,
padding = { left = 1, right = 1 },
},
{ -- git diff
"diff",
symbols = { added = "", modified = "", removed = "" },
'diff',
symbols = { added = '', modified = '', removed = '' },
diff_color = {
added = { fg = scolors.added },
modified = { fg = scolors.modified },
@ -105,9 +106,9 @@ function M.config()
padding = { left = 1, right = 1 },
},
{ -- nvim diagnostics
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "", warn = "", info = "", hint = "" },
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '', hint = '' },
diagnostics_color = {
color_error = { fg = scolors.error },
color_warn = { fg = scolors.warn },
@ -118,24 +119,24 @@ function M.config()
},
lualine_x = {
{ -- git blame
function ()
local blame_text = gitblame.get_current_blame_text()
blame_text = blame_text:gsub("Not Committed Yet", "not committed")
return blame_text
end,
function()
local blame_text = gitblame.get_current_blame_text()
blame_text = blame_text:gsub('Not Committed Yet', 'not committed')
return blame_text
end,
color = { fg = scolors.fg_wash },
cond = gitblame.is_blame_text_available,
padding = { left = 0, right = 1 },
},
{ -- location in file (line:col)
"location",
'location',
padding = { left = 0, right = 1 },
},
{ -- progress through file (%)
-- slightly modified from default "progress"
-- always 3 chars long, no TOP
-- https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/components/progress.lua
function ()
function()
local cur = vim.fn.line('.')
local total = vim.fn.line('$')
if cur == total then
@ -146,8 +147,8 @@ function M.config()
return math.floor(cur / total * 100) .. '%%'
end
end,
"progress",
color = { gui = "none" },
'progress',
color = { gui = 'none' },
padding = { left = 0, right = 1 },
},
},
@ -157,23 +158,22 @@ function M.config()
inactive_sections = {
lualine_a = {
{ -- file name
"filename",
path = 1,
icon="",
color = { fg = scolors.filename, gui = "bold" },
'filename',
path = 1,
icon = '',
color = { fg = scolors.filename, gui = 'bold' },
padding = { left = 1, right = 1 },
},
},
},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
}
},
}
lualine.setup(config)
end
return M

View File

@ -1,63 +1,68 @@
local M = {}
function M.config()
local status_ok, null_ls = pcall(require, "null-ls")
local status_ok, null_ls = pcall(require, 'null-ls')
if not status_ok then
return
end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup {
local augroup = vim.api.nvim_create_augroup('LspFormatting', {})
null_ls.setup({
debug = false,
sources = {
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
-- Python
-- Lua
-- pip install black
-- sudo pacman -S stylua
-- https://github.com/JohnnyMorganz/StyLua/releases
null_ls.builtins.formatting.stylua,
-- Python
-- pip install black
null_ls.builtins.formatting.black,
-- pip install isort
-- pip install isort
null_ls.builtins.formatting.isort,
-- JavaScript / TypeScript
-- JavaScript / TypeScript
-- sudo pacman -S prettierd
-- sudo npm install -g @fsouza/prettierd
-- sudo pacman -S prettierd
-- sudo npm install -g @fsouza/prettierd
null_ls.builtins.formatting.prettierd.with({
disabled_filetypes = { "html", "markdown" },
condition = function(utils)
return utils.root_has_file({ ".prettierrc.yml" })
end,
}),
disabled_filetypes = { 'html', 'markdown' },
condition = function(utils)
return utils.root_has_file({ '.prettierrc.yml' })
end,
}),
-- sudo pacman -S eslint_d
-- sudo npm install -g eslint_d
-- sudo pacman -S eslint_d
-- sudo npm install -g eslint_d
null_ls.builtins.diagnostics.eslint_d.with({
diagnostic_config = {
virtual_text = false,
severity_sort = true,
},
condition = function(utils)
return utils.root_has_file({ ".eslintrc.js" })
end,
}),
diagnostic_config = {
virtual_text = false,
severity_sort = true,
},
condition = function(utils)
return utils.root_has_file({ '.eslintrc.js' })
end,
}),
},
-- Format before save
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.format({ bufnr = bufnr })
end,
})
end
end,
}
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.format({ bufnr = bufnr })
end,
})
end
end,
})
end
return M

View File

@ -1,61 +1,61 @@
local M = {}
function M.config()
local status_ok, nvimtree = pcall(require, "nvim-tree")
local status_ok, nvimtree = pcall(require, 'nvim-tree')
if not status_ok then
return
end
nvimtree.setup {
nvimtree.setup({
filters = {
dotfiles = false,
custom = {
"^\\.git$",
"^\\.mypy_cache$",
"^\\.test_cache$",
"^\\.coverage$",
"^node_modules$",
'^\\.git$',
'^\\.mypy_cache$',
'^\\.test_cache$',
'^\\.coverage$',
'^node_modules$',
},
},
view = {
width = 40,
side = "left",
side = 'left',
hide_root_folder = true,
number = false,
relativenumber = false,
signcolumn = "yes",
signcolumn = 'yes',
},
renderer = {
indent_markers = {
enable = false,
icons = {
corner = "",
edge = "",
none = " ",
}
corner = '',
edge = '',
none = ' ',
},
},
icons = {
webdev_colors = true,
glyphs = {
folder = {
symlink_open = "",
},
},
}
glyphs = {
folder = {
symlink_open = '',
},
},
},
},
disable_netrw = true,
hijack_netrw = true,
open_on_tab = false,
ignore_ft_on_setup = {
"alpha",
'alpha',
},
actions = {
open_file = {
quit_on_open = false,
window_picker = {
enable = false,
}
}
},
},
},
hijack_cursor = true,
update_focused_file = {
@ -64,10 +64,10 @@ function M.config()
diagnostics = {
enable = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
hint = '',
info = '',
warning = '',
error = '',
},
},
git = {
@ -75,8 +75,7 @@ function M.config()
ignore = false,
timeout = 500,
},
}
})
end
return M

View File

@ -1,23 +1,23 @@
local M = {}
function M.config()
local status_ok, session_manager = pcall(require, "session_manager")
local status_ok, session_manager = pcall(require, 'session_manager')
if not status_ok then
return
end
local sm_config = require'session_manager.config'
local sm_config = require('session_manager.config')
local function get_branch_name()
local handle = io.popen("git branch --show-current 2>/dev/null")
if (handle == nil) then
local handle = io.popen('git branch --show-current 2>/dev/null')
if handle == nil then
return nil
end
local branch = handle:read("l")
local branch = handle:read('l')
handle:close()
if (branch == nil) then
if branch == nil then
return nil
end
branch = branch:gsub("/", "--")
branch = branch:gsub('/', '--')
return branch
end
@ -25,14 +25,14 @@ function M.config()
session_manager.setup({
autoload_mode = sm_config.AutoloadMode.Disabled, -- do not auto-load the last session at startup
session_filename_to_dir = function(filename)
local filename_without_extra = filename:sub(0, filename:find("=="))
local filename_without_extra = filename:sub(0, filename:find('=='))
return sm_config.delimited_session_filename_to_dir(filename_without_extra)
end,
dir_to_session_filename = function(dir)
local filename = sm_config.dir_to_delimited_session_filename(dir)
local branch = get_branch_name()
if branch ~= nil then
return filename .. "==" .. branch
return filename .. '==' .. branch
else
return filename
end
@ -41,4 +41,3 @@ function M.config()
end
return M

View File

@ -1,77 +1,77 @@
local M = {}
function M.config()
local status_ok, telescope = pcall(require, "telescope")
local status_ok, telescope = pcall(require, 'telescope')
if not status_ok then
return
end
local actions = require "telescope.actions"
local actions = require('telescope.actions')
--telescope.load_extension "fzf"
telescope.setup {
telescope.setup({
defaults = {
prompt_prefix = "",
selection_caret = "+ ",
-- emojis cause annoying highlight behavior
-- waiting on https://github.com/nvim-telescope/telescope.nvim/issues/1841
prompt_prefix = '',
selection_caret = '+ ',
-- emojis cause annoying highlight behavior
-- waiting on https://github.com/nvim-telescope/telescope.nvim/issues/1841
--selection_caret = " ",
path_display = { "truncate" },
path_display = { 'truncate' },
mappings = {
i = {
["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev,
['<C-n>'] = actions.cycle_history_next,
['<C-p>'] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
['<C-j>'] = actions.move_selection_next,
['<C-k>'] = actions.move_selection_previous,
["<C-c>"] = actions.close,
['<C-c>'] = actions.close,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
['<Down>'] = actions.move_selection_next,
['<Up>'] = actions.move_selection_previous,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
['<CR>'] = actions.select_default,
['<C-x>'] = actions.select_horizontal,
['<C-v>'] = actions.select_vertical,
['<C-t>'] = actions.select_tab,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
['<C-u>'] = actions.preview_scrolling_up,
['<C-d>'] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
['<PageUp>'] = actions.results_scrolling_up,
['<PageDown>'] = actions.results_scrolling_down,
["<Tab>"] = actions.toggle_selection,
["<S-Tab>"] = actions.toggle_selection,
['<Tab>'] = actions.toggle_selection,
['<S-Tab>'] = actions.toggle_selection,
["<C-l>"] = actions.complete_tag,
['<C-l>'] = actions.complete_tag,
},
n = {
["<esc>"] = actions.close,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
['<esc>'] = actions.close,
['<CR>'] = actions.select_default,
['<C-x>'] = actions.select_horizontal,
['<C-v>'] = actions.select_vertical,
['<C-t>'] = actions.select_tab,
["<Tab>"] = actions.toggle_selection,
["<S-Tab>"] = actions.toggle_selection,
['<Tab>'] = actions.toggle_selection,
['<S-Tab>'] = actions.toggle_selection,
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
['j'] = actions.move_selection_next,
['k'] = actions.move_selection_previous,
["gg"] = actions.move_to_top,
["G"] = actions.move_to_bottom,
['gg'] = actions.move_to_top,
['G'] = actions.move_to_bottom,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
['<Down>'] = actions.move_selection_next,
['<Up>'] = actions.move_selection_previous,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
['<C-u>'] = actions.preview_scrolling_up,
['<C-d>'] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
['<PageUp>'] = actions.results_scrolling_up,
['<PageDown>'] = actions.results_scrolling_down,
},
},
},
@ -91,7 +91,7 @@ function M.config()
-- case_mode = "smart_case",
-- },
},
}
})
end
return M

View File

@ -1,4 +1,3 @@
local M = {}
function M.config()
@ -7,10 +6,9 @@ function M.config()
return
end
treesitter_context.setup {
mode = 'topline',
}
treesitter_context.setup({
mode = 'topline',
})
end
return M

View File

@ -6,19 +6,18 @@ function M.config()
return
end
treesitter_configs.setup {
treesitter_configs.setup({
highlight = {
enable = true,
disable = { },
disable = {},
--additional_vim_regex_highlighting = true
},
context_commentstring = {
enable = true,
enable_autocmd = false,
},
indent = { enable = true, disable = { "html" } },
}
indent = { enable = true, disable = { 'html' } },
})
end
return M

View File

@ -1,3 +1,2 @@
-- Mostly to hide the nvim-tree Vert Split group. Looks nice in general too
vim.cmd [[ highlight VertSplit guifg=#252526 guibg=#252526 ]]
vim.cmd([[ highlight VertSplit guifg=#252526 guibg=#252526 ]])

View File

@ -1,84 +1,84 @@
local opts = { noremap = true, silent = true }
local map = vim.api.nvim_set_keymap
map("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
map('', '<Space>', '<Nop>', opts)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Window Navigation without needing <C-w> first
map("n", "<C-h>", "<C-w>h", opts)
map("n", "<C-j>", "<C-w>j", opts)
map("n", "<C-k>", "<C-w>k", opts)
map("n", "<C-l>", "<C-w>l", opts)
map('n', '<C-h>', '<C-w>h', opts)
map('n', '<C-j>', '<C-w>j', opts)
map('n', '<C-k>', '<C-w>k', opts)
map('n', '<C-l>', '<C-w>l', opts)
-- Stay in visual mode when indenting
map("v", "<", "<gv", opts)
map("v", ">", ">gv", opts)
map('v', '<', '<gv', opts)
map('v', '>', '>gv', opts)
-- Resize with C-arrow
map("n", "<C-Up>", "<cmd>resize -2<CR>", opts)
map("n", "<C-Down>", "<cmd>resize +2<CR>", opts)
map("n", "<C-Left>", "<cmd>vertical resize -2<CR>", opts)
map("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts)
map('n', '<C-Up>', '<cmd>resize -2<CR>', opts)
map('n', '<C-Down>', '<cmd>resize +2<CR>', opts)
map('n', '<C-Left>', '<cmd>vertical resize -2<CR>', opts)
map('n', '<C-Right>', '<cmd>vertical resize +2<CR>', opts)
-- Jump to column and row rather than first column in row
map("n", "'", "`", opts)
map("n", "`", "'", opts)
map('n', "'", '`', opts)
map('n', '`', "'", opts)
-- Close context menus
map('n', '<leader>q', '<cmd>cclose<CR>', opts)
-- Navigate buffers
map("n", "<S-l>", "<cmd>BufferLineCycleNext<CR>", opts) -- :bnext
map("n", "<S-h>", "<cmd>BufferLineCyclePrev<CR>", opts) -- :bprevious
map("n", "]b", "<cmd>BufferLineMoveNext<CR>", opts)
map("n", "[b", "<cmd>BufferLineMovePrev<CR>", opts)
map("n", "<leader>w", "<cmd>Bdelete<CR>", opts) -- don't close if unsaved
map("n", "<leader>c", "<cmd>Bdelete!<CR>", opts) -- close it no matter what B)
map('n', '<S-l>', '<cmd>BufferLineCycleNext<CR>', opts) -- :bnext
map('n', '<S-h>', '<cmd>BufferLineCyclePrev<CR>', opts) -- :bprevious
map('n', ']b', '<cmd>BufferLineMoveNext<CR>', opts)
map('n', '[b', '<cmd>BufferLineMovePrev<CR>', opts)
map('n', '<leader>w', '<cmd>Bdelete<CR>', opts) -- don't close if unsaved
map('n', '<leader>c', '<cmd>Bdelete!<CR>', opts) -- close it no matter what B)
-- Navigate Git Signs
map("n", "]g", "<cmd>Gitsigns next_hunk<CR>", opts)
map("n", "[g", "<cmd>Gitsigns prev_hunk<CR>", opts)
map('n', ']g', '<cmd>Gitsigns next_hunk<CR>', opts)
map('n', '[g', '<cmd>Gitsigns prev_hunk<CR>', opts)
-- Toggle Diagnostics
map("n", "<leader>de", "<cmd>lua vim.diagnostic.enable()<cr>", opts)
map("n", "<leader>dd", "<cmd>lua vim.diagnostic.disable()<cr>", opts)
map('n', '<leader>de', '<cmd>lua vim.diagnostic.enable()<cr>', opts)
map('n', '<leader>dd', '<cmd>lua vim.diagnostic.disable()<cr>', opts)
-- NvimTree
map('n', '<leader>e', '<cmd>NvimTreeToggle<CR>', opts)
map('n', '<leader>o', '<cmd>NvimTreeFocus<CR>', opts)
-- Telescope (See also configs/telescope.lua)
map("n", "<leader>ff", "<cmd>Telescope find_files<CR>", opts)
map("n", "<leader>fw", "<cmd>Telescope live_grep<CR>", opts)
map("n", "<leader>fo", "<cmd>Telescope oldfiles<CR>", opts)
map("n", "<leader>fp", "<cmd>Telescope projects<CR>", opts) -- ahmedkhalf/project.nvim
map('n', '<leader>ff', '<cmd>Telescope find_files<CR>', opts)
map('n', '<leader>fw', '<cmd>Telescope live_grep<CR>', opts)
map('n', '<leader>fo', '<cmd>Telescope oldfiles<CR>', opts)
map('n', '<leader>fp', '<cmd>Telescope projects<CR>', opts) -- ahmedkhalf/project.nvim
map("n", "<leader>fb", "<cmd>Telescope buffers<CR>", opts)
map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>", opts)
map("n", "<leader>fs", "<cmd>Telescope git_status<CR>", opts)
map("n", "<leader>fc", "<cmd>Telescope git_commits<CR>", opts)
map('n', '<leader>fb', '<cmd>Telescope buffers<CR>', opts)
map('n', '<leader>fh', '<cmd>Telescope help_tags<CR>', opts)
map('n', '<leader>fs', '<cmd>Telescope git_status<CR>', opts)
map('n', '<leader>fc', '<cmd>Telescope git_commits<CR>', opts)
map("n", "gr", "<cmd>Telescope lsp_references<CR>", opts)
map('n', 'gr', '<cmd>Telescope lsp_references<CR>', opts)
-- Lspsaga (See also configs/lspsaga.lua)
--map("n", "gl", "<cmd>Lspsaga show_line_diagnostics<CR>", opts)
map("n", "gpd", "<cmd>Lspsaga preview_definition<CR>", opts)
map("n", "gs", "<cmd>Lspsaga signature_help<CR>", opts)
map("i", "<C-s>", "<cmd>Lspsaga signature_help<CR>", opts)
map("n", "<leader>lr", "<cmd>Lspsaga rename<CR>", opts)
map("n", "<leader>la", "<cmd>Lspsaga code_action<CR>", opts)
map("n", "<C-u>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>", opts)
map("n", "<C-d>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>", opts)
map('n', 'gpd', '<cmd>Lspsaga preview_definition<CR>', opts)
map('n', 'gs', '<cmd>Lspsaga signature_help<CR>', opts)
map('i', '<C-s>', '<cmd>Lspsaga signature_help<CR>', opts)
map('n', '<leader>lr', '<cmd>Lspsaga rename<CR>', opts)
map('n', '<leader>la', '<cmd>Lspsaga code_action<CR>', opts)
map('n', '<C-u>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>", opts)
map('n', '<C-d>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>", opts)
-- Custom "toggle summary" function for blame
-- jkkj is a hack to refresh the git blame message since it doesn't update till the line changes
map("n", "<leader>s", "<cmd>GitBlameToggleSummary<CR>jkkj", opts)
map('n', '<leader>s', '<cmd>GitBlameToggleSummary<CR>jkkj', opts)
-- LSP (see configs/lsp-installer.lua)
-- disable K in visual mode
map("v", "K", "<Nop>", { noremap=false, silent=true })
map('v', 'K', '<Nop>', { noremap = false, silent = true })
-- Illuminate
map("n", "<C-n>", "<cmd>lua require('illuminate').goto_next_reference()<CR>", opts)
map("n", "g<C-n>", "<cmd>lua require('illuminate').goto_prev_reference()<CR>", opts)
map('n', '<C-n>', "<cmd>lua require('illuminate').goto_next_reference()<CR>", opts)
map('n', 'g<C-n>', "<cmd>lua require('illuminate').goto_prev_reference()<CR>", opts)

View File

@ -1,221 +1,292 @@
-- Make sure to install packer via the AUR
-- $ yay -S nvim-packer-git
local packer_status_ok, packer = pcall(require, "packer")
local packer_status_ok, packer = pcall(require, 'packer')
if not packer_status_ok then
return
end
vim.cmd [[packadd packer.nvim]]
vim.cmd([[packadd packer.nvim]])
packer.startup {
packer.startup({
function(use)
-- git clone --depth 1 https://github.com/wbthomason/packer.nvim \
-- ~/.local/share/nvim/site/pack/packer/start/packer.nvim
-- Packer will try to delete itself otherwise
use 'wbthomason/packer.nvim'
-- git clone --depth 1 https://github.com/wbthomason/packer.nvim \
-- ~/.local/share/nvim/site/pack/packer/start/packer.nvim
-- Packer will try to delete itself otherwise
use('wbthomason/packer.nvim')
--
-- General
--
-- General Lua functions
use { 'nvim-lua/plenary.nvim' }
use { 'nvim-lua/popup.nvim' }
use({ 'nvim-lua/plenary.nvim' })
use({ 'nvim-lua/popup.nvim' })
-- General optimizations
use { 'lewis6991/impatient.nvim' }
use { 'nathom/filetype.nvim', config = function() vim.g.did_load_filetypes = 1 end }
use({ 'lewis6991/impatient.nvim' })
use({
'nathom/filetype.nvim',
config = function()
vim.g.did_load_filetypes = 1
end,
})
-- General Assets/Resources
use { 'kyazdani42/nvim-web-devicons', config = function() require'configs.icons'.config() end }
use({
'kyazdani42/nvim-web-devicons',
config = function()
require('configs.icons').config()
end,
})
--
-- Style
--
-- Colorscheme (See autocommands.lua)
use {
'lunarvim/darkplus.nvim',
commit = 'f20cba5d690bc34398a3a8372ee7bbbc7b6609fa',
-- tag = 'neovim-0.7', -- this has imperfect comment highlights
}
use({
'lunarvim/darkplus.nvim',
commit = 'f20cba5d690bc34398a3a8372ee7bbbc7b6609fa',
-- tag = 'neovim-0.7', -- this has imperfect comment highlights
})
--[[ use { '~/builds/darkplus.nvim' } ]]
-- Buffer Line
use { 'moll/vim-bbye' } -- Close buffers softly
use {
use({ 'moll/vim-bbye' }) -- Close buffers softly
use({
'akinsho/bufferline.nvim',
-- v3.* requires nvim v0.8+
tag = 'v2.*',
-- v3.* requires nvim v0.8+
tag = 'v2.*',
requires = {
{ 'kyazdani42/nvim-web-devicons' }
{ 'kyazdani42/nvim-web-devicons' },
},
config = function() require'configs.bufferline'.config() end
}
config = function()
require('configs.bufferline').config()
end,
})
-- Git (git-blame must be before lualine)
use { 'lewis6991/gitsigns.nvim', config = function() require'configs.gitsigns'.config() end }
use { 'f-person/git-blame.nvim', config = function() require'configs.git-blame'.config() end }
-- Git (git-blame must be before lualine)
use({
'lewis6991/gitsigns.nvim',
config = function()
require('configs.gitsigns').config()
end,
})
use({
'f-person/git-blame.nvim',
config = function()
require('configs.git-blame').config()
end,
})
-- Status Line
use { 'nvim-lualine/lualine.nvim', config = function() require'configs.lualine'.config() end }
use({
'nvim-lualine/lualine.nvim',
config = function()
require('configs.lualine').config()
end,
})
-- NvimTree
use {
use({
'kyazdani42/nvim-tree.lua',
requires = {
{ 'kyazdani42/nvim-web-devicons' }
{ 'kyazdani42/nvim-web-devicons' },
},
config = function() require'configs.nvim-tree'.config() end
}
config = function()
require('configs.nvim-tree').config()
end,
})
-- Show indentation
use { 'lukas-reineke/indent-blankline.nvim', config = function() require'configs.indent-blankline'.config() end }
use({
'lukas-reineke/indent-blankline.nvim',
config = function()
require('configs.indent-blankline').config()
end,
})
-- Telescope (find files, words, git commits, etc)
use { 'nvim-telescope/telescope.nvim', config = function() require'configs.telescope'.config() end }
use({
'nvim-telescope/telescope.nvim',
config = function()
require('configs.telescope').config()
end,
})
-- use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
-- Sessions
-- use {
-- 'Shatur/neovim-session-manager',
-- commit = '4005dac93f5cd1257792259ef4df6af0e3afc213',
-- config = function() require'configs.session-manager'.config() end
-- }
-- custom build of the above plugin
use {
'~/builds/neovim-session-manager',
config = function() require'configs.session-manager'.config() end
}
-- Sessions
-- use {
-- 'Shatur/neovim-session-manager',
-- commit = '4005dac93f5cd1257792259ef4df6af0e3afc213',
-- config = function() require'configs.session-manager'.config() end
-- }
-- custom build of the above plugin
use({
'~/builds/neovim-session-manager',
config = function()
require('configs.session-manager').config()
end,
})
--
-- Treesitter
--
-- Treesitter
use {
use({
'nvim-treesitter/nvim-treesitter',
commit = '4cccb6f494eb255b32a290d37c35ca12584c74d0',
commit = '4cccb6f494eb255b32a290d37c35ca12584c74d0',
run = ':TSUpdate',
config = function() require'configs.treesitter'.config() end,
-- the next commit, 42ab95d5e11f247c6f0c8f5181b02e816caa4a4f breaks the darkplus colorscheme (and nvim 0.7.2)
-- https://github.com/nvim-treesitter/nvim-treesitter/pull/3656
}
config = function()
require('configs.treesitter').config()
end,
-- the next commit, 42ab95d5e11f247c6f0c8f5181b02e816caa4a4f breaks the darkplus colorscheme (and nvim 0.7.2)
-- https://github.com/nvim-treesitter/nvim-treesitter/pull/3656
})
-- Auto-close tags
use { 'windwp/nvim-ts-autotag', after = 'nvim-treesitter' }
use({ 'windwp/nvim-ts-autotag', after = 'nvim-treesitter' })
-- Context-based auto commenting
use { 'JoosepAlviste/nvim-ts-context-commentstring', after = 'nvim-treesitter' }
use({ 'JoosepAlviste/nvim-ts-context-commentstring', after = 'nvim-treesitter' })
-- Show context
use { 'nvim-treesitter/nvim-treesitter-context', config = function() require'configs.treesitter-context'.config() end }
-- Show context
use({
'nvim-treesitter/nvim-treesitter-context',
config = function()
require('configs.treesitter-context').config()
end,
})
--
-- LSP
--
-- Cursorhold fix
use {
"antoinemadec/FixCursorHold.nvim",
config = function() vim.g.cursorhold_updatetime = 300 end,
}
use({
'antoinemadec/FixCursorHold.nvim',
config = function()
vim.g.cursorhold_updatetime = 300
end,
})
-- Built-In LSP Config
use {
use({
'neovim/nvim-lspconfig',
-- event = 'BufRead',
config = function() require'configs.lspconfig'.config() end
}
config = function()
require('configs.lspconfig').config()
end,
})
-- TODO: LSP Enhancer
use {
use({
'tami5/lspsaga.nvim',
config = function() require'configs.lspsaga'.config() end
}
config = function()
require('configs.lspsaga').config()
end,
})
-- TODO: Symbols Outline
-- use { 'simrat39'/symbols-outline.nvim', cmd = 'SymbolsOutline', setup = function ... }
-- Formatting + Linting
use {
use({
'jose-elias-alvarez/null-ls.nvim',
event = 'BufRead',
config = function() require'configs.null-ls'.config() end
}
-- highlight hovered-over text
use {
'RRethy/vim-illuminate',
config = function() require'configs.illuminate'.config() end
}
config = function()
require('configs.null-ls').config()
end,
})
-- highlight hovered-over text
use({
'RRethy/vim-illuminate',
config = function()
require('configs.illuminate').config()
end,
})
--
-- Autocompletion
--
-- Autocompletion Engine
use {
use({
'hrsh7th/nvim-cmp',
config = function() require'configs.cmp'.config() end
}
config = function()
require('configs.cmp').config()
end,
})
-- Snippet Engine (for nvim-cmp)
-- TODO: Add snippets? rafamadriz/friendly-snippets is too cow for me and has too many snippets.
-- I'd like to use my own collection exclusively (unless there is a better, less extensive collection)
use { 'L3MON4D3/LuaSnip' }
use({ 'L3MON4D3/LuaSnip' })
-- Autocompletion Sources
use { 'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp', requires = { 'nvim-cmp' } }
use { 'hrsh7th/cmp-buffer', after = 'nvim-cmp', requires = { 'nvim-cmp' } }
use { 'hrsh7th/cmp-path', after = 'nvim-cmp', requires = { 'nvim-cmp' } }
use { 'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp', requires = { 'nvim-cmp' } }
use({ 'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp', requires = { 'nvim-cmp' } })
use({ 'hrsh7th/cmp-buffer', after = 'nvim-cmp', requires = { 'nvim-cmp' } })
use({ 'hrsh7th/cmp-path', after = 'nvim-cmp', requires = { 'nvim-cmp' } })
use({ 'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp', requires = { 'nvim-cmp' } })
--
-- Quality of Life
--
-- Dashboard
use {
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
config = function() require'configs.alpha'.config() end
}
-- Dashboard
use({
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
config = function()
require('configs.alpha').config()
end,
})
-- Autopairs
use { 'windwp/nvim-autopairs', config = function() require'configs.autopairs'.config() end }
use({
'windwp/nvim-autopairs',
config = function()
require('configs.autopairs').config()
end,
})
-- Commenting
use {
'numToStr/Comment.nvim',
config = function() require'configs.comment'.config() end,
after = 'nvim-ts-context-commentstring'
}
-- Commenting
use({
'numToStr/Comment.nvim',
config = function()
require('configs.comment').config()
end,
after = 'nvim-ts-context-commentstring',
})
-- Automatically colorize color strings (#f1b8f1)
use { 'norcalli/nvim-colorizer.lua', config = function() require'configs.colorizer'.config() end }
use({
'norcalli/nvim-colorizer.lua',
config = function()
require('configs.colorizer').config()
end,
})
-- Remember your last place when opening a file
use { 'farmergreg/vim-lastplace' }
use({ 'farmergreg/vim-lastplace' })
-- Import sorting for python (:Isort)
use { 'stsewd/isort.nvim', run = ':UpdateRemotePlugins' }
-- Import sorting for python (:Isort)
use({ 'stsewd/isort.nvim', run = ':UpdateRemotePlugins' })
-- Formatting for python (:call Black())
use { 'averms/black-nvim', run = ':UpdateRemotePlugins' }
-- Formatting for python (:call Black())
use({ 'averms/black-nvim', run = ':UpdateRemotePlugins' })
end,
config = {
display = {
open_fn = function()
return require'packer.util'.float { border = 'rounded' }
end
return require('packer.util').float({ border = 'rounded' })
end,
},
profile = {
enable = true,
threshold = 0.0001,
}
}
}
},
},
})

View File

@ -27,13 +27,9 @@ set.number = true
set.cursorline = true
set.wrap = false
-- Javascript Mode
--set.expandtab = false
--set.shiftwidth = 4
--set.tabstop = 4
-- Python Mode
set.expandtab = true
set.expandtab = false
set.shiftwidth = 4
set.tabstop = 4
-- enable expandtab for python files