add autopairs and debug
This commit is contained in:
parent
c3994e069c
commit
9225d6e39b
|
@ -37,4 +37,5 @@ o.swapfile = false
|
|||
o.scrolloff = 8
|
||||
o.colorcolumn = '80'
|
||||
|
||||
o.timeoutlen = 500
|
||||
|
||||
|
|
|
@ -6,5 +6,30 @@
|
|||
go install github.com/incu6us/goimports-reviser/v3@latest
|
||||
go install mvdan.cc/gofumpt@latest
|
||||
go install github.com/segmentio/golines@latest
|
||||
|
||||
go install github.com/go-delve/delve/cmd/dlv@latest # for go debug
|
||||
```
|
||||
|
||||
Substitute Mode
|
||||
```shell
|
||||
:V,s/pattern/
|
||||
```
|
||||
|
||||
Check for key combination
|
||||
```shell
|
||||
:nmap # show all maps for normal mode
|
||||
:nmap <leader> # show maps for the leader
|
||||
:verbose nmap <leader> # show where the map was last set
|
||||
:telescope keymaps
|
||||
```
|
||||
|
||||
Open new Tab
|
||||
```shell
|
||||
<c>wT
|
||||
```
|
||||
|
||||
Moving between tabs
|
||||
```shell
|
||||
gt # next tab
|
||||
gT # previous tab
|
||||
```
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
}
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- 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',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
|
||||
-- telescope dap
|
||||
'nvim-telescope/telescope-dap.nvim',
|
||||
|
||||
-- add debug description text
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
},
|
||||
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_setup = 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',
|
||||
},
|
||||
}
|
||||
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'dap run/continue debug' })
|
||||
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'dap step into' })
|
||||
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'dap step over' })
|
||||
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'dap step out' })
|
||||
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'dap toggle breakpoint' })
|
||||
vim.keymap.set('n', '<leader>B', function()
|
||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end, { desc = 'dap breakpoint condition' })
|
||||
|
||||
-- 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 = "⏏",
|
||||
},
|
||||
},
|
||||
}
|
||||
-- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception.
|
||||
vim.keymap.set("n", "<F7>", dapui.toggle)
|
||||
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()
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
end,
|
||||
}
|
|
@ -3,13 +3,13 @@ return {
|
|||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function ()
|
||||
local mark = require('harpoon.mark')
|
||||
vim.keymap.set("n", "<leader>ha", mark.add_file)
|
||||
vim.keymap.set("n", "<leader>ha", mark.add_file, { desc = "[H]arpoon [A]dd file" })
|
||||
|
||||
local ui = require('harpoon.ui')
|
||||
vim.keymap.set("n", "<c-e>", ui.toggle_quick_menu)
|
||||
vim.keymap.set("n", "<c-h>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<c-t>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<c-n>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<c-s>", function() ui.nav_file(4) end)
|
||||
vim.keymap.set("n", "<c-e>", ui.toggle_quick_menu, { desc = "harpoon toggle quick menu" })
|
||||
vim.keymap.set("n", "<c-h>", function() ui.nav_file(1) end, { desc = "harpoon add nav file 1" })
|
||||
vim.keymap.set("n", "<c-t>", function() ui.nav_file(2) end, { desc = "harpoon add nav file 2" })
|
||||
vim.keymap.set("n", "<c-n>", function() ui.nav_file(3) end, { desc = "harpoon add nav file 3" })
|
||||
vim.keymap.set("n", "<c-s>", function() ui.nav_file(4) end, { desc = "harpoon add nav file 4" })
|
||||
end
|
||||
}
|
||||
|
|
|
@ -1,19 +1,91 @@
|
|||
-- 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 {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
version = "*",
|
||||
dependencies= {
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function ()
|
||||
require('neo-tree').setup {}
|
||||
config = function()
|
||||
require('neo-tree').setup {
|
||||
window = {
|
||||
position = "float",
|
||||
popup = {
|
||||
-- settings that apply to float position only
|
||||
size = { height = "20", width = "95" },
|
||||
-- 50% means center it
|
||||
position = "50%",
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1, -- extra padding on left hand side
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
-- expander config, needed for nesting files
|
||||
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "ﰊ",
|
||||
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
|
||||
-- then these will never be used.
|
||||
default = "*",
|
||||
highlight = "NeoTreeFileIcon"
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = false,
|
||||
use_git_status_colors = true,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
}
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
show_hidden_count = true,
|
||||
hide_by_name = {
|
||||
},
|
||||
never_show = {
|
||||
".git",
|
||||
".idea",
|
||||
".DS_Store",
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.keymap.set("n", "<leader>nt", "<CMD>Neotree toggle<CR>")
|
||||
vim.keymap.set("n", "<leader>o", "<CMD>Neotree focus<CR>")
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ return {
|
|||
|
||||
term.setup {
|
||||
size = 20,
|
||||
open_mapping = [[<leader>tf]],
|
||||
open_mapping = [[<c-\>]],
|
||||
shading_factor = 2,
|
||||
direction = 'float',
|
||||
float_opts = {
|
||||
|
|
Loading…
Reference in New Issue