feat: update documentation and configuration files for Neovim setup

Signed-off-by: juliano.barbosa <julianomb@gmail.com>
This commit is contained in:
Juliano Barbosa 2025-02-22 13:04:03 -03:00
parent 76edf81b0a
commit 7128ca764c
47 changed files with 1956 additions and 1147 deletions

View file

@ -1,17 +1,38 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
return {
{
'jackMort/ChatGPT.nvim',
event = 'VeryLazy',
config = function()
require('chatgpt').setup {
local prompts_url = 'https://raw.githubusercontent.com/julianobarbosa' .. '/custom-gpt-prompts/main/prompt.csv'
require('chatgpt').setup({
api_key_cmd = 'pass show azure/hypera/oai/idg-dev/token',
api_host_cmd = 'echo -n ""',
api_type_cmd = 'echo azure',
azure_api_base_cmd = 'pass show azure/hypera/oai/idg-dev/base',
azure_api_engine_cmd = 'pass show azure/hypera/oai/idg-dev/engine',
azure_api_version_cmd = 'pass show azure/hypera/oai/idg-dev/api-version',
predefined_chat_gpt_prompts = 'https://raw.githubusercontent.com/julianobarbosa/custom-gpt-prompts/main/prompt.csv',
}
predefined_chat_gpt_prompts = prompts_url,
})
end,
dependencies = {
'MunifTanjim/nui.nvim',

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
return {
'github/copilot.vim',
opts = {
@ -22,8 +42,8 @@ return {
['gitcommit'] = {
enable = true,
-- Disable using previous commit messages as suggestions
previous_commit_history = false
}
previous_commit_history = false,
},
}
end,
}

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- python-debugging.lua: Debugging Python code with DAP
--
@ -5,34 +25,76 @@ return {
{
'mfussenegger/nvim-dap',
dependencies = {
'mfussenegger/nvim-dap-python', -- Python adapter
'rcarriga/nvim-dap-ui', -- UI for DAP
'theHamsta/nvim-dap-virtual-text' -- Inline variable text
'mfussenegger/nvim-dap-python', -- Python adapter
'rcarriga/nvim-dap-ui', -- UI for DAP
'theHamsta/nvim-dap-virtual-text', -- Inline variable text
},
keys = {
{ '<leader>dc', function() require('dap').continue() end, desc = 'Debug: Start/Continue' },
{ '<leader>db', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' },
{ '<leader>dt', function() require('dap').terminate() end, desc = 'Debug: Terminate' },
{ '<leader>di', function() require('dap').step_into() end, desc = 'Debug: Step Into' },
{ '<leader>do', function() require('dap').step_over() end, desc = 'Debug: Step Over' },
{ '<leader>dr', function() require('dap').repl.open() end, desc = 'Debug: Open REPL' },
{
'<leader>dc',
function()
require('dap').continue()
end,
desc = 'Debug: Start/Continue',
},
{
'<leader>db',
function()
require('dap').toggle_breakpoint()
end,
desc = 'Debug: Toggle Breakpoint',
},
{
'<leader>dt',
function()
require('dap').terminate()
end,
desc = 'Debug: Terminate',
},
{
'<leader>di',
function()
require('dap').step_into()
end,
desc = 'Debug: Step Into',
},
{
'<leader>do',
function()
require('dap').step_over()
end,
desc = 'Debug: Step Over',
},
{
'<leader>dr',
function()
require('dap').repl.open()
end,
desc = 'Debug: Open REPL',
},
},
config = function()
local dap = require('dap')
local dapui = require('dapui')
-- Configure dapui
dapui.setup()
-- Configure Python
require('dap-python').setup(vim.fn.exepath('python3'))
-- Auto open/close dapui
dap.listeners.after.event_initialized['dapui_config'] = function() dapui.open() end
dap.listeners.before.event_terminated['dapui_config'] = function() dapui.close() end
dap.listeners.before.event_exited['dapui_config'] = function() dapui.close() end
end
}
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open()
end
dap.listeners.before.event_terminated['dapui_config'] = function()
dapui.close()
end
dap.listeners.before.event_exited['dapui_config'] = function()
dapui.close()
end
end,
},
}
-- The line beneath this is called `modeline`. See `:help modeline`

View file

@ -1,67 +1,89 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
return {
"nvim-neo-tree/neo-tree.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
cmd = "Neotree",
init = function() vim.g.neo_tree_remove_legacy_commands = true end,
'nvim-neo-tree/neo-tree.nvim',
dependencies = { 'MunifTanjim/nui.nvim' },
cmd = 'Neotree',
init = function()
vim.g.neo_tree_remove_legacy_commands = true
end,
opts = function()
return {
auto_clean_after_session_restore = true,
close_if_last_window = true,
sources = { "filesystem", "buffers", "git_status" },
sources = { 'filesystem', 'buffers', 'git_status' },
source_selector = {
sources = {
{ source = "filesystem", display_name = " 󰉓 Files " },
{ source = "git_status", display_name = " 󰊢 Git " },
{ source = 'filesystem', display_name = ' 󰉓 Files ' },
{ source = 'git_status', display_name = ' 󰊢 Git ' },
},
},
default_component_configs = {
icon = {
folder_empty = "!",
folder_empty_open = "!O",
folder_empty = '!',
folder_empty_open = '!O',
},
git_status = {
symbols = {
renamed = "󰁕",
unstaged = "💣",
renamed = '󰁕',
unstaged = '💣',
},
},
},
document_symbols = {
kinds = {
File = { icon = "󰈙", hl = "Tag" },
Namespace = { icon = "󰌗", hl = "Include" },
Package = { icon = "󰏖", hl = "Label" },
Class = { icon = "󰌗", hl = "Include" },
Property = { icon = "󰆧", hl = "@property" },
Enum = { icon = "󰒻", hl = "@number" },
Function = { icon = "󰊕", hl = "Function" },
String = { icon = "󰀬", hl = "String" },
Number = { icon = "󰎠", hl = "Number" },
Array = { icon = "󰅪", hl = "Type" },
Object = { icon = "󰅩", hl = "Type" },
Key = { icon = "󰌋", hl = "" },
Struct = { icon = "󰌗", hl = "Type" },
Operator = { icon = "󰆕", hl = "Operator" },
TypeParameter = { icon = "󰊄", hl = "Type" },
File = { icon = '󰈙', hl = 'Tag' },
Namespace = { icon = '󰌗', hl = 'Include' },
Package = { icon = '󰏖', hl = 'Label' },
Class = { icon = '󰌗', hl = 'Include' },
Property = { icon = '󰆧', hl = '@property' },
Enum = { icon = '󰒻', hl = '@number' },
Function = { icon = '󰊕', hl = 'Function' },
String = { icon = '󰀬', hl = 'String' },
Number = { icon = '󰎠', hl = 'Number' },
Array = { icon = '󰅪', hl = 'Type' },
Object = { icon = '󰅩', hl = 'Type' },
Key = { icon = '󰌋', hl = '' },
Struct = { icon = '󰌗', hl = 'Type' },
Operator = { icon = '󰆕', hl = 'Operator' },
TypeParameter = { icon = '󰊄', hl = 'Type' },
StaticMethod = { icon = '󰠄 ', hl = 'Function' },
},
},
commands = {
parent_or_close = function(state)
local node = state.tree:get_node()
if (node.type == "directory" or node:has_children()) and node:is_expanded() then
if (node.type == 'directory' or node:has_children()) and node:is_expanded() then
state.commands.toggle_node(state)
else
require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id())
require('neo-tree.ui.renderer').focus_node(state, node:get_parent_id())
end
end,
child_or_open = function(state)
local node = state.tree:get_node()
if node.type == "directory" or node:has_children() then
if node.type == 'directory' or node:has_children() then
if not node:is_expanded() then -- if unexpanded, expand
state.commands.toggle_node(state)
else -- if expanded and has children, seleect the next child
require("neo-tree.ui.renderer").focus_node(state, node:get_child_ids()[1])
else -- if expanded and has children, seleect the next child
require('neo-tree.ui.renderer').focus_node(state, node:get_child_ids()[1])
end
else -- if not a directory just open it
state.commands.open(state)
@ -74,62 +96,64 @@ return {
local modify = vim.fn.fnamemodify
local results = {
e = { val = modify(filename, ":e"), msg = "Extension only" },
f = { val = filename, msg = "Filename" },
F = { val = modify(filename, ":r"), msg = "Filename w/o extension" },
h = { val = modify(filepath, ":~"), msg = "Path relative to Home" },
p = { val = modify(filepath, ":."), msg = "Path relative to CWD" },
P = { val = filepath, msg = "Absolute path" },
e = { val = modify(filename, ':e'), msg = 'Extension only' },
f = { val = filename, msg = 'Filename' },
F = { val = modify(filename, ':r'), msg = 'Filename w/o extension' },
h = { val = modify(filepath, ':~'), msg = 'Path relative to Home' },
p = { val = modify(filepath, ':.'), msg = 'Path relative to CWD' },
P = { val = filepath, msg = 'Absolute path' },
}
local messages = {
{ "\nChoose to copy to clipboard:\n", "Normal" },
{ '\nChoose to copy to clipboard:\n', 'Normal' },
}
for i, result in pairs(results) do
if result.val and result.val ~= "" then
if result.val and result.val ~= '' then
vim.list_extend(messages, {
{ ("%s."):format(i), "Identifier" },
{ (" %s: "):format(result.msg) },
{ result.val, "String" },
{ "\n" },
{ ('%s.'):format(i), 'Identifier' },
{ (' %s: '):format(result.msg) },
{ result.val, 'String' },
{ '\n' },
})
end
end
vim.api.nvim_echo(messages, false, {})
local result = results[vim.fn.getcharstr()]
if result and result.val and result.val ~= "" then
vim.fn.setreg("+", result.val)
if result and result.val and result.val ~= '' then
vim.fn.setreg('+', result.val)
end
end,
find_in_dir = function(state)
local node = state.tree:get_node()
local path = node:get_id()
require("telescope.builtin").find_files {
cwd = node.type == "directory" and path or vim.fn.fnamemodify(path, ":h"),
}
require('telescope.builtin').find_files({
cwd = node.type == 'directory' and path or vim.fn.fnamemodify(path, ':h'),
})
end,
},
window = {
width = 30,
mappings = {
["<space>"] = false, -- disable space until we figure out which-key disabling
["[b"] = "prev_source",
["]b"] = "next_source",
Y = "copy_selector",
h = "parent_or_close",
l = "child_or_open",
o = "open",
['<space>'] = false, -- disable space until we figure out which-key disabling
['[b'] = 'prev_source',
[']b'] = 'next_source',
Y = 'copy_selector',
h = 'parent_or_close',
l = 'child_or_open',
o = 'open',
},
},
filesystem = {
follow_current_file = true,
hijack_netrw_behavior = "open_current",
hijack_netrw_behavior = 'open_current',
use_libuv_file_watcher = true,
},
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function(_) vim.opt_local.signcolumn = "auto" end,
event = 'neo_tree_buffer_enter',
handler = function(_)
vim.opt_local.signcolumn = 'auto'
end,
},
},
}

View file

@ -1,9 +1,34 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
return {
'ThePrimeagen/harpoon',
config = function()
require('harpoon').setup()
vim.keymap.set('n', '<leader>ha', require('harpoon.mark').add_file, { desc = '[H]arpoon [A]dd file' })
vim.keymap.set('n', '<leader>ht', require('harpoon.ui').toggle_quick_menu, { desc = '[H]arpoon [T]oggle quick menu' })
vim.keymap.set(
'n',
'<leader>ht',
require('harpoon.ui').toggle_quick_menu,
{ desc = '[H]arpoon [T]oggle quick menu' }
)
vim.keymap.set('n', '<leader>hn', require('harpoon.ui').nav_next, { desc = '[H]arpoon nav [N]ext' })
vim.keymap.set('n', '<leader>hp', require('harpoon.ui').nav_prev, { desc = '[H]arpoon nav [P]revious' })
vim.keymap.set('n', '<leader>h1', function()

View file

@ -1,10 +1,35 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {
-- Add trouble.nvim plugin
{ 'folke/trouble.nvim', event = 'VimEnter', dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function()
require('trouble').setup {}
end },
{
'folke/trouble.nvim',
event = 'VimEnter',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('trouble').setup({})
end,
},
}

View file

@ -1,3 +1,28 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
if not vim then
return
end
local bufnr = vim.api.nvim_get_current_buf()
return {
-- local function map(mode, lhs, rhs, opts)
-- local options = { noremap=true, silent=true }
@ -7,31 +32,21 @@ return {
-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
-- end
vim.keymap.set('n', '<leader>ff', ":Telescope find_files<cr>", {}),
vim.keymap.set('n', '<leader>fg', ":Telescope live_grep<cr>", {}),
vim.keymap.set('n', '<leader>fb', ":Telescope buffers<cr>", {}),
vim.keymap.set('n', '<leader>fh', ":Telescope help_tags", {}),
vim.keymap.set('n', '<leader>ff', ':Telescope find_files<cr>', {}),
vim.keymap.set('n', '<leader>fg', ':Telescope live_grep<cr>', {}),
vim.keymap.set('n', '<leader>fb', ':Telescope buffers<cr>', {}),
vim.keymap.set('n', '<leader>fh', ':Telescope help_tags', {}),
-- map("n", "<s-h>", ":bn")
vim.keymap.set(
'n',
'<S-h>',
":bp<cr>",
{
buffer = bufnr,
desc = '[G]o to [P]revious Buffer'
}
),
vim.keymap.set('n', '<S-h>', ':bp<cr>', {
buffer = bufnr,
desc = '[G]o to [P]revious Buffer',
}),
-- map("n", "<s-l>", ":bp")
vim.keymap.set(
'n',
'<S-l>',
":bn<cr>",
{
buffer = bufnr,
desc = '[G]o to [N]ext Buffer'
}
)
vim.keymap.set('n', '<S-l>', ':bn<cr>', {
buffer = bufnr,
desc = '[G]o to [N]ext Buffer',
}),
-- map("n", "<leader>bq", ":Bdelete")
-- vim.keymap.set(

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- python-debugging.lua: Debugging Python code with DAP
--
@ -45,7 +65,7 @@ return {
repl_definition = {
python = {
command = function()
local ipythonAvailable = vim.fn.executable 'ipython' == 1
local ipythonAvailable = vim.fn.executable('ipython') == 1
local binary = ipythonAvailable and 'ipython' or 'python3'
return { binary }
end,

View file

@ -1,3 +1,27 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
if not vim then
return
end
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
@ -38,9 +62,9 @@ vim.keymap.set('n', '<leader>wa', ':wall<CR>', { noremap = true, desc = '[W]rite
vim.keymap.set('n', '<leader>wf', ':w<CR>', { noremap = true, desc = '[W]rite [F]ile' })
-- Create command do save with qw
vim.api.nvim_command 'cmap qw wq'
vim.api.nvim_command 'cmap WQ wq'
vim.api.nvim_command 'cmap QW wq'
vim.api.nvim_command('cmap qw wq')
vim.api.nvim_command('cmap WQ wq')
vim.api.nvim_command('cmap QW wq')
-- Navigate buffers
vim.keymap.set('n', '<S-h>', ':bp<CR>', { noremap = true, desc = '[G]oto [P]revious Buffer' })
@ -58,4 +82,9 @@ vim.keymap.set('n', '<leader>taa', ':!make applyA<CR>', opts)
-- Better copy-paste between vim and system clipboard
vim.api.nvim_set_keymap('v', '<C-c>', '"+y', { noremap = true, silent = true, desc = 'Copy to system clipboard' })
vim.api.nvim_set_keymap('n', '<C-v>', '"+p', { noremap = true, silent = true, desc = 'Paste from system clipboard' })
vim.api.nvim_set_keymap('i', '<C-v>', '<C-r>+', { noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' })
vim.api.nvim_set_keymap(
'i',
'<C-v>',
'<C-r>+',
{ noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' }
)

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
--[[
--
-- This file is not required for your own configuration,
@ -21,7 +41,7 @@ end
local check_external_reqs = function()
-- Basic utils: `git`, `make`, `unzip`
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
for _, exe in ipairs({ 'git', 'make', 'unzip', 'rg' }) do
local is_executable = vim.fn.executable(exe) == 1
if is_executable then
vim.health.ok(string.format("Found executable: '%s'", exe))
@ -35,13 +55,13 @@ end
return {
check = function()
vim.health.start 'kickstart.nvim'
vim.health.start('kickstart.nvim')
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
vim.health.info([[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
Fix only warnings for plugins and languages you intend to use.
Mason will give warnings for languages that are not installed.
You do not need to install, unless you want to use those languages!]]
You do not need to install, unless you want to use those languages!]])
local uv = vim.uv or vim.loop
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- autoformat.lua
--
-- Use your language server to automatically format your code on save.
@ -60,12 +80,12 @@ return {
return
end
vim.lsp.buf.format {
vim.lsp.buf.format({
async = false,
filter = function(c)
return c.id == client.id
end,
}
})
end,
})
end,

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- autopairs
-- https://github.com/windwp/nvim-autopairs
@ -7,10 +27,10 @@ return {
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('nvim-autopairs').setup {}
require('nvim-autopairs').setup({})
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp = require 'cmp'
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- debug.la
--
-- Shows how to use the DAP plugin to debug your code.
@ -69,7 +89,7 @@ return {
{
'<leader>B',
function()
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))
end,
desc = 'Debug: Set Breakpoint',
},
@ -83,13 +103,11 @@ return {
},
},
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
local path = require('mason-registry').get_package('debugpy'):get_install_path()
local dap = require('dap')
local dapui = require('dapui')
require('dap-python').setup(os.getenv('PYENV_ROOT') .. '/versions/3.11.9/bin/python')
require('dap-python').setup(os.getenv 'PYENV_ROOT' .. '/versions/3.11.9/bin/python')
require('mason-nvim-dap').setup {
require('mason-nvim-dap').setup({
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
@ -109,11 +127,11 @@ return {
'jq',
'stylua',
},
}
})
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
dapui.setup({
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
@ -131,7 +149,7 @@ return {
disconnect = '',
},
},
}
})
-- Change breakpoint icons
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
@ -150,12 +168,12 @@ return {
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
require('dap-go').setup({
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
detached = vim.fn.has('win32') == 0,
},
}
})
end,
}

View file

@ -1,3 +1,23 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
@ -7,7 +27,7 @@ return {
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local gitsigns = require('gitsigns')
local function map(mode, l, r, opts)
opts = opts or {}
@ -18,27 +38,27 @@ return {
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
vim.cmd.normal({ ']c', bang = true })
else
gitsigns.nav_hunk 'next'
gitsigns.nav_hunk('next')
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
vim.cmd.normal({ '[c', bang = true })
else
gitsigns.nav_hunk 'prev'
gitsigns.nav_hunk('prev')
end
end, { desc = 'Jump to previous git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') })
end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') })
end, { desc = 'git [r]eset hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
@ -50,7 +70,7 @@ return {
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
gitsigns.diffthis '@'
gitsigns.diffthis('@')
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })

View file

@ -1,10 +1,30 @@
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
local lint = require('lint')
lint.linters_by_ft = {
dockerfile = { 'hadolint' },
json = { 'jsonlint' },