Convert single quote to double quotes.

main
Joshua Potter 2024-03-04 20:10:57 -07:00
parent e909a2c826
commit a5401bb9a8
12 changed files with 235 additions and 235 deletions

View File

@ -1,26 +1,26 @@
local M = {} local M = {}
function M.nvim_dap() function M.nvim_dap()
local dap = require('dap') local dap = require("dap")
local key = 'codelldb' local key = "codelldb"
dap.adapters[key] = { dap.adapters[key] = {
type = 'server', type = "server",
port = '${port}', port = "${port}",
executable = { executable = {
command = 'codelldb', command = "codelldb",
args = {'--port', '${port}'}, args = { "--port", "${port}" },
}, },
} }
local config = { local config = {
name = 'Launch Executable', name = "Launch Executable",
type = key, type = key,
request = 'launch', request = "launch",
program = function() program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end, end,
cwd = '${workspaceFolder}', cwd = "${workspaceFolder}",
} }
dap.configurations.c = dap.configurations.c or {} dap.configurations.c = dap.configurations.c or {}
@ -31,7 +31,7 @@ function M.nvim_dap()
end end
function M.nvim_lspconfig() function M.nvim_lspconfig()
require('utils.lsp').setup(require('lspconfig').clangd) {} require("utils.lsp").setup(require("lspconfig").clangd) {}
end end
return M return M

View File

