Added quite a few additional configs
This commit is contained in:
parent
a4b3cfb24c
commit
13f1959014
|
@ -2,4 +2,4 @@ column_width = 120
|
|||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
quote_style = "AutoPreferDouble"
|
||||
|
|
11
init.lua
11
init.lua
|
@ -43,17 +43,6 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Configure Neovim tab settings for Go files
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = 'go',
|
||||
-- callback = function()
|
||||
-- vim.bo.expandtab = true -- Use spaces instead of tabs
|
||||
-- vim.bo.tabstop = 4 -- Display each tab as 4 spaces
|
||||
-- vim.bo.shiftwidth = 4 -- Indentation size of 4 spaces
|
||||
-- vim.bo.softtabstop = 4 -- <Tab> key inserts 4 spaces
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
require('rakshit.lazy')
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
|
|
|
@ -54,3 +54,10 @@ vim.keymap.set('n', '<leader>tx', '<cmd>tabclose<CR>', { desc = 'Close current t
|
|||
vim.keymap.set('n', '<leader>tn', '<cmd>tabn<CR>', { desc = 'Go to next tab' }) -- go to next tab
|
||||
vim.keymap.set('n', '<leader>tp', '<cmd>tabp<CR>', { desc = 'Go to previous tab' }) -- go to previous tab
|
||||
vim.keymap.set('n', '<leader>tf', '<cmd>tabnew %<CR>', { desc = 'Open current buffer in new tab' }) -- move current buffer to new tab
|
||||
|
||||
-- Gopher plugin keymaps
|
||||
vim.keymap.set('n', '<leader>if', '<cmd> GoIfErr <CR>', { desc = 'Add if err != nil snippet' })
|
||||
|
||||
-- Borrowed from my VS Code settings for better Vim navigations
|
||||
vim.keymap.set('n', '<leader>l', '$', { desc = 'Move to end of the line with leader + l' })
|
||||
vim.keymap.set('n', '<leader>h', '_', { desc = 'Move to first character of the line with leader + h' })
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
return {}
|
||||
-- dap = {
|
||||
-- plugin = true,
|
||||
-- n = {
|
||||
-- ['<leader>db'] = {
|
||||
-- '<cmd> DapToggleBreakpoint <CR>',
|
||||
-- 'Add breakpoint at line',
|
||||
-- },
|
||||
-- ['<leader>dus'] = {
|
||||
-- function()
|
||||
-- local widgets = require('dap.ui.widgets')
|
||||
-- local sidebar = widgets.sidebar(widgets.scopes)
|
||||
-- sidebar.open()
|
||||
-- end,
|
||||
-- 'Open debugging sidebar',
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- dap_go = {
|
||||
-- plugin = true,
|
||||
-- n = {
|
||||
-- ['<leader>dgt'] = {
|
||||
-- function()
|
||||
-- require('dag-go').debug_test()
|
||||
-- end,
|
||||
-- 'Debug go test',
|
||||
-- },
|
||||
-- ['<leader>dgl'] = {
|
||||
-- function()
|
||||
-- require('dap-go').debug_last()
|
||||
-- end,
|
||||
-- 'Debug last go test',
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
|
@ -6,100 +6,105 @@
|
|||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {}
|
||||
-- -- NOTE: Yes, you can install new plugins here!
|
||||
-- 'mfussenegger/nvim-dap',
|
||||
-- -- NOTE: And you can specify dependencies as well
|
||||
-- dependencies = {
|
||||
-- -- Creates a beautiful debugger UI
|
||||
-- 'rcarriga/nvim-dap-ui',
|
||||
--
|
||||
-- -- Required dependency for nvim-dap-ui
|
||||
-- 'nvim-neotest/nvim-nio',
|
||||
--
|
||||
-- -- Installs the debug adapters for you
|
||||
-- 'williamboman/mason.nvim',
|
||||
-- 'jay-babu/mason-nvim-dap.nvim',
|
||||
--
|
||||
-- -- Add your own debuggers here
|
||||
-- 'leoluz/nvim-dap-go',
|
||||
-- },
|
||||
-- keys = function(_, keys)
|
||||
-- local dap = require('dap')
|
||||
-- local dapui = require('dapui')
|
||||
-- return {
|
||||
-- -- Basic debugging keymaps, feel free to change to your liking!
|
||||
-- { '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
|
||||
-- { '<F1>', dap.step_into, desc = 'Debug: Step Into' },
|
||||
-- { '<F2>', dap.step_over, desc = 'Debug: Step Over' },
|
||||
-- { '<F3>', dap.step_out, desc = 'Debug: Step Out' },
|
||||
-- { '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
|
||||
-- {
|
||||
-- '<leader>B',
|
||||
-- function()
|
||||
-- dap.set_breakpoint(vim.fn.input('Breakpoint condition: '))
|
||||
-- end,
|
||||
-- desc = 'Debug: Set Breakpoint',
|
||||
-- },
|
||||
-- -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
-- { '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
|
||||
-- unpack(keys),
|
||||
-- }
|
||||
-- end,
|
||||
-- config = function()
|
||||
-- local dap = require('dap')
|
||||
-- local dapui = require('dapui')
|
||||
--
|
||||
-- require('mason-nvim-dap').setup({
|
||||
-- -- Makes a best effort to setup the various debuggers with
|
||||
-- -- reasonable debug configurations
|
||||
-- automatic_installation = true,
|
||||
--
|
||||
-- -- You can provide additional configuration to the handlers,
|
||||
-- -- see mason-nvim-dap README for more information
|
||||
-- handlers = {},
|
||||
--
|
||||
-- -- You'll need to check that you have the required things installed
|
||||
-- -- online, please don't ask me how to install them :)
|
||||
-- ensure_installed = {
|
||||
-- -- Update this to ensure that you have the debuggers for the langs you want
|
||||
-- 'delve',
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- -- Dap UI setup
|
||||
-- -- For more information, see |:help nvim-dap-ui|
|
||||
-- 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.
|
||||
-- icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
-- controls = {
|
||||
-- icons = {
|
||||
-- pause = '⏸',
|
||||
-- play = '▶',
|
||||
-- step_into = '⏎',
|
||||
-- step_over = '⏭',
|
||||
-- step_out = '⏮',
|
||||
-- step_back = 'b',
|
||||
-- run_last = '▶▶',
|
||||
-- terminate = '⏹',
|
||||
-- disconnect = '⏏',
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||
-- dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
-- dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
--
|
||||
-- -- Install golang specific config
|
||||
-- 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,
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
return {
|
||||
-- NOTE: Yes, you can install new plugins here!
|
||||
'mfussenegger/nvim-dap',
|
||||
|
||||
-- init = function()
|
||||
-- require('core.utils').load_mappings('dap')
|
||||
-- end,
|
||||
|
||||
-- NOTE: And you can specify dependencies as well
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Required dependency for nvim-dap-ui
|
||||
'nvim-neotest/nvim-nio',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
},
|
||||
keys = function(_, keys)
|
||||
local dap = require('dap')
|
||||
local dapui = require('dapui')
|
||||
return {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
|
||||
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
|
||||
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
|
||||
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
|
||||
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
dap.set_breakpoint(vim.fn.input('Breakpoint condition: '))
|
||||
end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
|
||||
unpack(keys),
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
local dapui = require('dapui')
|
||||
|
||||
require('mason-nvim-dap').setup({
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
},
|
||||
})
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
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.
|
||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = '⏸',
|
||||
play = '▶',
|
||||
step_into = '⏎',
|
||||
step_over = '⏭',
|
||||
step_out = '⏮',
|
||||
step_back = 'b',
|
||||
run_last = '▶▶',
|
||||
terminate = '⏹',
|
||||
disconnect = '⏏',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
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,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ return { -- Autoformat
|
|||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
notify_no_formatters = true,
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
|
@ -56,14 +57,4 @@ return { -- Autoformat
|
|||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
},
|
||||
-- Configure Neovim tab settings for Go files
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = 'go',
|
||||
-- callback = function()
|
||||
-- -- vim.bo.expandtab = true -- Use spaces instead of tabs
|
||||
-- vim.bo.tabstop = 4 -- Display each tab as 4 spaces
|
||||
-- vim.bo.shiftwidth = 4 -- Indentation size of 4 spaces
|
||||
-- vim.bo.softtabstop = 4 -- <Tab> key inserts 4 spaces
|
||||
-- end,
|
||||
-- }),
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
'olexsmir/gopher.nvim',
|
||||
ft = 'go',
|
||||
config = function(_, opts)
|
||||
require('gopher').setup(opts)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd([[silent! GoInstallDeps]])
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "Open Lazy Git" },
|
||||
},
|
||||
}
|
|
@ -56,9 +56,9 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>l', function()
|
||||
lint.try_lint()
|
||||
end, { desc = 'Trigger linting for current file' })
|
||||
-- vim.keymap.set('n', '<leader>l', function()
|
||||
-- lint.try_lint()
|
||||
-- end, { desc = 'Trigger linting for current file' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -50,6 +50,21 @@ return {
|
|||
-- function will be executed to configure the current buffer
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require('lspconfig')
|
||||
local util = require('lspconfig/util')
|
||||
lspconfig.gopls.setup({
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
root_dir = util.root_pattern('go.work', 'go.mod', '.git'),
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- import mason_lspconfig plugin
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
'leoluz/nvim-dap-go',
|
||||
ft = 'go',
|
||||
dependencies = 'mfussenegger/nvim-dap',
|
||||
config = function(_, opts)
|
||||
require('dap-go').setup(opts)
|
||||
-- require('core-utils').load_mappings('dap_go')
|
||||
end,
|
||||
}
|
|
@ -63,7 +63,7 @@ return { -- Useful plugin to show you pending keybinds.
|
|||
{ '<leader>s', group = '[S]earch' },
|
||||
{ '<leader>w', group = '[W]orkspace' },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
-- { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue