format all lua files
This commit is contained in:
@ -7,7 +7,7 @@ return {
|
||||
require('aerial').setup({
|
||||
backends = { 'lsp', 'treesitter', 'markdown' },
|
||||
layout = {
|
||||
default_direction = "prefer_left"
|
||||
default_direction = 'prefer_left'
|
||||
},
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
@ -18,7 +18,7 @@ return {
|
||||
keys = {
|
||||
{
|
||||
'<leader>s',
|
||||
function ()
|
||||
function()
|
||||
require('aerial').toggle()
|
||||
end,
|
||||
desc = 'Symbols outline',
|
||||
|
@ -1,11 +1,11 @@
|
||||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
config = {
|
||||
cmake_command = "cmake",
|
||||
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1", '-G', 'Ninja' },
|
||||
cmake_show_console = "always",
|
||||
cmake_build_directory = "build_nvim",
|
||||
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
|
||||
cmake_command = 'cmake',
|
||||
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
|
||||
cmake_show_console = 'always',
|
||||
cmake_build_directory = 'build_nvim',
|
||||
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
|
||||
},
|
||||
cmd = {
|
||||
'CMakeGenerate',
|
||||
|
@ -106,7 +106,7 @@ return {
|
||||
-- { name = 'emoji' },
|
||||
},
|
||||
enabled = function()
|
||||
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt"
|
||||
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
||||
|
@ -9,14 +9,14 @@ return {
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_current)',
|
||||
desc= 'Toggle comment'
|
||||
desc = 'Toggle comment'
|
||||
},
|
||||
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_visual)gv',
|
||||
mode = 'v',
|
||||
desc= 'Toggle comment'
|
||||
desc = 'Toggle comment'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,12 +77,12 @@ return {
|
||||
},
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''})
|
||||
require("cmp_dap").is_dap_buffer()
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
||||
require('cmp_dap').is_dap_buffer()
|
||||
|
||||
|
||||
-- make sure we can exit the terminal with esc
|
||||
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
||||
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||
pattern = { '*dap-terminal*' },
|
||||
callback = function()
|
||||
local opts = { noremap = true }
|
||||
@ -99,13 +99,13 @@ return {
|
||||
end
|
||||
|
||||
local function getPythonEnv()
|
||||
local venv = os.getenv("VIRTUAL_ENV")
|
||||
local venv = os.getenv('VIRTUAL_ENV')
|
||||
if venv ~= nil then
|
||||
return string.format("%s/%s", venv, getVenvSuffix())
|
||||
return string.format('%s/%s', venv, getVenvSuffix())
|
||||
end
|
||||
local conda = os.getenv("CONDA_PREFIX")
|
||||
local conda = os.getenv('CONDA_PREFIX')
|
||||
if conda ~= nil then
|
||||
return string.format("%s/%s", conda, 'python.exe')
|
||||
return string.format('%s/%s', conda, 'python.exe')
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
@ -144,15 +144,15 @@ return {
|
||||
};
|
||||
}
|
||||
|
||||
local dapui = require("dapui")
|
||||
local dapui = require('dapui')
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
||||
@ -160,9 +160,9 @@ return {
|
||||
{
|
||||
type = 'python';
|
||||
request = 'launch';
|
||||
name = "Launch file with venv";
|
||||
name = 'Launch file with venv';
|
||||
justMyCode = false;
|
||||
program = "${file}";
|
||||
program = '${file}';
|
||||
cwd = vim.fn.getcwd();
|
||||
pythonPath = getPythonEnv
|
||||
},
|
||||
@ -182,7 +182,7 @@ return {
|
||||
-- CPP
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = "${port}",
|
||||
port = '${port}',
|
||||
executable = {
|
||||
-- CHANGE THIS to your path!
|
||||
command = masonpath .. '/bin/codelldb.cmd',
|
||||
@ -207,9 +207,9 @@ return {
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch codelldb",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
name = 'Launch codelldb',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file')
|
||||
end,
|
||||
|
@ -3,7 +3,7 @@ return {
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local colors = require('gruvbox.colors')
|
||||
vim.g.gruvbox_flat_style = "dark"
|
||||
vim.g.gruvbox_flat_style = 'dark'
|
||||
vim.g.gruvbox_colors = {
|
||||
bg_search = 'purple',
|
||||
fg_search = 'black',
|
||||
|
@ -11,7 +11,7 @@ return {
|
||||
'LazyGit',
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("lazygit")
|
||||
require('telescope').load_extension('lazygit')
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
|
@ -22,37 +22,37 @@ return {
|
||||
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
"LspReferenceText",
|
||||
'LspReferenceText',
|
||||
{ bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = "#5a524c" }
|
||||
bg = '#5a524c' }
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
"LspReferenceRead",
|
||||
'LspReferenceRead',
|
||||
{ bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkGreen' }
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
"LspReferenceWrite",
|
||||
'LspReferenceWrite',
|
||||
{ bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkRed' }
|
||||
)
|
||||
local diagnostics = {
|
||||
Error = " ",
|
||||
Warning = " ",
|
||||
Information = " ",
|
||||
Question = " ",
|
||||
Hint = " ",
|
||||
Error = ' ',
|
||||
Warning = ' ',
|
||||
Information = ' ',
|
||||
Question = ' ',
|
||||
Hint = ' ',
|
||||
}
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = diagnostics.Error },
|
||||
{ name = "DiagnosticSignWarn", text = diagnostics.Warning },
|
||||
{ name = "DiagnosticSignHint", text = diagnostics.Hint },
|
||||
{ name = "DiagnosticSignInfo", text = diagnostics.Information },
|
||||
{ name = 'DiagnosticSignError', text = diagnostics.Error },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
@ -129,22 +129,22 @@ return {
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.server_capabilities.documentHighlightProvider then
|
||||
local group = vim.api.nvim_create_augroup("lsp_document_highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
callback = function()
|
||||
vim.lsp.buf.document_highlight()
|
||||
end,
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
desc = "Document Highlight",
|
||||
desc = 'Document Highlight',
|
||||
})
|
||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
callback = function()
|
||||
vim.lsp.buf.clear_references()
|
||||
end,
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
desc = "Clear All the References",
|
||||
desc = 'Clear All the References',
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
|
||||
group = group,
|
||||
@ -185,8 +185,8 @@ return {
|
||||
|
||||
local clangd_capabilities = capabilities
|
||||
clangd_capabilities.textDocument.semanticHighlighting = true
|
||||
clangd_capabilities.offsetEncoding = { "utf-16" }
|
||||
require("clangd_extensions").setup {
|
||||
clangd_capabilities.offsetEncoding = { 'utf-16' }
|
||||
require('clangd_extensions').setup {
|
||||
server = {
|
||||
capabilities = clangd_capabilities,
|
||||
on_attach = on_attach,
|
||||
@ -211,13 +211,6 @@ return {
|
||||
}
|
||||
|
||||
}
|
||||
-- require('clangd_extensions').setup({
|
||||
-- server = {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
lspconfig['jsonls'].setup {
|
||||
capabilities = capabilities,
|
||||
@ -256,7 +249,7 @@ return {
|
||||
defaultConfig = {
|
||||
indent_style = 'space',
|
||||
indent_size = '2',
|
||||
quote_style = 'single'
|
||||
quote_style = 'single',
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -300,10 +293,10 @@ return {
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
float = {
|
||||
border = "single",
|
||||
border = 'single',
|
||||
format = function(diagnostic)
|
||||
return string.format(
|
||||
"%s (%s) [%s]",
|
||||
'%s (%s) [%s]',
|
||||
diagnostic.message,
|
||||
diagnostic.source,
|
||||
diagnostic.code or diagnostic.user_data.lsp.code
|
||||
|
@ -56,7 +56,7 @@ return {
|
||||
}
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { "./my-snippets" } })
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } })
|
||||
end,
|
||||
dependencies =
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
return {
|
||||
"AckslD/nvim-neoclip.lua",
|
||||
'AckslD/nvim-neoclip.lua',
|
||||
dependencies = {
|
||||
{ 'kkharji/sqlite.lua', module = 'sqlite' },
|
||||
-- { 'nvim-telescope/telescope.nvim' },
|
||||
@ -8,8 +8,8 @@ return {
|
||||
keys = {
|
||||
{
|
||||
'[',
|
||||
function ()
|
||||
require('telescope').extensions.neoclip.default({initial_mode='normal'})
|
||||
function()
|
||||
require('telescope').extensions.neoclip.default({ initial_mode = 'normal' })
|
||||
end,
|
||||
desc = 'NeoClip'
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ return {
|
||||
'nvim-neotest/neotest-python'
|
||||
},
|
||||
config = function()
|
||||
require("neotest").setup({
|
||||
require('neotest').setup({
|
||||
adapters = {
|
||||
require("neotest-python")({
|
||||
require('neotest-python')({
|
||||
dap = {
|
||||
justMyCode = false
|
||||
},
|
||||
args = { "--log-level", "DEBUG" },
|
||||
args = { '--log-level', 'DEBUG' },
|
||||
runner = 'pytest',
|
||||
})
|
||||
}
|
||||
@ -23,14 +23,14 @@ return {
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require("neotest").run.run()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
},
|
||||
{
|
||||
'<S-F3>',
|
||||
function()
|
||||
require("neotest").run.run({ strategy = "dap" })
|
||||
require('neotest').run.run({ strategy = 'dap' })
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ return {
|
||||
'stevearc/overseer.nvim',
|
||||
config = function()
|
||||
require('overseer').setup({
|
||||
templates = { "builtin", "user.cmake.cmake" },
|
||||
templates = { 'builtin', 'user.cmake.cmake' },
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
|
@ -1,11 +1,11 @@
|
||||
return {
|
||||
'ahmedkhalf/project.nvim',
|
||||
config = function()
|
||||
require("project_nvim").setup(
|
||||
require('project_nvim').setup(
|
||||
{
|
||||
silent_chdir = true,
|
||||
ignore_lsp = { 'null-ls', 'cmake' },
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "build_nvim", "real_path.txt" },
|
||||
patterns = { '.git', '_darcs', '.hg', '.bzr', '.svn', 'Makefile', 'package.json', 'build_nvim', 'real_path.txt' },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -14,19 +14,19 @@ return {
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
'ahmedkhalf/project.nvim',
|
||||
},
|
||||
cmd = { "Telescope" },
|
||||
cmd = { 'Telescope' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require("telescope.builtin").find_files({ no_ignore = true, hidden = true })
|
||||
require('telescope.builtin').find_files({ no_ignore = true, hidden = true })
|
||||
end,
|
||||
desc = 'Find file',
|
||||
},
|
||||
{
|
||||
'<leader>c',
|
||||
function()
|
||||
require("telescope.builtin").commands()
|
||||
require('telescope.builtin').commands()
|
||||
end,
|
||||
desc = 'Telescope commands',
|
||||
},
|
||||
@ -40,56 +40,56 @@ return {
|
||||
{
|
||||
'<leader>o',
|
||||
function()
|
||||
require("telescope.builtin").oldfiles()
|
||||
require('telescope.builtin').oldfiles()
|
||||
end,
|
||||
desc = 'Find old files',
|
||||
},
|
||||
{
|
||||
'<leader>h',
|
||||
function()
|
||||
require("telescope.builtin").command_history()
|
||||
require('telescope.builtin').command_history()
|
||||
end,
|
||||
desc = 'Open command history',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require("telescope.builtin").buffers()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
desc = 'Select buffer',
|
||||
},
|
||||
{
|
||||
'<leader>q',
|
||||
function()
|
||||
require("telescope.builtin").quickfix()
|
||||
require('telescope.builtin').quickfix()
|
||||
end,
|
||||
desc = 'Quickfix list with telescope',
|
||||
},
|
||||
{
|
||||
'<leader>l',
|
||||
function()
|
||||
require("telescope.builtin").live_grep()
|
||||
require('telescope.builtin').live_grep()
|
||||
end,
|
||||
desc = 'Search in project',
|
||||
},
|
||||
{
|
||||
'<leader>j',
|
||||
function()
|
||||
require("telescope.builtin").jumplist()
|
||||
require('telescope.builtin').jumplist()
|
||||
end,
|
||||
desc = 'Open jumplist',
|
||||
},
|
||||
{
|
||||
'<c-f>',
|
||||
function()
|
||||
require("telescope.builtin").current_buffer_fuzzy_find()
|
||||
require('telescope.builtin').current_buffer_fuzzy_find()
|
||||
end,
|
||||
desc = 'Find in buffer',
|
||||
},
|
||||
{
|
||||
'<leader>d',
|
||||
function()
|
||||
require("telescope.builtin").grep_string()
|
||||
require('telescope.builtin').grep_string()
|
||||
end,
|
||||
desc = 'Find in workspace',
|
||||
},
|
||||
@ -113,21 +113,21 @@ return {
|
||||
|
||||
Project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
local ok = pcall(require "telescope.builtin".git_files, opts)
|
||||
if not ok then require "telescope.builtin".find_files(opts) end
|
||||
local ok = pcall(require 'telescope.builtin'.git_files, opts)
|
||||
if not ok then require 'telescope.builtin'.find_files(opts) end
|
||||
end
|
||||
|
||||
|
||||
local telescopeConfig = require("telescope.config")
|
||||
local telescopeConfig = require('telescope.config')
|
||||
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||
|
||||
-- I want to search in hidden/dot files.
|
||||
table.insert(vimgrep_arguments, "--hidden")
|
||||
table.insert(vimgrep_arguments, '--hidden')
|
||||
-- I don't want to search in the `.git` directory.
|
||||
table.insert(vimgrep_arguments, "--glob")
|
||||
table.insert(vimgrep_arguments, "!**/.git/*")
|
||||
table.insert(vimgrep_arguments, '--glob')
|
||||
table.insert(vimgrep_arguments, '!**/.git/*')
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
@ -160,7 +160,7 @@ return {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
|
||||
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
@ -176,14 +176,14 @@ return {
|
||||
lsp_dynamic_workspace_symbols = {},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require("telescope").load_extension("ui-select")
|
||||
require('telescope').load_extension('ui-select')
|
||||
require('telescope').load_extension('fzf')
|
||||
end
|
||||
}
|
||||
|
@ -26,25 +26,24 @@ return {
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'none',
|
||||
peek_definition_code = {
|
||||
["<leader>df"] = "@function.outer",
|
||||
["<leader>dF"] = "@class.outer",
|
||||
['<leader>df'] = '@function.outer',
|
||||
['<leader>dF'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
|
||||
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
||||
require("nvim-treesitter.install").prefer_git = true
|
||||
require('nvim-treesitter.install').prefer_git = true
|
||||
end
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user