@ -1,21 +1,21 @@
local M = {} local M = {}
function M.nvim_lspconfig() function M.nvim_lspconfig()
require('utils.lsp').setup(require('lspconfig').lua_ls) { require("utils.lsp").setup(require("lspconfig").lua_ls) {
-- Provide completions, analysis, and location handling for plugins on the -- Provide completions, analysis, and location handling for plugins on the
-- vim runtime path. -- vim runtime path.
-- https://github.com/neovim/nvim-lspconfig/blob/48347089666d5b77d054088aa72e4e0b58026e6e/doc/server_configurations.md#lua_ls -- https://github.com/neovim/nvim-lspconfig/blob/48347089666d5b77d054088aa72e4e0b58026e6e/doc/server_configurations.md#lua_ls
on_init = function(client) on_init = function(client)
local path = client.workspace_folders[1].name local path = client.workspace_folders[1].name
if ( if (
not vim.loop.fs_stat(path .. '/.luarc.json') and not vim.loop.fs_stat(path .. "/.luarc.json") and
not vim.loop.fs_stat(path .. '/.luarc.jsonc') not vim.loop.fs_stat(path .. "/.luarc.jsonc")
) then ) then
client.config.settings = vim.tbl_deep_extend( client.config.settings = vim.tbl_deep_extend(
'force', client.config.settings, { "force", client.config.settings, {
Lua = { Lua = {
runtime = { runtime = {
version = 'LuaJIT' version = "LuaJIT"
}, },
workspace = { workspace = {
checkThirdParty = false, checkThirdParty = false,

View File

@ -1,36 +1,36 @@
local M = {} local M = {}
function M.nvim_dap() function M.nvim_dap()
local dap = require('dap') local dap = require("dap")
local key = 'debugpy' local key = "debugpy"
dap.adapters[key] = { dap.adapters[key] = {
type = 'executable', type = "executable",
command = 'python3', command = "python3",
args = { '-m', 'debugpy.adapter' }, args = { "-m", "debugpy.adapter" },
options = { options = {
source_filetype = 'python', source_filetype = "python",
}, },
} }
dap.configurations.python = dap.configurations.python or {} dap.configurations.python = dap.configurations.python or {}
table.insert(dap.configurations.python, { table.insert(dap.configurations.python, {
name = 'Launch File', name = "Launch File",
type = key, type = key,
request = 'launch', request = "launch",
program = '${file}', program = "${file}",
cwd = '${workspaceFolder}', cwd = "${workspaceFolder}",
}) })
end end
function M.nvim_lspconfig() function M.nvim_lspconfig()
require('utils.lsp').setup(require('lspconfig').pylsp) { require("utils.lsp").setup(require("lspconfig").pylsp) {
settings = { settings = {
pylsp = { pylsp = {
-- `flake8` currently fails in some cases. Prefer the default set of -- `flake8` currently fails in some cases. Prefer the default set of
-- utilities instead. -- utilities instead.
-- https://github.com/python-lsp/python-lsp-server/pull/434 -- https://github.com/python-lsp/python-lsp-server/pull/434
configurationSources = 'pycodestyle', configurationSources = "pycodestyle",
plugins = { plugins = {
autopep8 = { enabled = false }, autopep8 = { enabled = false },
black = { enabled = true }, black = { enabled = true },

View File

@ -1,22 +1,22 @@
local M = {} local M = {}
local cmp = require('cmp') local cmp = require("cmp")
local cmp_buffer = require('cmp_buffer') local cmp_buffer = require("cmp_buffer")
local luasnip = require('luasnip') local luasnip = require("luasnip")
local types = require('cmp.types') local types = require("cmp.types")
function M.setup() function M.setup()
cmp.setup { cmp.setup {
snippet = { snippet = {
expand = function(args) expand = function(args)
require('luasnip').lsp_expand(args.body) require("luasnip").lsp_expand(args.body)
end, end,
}, },
sources = { sources = {
{ name = 'luasnip', option = { show_autosnippets = true } }, { name = "luasnip", option = { show_autosnippets = true } },
{ name = 'nvim_lsp' }, { name = "nvim_lsp" },
{ {
name = 'buffer', name = "buffer",
option = { option = {
-- Complete only on visible buffers. -- Complete only on visible buffers.
get_bufnrs = function() get_bufnrs = function()
@ -51,23 +51,23 @@ function M.setup()
}, },
}, },
mapping = { mapping = {
['<tab>'] = cmp.mapping(function(fallback) ["<tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.confirm({ select = true }) cmp.confirm({ select = true })
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
['<c-l>'] = cmp.mapping(function(fallback) ["<c-l>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.abort() cmp.abort()
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
['<c-n>'] = cmp.mapping(function(fallback) ["<c-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then elseif luasnip.expand_or_locally_jumpable() then
@ -75,9 +75,9 @@ function M.setup()
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
['<c-p>'] = cmp.mapping(function(fallback) ["<c-p>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then elseif luasnip.locally_jumpable(-1) then
@ -85,7 +85,7 @@ function M.setup()
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
}, },
} }
end end

View File

@ -1,16 +1,16 @@
local M = {} local M = {}
local dap = require('dap') local dap = require("dap")
local dap_ui = require('dap.ui') local dap_ui = require("dap.ui")
local dap_ui_widgets = require('dap.ui.widgets') local dap_ui_widgets = require("dap.ui.widgets")
local function query_launch() local function query_launch()
local command = vim.fn.input('Launch> ', vim.fn.getcwd() .. '/', 'file') local command = vim.fn.input("Launch> ", vim.fn.getcwd() .. "/", "file")
vim.api.nvim_echo({ { '', 'None' } }, false, {}) vim.api.nvim_echo({ { "", "None" } }, false, {})
local parts = vim.split(command, '%s+', { trimempty = true }) local parts = vim.split(command, "%s+", { trimempty = true })
if not parts[1] then if not parts[1] then
vim.api.nvim_err_writeln('Invalid command specification.') vim.api.nvim_err_writeln("Invalid command specification.")
return return
end end
@ -19,19 +19,19 @@ end
-- Adaptation of https://github.com/mfussenegger/nvim-dap/blob/e154fdb6d70b3765d71f296e718b29d8b7026a63/lua/dap.lua#L413. -- Adaptation of https://github.com/mfussenegger/nvim-dap/blob/e154fdb6d70b3765d71f296e718b29d8b7026a63/lua/dap.lua#L413.
local function select_config_and_run() local function select_config_and_run()
local filetype = vim.api.nvim_buf_get_option(0, 'filetype') local filetype = vim.api.nvim_buf_get_option(0, "filetype")
local configs = dap.configurations[filetype] or {} local configs = dap.configurations[filetype] or {}
assert( assert(
vim.tbl_islist(configs), vim.tbl_islist(configs),
string.format( string.format(
'`dap.configurations.%s` must be a list of configurations, got %s', "`dap.configurations.%s` must be a list of configurations, got %s",
filetype, filetype,
vim.inspect(configs) vim.inspect(configs)
) )
) )
if not configs[1] then if not configs[1] then
local msg = 'No configuration found for `%s`. You need to add configs ' .. local msg = "No configuration found for `%s`. You need to add configs " ..
'to `dap.configurations.%s` (See `:h dap-configuration`)' "to `dap.configurations.%s` (See `:h dap-configuration`)"
vim.api.nvim_err_writeln(string.format(msg, filetype, filetype)) vim.api.nvim_err_writeln(string.format(msg, filetype, filetype))
return return
end end
@ -41,17 +41,17 @@ local function select_config_and_run()
dap_ui.pick_if_many( dap_ui.pick_if_many(
configs, configs,
'Configuration: ', "Configuration: ",
function(c) -- Label function function(c) -- Label function
return c.name return c.name
end, end,
function(c) -- Callback function(c) -- Callback
if not c then if not c then
vim.api.nvim_err_writeln('No configuration selected.') vim.api.nvim_err_writeln("No configuration selected.")
return return
end end
local copy = vim.deepcopy(c) local copy = vim.deepcopy(c)
if copy.request == 'launch' then if copy.request == "launch" then
local program, args = query_launch() local program, args = query_launch()
copy.program = program copy.program = program
copy.args = args copy.args = args
@ -93,21 +93,21 @@ function M.buffer_map()
else else
local win_id = vim.fn.win_getid() local win_id = vim.fn.win_getid()
vim.cmd.wincmd('t') -- Move to topleft-most window. vim.cmd.wincmd('t') -- Move to topleft-most window.
vim.cmd(sidebar_any_open() and 'leftabove split' or 'vertical topleft split') vim.cmd(sidebar_any_open() and "leftabove split" or "vertical topleft split")
sidebar.open() sidebar.open()
vim.fn.win_gotoid(win_id) vim.fn.win_gotoid(win_id)
-- Update state of windows. -- Update state of windows.
vim.api.nvim_win_set_option(sidebar.win, 'colorcolumn', '') vim.api.nvim_win_set_option(sidebar.win, "colorcolumn", "")
vim.api.nvim_win_set_option(sidebar.win, 'list', false) vim.api.nvim_win_set_option(sidebar.win, "list", false)
vim.api.nvim_win_set_option(sidebar.win, 'wrap', false) vim.api.nvim_win_set_option(sidebar.win, "wrap", false)
vim.api.nvim_win_set_option(sidebar.win, 'winfixwidth', true) vim.api.nvim_win_set_option(sidebar.win, "winfixwidth", true)
end end
end end
local function sidebar_only(sidebar) local function sidebar_only(sidebar)
for _, sb in pairs(sidebars) do for _, sb in pairs(sidebars) do
if sb ~= sidebar and sidebar_is_open(sb) then if sb ~= sidebar and sidebar_is_open(sb) then
sb.close({ mode = 'toggle' }) sb.close({ mode = "toggle" })
end end
end end
if not sidebar_is_open(sidebar) then if not sidebar_is_open(sidebar) then
@ -151,9 +151,9 @@ function M.buffer_map()
local win_id = vim.fn.win_getid() local win_id = vim.fn.win_getid()
vim.cmd.wincmd('b') -- Move to bottomright-most window. vim.cmd.wincmd('b') -- Move to bottomright-most window.
dap.repl.open({}, term_is_open() and dap.repl.open({}, term_is_open() and
'vertical rightbelow split' or "vertical rightbelow split" or
string.format('rightbelow %dsplit', height)) string.format("rightbelow %dsplit", height))
vim.api.nvim_win_set_option(0, 'winfixheight', true) vim.api.nvim_win_set_option(0, "winfixheight", true)
vim.fn.win_gotoid(win_id) vim.fn.win_gotoid(win_id)
end end
@ -165,9 +165,9 @@ function M.buffer_map()
local win_id = vim.fn.win_getid() local win_id = vim.fn.win_getid()
vim.cmd.wincmd('b') -- Move to bottomright-most window. vim.cmd.wincmd('b') -- Move to bottomright-most window.
vim.cmd(repl_is_open() and vim.cmd(repl_is_open() and
'vertical rightbelow split' or "vertical rightbelow split" or
string.format('rightbelow %dsplit', height)) string.format("rightbelow %dsplit", height))
vim.api.nvim_win_set_option(0, 'winfixheight', true) vim.api.nvim_win_set_option(0, "winfixheight", true)
vim.api.nvim_win_set_buf(0, find_bufnr_by_pattern("^%[dap%-terminal]")) vim.api.nvim_win_set_buf(0, find_bufnr_by_pattern("^%[dap%-terminal]"))
vim.fn.win_gotoid(win_id) vim.fn.win_gotoid(win_id)
end end
@ -196,43 +196,43 @@ function M.buffer_map()
end end
local function set_nnoremap(key, func) local function set_nnoremap(key, func)
local input = string.format('<localleader>%s', key) local input = string.format("<localleader>%s", key)
vim.keymap.set('n', input, func, { buffer = true }) vim.keymap.set("n", input, func, { buffer = true })
end end
set_nnoremap('<localleader>', select_config_and_run) set_nnoremap("<localleader>", select_config_and_run)
set_nnoremap('b', dap.toggle_breakpoint) set_nnoremap("b", dap.toggle_breakpoint)
set_nnoremap('c', function() set_nnoremap("c", function()
if dap.status() == '' then if dap.status() == "" then
vim.api.nvim_err_writeln('No active session.') vim.api.nvim_err_writeln("No active session.")
return return
end end
dap.continue() dap.continue()
end) end)
set_nnoremap('d', dap.down) set_nnoremap("d", dap.down)
set_nnoremap('i', dap.step_into) set_nnoremap("i", dap.step_into)
set_nnoremap('n', dap.step_over) set_nnoremap("n", dap.step_over)
set_nnoremap('o', dap.step_out) set_nnoremap("o", dap.step_out)
set_nnoremap('q', dap.close) set_nnoremap("q", dap.close)
set_nnoremap('r', dap.run_to_cursor) set_nnoremap("r", dap.run_to_cursor)
set_nnoremap('u', dap.up) set_nnoremap("u", dap.up)
set_nnoremap('x', dap.clear_breakpoints) set_nnoremap("x", dap.clear_breakpoints)
set_nnoremap('wf', function() sidebar_toggle(sidebars.frames) end) set_nnoremap("wf", function() sidebar_toggle(sidebars.frames) end)
set_nnoremap('wh', function() sidebar_toggle(sidebars.threads) end) set_nnoremap("wh", function() sidebar_toggle(sidebars.threads) end)
set_nnoremap('wr', function() repl_toggle({ height = 10 }) end) set_nnoremap("wr", function() repl_toggle({ height = 10 }) end)
set_nnoremap('ws', function() sidebar_toggle(sidebars.scopes) end) set_nnoremap("ws", function() sidebar_toggle(sidebars.scopes) end)
set_nnoremap('wt', function() term_toggle({ height = 10 }) end) set_nnoremap("wt", function() term_toggle({ height = 10 }) end)
set_nnoremap('wF', function() sidebar_only(sidebars.frames) end) set_nnoremap("wF", function() sidebar_only(sidebars.frames) end)
set_nnoremap('wH', function() sidebar_only(sidebars.threads) end) set_nnoremap("wH", function() sidebar_only(sidebars.threads) end)
set_nnoremap('wR', function() set_nnoremap("wR", function()
term_close() term_close()
repl_open({ height = 10 }) repl_open({ height = 10 })
end) end)
set_nnoremap('wS', function() sidebar_only(sidebars.scopes) end) set_nnoremap("wS", function() sidebar_only(sidebars.scopes) end)
set_nnoremap('wT', function() set_nnoremap("wT", function()
repl_close() repl_close()
term_open({ height = 10 }) term_open({ height = 10 })
end) end)

View File

@ -2,17 +2,17 @@ local M = {}
function M.on_attach(client, bufnr) function M.on_attach(client, bufnr)
local function set_nnoremap(key, func) local function set_nnoremap(key, func)
vim.keymap.set('n', key, func, { buffer = bufnr }) vim.keymap.set("n", key, func, { buffer = bufnr })
end end
set_nnoremap('[d', vim.diagnostic.goto_prev) set_nnoremap("[d", vim.diagnostic.goto_prev)
set_nnoremap(']d', vim.diagnostic.goto_next) set_nnoremap("]d", vim.diagnostic.goto_next)
set_nnoremap('g"', vim.lsp.buf.code_action) set_nnoremap('g"', vim.lsp.buf.code_action)
set_nnoremap('g?', vim.diagnostic.open_float) set_nnoremap("g?", vim.diagnostic.open_float)
set_nnoremap('gq', function() vim.lsp.buf.format { async = true } end) set_nnoremap("gq", function() vim.lsp.buf.format { async = true } end)
set_nnoremap('gr', vim.lsp.buf.rename) set_nnoremap("gr", vim.lsp.buf.rename)
end end
M.capabilities = require('cmp_nvim_lsp').default_capabilities() M.capabilities = require("cmp_nvim_lsp").default_capabilities()
function M.setup(client) function M.setup(client)
-- Return a nested function so that we can continue invoking `setup` in the -- Return a nested function so that we can continue invoking `setup` in the

View File

@ -1,7 +1,7 @@
local M = {} local M = {}
local luasnip = require('luasnip') local luasnip = require("luasnip")
local types = require('luasnip.util.types') local types = require("luasnip.util.types")
function M.visual_isn(pos) function M.visual_isn(pos)
local d = luasnip.dynamic_node local d = luasnip.dynamic_node
@ -15,7 +15,7 @@ function M.visual_isn(pos)
table.insert(res, ele) table.insert(res, ele)
end end
return sn(nil, i(1, res)) return sn(nil, i(1, res))
end), '$PARENT_INDENT\t') end), "$PARENT_INDENT\t")
end end
function M.choice_index(choice_node) function M.choice_index(choice_node)
@ -29,53 +29,53 @@ end
function M.setup() function M.setup()
luasnip.config.setup { luasnip.config.setup {
region_check_events = 'InsertEnter', region_check_events = "InsertEnter",
delete_check_events = 'InsertLeave', delete_check_events = "InsertLeave",
store_selection_keys = '<tab>', store_selection_keys = "<tab>",
enable_autosnippets = true, enable_autosnippets = true,
ext_opts = { ext_opts = {
[types.snippet] = { [types.snippet] = {
active = { active = {
virt_text = { { '', 'DiagnosticWarn' } }, virt_text = { { "", "DiagnosticWarn" } },
}, },
}, },
[types.insertNode] = { [types.insertNode] = {
passive = { passive = {
hl_group = 'DiagnosticVirtualTextWarn', hl_group = "DiagnosticVirtualTextWarn",
}, },
}, },
[types.choiceNode] = { [types.choiceNode] = {
active = { active = {
hl_group = 'DiagnosticVirtualTextHint', hl_group = "DiagnosticVirtualTextHint",
virt_text = { { '', 'DiagnosticHint' } }, virt_text = { { "", "DiagnosticHint" } },
}, },
}, },
}, },
} }
-- Track where we are expanding the snippet. -- Track where we are expanding the snippet.
luasnip.env_namespace('INFO', { luasnip.env_namespace("INFO", {
init = function(info) return { POS = info.pos } end, init = function(info) return { POS = info.pos } end,
}) })
vim.keymap.set({ 'i', 's' }, '<c-e>', function() vim.keymap.set({ "i", "s" }, "<c-e>", function()
if luasnip.choice_active() then if luasnip.choice_active() then
return '<Plug>luasnip-next-choice' return "<Plug>luasnip-next-choice"
else else
return '<c-e>' return "<c-e>"
end end
end, { silent = true, expr = true, remap = true }) end, { silent = true, expr = true, remap = true })
vim.keymap.set({ 'i', 's' }, '<c-y>', function() vim.keymap.set({ "i", "s" }, "<c-y>", function()
if luasnip.choice_active() then if luasnip.choice_active() then
return '<Plug>luasnip-prev-choice' return "<Plug>luasnip-prev-choice"
else else
return '<c-y>' return "<c-y>"
end end
end, { silent = true, expr = true, remap = true }) end, { silent = true, expr = true, remap = true })
-- Allow aborting the active snippet at any point in time. -- Allow aborting the active snippet at any point in time.
vim.keymap.set({ 'n', 'i', 's' }, '<c-l>', '<cmd>LuaSnipUnlinkCurrent<cr>') vim.keymap.set({ "n", "i", "s" }, "<c-l>", "<cmd>LuaSnipUnlinkCurrent<cr>")
-- Allow toggling autoexpansion on and off. This is more or less the intended -- Allow toggling autoexpansion on and off. This is more or less the intended
-- approach: https://github.com/L3MON4D3/LuaSnip/issues/832#issuecomment-1474993417 -- approach: https://github.com/L3MON4D3/LuaSnip/issues/832#issuecomment-1474993417
@ -92,7 +92,7 @@ function M.setup()
end end
toggle_expand_auto() toggle_expand_auto()
vim.keymap.set({ 'n', 'i', 's' }, '', toggle_expand_auto) vim.keymap.set({ "n", "i", "s" }, "", toggle_expand_auto)
end end
return M return M

View File

@ -1,7 +1,7 @@
local M = {} local M = {}
function M.get_active_lsp() function M.get_active_lsp()
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_active_clients()
if next(clients) == nil then if next(clients) == nil then
return "" return ""

View File

@ -2,55 +2,55 @@ local M = {}
local function set_telescope_map(key, picker) local function set_telescope_map(key, picker)
vim.keymap.set( vim.keymap.set(
'n', "n",
string.format('<c-;>%s', key), string.format("<c-;>%s", key),
string.format('<cmd>Telescope %s<cr>', picker) string.format("<cmd>Telescope %s<cr>", picker)
) )
vim.keymap.set( vim.keymap.set(
'n', "n",
string.format('<c-;><c-%s>', key), string.format("<c-;><c-%s>", key),
string.format('<cmd>Telescope %s<cr>', picker) string.format("<cmd>Telescope %s<cr>", picker)
) )
end end
function M.setup() function M.setup()
require('telescope').setup { require("telescope").setup {
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
['<c-s>'] = 'select_horizontal', ["<c-s>"] = "select_horizontal",
['<c-t>'] = 'select_tab', ["<c-t>"] = "select_tab",
['<c-v>'] = 'select_vertical', ["<c-v>"] = "select_vertical",
['<esc>'] = 'close', ["<esc>"] = "close",
}, },
}, },
}, },
pickers = { pickers = {
buffers = { theme = 'ivy' }, buffers = { theme = "ivy" },
find_files = { theme = 'ivy' }, find_files = { theme = "ivy" },
live_grep = { theme = 'ivy' }, live_grep = { theme = "ivy" },
lsp_definitions = { theme = 'cursor' }, lsp_definitions = { theme = "cursor" },
lsp_implementations = { theme = 'cursor' }, lsp_implementations = { theme = "cursor" },
lsp_type_definitions = { theme = 'cursor' }, lsp_type_definitions = { theme = "cursor" },
lsp_workspace_symbols = { theme = 'ivy' }, lsp_workspace_symbols = { theme = "ivy" },
}, },
} }
-- General -- General
set_telescope_map(';', 'resume') set_telescope_map(";", "resume")
set_telescope_map('b', 'buffers') set_telescope_map("b", "buffers")
set_telescope_map('f', 'find_files') set_telescope_map("f", "find_files")
set_telescope_map('g', 'live_grep') set_telescope_map("g", "live_grep")
-- LSP -- LSP
set_telescope_map('?', 'diagnostics') set_telescope_map("?", "diagnostics")
set_telescope_map(']', 'lsp_definitions') set_telescope_map("]", "lsp_definitions")
set_telescope_map('i', 'lsp_implementations') set_telescope_map("i", "lsp_implementations")
set_telescope_map('s', 'lsp_workspace_symbols') set_telescope_map("s", "lsp_workspace_symbols")
set_telescope_map('t', 'lsp_type_definitions') set_telescope_map("t", "lsp_type_definitions")
vim.api.nvim_create_autocmd('User', { vim.api.nvim_create_autocmd("User", {
pattern = 'TelescopePreviewerLoaded', pattern = "TelescopePreviewerLoaded",
callback = function() callback = function()
vim.wo.wrap = true vim.wo.wrap = true
end, end,

View File

@ -1,6 +1,6 @@
local M = {} local M = {}
local configs = require('nvim-treesitter.configs') local configs = require("nvim-treesitter.configs")
function M.setup() function M.setup()
configs.setup { configs.setup {

View File

@ -7,201 +7,201 @@ return {
-- Superscripts -- Superscripts
s( s(
{ trig = [[\^+]], wordTrig = false }, { trig = [[\^+]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^-]], wordTrig = false }, { trig = [[\^-]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^0]], wordTrig = false }, { trig = [[\^0]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^1]], wordTrig = false }, { trig = [[\^1]], wordTrig = false },
t('¹') t("¹")
), ),
s( s(
{ trig = [[\^2]], wordTrig = false }, { trig = [[\^2]], wordTrig = false },
t('²') t("²")
), ),
s( s(
{ trig = [[\^3]], wordTrig = false }, { trig = [[\^3]], wordTrig = false },
t('³') t("³")
), ),
s( s(
{ trig = [[\^4]], wordTrig = false }, { trig = [[\^4]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^5]], wordTrig = false }, { trig = [[\^5]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^6]], wordTrig = false }, { trig = [[\^6]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^7]], wordTrig = false }, { trig = [[\^7]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^8]], wordTrig = false }, { trig = [[\^8]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\^9]], wordTrig = false }, { trig = [[\^9]], wordTrig = false },
t('') t("")
), ),
-- Subscripts -- Subscripts
s( s(
{ trig = [[\_+]], wordTrig = false }, { trig = [[\_+]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_-]], wordTrig = false }, { trig = [[\_-]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_0]], wordTrig = false }, { trig = [[\_0]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_1]], wordTrig = false }, { trig = [[\_1]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_2]], wordTrig = false }, { trig = [[\_2]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_3]], wordTrig = false }, { trig = [[\_3]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_4]], wordTrig = false }, { trig = [[\_4]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_5]], wordTrig = false }, { trig = [[\_5]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_6]], wordTrig = false }, { trig = [[\_6]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_7]], wordTrig = false }, { trig = [[\_7]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_8]], wordTrig = false }, { trig = [[\_8]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_9]], wordTrig = false }, { trig = [[\_9]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_a]], wordTrig = false }, { trig = [[\_a]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_i]], wordTrig = false }, { trig = [[\_i]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_j]], wordTrig = false }, { trig = [[\_j]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_k]], wordTrig = false }, { trig = [[\_k]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_m]], wordTrig = false }, { trig = [[\_m]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\_n]], wordTrig = false }, { trig = [[\_n]], wordTrig = false },
t('') t("")
), ),
-- Lists -- Lists
s( s(
{ trig = [[\.]], wordTrig = false }, { trig = [[\.]], wordTrig = false },
t('·') t("·")
), ),
s( s(
{ trig = [[\circ]], wordTrig = false }, { trig = [[\circ]], wordTrig = false },
t('') t("")
), ),
-- Arrows -- Arrows
s( s(
{ trig = [[\d]], wordTrig = false }, { trig = [[\d]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\l]], wordTrig = false }, { trig = [[\l]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\lr]], wordTrig = false }, { trig = [[\lr]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[←r]], wordTrig = false }, { trig = [[←r]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\r]], wordTrig = false }, { trig = [[\r]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\u]], wordTrig = false }, { trig = [[\u]], wordTrig = false },
t('') t("")
), ),
-- Greek letters -- Greek letters
s( s(
{ trig = [[\a]], wordTrig = false }, { trig = [[\a]], wordTrig = false },
t('α') t("α")
), ),
s( s(
{ trig = [[\b]], wordTrig = false }, { trig = [[\b]], wordTrig = false },
t('β') t("β")
), ),
s( s(
{ trig = [[\g]], wordTrig = false }, { trig = [[\g]], wordTrig = false },
t('γ') t("γ")
), ),
s( s(
{ trig = [[\e]], wordTrig = false }, { trig = [[\e]], wordTrig = false },
t('ε') t("ε")
), ),
s( s(
{ trig = [[\pi]], wordTrig = false }, { trig = [[\pi]], wordTrig = false },
t('π') t("π")
), ),
s( s(
{ trig = [[\s]], wordTrig = false }, { trig = [[\s]], wordTrig = false },
t('σ') t("σ")
), ),
s( s(
{ trig = [[\z]], wordTrig = false }, { trig = [[\z]], wordTrig = false },
t('ζ') t("ζ")
), ),
-- Other operators -- Other operators
s( s(
{ trig = [[\not]], wordTrig = false }, { trig = [[\not]], wordTrig = false },
t('¬') t("¬")
), ),
s( s(
{ trig = [[\and]], wordTrig = false }, { trig = [[\and]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[αnd]], wordTrig = false }, { trig = [[αnd]], wordTrig = false },
@ -209,50 +209,50 @@ return {
), ),
s( s(
{ trig = [[\or]], wordTrig = false }, { trig = [[\or]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\iff]], wordTrig = false }, { trig = [[\iff]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\imp]], wordTrig = false }, { trig = [[\imp]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\cap]], wordTrig = false }, { trig = [[\cap]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\cup]], wordTrig = false }, { trig = [[\cup]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\leq]], wordTrig = false }, { trig = [[\leq]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[←eq]], wordTrig = false }, { trig = [[←eq]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\geq]], wordTrig = false }, { trig = [[\geq]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[γeq]], wordTrig = false }, { trig = [[γeq]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\in]], wordTrig = false }, { trig = [[\in]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[\notin]], wordTrig = false }, { trig = [[\notin]], wordTrig = false },
t('') t("")
), ),
s( s(
{ trig = [[¬in]], wordTrig = false }, { trig = [[¬in]], wordTrig = false },
t('') t("")
), ),
} }

