diff options
Diffstat (limited to '.config/nvim/lua/user')
| -rw-r--r-- | .config/nvim/lua/user/keys.lua | 21 | ||||
| -rw-r--r-- | .config/nvim/lua/user/pack.lua | 26 |
2 files changed, 37 insertions, 10 deletions
diff --git a/.config/nvim/lua/user/keys.lua b/.config/nvim/lua/user/keys.lua index c0592da..8e16d03 100644 --- a/.config/nvim/lua/user/keys.lua +++ b/.config/nvim/lua/user/keys.lua @@ -29,6 +29,7 @@ map("n", "<leader><CR>", --------------- Extended Operations --------------- -- Conditional 'q' to quit on floating/quickfix/help windows otherwise still use it for macros +-- TODO: Have a list of if available on system/packages, example "Zen Mode" to not work on it (quit Zen Mode) map('n', 'q', function() local config = vim.api.nvim_win_get_config(0) if config.relative ~= "" then -- is_floating_window? @@ -78,6 +79,14 @@ map("n", "<leader>%", ":NumbersOnOff<CR>") --map("n", "<C-K>", "<C-W><C-K>") --map("n", "<C-L>", "<C-W><C-L>") --map("n", "<C-H>", "<C-W><C-H>") +map("t", "<C-[>", "<C-\\><C-N>") +map("t", "<C-h>", "<C-\\><C-N><C-h>") +map("t", "<C-j>", "<C-\\><C-N><C-j>") +map("t", "<C-k>", "<C-\\><C-N><C-k>") +map("t", "<C-l>", "<C-\\><C-N><C-l>") +map("t", "<C-x>", "<C-c>") +map("n", "<C-x>", "<C-c>") +--map("n", "<C-r>", ":<C-u>call MyFunc(v:count)<CR>") -- Split window map("n", "<leader>h", ":split<CR>") @@ -146,7 +155,7 @@ map("n", "<A-j>", ':let save_a=@a<Cr>"add"ap:let @a=save_a<Cr>') map("v", "<leader>sr", 'y:%s/<C-r><C-r>"//g<Left><Left>c') -- Toggle Diff -map("n", "<leader>dt", "<Cmd>call utils#ToggleDiff()<CR>") +map("n", "<leader>td", "<Cmd>call utils#ToggleDiff()<CR>") -- Map delete to Ctrl+l map("i", "<C-l>", "<Del>") @@ -162,7 +171,7 @@ map("v", "p", '"_dP') -- Swap two pieces of text, use x to cut in visual mode, then use Ctrl-x in -- visual mode to select text to swap with -map("v", "<C-X>", "<Esc>`.``gvP``P") +--map("v", "<C-X>", "<Esc>`.``gvP``P") -- Change Working Directory to current project map("n", "<leader>cd", ":cd %:p:h<CR>:pwd<CR>") @@ -357,14 +366,20 @@ end) -- Set breakpoints, get variable values, step into/out of functions, etc. map("n", "<leader>dl", require("dap.ui.widgets").hover) map("n", "<leader>dc", dap.continue) +map("n", "<leader>dC", dap.close) +map("n", "<leader>dt", dap.terminate) map("n", "<leader>db", dap.toggle_breakpoint) map("n", "<leader>dn", dap.step_over) map("n", "<leader>di", dap.step_into) map("n", "<leader>do", dap.step_out) -map("n", "<leader>dC", function() +map("n", "<leader>dB", function() dap.clear_breakpoints() require("notify")("Breakpoints cleared", "warn") end) +--vim.keymap.set("n", "<leader>B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>") +--vim.keymap.set("v", "<leader>B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>") +--vim.keymap.set("n", "<leader>lp", ":lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>") +--vim.keymap.set("n", "<leader>dr", ":lua require'dap'.repl.open()<CR>") -- Close debugger and clear breakpoints map("n", "<leader>de", function() diff --git a/.config/nvim/lua/user/pack.lua b/.config/nvim/lua/user/pack.lua index 951e9f7..f71e114 100644 --- a/.config/nvim/lua/user/pack.lua +++ b/.config/nvim/lua/user/pack.lua @@ -73,9 +73,13 @@ return packer.startup(function(use) }) use("rmagatti/goto-preview") + -- neodev + use("folke/neodev.nvim") + -- Debugger use("mfussenegger/nvim-dap") -- Debug Adapter Protocol client implementation for Neovim use("rcarriga/nvim-dap-ui") -- UI for nvim-dap + use("theHamsta/nvim-dap-virtual-text") use("gabrielpoca/replacer.nvim") use({ "jayp0521/mason-nvim-dap.nvim", @@ -114,6 +118,7 @@ return packer.startup(function(use) use("hrsh7th/cmp-calc") -- Completion source for math calculation use("saadparwaiz1/cmp_luasnip") -- Completion source for snippets, specifically for luasnip use("hrsh7th/cmp-nvim-lsp-signature-help") -- Completion source for displaying function signatures with the current parameter emphasized + use("rcarriga/cmp-dap") -- Snippets use("L3MON4D3/LuaSnip") -- Snippet engine @@ -200,13 +205,20 @@ return packer.startup(function(use) -- UI use("kyazdani42/nvim-web-devicons") -- use("onsails/lspkind-nvim") -- - --use({ - -- 'goolord/alpha-nvim', - -- requires = { 'nvim-tree/nvim-web-devicons' }, - -- config = function () - -- require'alpha'.setup(require'alpha.themes.startify'.config) - -- end - --}) + use ({'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async'}) -- Fold code + use ({"luukvbaal/statuscol.nvim", + config = function() + local builtin = require "statuscol.builtin" + require("statuscol").setup { + relculright = true, + segments = { + { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, + { text = { "%s" }, click = "v:lua.ScSa" }, + { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, + }, + } + end + }) use({ 'glepnir/dashboard-nvim', event = 'VimEnter', |