View File

@ -7,22 +7,22 @@ let
"eb82712f86319272f4b7b9dbb4ec6df650e6987f" "eb82712f86319272f4b7b9dbb4ec6df650e6987f"
"EdenEast/nightfox.nvim"; "EdenEast/nightfox.nvim";
config = '' config = ''
vim.cmd('colorscheme nordfox') vim.cmd("colorscheme nordfox")
''; '';
}; };
lualine = { lualine = {
plugin = pkgs.vimPlugins.lualine-nvim; plugin = pkgs.vimPlugins.lualine-nvim;
config = '' config = ''
require('lualine').setup { require("lualine").setup {
sections = { sections = {
lualine_x = {'encoding', 'filetype'}, lualine_x = { "encoding", "filetype" },
lualine_y = { lualine_y = {
require('utils.statusline').get_active_lsp, require("utils.statusline").get_active_lsp,
require('utils.statusline').get_dap_status, require("utils.statusline").get_dap_status,
require('utils.statusline').get_autoexpand_status, require("utils.statusline").get_autoexpand_status,
}, },
lualine_z = {'%c:%l:%%%p'}, lualine_z = { "%c:%l:%%%p" },
}, },
} }
''; '';
@ -31,8 +31,8 @@ let
luasnip = { luasnip = {
plugin = pkgs.vimPlugins.luasnip; plugin = pkgs.vimPlugins.luasnip;
config = '' config = ''
require('utils.luasnip').setup() require("utils.luasnip").setup()
require('luasnip').add_snippets('all', require('utils.utf8'), { require("luasnip").add_snippets("all", require("utils.utf8"), {
type = "autosnippets", type = "autosnippets",
}) })
''; '';
@ -41,7 +41,7 @@ let
nvim-cmp = { nvim-cmp = {
plugin = pkgs.vimPlugins.nvim-cmp; plugin = pkgs.vimPlugins.nvim-cmp;
config = '' config = ''
require('utils.cmp').setup() require("utils.cmp").setup()
''; '';
}; };
@ -68,7 +68,7 @@ let
nvim-telescope = { nvim-telescope = {
plugin = pkgs.vimPlugins.telescope-nvim; plugin = pkgs.vimPlugins.telescope-nvim;
config = '' config = ''
require('utils.telescope').setup() require("utils.telescope").setup()
''; '';
}; };
@ -88,7 +88,7 @@ let
] ]
)); ));
config = '' config = ''
require('utils.treesitter').setup() require("utils.treesitter").setup()
''; '';
}; };
in in
@ -97,7 +97,7 @@ in
nvim-dap = lib.mkOption { nvim-dap = lib.mkOption {
type = lib.types.lines; type = lib.types.lines;
example = '' example = ''
require('...').nvim_dap() require("...").nvim_dap()
''; '';
description = lib.mdDoc '' description = lib.mdDoc ''
Language-specific configurations for the `nvim-dap` plugin. Language-specific configurations for the `nvim-dap` plugin.
@ -107,7 +107,7 @@ in
nvim-lspconfig = lib.mkOption { nvim-lspconfig = lib.mkOption {
type = lib.types.lines; type = lib.types.lines;
example = '' example = ''
require('...').nvim_lspconfig() require("...").nvim_lspconfig()
''; '';
description = lib.mdDoc '' description = lib.mdDoc ''
Language-specific configurations for the `nvim-lspconfig` plugin. Language-specific configurations for the `nvim-lspconfig` plugin.
@ -153,18 +153,18 @@ in
# Extra Lua configuration to be prepended to `init.lua`. Extend the # Extra Lua configuration to be prepended to `init.lua`. Extend the
# Lua loader to search for our /nix/store/.../?.lua files. # Lua loader to search for our /nix/store/.../?.lua files.
(lib.mkBefore '' (lib.mkBefore ''
package.path = '${config}/?.lua;' .. package.path package.path = "${config}/?.lua;" .. package.path
'') '')
# Extra Lua configuration to be appended to `init.lua`. # Extra Lua configuration to be appended to `init.lua`.
(lib.mkAfter '' (lib.mkAfter ''
vim.g.mapleader = ' ' vim.g.mapleader = " "
vim.g.maplocalleader = '\\' vim.g.maplocalleader = "\\"
vim.o.colorcolumn = '80,100' vim.o.colorcolumn = "80,100"
vim.o.equalalways = false -- Disable auto window resize. vim.o.equalalways = false -- Disable auto window resize.
vim.o.expandtab = true -- Spaces instead of tabs. vim.o.expandtab = true -- Spaces instead of tabs.
vim.o.list = true -- Show hidden characters. vim.o.list = true -- Show hidden characters.
vim.o.shiftwidth = 2 -- # of spaces to use for each (auto)indent. vim.o.shiftwidth = 2 -- # of spaces to use for each (auto)indent.
vim.o.tabstop = 2 -- # of spaces a <Tab> in the file counts for. vim.o.tabstop = 2 -- # of spaces a <Tab> in the file counts for.
'') '')
]; ];
}; };